Skip to content
Snippets Groups Projects
Commit f86bd453 authored by Andrew W Petro's avatar Andrew W Petro
Browse files

stuff

parent dce1af52
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,9 @@
## Summary
+ MyUW widgets combine a template, configuration, and data
to render a pithy box.
## Objectives of this talk
......@@ -31,23 +34,120 @@ Widgets consist of a template, configuration, and dynamic data.
### No widget - just a hyperlink
Example: Box
+ [Box in app directory](https://my.wisc.edu/web/apps/details/box)
+ [Box entity file](https://git.doit.wisc.edu/myuw-overlay/entities/-/blob/prod/src/main/resources/portlet-definition/box.portlet-definition.xml)
### List of Links
### Search
Example: Voting
+ [Voting in app directory](https://my.wisc.edu/web/apps/details/voting)
+ [Voting entity file](https://git.doit.wisc.edu/myuw-overlay/entities/-/blob/prod/src/main/resources/portlet-definition/voting.portlet-definition.xml)
Example: Payroll Information
The links on the widget can be dynamic,
sourced from JSON at a URL rather than from configuration.
+ [Payroll Information in app directory](https://my.wisc.edu/web/apps/details/earnings-statement)
+ [Payroll Information entity file](https://git.doit.wisc.edu/myuw-overlay/entities/-/blob/prod/src/main/resources/portlet-definition/earnings-statement.portlet-definition.xml)
+ [Dynamic JSON](https://my.wisc.edu/portal/p/earnings-statement.ctf2/max/listOfLinks.resource.uP)
### Other widget types
There are more.
<https://uportal-project.github.io/uportal-app-framework/make-a-widget.html>
### Custom
Wiscard balance
Note that the loose coupling means I have no idea how the Wiscard vendor is
generating that JSON. .NET? ColdFusion? It doesn't matter.
Separating the "view" from the "controller" for the win.
Preparing for SOAR
SOAR Orientation
### Remote
Benefit information
Technically, the widget can draw the fully rendered content from a URL.
This means a legacy JSR-286 Portlet can provide arbitrary markup for a widget.
We use this for the Benefit Information widget and its many states supporting
benefit enrollment.
(Yes, PHP, WordPress, Salesforce, or your other server-side solutiuon of choice
could, technically, be generating arbitrarily awesome widgets.)
Note the tradeoffs here.
## Let's make a widget
### Example 1: Enhancing the DoITNet widget
Did you know there's a DoITNet widget?
You can pin DoITNet from your MyUW home page.
But it might be even cooler if you could search DoITNet.
So, it needs a widget type, and configuration.
```xml
<portlet-preference>
<name>widgetType</name>
<value>search-with-links</value>
</portlet-preference>
<portlet-preference>
<name>widgetConfig</name>
<value><![CDATA[
{
"actionURL":"https://doitnet.doit.wisc.edu/",
"actionTarget":"_blank",
"actionParameter":"s",
"launchText":"Open website",
"links":[
{
"title":"Org chart",
"href":"https://it.wisc.edu/wp-content/uploads/Updated-Org-Chart-Master-1.pdf",
"icon":"fa-map-o",
"target":"_blank"
}
]
}]]></value>
</portlet-preference>
```
Let's show doing this in source and running the entity import Jenkins job...
### Example 2: WiscIT incident launcher
Let's show importing this entity.
## Characteristics of this architecture
+ Shared templates via widget types adds abstraction, and leverage.
+ Types make similar content look and behave similarly
+ Improve the type, realize the improvement everywhere it's used.
+ Separation of concerns - Model-View-Controller-ish
+ Model: configuration, dynamic data
+ View: template. Styling. Markup.
+ Controller: type
+ As implemented, with 2020 hindsight
+ The widget types and especially the templates have too much "business logic"
in them. The AngularJS directives feel complicated. It might be nice to
have more pure "views" that are more straight tranformations to markup.
## Beyond AngularJS
Web Components?
Web Components? (This may be a chance to refactor to lighter views )
Design System?
......
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<portlet-definition xmlns="https://source.jasig.org/schemas/uportal/io/portlet-definition" xmlns:ns2="https://source.jasig.org/schemas/uportal" xmlns:ns3="https://source.jasig.org/schemas/uportal/io/portlet-type" xmlns:ns4="https://source.jasig.org/schemas/uportal/io/event-aggregation" xmlns:ns5="https://source.jasig.org/schemas/uportal/io/stylesheet-descriptor" xmlns:ns6="https://source.jasig.org/schemas/uportal/io/permission-owner" xmlns:ns7="https://source.jasig.org/schemas/uportal/io/subscribed-fragment" xmlns:ns8="https://source.jasig.org/schemas/uportal/io/user" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.0" xsi:schemaLocation="https://source.jasig.org/schemas/uportal/io/portlet-definition https://source.jasig.org/schemas/uportal/io/portlet-definition/portlet-definition-4.0.xsd">
<title>DoITnet</title>
<name>DoITnet</name>
<fname>doitnet</fname>
<desc>Central hub for DoIT announcements, news and links.</desc>
<type>Portlet</type>
<timeout>10000</timeout>
<portlet-descriptor>
<ns2:webAppName>/SimpleContentPortlet</ns2:webAppName>
<ns2:portletName>DoITnet</ns2:portletName>
</portlet-descriptor>
<group>All DoIT Employees</group>
<permissions>
<permission system="UP_PORTLET_SUBSCRIBE" activity="BROWSE">
<group>All DoIT Employees</group>
</permission>
</permissions>
<parameter>
<name>mdIcon</name>
<value>computer</value>
</parameter>
<parameter>
<name>alternativeMaximizedLink</name>
<value>https://doitnet.doit.wisc.edu</value>
</parameter>
<parameter>
<name>target</name>
<value>_blank</value>
</parameter>
<portlet-preference>
<name>widgetType</name>
<value>search-with-links</value>
</portlet-preference>
<portlet-preference>
<name>widgetConfig</name>
<value><![CDATA[
{
"actionURL":"https://doitnet.doit.wisc.edu/",
"actionTarget":"_blank",
"actionParameter":"s",
"launchText":"Open website",
"links":[
{
"title":"Org chart",
"href":"https://it.wisc.edu/wp-content/uploads/Updated-Org-Chart-Master-1.pdf",
"icon":"fa-map-o",
"target":"_blank"
}
]
}]]></value>
</portlet-preference>
<portlet-preference>
<name>content</name>
<readOnly>false</readOnly>
<value><![CDATA[
<a
href="https://doitnet.doit.wisc.edu"
target="_blank" rel="noopener noreferrer">
DoITnet</a>
]]></value>
</portlet-preference>
</portlet-definition>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<portlet-definition xmlns="https://source.jasig.org/schemas/uportal/io/portlet-definition" xmlns:ns2="https://source.jasig.org/schemas/uportal" xmlns:ns3="https://source.jasig.org/schemas/uportal/io/portlet-type" xmlns:ns4="https://source.jasig.org/schemas/uportal/io/event-aggregation" xmlns:ns5="https://source.jasig.org/schemas/uportal/io/stylesheet-descriptor" xmlns:ns6="https://source.jasig.org/schemas/uportal/io/permission-owner" xmlns:ns7="https://source.jasig.org/schemas/uportal/io/subscribed-fragment" xmlns:ns8="https://source.jasig.org/schemas/uportal/io/user" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.0" xsi:schemaLocation="https://source.jasig.org/schemas/uportal/io/portlet-definition https://source.jasig.org/schemas/uportal/io/portlet-definition/portlet-definition-4.0.xsd">
<title>WiscIT incidents</title>
<name>WiscIT incidents</name>
<fname>wiscit-incidents</fname>
<desc>Launch an incident by ID.</desc>
<type>Portlet</type>
<timeout>10000</timeout>
<portlet-descriptor>
<ns2:webAppName>/SimpleContentPortlet</ns2:webAppName>
<ns2:portletName>DoITnet</ns2:portletName>
</portlet-descriptor>
<group>All DoIT Employees</group>
<permissions>
<permission system="UP_PORTLET_SUBSCRIBE" activity="BROWSE">
<group>All DoIT Employees</group>
</permission>
</permissions>
<parameter>
<name>mdIcon</name>
<value>computer</value>
</parameter>
<parameter>
<name>alternativeMaximizedLink</name>
<value>https://wiscit.wisc.edu/CherwellClient/Access</value>
</parameter>
<parameter>
<name>target</name>
<value>_blank</value>
</parameter>
<portlet-preference>
<name>widgetType</name>
<value>search-with-links</value>
</portlet-preference>
<portlet-preference>
<name>widgetConfig</name>
<value><![CDATA[
{
"actionURL":"https://wiscit.wisc.edu/CherwellClient/Access/Command/Queries.GoToRecord?BusObID=Incident",
"actionTarget":"_blank",
"actionParameter":"PublicID",
"launchText":"Open incident",
"links":[]
}]]></value>
</portlet-preference>
<portlet-preference>
<name>content</name>
<readOnly>false</readOnly>
<value><![CDATA[
<a
href="https://doitnet.doit.wisc.edu"
target="_blank" rel="noopener noreferrer">
DoITnet</a>
]]></value>
</portlet-preference>
</portlet-definition>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment