com.arsdigita.cms.installer.xml
Class ContentItemLoader
java.lang.Object
com.arsdigita.kernel.BaseInitializer
com.arsdigita.cms.installer.xml.ContentItemLoader
- All Implemented Interfaces:
- com.arsdigita.initializer.Initializer
- public class ContentItemLoader
- extends com.arsdigita.kernel.BaseInitializer
An initializer to load content items for load testing Will take an
XML file with one content item definition, and create items whose
title is "title + number".
There's an example configuration file in
/WEB-INF/content-items/ContentItemLoader.xml It looks like this:
<ccm:content-items>
<ccm:folder
clone="3"
depth="2"
label="Folder" >
<ccm:content-item clone="4">
<ccm:content-type
classname="com.arsdigita.cms.dublin.types.DublinArticle"
objectType="com.arsdigita.cms.dublin.types.DublinArticle"/>
<ccm:item-properties title="item" >
<body-text>
body text
</body-text>
</ccm:item-properties>
</ccm:content-item>
<ccm:content-item clone="1">
<ccm:content-type
classname="com.arsdigita.cms.contenttypes.Address"
objectType="com.arsdigita.cms.contenttypes.Address"
helperClass="com.arsdigita.util.cms.ContentPageHelper"/>
<ccm:item-properties title="address" >
<ccm:item-property method="setAddress"
argClass="java.lang.String" argValue="338 EustonRoad"/>
<body-text>
there's no body text
</body-text>
</ccm:item-properties>
</ccm:content-item>
</ccm:folder>
</ccm:content-items>
This will create a folder tree with 2 levels of folders, each folder
will have 3 subfolders and 4 content items.
The XMLContentItemHandler will create any content type. However, it
will only process the values for the basic attributes (name, title,
body text if it exists).
- Author:
- Nobuko Asakai (nasakai@redhat.com)
- See Also:
XMLContentItemHandler
,
ContentItemHelper
Fields inherited from interface com.arsdigita.initializer.Initializer |
versionId |
Methods inherited from class com.arsdigita.kernel.BaseInitializer |
shutdown, startup |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ContentItemLoader
public ContentItemLoader()
getContentSectionParam
public String getContentSectionParam()
getContentDefinition
public String getContentDefinition()
getConfiguration
public com.arsdigita.initializer.Configuration getConfiguration()
doStartup
public void doStartup()
doShutdown
public void doShutdown()
validateNameParameter
public void validateNameParameter(String value)
throws com.arsdigita.initializer.InitializationException
- Throws:
com.arsdigita.initializer.InitializationException
getContentSection
public ContentSection getContentSection()
throws com.arsdigita.initializer.InitializationException
- Throws:
com.arsdigita.initializer.InitializationException
loadContentItems
public void loadContentItems(String path,
ContentSection section)
Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 19 2004:2352 UTC