Mass Creation of Portal Content – Generic Creator
- In your portal implementation you need to integrate a lot of websites. So you find yourself creating a lot of similar URL-based iViews. After creating a few you are getting impatient and you want the higher gods to help you avoid this boredom.
There can be more scenarios like this but you get the basic picture. There are repetitive tasks to be performed during the content creation and you want to automate this. Your prayers have been answered and now we have a robust(at least I think) implementation of the Generic Creator in the latest portal releases. What is even better is that there is a HOWTO telling you the guts of this component. Please download it and feel the love.
It would be bad of me to end this blog without giving some examples. So here is the XML code you can use for the above mentioned two scenarios: creating a folder hierarchy, and creating URL iViews. As always you will be doing it at your own risk.
For uploading the given XML code, create an XML file with the given code and then visit the following:
System Administration -> Transport -> Upload Content and Actions
<Context parent=”portal_content” name=”$.general” objectClass=”com.sap.portal.pcd.gl.GlContext” title=”General” >
<Context name=”$.general.iviews” objectClass=”com.sap.portal.pcd.gl.GlContext” title=”iViews” />
<Context name=”$.general.pages” objectClass=”com.sap.portal.pcd.gl.GlContext” title=”Pages” />
<Context name=”$.general.worksets” objectClass=”com.sap.portal.pcd.gl.GlContext” title=”Worksets” />
<Context name=”$.general.roles” objectClass=”com.sap.portal.pcd.gl.GlContext” title=”Roles” />
Creating a URL iView</b>
This creates a URL-based iView in General/iViews created above.
<textarea rows=”10″ cols=”90″>
<GenericCreator author=”Pankaj Kumar” version=”Portal Content 1.0″ mode=”execute” createMode=”1″ log.level=”success” default.locale=”en” ignore=”false”>
<Property name=”namespace” value=”com.mycompany.pct”/>
<Property name=”locale” value=”en”/>
<Context parent=”portal_content/$.general/$.general.iviews” create_as=”0″ name=”$.general.iviews.Google” objectClass=”com.sapportals.portal.iview” title=”Google” template=”portal_content/templates/iviews/urliview” >
I have tested this code on EP 6.0 SP7 on WAS 6.40 SP8 in a Windows environment.