com.arsdigita.cms.installer.xml
Class ContentBundleHelper

java.lang.Object
  extended bycom.arsdigita.cms.installer.xml.ContentItemHelper
      extended bycom.arsdigita.cms.installer.xml.ContentBundleHelper
Direct Known Subclasses:
ContentPageHelper

public class ContentBundleHelper
extends ContentItemHelper

This Helper class is used to parse input from xml files that represent ContentItems stored as bundles. The Helper makes it virtually transparent to save Items as Bundles. The Bundles are stored internally, and it is not recommended that subclasses make use of them directly. Instead, save the Item as you would were you using ContentItemHelper

Author:
Aizaz Ahmed
See Also:
ContentItemHelper

Field Summary
 
Fields inherited from class com.arsdigita.cms.installer.xml.ContentItemHelper
m_item, m_language
 
Constructor Summary
ContentBundleHelper(ContentSection section)
           
 
Method Summary
 ContentItem cloneItem(String name, Folder parent, boolean save)
           Clones the item and the corresponding ContentBundles
protected  ContentItem createContentItem(boolean save)
           Adds to ContentItemHelper.createContentItem(boolean) so that new Items are saved in appropriate bundles.
protected  ContentItem createNewContentItem()
          Sets the title of the ContentItem returned by the super method to be the same as the item name
 void save()
          Saves the Item and it's associated ContentBundle
 void setContentItem(ContentItem item)
           
 void setParent(Folder parent)
           Note: If the create (or one of it's variants) has already been called, setting the parent implicitly saves the object
 
Methods inherited from class com.arsdigita.cms.installer.xml.ContentItemHelper
cloneItem, cloneItem, cloneName, create, create, createContentItem, getCloneCount, getContentItem, getContentItemByName, getContentSection, getContentType, getName, getParent, newCloneItem, set, setBodyText, setCloneCount, setContentSection, setContentType, setLanguage, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentBundleHelper

public ContentBundleHelper(ContentSection section)
Method Detail

setParent

public void setParent(Folder parent)

Note: If the create (or one of it's variants) has already been called, setting the parent implicitly saves the object

Overrides:
setParent in class ContentItemHelper

setContentItem

public void setContentItem(ContentItem item)
Overrides:
setContentItem in class ContentItemHelper

save

public void save()

Saves the Item and it's associated ContentBundle

Overrides:
save in class ContentItemHelper

createContentItem

protected ContentItem createContentItem(boolean save)

Adds to ContentItemHelper.createContentItem(boolean) so that new Items are saved in appropriate bundles. If the bundle does not exist, it is created. If it does exist, it is retrieved and the new ContentItem is added to it. If this bundle already contains an instance of this language, it will fail on Assert.

Overrides:
createContentItem in class ContentItemHelper
See Also:
ContentItemHelper.createNewContentItem()

createNewContentItem

protected ContentItem createNewContentItem()

Sets the title of the ContentItem returned by the super method to be the same as the item name

Overrides:
createNewContentItem in class ContentItemHelper
See Also:
ContentItemHelper.createContentItem(boolean)

cloneItem

public ContentItem cloneItem(String name,
                             Folder parent,
                             boolean save)

Clones the item and the corresponding ContentBundles

Note: Cloning is done on an item basis. Ie. if you clone this item it will only clone this language instance and create a new ( or retrieve the appropriate) content bundle to add it to.

Overrides:
cloneItem in class ContentItemHelper


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2352 UTC