Creating Novell Portal Services Gadgets: An Architectural Overview Novell BrainShare 2002 Creating Novell Portal Services Gadgets: An Architectural Overview Scott Villinski CTS Novell, Inc. svillinski@novell.com Kevin James Prototype Systems Developer kjames@novell.com TUT251—Creating Novell Portal Services Gadgets: An Architectural Overview
Agenda Novell vision and mission Novell Portal Services (NPS) architecture NPS gadget overview Additional advanced programming
Vision…one Net Mission Novell BrainShare 2002 Vision…one Net A world where networks of all types—corporate and public, intranets, extranets, and the Internet—work together as one Net and securely connect employees, customers, suppliers, and partners across organizational boundaries Mission To solve complex business and technical challenges with Net business solutions that enable people, processes, and systems to work together and our customers to profit from the opportunities of a networked world TUT251—Creating Novell Portal Services Gadgets: An Architectural Overview
One Step Authentication Novell BrainShare 2002 NPS Architecture Database GroupWare Web content Gadgets HTML HTML Code ASP JSP Scripts XML Information Feeds LOB Engines Java Applications Collaboration Management Administration Legacy Apps One Step Authentication No addition passwords Account management Access rights Novell eDirectory™ One identity Knows you Personalized Novell Portal Services Novell Portal Services rides on top of leading web application servers. This includes environments in windows, linux, Netware, and Solaris. The user simply goes to the URL for the portal – in this example it is the yourcompany.com – the application server passes it to Novell Portal Services. Novell Portal Services prompts the user to then login. Here the id and password are compared against eDirectory. eDirectory can be your current NDS directory or a standalone tree – this is really only dependent on how you implement it. eDirectory acts as the secure database for all the data and user information that is used to build the portal. Novell Portal Services uses this to build a personalized page for the user – based on who they are in the directory. This is done based on their business context – the context of who they are in your organization – their department, title, location, etc. to build and present the correct information. The building blocks of the user presentation are called gadgets. They are windows of information from your intranet and the internet. They can access data and information in HTML, XML, and JAVA – accessing Databases, GroupWare, and Web Content. They also provide ease of password access as they can securely store user ids and passwords in eDirectory so users don’t have to keep re-entering their information over and over again. Web application server http://www.digitalairlines.com TUT251—Creating Novell Portal Services Gadgets: An Architectural Overview
What Is a Gadget? Application used to interface with resource Databases, directories, files, Internet resources Can be remote or native Consists of XML and XSL Transformations (XSLT) Integrates with Novell eDirectory™ using NPS APIs Doesn’t require knowledge of Novell eDirectory APIs or LDAP APIs
Novell Portal Services SDK http://developer.novell.com/ndk/npssdk.htm Gadget runner Tomcat engine LDAP emulator Documentation API Docs Sample code
High-Level Design User logs on and requests database information Request is forwarded to the gadget responsible for that information Gadget accesses client’s authentication information from the directory Gadget retrieves information from the back-end server Gadget presents information to the Novell Portal Services servlet as an XML stream Information is delivered to user
Simple Gadget Process Flow Manager 7 7. NPS renders XML and XSL to HTML 1 1. Http request for http://ipaddress/nps 2 2. Determine what gadgets are for this user’s page Gadget 3 3. Return gadget name 4 4. Call gadget’s getData() NPS 5 5. Return gadget’s XML data Stylesheet 6 6. Grab the gadget’s XSL file
Creating a Simple Gadget Extend the BaseGadgetInstance public class NIMSStats extends com.novell.nps.gadgetManager.BaseGadgetInstance Override the getData method public void getData(HttpServletRequest req, BufferedWriter out, Document domTree) throws GadgetInstanceException
Extend BaseGadgetInstance
Override getData() Method
Resulting XML Document
Corresponding XSL Document
Corresponding XSL Document
Advanced Gadget Process Flow Manager 2 2. NPS asks Gadget Manager for gadget instance matching GI_ID provided in form data 1 Browser makes POST request with form data 9 9. NPS combines XML and XSL to create HTML document to return to browser 3 3. Gadget Manager returns gadget instance that matches GI_ID passed in the form data Gadget 4 4. NPS calls gadget’s processRequest method, passing a HttpServletRequest object containing the form data NPS 5 5. After processing the form data, maybe setting some values in the user’s session, processRequest returns 6 6. NPS calls gadget’s getData method 7 7. Gadget returns an XML fragment—depends on gadget’s design and user’s configuration Stylesheet 8 8. NPS gets gadget’s stylesheet
Creating an Advanced Gadget Extend the BaseGadgetInstance public class NIMSList extends com.novell.nps.gadgetManager.BaseGadgetInstance Override the getData method public void getData(HttpServletRequest req, BufferedWriter out, Document domTree) throws GadgetInstanceException Override the processRequest method public void processRequest (HttpServletRequest req) throws GadgetInstanceException
Extend BaseGadgetInstance
Override getData() Method
Override processRequest() Method
Additional Advanced Programming Reading configuration Writing configuration Overriding default XSL stylesheet Debug logging
Read Configuration Process Flow Novell BrainShare 2002 Read Configuration Process Flow Directory 4 4. Configuration manager queries directory for user/ gadget assignment configuration 5 5. Data is returned from the directory Configuration Manager 1 Browser makes POST request with form data 9 9. NPS combines XML and XSL to create HTML document to return to browser 3 3. Gadget calls getConfigSetting (inherited from BaseGadgetInstance) 6 6. Configuration manager calculates the setting value and returns it to the gadget NPS Gadget 7 7. Gadget generates XML document based on returned setting 2 2. NPS calls gadget’s getData method 4 / 5 / 6. The Configuration manager will get from the directory the settings for the gadget assignment, and the settings on the user, and then create a configuration object based on the overwritable / cumulative flags for the gadget instance. 8 8. NPS gets gadget’s stylesheet Stylesheet TUT251—Creating Novell Portal Services Gadgets: An Architectural Overview
Extend BaseGadgetInstance
Override getData() Method
Reading Configuration Used to store configuration information in the directory To read a configuration getConfigSetting
Gadget Configuration Settings Gadget configuration settings can be Overwritable—meaning a user can over write the setting Cumulative—add up all of the settings 1 = True 0 = False getConfigSetting() Overwritable=True Overwritable=False Cumulative=True Gadget Value 1 User Value 1 Cumulative=False
Write Configuration Process Flow Novell BrainShare 2002 Write Configuration Process Flow 7 7. Status of write is returned from directory Directory 6 6. Configuration manager writes setting to users’ bhConfigRW attribute Configuration Manager 1 Browser makes POST request with form data 11 11. NPS combines XML and XSL to create HTML document to return to browser 8 8. Configuration manager returns status of config write to gadget 5 5. Gadget calls writeConfig (inherited from BaseGadgetInstance) 3 3. Gadget calls setConfigSetting (inherited from BaseGadgetInstance) 4 4. Configuration manager updates its internal representation of the setting, and returns NPS 2 2. NPS calls gadget’s getData method Gadget 9 9. Gadget generates XML document based on returned setting 4 / 5 / 6. The Configuration manager will get from the directory the settings for the gadget assignment, and the settings on the user, and then create a configuration object based on the overwritable / cumulative flags for the gadget instance. 10 10. NPS gets gadget stylesheet Stylesheet TUT251—Creating Novell Portal Services Gadgets: An Architectural Overview
Writing Configuration Used to create/update configuration information If setting doesn’t exist, will create it
Overriding default XSL Stylesheet By default, main.xsl is the stylesheet used For example: XML Remote gadget overrides the default stylesheets Use this: getStylesheetAndResourceSets
Debug Logging NPS provides a logging facility Messages can be sent to the servlet screen or a log file Logging level is configured in the Portal Admin