wt.inf.template
Class ContainerTemplateHelper

java.lang.Object
  extended bywt.inf.template.ContainerTemplateHelper
All Implemented Interfaces:
Externalizable, Serializable

public class ContainerTemplateHelper
extends Object
implements Externalizable



Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static Object[] DEF_PARAMS
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
static ContainerTemplateService service
          

Supported API: true
 
Constructor Summary
ContainerTemplateHelper()
           
 
Method Summary
private static void checkContainerAndTemplate(WTContainerRef parent, WTContainerTemplate tmpl)
           
static WTContainerTemplate copyTemplate(WTContainerRef parentContainer, WTContainerTemplate template, String name)
          Saves the non-identity information of a template along with any associated content files to a new template.
static WTContainerTemplate copyTemplate(WTContainerRef parentContainer, WTContainerTemplate template, String name, String descr, boolean enabled)
          Saves the non-identity information of a template along with any associated content files to a new template.
static WTContainerTemplate copyTemplate(WTContainerTemplate template, String name)
          Saves the non-identity information of a template along with any associated content files to a new template.
static WTContainerTemplate copyTemplate(WTContainerTemplate template, String name, String descr, boolean enabled)
          Saves the non-identity information of a template along with any associated content files to a new template.
static WTContainerTemplateRef copyTemplateRef(WTContainerRef parentContainer, WTContainerTemplateRef tmplRef, String name)
          Saves the non-identity information of a template along with any associated content files to a new template.
static WTContainerTemplateRef copyTemplateRef(WTContainerRef parentContainer, WTContainerTemplateRef tmplRef, String name, String descr, boolean enabled)
          Saves the non-identity information of a template along with any associated content files to a new template.
static WTContainerTemplateRef copyTemplateRef(WTContainerTemplateRef tmplRef, String name)
          Saves the non-identity information of a template along with any associated content files to a new template.
static WTContainerTemplateRef copyTemplateRef(WTContainerTemplateRef tmplRef, String name, String descr, boolean enabled)
          Saves the non-identity information of a template along with any associated content files to a new template.
static WTContainer getDefaultContainerValues(WTContainerTemplateMaster master)
          Returns an unpersisted WTContainer corresponding to the DefaultContainerValues object corresponding to the passed in template.
static WTContainer getDefaultContainerValues(WTContainerTemplateMasterReference masterRef)
          Returns an unpersisted WTContainer corresponding to the DefaultContainerValues object corresponding to the passed in template.
static WTContainer getDefaultContainerValues(WTContainerTemplateMasterReference masterRef, WTContainer cont)
          Returns an unpersisted WTContainer corresponding to the DefaultContainerValues object corresponding to the passed in template.
static WTContainer getDefaultContainerValues(WTContainerTemplateMaster master, WTContainer cont)
          Returns an unpersisted WTContainer corresponding to the DefaultContainerValues object corresponding to the passed in template.
private static DefaultWTContainerTemplate getTemplateFromReference(WTContainerTemplateRef tmplRef)
           
static boolean hasDownloadableXML(WTContainerTemplateRef tmplRef)
           
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(ContainerTemplateHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

service

public static final ContainerTemplateService service


Supported API: true


serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

DEF_PARAMS

private static final Object[] DEF_PARAMS
Constructor Detail

ContainerTemplateHelper

public ContainerTemplateHelper()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(ContainerTemplateHelper thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

copyTemplate

public static WTContainerTemplate copyTemplate(WTContainerTemplate template,
                                               String name)
                                        throws WTException
Saves the non-identity information of a template along with any associated content files to a new template. The template will be saved in the same container as the passed in template resides in.

Supported API: false

Parameters:
template - The template to be copied.
name - This is the name that the new template is to have. An exception will be thrown if the name is not unique within the container that it is being saved to.
Returns:
WTContainerTemplate
Throws:
WTException

copyTemplate

public static WTContainerTemplate copyTemplate(WTContainerRef parentContainer,
                                               WTContainerTemplate template,
                                               String name)
                                        throws WTException
Saves the non-identity information of a template along with any associated content files to a new template. The template will be saved in the passed in container if the user has permission to modify that container. Otherwise an exception will be thrown.

Supported API: false

Parameters:
parentContainer -
template -
name - Identity information for the new template. See wt.inf.template.GeneratedTemplateAttributes
Returns:
WTContainerTemplate
Throws:
WTException

copyTemplate

public static WTContainerTemplate copyTemplate(WTContainerTemplate template,
                                               String name,
                                               String descr,
                                               boolean enabled)
                                        throws WTException
Saves the non-identity information of a template along with any associated content files to a new template. The template will be saved in the same container as the passed in template resides in.

Supported API: false

Parameters:
template -
name - Identity information for the new template. See wt.inf.template.GeneratedTemplateAttributes
descr -
enabled -
Returns:
WTContainerTemplate
Throws:
WTException

copyTemplate

public static WTContainerTemplate copyTemplate(WTContainerRef parentContainer,
                                               WTContainerTemplate template,
                                               String name,
                                               String descr,
                                               boolean enabled)
                                        throws WTException
Saves the non-identity information of a template along with any associated content files to a new template. The template will be saved in the passed in container if the user has permission to modify that container. Otherwise an exception will be thrown.

Supported API: false

Parameters:
parentContainer -
template -
name - Identity information for the new template. See wt.inf.template.GeneratedTemplateAttributes
descr -
enabled -
Returns:
WTContainerTemplate
Throws:
WTException

copyTemplateRef

public static WTContainerTemplateRef copyTemplateRef(WTContainerTemplateRef tmplRef,
                                                     String name)
                                              throws WTException
Saves the non-identity information of a template along with any associated content files to a new template. The template will be saved in the same container as the passed in template resides in.

Supported API: false

Parameters:
tmplRef - The template to be copied.
name - This is the name that the new template is to have. An exception will be thrown if the name is not unique within the container that it is being saved to.
Returns:
WTContainerTemplateRef
Throws:
WTException

copyTemplateRef

public static WTContainerTemplateRef copyTemplateRef(WTContainerRef parentContainer,
                                                     WTContainerTemplateRef tmplRef,
                                                     String name)
                                              throws WTException
Saves the non-identity information of a template along with any associated content files to a new template. The template will be saved in the same container as the passed in template resides in.

Supported API: false

Parameters:
parentContainer -
tmplRef - The template to be copied.
name - This is the name that the new template is to have. An exception will be thrown if the name is not unique within the container that it is being saved to.
Returns:
WTContainerTemplateRef
Throws:
WTException

copyTemplateRef

public static WTContainerTemplateRef copyTemplateRef(WTContainerTemplateRef tmplRef,
                                                     String name,
                                                     String descr,
                                                     boolean enabled)
                                              throws WTException
Saves the non-identity information of a template along with any associated content files to a new template. The template will be saved in the same container as the passed in template resides in.

Supported API: false

Parameters:
tmplRef -
name - Identity information for the new template. See wt.inf.template.GeneratedTemplateAttributes
descr -
enabled -
Returns:
WTContainerTemplateRef
Throws:
WTException

copyTemplateRef

public static WTContainerTemplateRef copyTemplateRef(WTContainerRef parentContainer,
                                                     WTContainerTemplateRef tmplRef,
                                                     String name,
                                                     String descr,
                                                     boolean enabled)
                                              throws WTException
Saves the non-identity information of a template along with any associated content files to a new template. The template will be saved in the passed in container if the user has permission to modify that container. Otherwise an exception will be thrown.

Supported API: false

Parameters:
parentContainer -
tmplRef -
name - Identity information for the new template. See wt.inf.template.GeneratedTemplateAttributes
descr -
enabled -
Returns:
WTContainerTemplateRef
Throws:
WTException

getDefaultContainerValues

public static WTContainer getDefaultContainerValues(WTContainerTemplateMasterReference masterRef)
                                             throws WTException
Returns an unpersisted WTContainer corresponding to the DefaultContainerValues object corresponding to the passed in template. This is usefull for client developers since container defaults can be forced on an instance based and a type based fashion.

Supported API: false

Parameters:
masterRef -
Returns:
WTContainer
Throws:
WTException

getDefaultContainerValues

public static WTContainer getDefaultContainerValues(WTContainerTemplateMasterReference masterRef,
                                                    WTContainer cont)
                                             throws WTException
Returns an unpersisted WTContainer corresponding to the DefaultContainerValues object corresponding to the passed in template. This is usefull for client developers since container defaults can be forced on an instance based and a type based fashion.

Supported API: false

Parameters:
masterRef -
cont - An exception is thrown if the passed in container has been persisted.
Returns:
WTContainer
Throws:
WTException

getDefaultContainerValues

public static WTContainer getDefaultContainerValues(WTContainerTemplateMaster master)
                                             throws WTException
Returns an unpersisted WTContainer corresponding to the DefaultContainerValues object corresponding to the passed in template. This is usefull for client developers since container defaults can be forced on an instance based and a type based fashion.

Supported API: false

Parameters:
master -
Returns:
WTContainer
Throws:
WTException

getDefaultContainerValues

public static WTContainer getDefaultContainerValues(WTContainerTemplateMaster master,
                                                    WTContainer cont)
                                             throws WTException
Returns an unpersisted WTContainer corresponding to the DefaultContainerValues object corresponding to the passed in template. This is usefull for client developers since container defaults can be forced on an instance based and a type based fashion.

Supported API: false

Parameters:
master -
cont - An exception is thrown if the passed in container has been persisted.
Returns:
WTContainer
Throws:
WTException

checkContainerAndTemplate

private static void checkContainerAndTemplate(WTContainerRef parent,
                                              WTContainerTemplate tmpl)
                                       throws WTException
Throws:
WTException

getTemplateFromReference

private static DefaultWTContainerTemplate getTemplateFromReference(WTContainerTemplateRef tmplRef)
                                                            throws WTException
Throws:
WTException

hasDownloadableXML

public static boolean hasDownloadableXML(WTContainerTemplateRef tmplRef)
                                  throws WTException
Throws:
WTException