automatic page copies

70
Automatic Page Copies A publish trigger and web services case study Daniel Horwitz and Darren Schaumann, ProHealth Care

Upload: mai

Post on 13-Jan-2016

26 views

Category:

Documents


3 download

DESCRIPTION

Automatic Page Copies. A publish trigger and web services case study Daniel Horwitz and Darren Schaumann, ProHealth Care. Where’s Darren?. In Tahiti on a large boat sipping margaritas and loving life OR In labor and delivery waiting for my second child to be born. Detailed Information. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Automatic Page Copies

Automatic Page CopiesA publish trigger and web services

case study

Daniel Horwitz andDarren Schaumann,

ProHealth Care

Page 2: Automatic Page Copies

Where’s Darren?

In Tahiti on a large boat sipping margaritas and loving life

OR

In labor and delivery waiting for my second child to be born.

Page 3: Automatic Page Copies

Detailed Information

• Information on downloading the detailed speaker’s notes, Java code, style sheets and build configuration will be made available at the end of this presentation.

Page 4: Automatic Page Copies

Introduction

• Our policies and procedures system was difficult to use, and even harder to maintain.

• Using a publish trigger and web services, we were able to simplify our system.

• Only one copy of each policy and procedure is updated.

Page 5: Automatic Page Copies

Problem Statement

• Policies and procedures defined

• Current situation

• Challenge

Page 6: Automatic Page Copies

Definition

• Policies and procedures are the documented processes and guidelines that the corporation and people are required to follow.

Page 7: Automatic Page Copies

Definition

• Policies can apply to multiple entities within the ProHealth Care system.

Page 8: Automatic Page Copies

Definition

• Each policy and procedure document should contain either a policy section, a procedure section or both.

Page 9: Automatic Page Copies

Current Situation

• Users note that searching on the current site is difficult to use.

Page 10: Automatic Page Copies

Current Situation

• Each entity has a directory structure to browse, but they all have different structures.

Page 11: Automatic Page Copies

Current Situation

• Policies were written in Microsoft Word™ and then converted to PDF files.

• They have many different, and inconsistent, formats.

Page 12: Automatic Page Copies

Challenge

• Simple search and site hierarchy for finding policies.

• Use content management for archiving and workflow.

• Single source policy applying to many places in the hierarchy.

• Have all the policies use the same format.

Page 13: Automatic Page Copies

First Attempt

• Display document in multiple places using ‘references’.

• Unable to get navigation to be based on user’s current location in site. Need separate index block generation for each folder where the policy appears.

Page 14: Automatic Page Copies

ProHealth Solution

• Build policies out of a series of HTML blocks.

• Allow content editors to edit only the source policies.

• Include entity and category information as metadata.

• When source policy is published, create or update copies of the policy at all the appropriate places in the site hierarchy, then publish the copies.

Page 15: Automatic Page Copies

User View

• Organization

• Home page

• Search

• Left Navigation

• Right Navigation

• Policy Display

Page 16: Automatic Page Copies

User View - Organization

• Policies are organized by entity and category.

Policies andProcedures

Entity:Lawrence Center

Entity:ProHealth Care

Entity:Waukesha Memorial

Hospital

Category:Administration

Category:Admitting

Category:Corporate

Compliance

UncategorizedPolicy

Page 17: Automatic Page Copies

User View – Home Page

• Policies and procedures home page has left-hand navigation and search.

• Both dynamically display all entities.

Page 18: Automatic Page Copies

User View - Search

• Using Google™ search appliance.• Finds policies under each applicable entity

and category.

Page 19: Automatic Page Copies

User View – Left Navigation

• Left-hand navigation block allows users to browse for policies in the site hierarchy.

Page 20: Automatic Page Copies

User View – Right Navigation

• Right navigation displays policies immediately under entity or policies within current category.

Page 21: Automatic Page Copies

User View – Policy Display

• Displayed as series of HTML blocks.

Page 22: Automatic Page Copies

Content Editors

• Content editors see only the source copy of the policy document.

• The different pieces of the document are all edited as blocks.

Page 23: Automatic Page Copies

Content Editors

• Defining entities and categories to which the policy applies.

Page 24: Automatic Page Copies

Content Editors

• Editor must enter policy, definitions and procedure into separate blocks.

Page 25: Automatic Page Copies

Content Editors

• When the content editor publishes the source, all the copies are published.

• Content editors can publish the folders containing the copies.

• When creating a new policy, the creator selects a different page type for a policy only, a procedure only or a combined policy and procedure.

Page 26: Automatic Page Copies

Site Administrators

• Only site administrators can see the copies.

• Site administrators set up entity and category selection blocks.

• Site administrators create folders and index pages for all the entity/category combinations.

Page 27: Automatic Page Copies

Style Sheets

• The style sheets take advantage of copies of all the policies being in the correct place.

• For navigation, the “current” attribute is the key to locating the system folder which is the user’s current location in the site.

Page 28: Automatic Page Copies

Style Sheets – Left Nav

• Left-hand navigation displays the user’s current location in the site.

• Style sheet called Left PandP Parent Children, because it displays both the parent (entity) information and the children (category) information.

Page 29: Automatic Page Copies

Style Sheets – Left Nav

• If current is an entity, displays all the entities, highlights the current and displays the categories of the current entity.

• If current is a category, displays all the entities, highlights the current and displays just the current category.

• If no current, then displays all the entities, with no current entity highlighted.

Page 30: Automatic Page Copies

Style Sheets - Search

• Search, on the right hand side on the home page, displays the search block.

• Style sheet is PandP Search.

• Handling of two columns loosely based on Home Left Navigation.

Page 31: Automatic Page Copies

Style Sheets – Right Nav

• When user’s current location is an entity, display that entity’s policies that do not have a category.

• Style sheet called PandP Children because it displays an entity’s children.

Page 32: Automatic Page Copies

Style Sheets – Right Nav

• When user’s current location is a category, display the category’s policies.

• Style sheet called PandP Grandchildren because it displays an entity’s grandchildren.

Page 33: Automatic Page Copies

Style Sheets - Navigation

• The navigation style sheets use an index block as their source. Generating the XML for an index block takes some time. This seems to be the main bottleneck for publishing.

• Navigation must be rendered based on user’s current location so that all the links are correct.

Page 34: Automatic Page Copies

Style Sheets - Policies

• The policy_procedure style sheet displays the selected policy.

• The policy is simply a list of blocks, which are displayed in order.

• The entities block is built from the “Site” dynamic-metadata element, which is a sibling of the system-data-structure element.

Page 35: Automatic Page Copies

Publish Trigger

• Notes• Vocabulary• High-level Algorithm• Web service calls used• Publish trigger interface• Web services interface• WebservicesUtils• Building an Asset for a psuedo-policy• Build Notes

Page 36: Automatic Page Copies

Publish Trigger - Notes

• In order to publish an asset, that asset must exist.

• When an asset is published by the user, or via the web service, it is placed on a queue.

• A single thread in the Cascade server takes an item from the queue and publishes it.

Page 37: Automatic Page Copies

Publish Trigger - Vocabulary

• Actual policy: The source policy, which is edited by the content editors.

• Pseudo-policy: A copy of the source policy, which is used to publish copies of the actual policy.

Page 38: Automatic Page Copies

High-level Algorithm - Notes

• Low-level details are in the Java code to be supplied later.

• Publish trigger is called for every destination of every document being published.

• Upon return from the trigger, the triggering document is published by Cascade to the specified destination.

Page 39: Automatic Page Copies

High-level Algorithm

• I) Examine the entity type and entity path from the publish information. If not a policy, do nothing.

• II) Read the policy being published.

• III) Look at the metadata. If a pseudo-policy, do nothing.

Page 40: Automatic Page Copies

High-level Algorithm - IV

• IV) Using the applicable entity and category lists from the metadata, loop through each pseudo-policy associated with the actual policy.

• A) Try to read the pseudo-policy.

Page 41: Automatic Page Copies

High-level Algorithm - IV

• B) If the pseudo-policy doesn’t exist:

• 1) Create the pseudo-policy.

• 2) Remove non-administrator access to the page.

• 3) Publish the indices to its parent and grandparent folders.

Page 42: Automatic Page Copies

High-level Algorithm - IV

• C) If the pseudo-policy exists but the actual policy has been updated later:

• 1) Update the pseudo-policy to reflect the actual policy’s content.

• 2) Remove non-administrator access to the page.

Page 43: Automatic Page Copies

High-level Algorithm - IV

• D) Publish the pseudo-policy.

Page 44: Automatic Page Copies

Web Service Calls Used

• Only assets being manipulated are pages.

• read()

• create()

• edit()

• editAccessRights()

• publish()

Page 45: Automatic Page Copies

Publish Trigger Interface

• See “Publish Triggers” in the knowledge base for details.

Page 46: Automatic Page Copies

Publish Trigger Interface

• SDK contained in CascadePublishTrigger.zip

• Use publishtrigger-5.5.jar

• Interface is part of Cascade installation. Don’t include interface classes in the publish trigger archives.

Page 47: Automatic Page Copies

Web Services Interface

• See “Web Services Skeleton Project” in the knowledge base for details.

Page 48: Automatic Page Copies

Web Services Interface

• Download axis 1.4 from http://ws.apache.org/axis.• Make the jar files in

axis-1_4/webapps/axis/WEB-INF/lib available.• Get a current copy of the wsdl file using a browser.

Cascade server must be running. URL is<server-base>/ws/services/AssetOperationService?wsdl.

• Build interface classes using org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask.

• Careful, AssetOperationService_address is based on how the wsdl file was addressed by the browser. Production interface must be built from production wsdl file.

Page 49: Automatic Page Copies

WebservicesUtils

• Get com.cms.webservices.WebservicesUtils from Cascade+Webservices.zip.

• Pages contain a number of elements where an identifier or path must be supplied, but not both.

Page 50: Automatic Page Copies

WebservicesUtils

• To set up a page for create() or edit(), read the page, call nullPageValues(), then perform application-specific editing.

• If you don’t use nullPageValues(), beware of dragons.

Page 51: Automatic Page Copies

WebservicesUtils

• Since WebservicesUtils has been written, the web services have been updated.

• Before line 84, add:pConf[i].setId( null );

Page 52: Automatic Page Copies

Building Asset for Pseudo-Policy

• An asset must be passed to create() or edit().

• Read actual policy page, run nullPageValues(), make an asset for the updated page and update the metadata fields.

Page 53: Automatic Page Copies

Building Asset for Pseudo-Policy

• Update metadata by getting dynamic fields list from the page’s metadata and go through the fields.

• Each field has a name and a list of values.• If the name is “Actual”, set to single false

value.• If the name is “pathToActual”, set to single

string which is the path to the actual policy.• If any other name, leave alone.

Page 54: Automatic Page Copies

Build Notes

• Use Java 1.5 JDK for compatibility with the Cascade server.

• Axis web service interface classes generate a lot of warnings.

• Copy publish trigger jar file to../tomcat/webapps/ROOT/WEB-INF/lib on each Cascade server.

Page 55: Automatic Page Copies

Debugging

• Mostly done with Eclipse debugger.• Use Log4j to log messages to Cascade log.• Publish trigger interface for testing

implemented by class in Eclipse.• Information hard-coded in the method that

drives test.• Probable that org.apache.axis.utils.JavaUtils

will log warnings about DataHandler and MimeMultipart. The warnings can be ignored.

Page 56: Automatic Page Copies

Debugging SOAP Messages

• Prudent to see the SOAP messages.• Hannon Hill often wants to see SOAP

messages.• Hannon Hill recommends tcpmon. Get it from

https://tcpmon.dev.java.net.• Web services interface code must explicitly

go through tcpmon. Update AssetOperationService_address in AssetOperationHandlerServiceLocator.java. Change protocol:host:port section to http://localhost:3333.

Page 57: Automatic Page Copies

Debugging SOAP Messages

• Bring up tcpmon in a command window using “java –jar tcpmon.jar”.

• Create new TCP Monitor Connection: Local Port: 3333 Server Name: <Cascade-server-name> Server Port: <Cascade-server-port>

• Run the test. tcpmon will capture the SOAP traffic.

Page 58: Automatic Page Copies

Cleaning up Orphaned Psuedo-policies

• Psuedo-policy with no associated actual policy is an orphan. Caused when policy no longer applies to entity or category.

• Orphaned policies appear in index blocks. This causes them to appear in navigation areas and allows them to be accessed by the users.

• Finding orphaned policies is slow because all the policy folders must be searched.

• Scheduled job runs weekly to clean up orphans.

Page 59: Automatic Page Copies

High-level Algorithm - Clean up Orphans

• Starting at root of policies, recursively go through that folder and all its sub-folders.

• In each folder:• A) Read the folder asset using read()• B) Go through all the folder’s child assets:• 1) If asset’s path ends in /index or /_cms, ignore it.• 2) If asset is a folder, recursively process the folder.• 3) If asset is a page, process potentially orphaned

policy by:

Page 60: Automatic Page Copies

High-level Algorithm – Clean up Orphans

• i) Read the potentially orphaned policy.

• ii) If not a pseudo-policy, ignore it.

• iii) Read associated actual policy. If the read fails, delete the pseudo-policy.

• iv) Look at entity and site in actual policy’s metadata. If no combinations match pseudo-policy, delete it.

Page 61: Automatic Page Copies

Cleaning up Orphaned Psuedo-policies

• The application uses read() and delete() web service calls.

• Activation and mailapi_1_1_3 jar files must be made available to the application.

• Directory on the server contains jar file, batch file, jar files from Axis 1.4 library, and activation and mailapi_1_1_3 jars.

Page 62: Automatic Page Copies

Eclipse Organization

• ProHealth uses Eclipse IDE and CVS.• Many ways to organize the Eclipse projects.• For reproducibility, copies of all third-party sources and libraries are in

CVS.• CascadePublishTriggerLib - publishtrigger-5.5.jar library from

CascadePublishTrigger.zip.• CascadeAxisLibs – Library jars for Axis 1-4.• CascadeWebServices – Java classes built here based on

AssetOperationService.wsdl from the Cascade server.• CascadePhcUtils – Project that builds the bulk of the publish trigger

and cleanup application.• CascadePublishTriggers – The publish trigger itself, ready for use on

the Cascade server.• CascadeCleanup – The application for deleting orphan pseudo-

policies.

Page 63: Automatic Page Copies

Gotchas

• The publish() web service call currently does not allow target destinations to be defined - CSNEW-132 requests that destinations be supported by the publish() web service call.

• The generation of the index block, used for generating the navigation, is rather intense. This causes the publishing of policies to be rather slow.

Page 64: Automatic Page Copies

Good to Know

• Hannon Hill has Professional Services that can write triggers and web service clients.

• Support model is very hands-on by Hannon Hill. The number of customers writing web service clients is small enough that customers are supported better by people than by extensive documentation that may or may not address the issue.

Page 65: Automatic Page Copies

Lessons Learned

• Get technical portions working first and then announce it to users.

• Working with the web services is an iterative process. The detailed implementation can require changes to the user process.

Page 66: Automatic Page Copies

Future Development

• Add workflow for policy updating.

Page 67: Automatic Page Copies

Detailed Information

• Additional information may be downloaded from:www.hannonhill.com/new-kb/Users-Conference/index.

Page 69: Automatic Page Copies

Summary

• Need multiple copies of documents to support location-specific navigation.

• Allow content editors to edit source documents and specify all display locations.

• Use publish trigger, that calls web services, to create, update and publish the copies.

Page 70: Automatic Page Copies

Questions?