com.arsdigita.cms.contenttypes
Class AbstractContentTypeLoader

java.lang.Object
  extended bycom.arsdigita.util.parameter.AbstractParameterContext
      extended bycom.arsdigita.runtime.AbstractScript
          extended bycom.arsdigita.loader.PackageLoader
              extended bycom.arsdigita.cms.contenttypes.AbstractContentTypeLoader
All Implemented Interfaces:
com.arsdigita.util.parameter.ParameterContext, com.arsdigita.runtime.Script

public abstract class AbstractContentTypeLoader
extends com.arsdigita.loader.PackageLoader

This is the base loader that can be used by individual content types. Specifically, it provides type loading functionality in the "run" method that can be used by content types to reduce code duplication.

Version:
$Revision: #11 $ $Date: 2004/04/07 $
Author:
Rafael H. Schloming <rhs@mit.edu>

Field Summary
static String versionId
           
 
Fields inherited from class com.arsdigita.loader.PackageLoader
s_log
 
Constructor Summary
AbstractContentTypeLoader()
           
 
Method Summary
protected  List getContentSections()
          Returns a list of content sections into which the content type should be installed.
protected abstract  String[] getTypes()
           
protected  void prepareSection(ContentSection section, ContentType type, LifecycleDefinition ld, com.arsdigita.workflow.simple.WorkflowTemplate wf)
           
 void run(com.arsdigita.runtime.ScriptContext ctx)
           
protected  Template setDefaultTemplate(String name, String label, URL templateURL, ContentSection section, ContentType type, LifecycleDefinition ld, com.arsdigita.workflow.simple.WorkflowTemplate wf)
          This provides an easy way to subtypes to register default templates during the loading.
 
Methods inherited from class com.arsdigita.loader.PackageLoader
exists, exists, exists, load, loader, requires, requires, requires
 
Methods inherited from class com.arsdigita.util.parameter.AbstractParameterContext
get, get, getParameters, load, load, loadInfo, register, save, set, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.arsdigita.util.parameter.ParameterContext
get, get, getParameters, load, save, set, validate
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

AbstractContentTypeLoader

public AbstractContentTypeLoader()
Method Detail

run

public void run(com.arsdigita.runtime.ScriptContext ctx)

prepareSection

protected void prepareSection(ContentSection section,
                              ContentType type,
                              LifecycleDefinition ld,
                              com.arsdigita.workflow.simple.WorkflowTemplate wf)

getTypes

protected abstract String[] getTypes()

getContentSections

protected List getContentSections()
Returns a list of content sections into which the content type should be installed.

If this returns an empty list, then the content type will be loaded into the section specified by ContentSectionConfig.getDefaultContentSection().

The default implementation returns an empty list.


setDefaultTemplate

protected Template setDefaultTemplate(String name,
                                      String label,
                                      URL templateURL,
                                      ContentSection section,
                                      ContentType type,
                                      LifecycleDefinition ld,
                                      com.arsdigita.workflow.simple.WorkflowTemplate wf)
This provides an easy way to subtypes to register default templates during the loading. When this is used, it should be called by the loader class by overriding prepareSection



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