In nearly all enterprise-level Oracle WebCenter Sites projects, it is very common to have following architectural design:
WebCenter Sites Systems
where each system has its own database, application server and web server (if applicable). One of the systems, Testing system, is an optional system usually installed for quality assurance. Content is synchronized between each system by means of Publishing (generally RealTime Publishing is used). But problem with having Test system is that authors/content editors do not usually approve and/or publish content from Management System but they want their content to be present in Testing System for testing site before go-live. And thus, this is where automatic approval of content can be very helpful for clients.
General steps:
1. Create one user with highest privileges on the source system (usually batchuser should be enough but having a separate user will not hurt). Although this is very easy task but needs to be taken care while creating such user as its credential should not be exposed to any other users who have access to Admin UI and/or Support Tools because these users can view/download the properties files and know password if not encrypted. To overcome this problem, use OOTB WebCenter Sites's utility program: PropertyEditor (both windows and unix version are available) which is shipped with WebCenter Sites; to save the password as encrypted (Check Sites Internal Security). Usually, it is better to create one site-specific/project-specific property file for e.g. [sitename/projectname]_Properties.ini file and add username & password. This property file should be placed in same folder where futuretense.ini file resides.
2. Write a custom utility which searches for held, new and edited assets which are required to be approved to target system. As it is considered that automatic publishing event is already set for publishing assets from source to target system, utility just needs to find and approve those assets. To implement this functionality, basic steps would be as followed:
- Create a CSElement from Admin UI or developer tools in Eclipse, say, for e.g. ApproveAssetsEvent
- Create a SiteEntry in SiteCatalog table using Sites Explorer (erstwhile Content Server Explorer) with same name i.e. ApproveAssetsEvent where sscache and cscache should be false. Important: Name should be same and should be created from Sites Explorer as there is one bug where in if SiteEntry is created from Admin UI, it fails to run the associated CSElement via System Events.
- Following sample code snippet should be helpful in writing this utility:
3. Add an entry in SystemEvents table via Sites Explorer with following:
- eventname: ApproveAssetsEvent
- type: 1
- enabled: 1 (1 for enabling and 0 for disabling)
- times: add time as mentioned in guide (Time format: hours:minutes:seconds weekdays/days of month/months of year)
- target: ContentServer
- params: pagename=ApproveAssetsEvent&target=12345 (where 12345 is Target System Id)
Summary:
- Create CSElement + SiteEntry or Template which lists the assets for approval and approves them for scheduled publishing.
- Add the entry in SystemEvents table using SitesExplorer.
- If there is too much activity on management system and depending upon how complex operations will take place in approve assets' element, custom event can be performance intensive and thus, it is better to schedule it when there is no or very less editorial activity. Usually scheduling to approve assets at the end of the day should be ideal time but obviously differs from project to project.
- Additionally one can off-load all events in SystemEvents table if you have clustered installation; by setting cs.eventhost to the cluster node which will act as event host and by setting cs.batchhost property which will act as batch host.
- Take care to set time of this custom approval event which doesn't clash with scheduled publishing event.
No comments:
Post a Comment