com.silverpeas.publicationTemplate
Class PublicationTemplateImpl

java.lang.Object
  extended by com.silverpeas.publicationTemplate.PublicationTemplateImpl
All Implemented Interfaces:
PublicationTemplate

public class PublicationTemplateImpl
extends Object
implements PublicationTemplate

A PublicationTemplate describes a set of publication records built on a same template. A PublicationTemplate groups :

  1. a RecordTemplate which describes the built records.
  2. a RecordSet of records built on this template,
  3. an update Form used to create and update the publication items
  4. a view Form used to show the publications.


Field Summary
static int LAYER_ACTION_ADD
           
static int LAYER_ACTION_NONE
           
static int LAYER_ACTION_REMOVE
           
 
Fields inherited from interface com.silverpeas.publicationTemplate.PublicationTemplate
DEFAULT_THUMBNAIL
 
Constructor Summary
PublicationTemplateImpl()
           
 
Method Summary
 PublicationTemplateImpl basicClone()
           
 List<String> getApplications()
           
 String getDataFileName()
           
 RecordTemplate getDataTemplate()
           
 String getDescription()
           
 String getExternalId()
           
 List<String> getFieldsForFacets()
          Returns all field names which can generate a search facet
 String getFileName()
           
protected  GenericRecordSetManager getGenericRecordSetManager()
          Gets an instance of a GenericRecordSet objects manager.
 List<String> getInstances()
           
 String getName()
           
 RecordSet getRecordSet()
          Return the RecordSet of all the records built from this template.
 RecordTemplate getRecordTemplate()
          Returns the RecordTemplate of the publication data item.
 RecordTemplate getRecordTemplate(boolean loadIfNull)
          Return the RecordTemplate of the publication data item.
 String getSearchFileName()
           
 Form getSearchForm()
          Returns the Form used to search the records built from this template.
 String getSearchResultFileName()
           
 Form getSearchResultForm()
          Returns the Form used to view the search result records built from this template.
 RecordTemplate getSearchResultTemplate()
           
 RecordTemplate getSearchTemplate()
          Returns the RecordTemplate of the publication search item.
 RecordTemplate getSearchTemplate(boolean loadIfNull)
          Returns the RecordTemplate of the publication search item.
 List<String> getSpaces()
           
 String getThumbnail()
           
 String getUpdateFileName()
           
 Form getUpdateForm()
          Returns the Form used to create and update the records built from this template.
 XmlForm getUpdateFormAsXMLOne()
          Returns the XML Form used to create and update the records built from this template.
 int getUpdateLayerAction()
           
 String getUpdateLayerFileName()
           
 RecordTemplate getUpdateTemplate()
          Returns the RecordTemplate of the publication update item.
 String getUpdateTypeFile()
           
 String getViewFileName()
           
 Form getViewForm()
          Returns the Form used to view the records built from this template.
 int getViewLayerAction()
           
 String getViewLayerFileName()
           
 RecordTemplate getViewTemplate()
          Returns the RecordTemplate of the publication view item.
 String getViewTypeFile()
           
 boolean isDataEncrypted()
           
 boolean isRestrictedVisibility()
           
 boolean isRestrictedVisibilityToApplication()
           
 boolean isRestrictedVisibilityToInstance()
           
 boolean isRestrictedVisibilityToSpace()
           
 boolean isSearchable()
          Is the publication records described by this template can be searchable?
 boolean isUpdateLayerDefined()
           
 boolean isUpdateLayerExist()
           
 boolean isViewLayerDefined()
           
 boolean isViewLayerExist()
           
 boolean isVisible()
          Is this publication template is visible to others?
 RecordTemplate loadRecordTemplate(String xmlFileName)
          load a recordTemplate definition from xml file to java objects
 void saveRecordTemplates()
          This method saves current templates inside a sub directory
 void setApplications(List<String> applications)
           
 void setDataEncrypted(boolean dataEncrypted)
           
 void setDataFileName(String dataFileName)
           
 void setDescription(String description)
           
 void setExternalId(String externalId)
           
 void setFileName(String fileName)
           
 void setInstances(List<String> instances)
           
 void setName(String name)
           
 void setSearchFileName(String searchFileName)
           
 void setSearchResultFileName(String searchResultFileName)
           
 void setSearchResultTemplate(RecordTemplate searchResultTemplate)
           
 void setSearchTemplate(RecordTemplate searchTemplate)
           
 void setSpaces(List<String> spaces)
           
 void setTemplate(RecordTemplate template)
           
 void setThumbnail(String thumbnail)
           
 void setUpdateFileName(String updateFileName)
           
 void setUpdateLayerAction(int updateLayerAction)
           
 void setUpdateLayerFileName(String updateLayerFileName)
           
 void setUpdateTemplate(RecordTemplate updateTemplate)
           
 void setUpdateTypeFile(String updateTypeFile)
           
 void setViewFileName(String viewFileName)
           
 void setViewLayerAction(int viewLayerAction)
           
 void setViewLayerFileName(String viewLayerFileName)
           
 void setViewTemplate(RecordTemplate viewTemplate)
           
 void setViewTypeFile(String viewTypeFile)
           
 void setVisible(boolean visible)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAYER_ACTION_NONE

public static final int LAYER_ACTION_NONE
See Also:
Constant Field Values

LAYER_ACTION_ADD

public static final int LAYER_ACTION_ADD
See Also:
Constant Field Values

LAYER_ACTION_REMOVE

public static final int LAYER_ACTION_REMOVE
See Also:
Constant Field Values
Constructor Detail

PublicationTemplateImpl

public PublicationTemplateImpl()
Method Detail

getRecordTemplate

public RecordTemplate getRecordTemplate(boolean loadIfNull)
                                 throws PublicationTemplateException
Return the RecordTemplate of the publication data item.

Parameters:
loadIfNull -
Returns:
the record template, or a dummy record template if not found (never return null if loadIfNull is true), or null if not loaded and loadIfNull is false.
Throws:
PublicationTemplateException

getRecordTemplate

public RecordTemplate getRecordTemplate()
                                 throws PublicationTemplateException
Description copied from interface: PublicationTemplate
Returns the RecordTemplate of the publication data item.

Specified by:
getRecordTemplate in interface PublicationTemplate
Throws:
PublicationTemplateException

getRecordSet

public RecordSet getRecordSet()
                       throws PublicationTemplateException
Return the RecordSet of all the records built from this template.

Specified by:
getRecordSet in interface PublicationTemplate
Returns:
the record set or a dummy record set if not found (never return null).
Throws:
PublicationTemplateException

getUpdateForm

public Form getUpdateForm()
                   throws PublicationTemplateException
Returns the Form used to create and update the records built from this template.

Specified by:
getUpdateForm in interface PublicationTemplate
Throws:
PublicationTemplateException

getUpdateFormAsXMLOne

public XmlForm getUpdateFormAsXMLOne()
                              throws PublicationTemplateException
Description copied from interface: PublicationTemplate
Returns the XML Form used to create and update the records built from this template. Even if an HTML layer exists (HTMLForm), the XML one is returned.

Specified by:
getUpdateFormAsXMLOne in interface PublicationTemplate
Returns:
the XMLForm
Throws:
PublicationTemplateException

getViewForm

public Form getViewForm()
                 throws PublicationTemplateException
Returns the Form used to view the records built from this template.

Specified by:
getViewForm in interface PublicationTemplate
Throws:
PublicationTemplateException

getSearchTemplate

public RecordTemplate getSearchTemplate(boolean loadIfNull)
                                 throws PublicationTemplateException
Returns the RecordTemplate of the publication search item.

Throws:
PublicationTemplateException

getSearchTemplate

public RecordTemplate getSearchTemplate()
                                 throws PublicationTemplateException
Returns the RecordTemplate of the publication search item.

Throws:
PublicationTemplateException

getViewTemplate

public RecordTemplate getViewTemplate()
                               throws PublicationTemplateException
Returns the RecordTemplate of the publication view item.

Throws:
PublicationTemplateException

getUpdateTemplate

public RecordTemplate getUpdateTemplate()
                                 throws PublicationTemplateException
Returns the RecordTemplate of the publication update item.

Throws:
PublicationTemplateException

getDataTemplate

public RecordTemplate getDataTemplate()
                               throws PublicationTemplateException
Throws:
PublicationTemplateException

getSearchForm

public Form getSearchForm()
                   throws PublicationTemplateException
Description copied from interface: PublicationTemplate
Returns the Form used to search the records built from this template.

Specified by:
getSearchForm in interface PublicationTemplate
Throws:
PublicationTemplateException

setViewFileName

public void setViewFileName(String viewFileName)

getViewFileName

public String getViewFileName()

setUpdateFileName

public void setUpdateFileName(String updateFileName)

getUpdateTypeFile

public String getUpdateTypeFile()

setUpdateTypeFile

public void setUpdateTypeFile(String updateTypeFile)

getViewTypeFile

public String getViewTypeFile()

setViewTypeFile

public void setViewTypeFile(String viewTypeFile)

getUpdateFileName

public String getUpdateFileName()

setDataFileName

public void setDataFileName(String dataFileName)

getDataFileName

public String getDataFileName()

setExternalId

public void setExternalId(String externalId)
Specified by:
setExternalId in interface PublicationTemplate

getExternalId

public String getExternalId()
Specified by:
getExternalId in interface PublicationTemplate

loadRecordTemplate

public RecordTemplate loadRecordTemplate(String xmlFileName)
                                  throws PublicationTemplateException
load a recordTemplate definition from xml file to java objects

Parameters:
xmlFileName - the xml file name that contains process model definition
Returns:
a RecordTemplate object
Throws:
PublicationTemplateException

saveRecordTemplates

public void saveRecordTemplates()
                         throws PublicationTemplateException
This method saves current templates inside a sub directory

Throws:
PublicationTemplateException

getName

public String getName()
Specified by:
getName in interface PublicationTemplate

setName

public void setName(String name)

getFileName

public String getFileName()
Specified by:
getFileName in interface PublicationTemplate

setFileName

public void setFileName(String fileName)

getDescription

public String getDescription()
Specified by:
getDescription in interface PublicationTemplate

setDescription

public void setDescription(String description)

getThumbnail

public String getThumbnail()
Specified by:
getThumbnail in interface PublicationTemplate

setThumbnail

public void setThumbnail(String thumbnail)

setVisible

public void setVisible(boolean visible)

isVisible

public boolean isVisible()
Description copied from interface: PublicationTemplate
Is this publication template is visible to others?

Specified by:
isVisible in interface PublicationTemplate
Returns:
true if it is visible, false otherwise.

getSearchFileName

public String getSearchFileName()

setSearchFileName

public void setSearchFileName(String searchFileName)

setSearchTemplate

public void setSearchTemplate(RecordTemplate searchTemplate)

setTemplate

public void setTemplate(RecordTemplate template)

setUpdateTemplate

public void setUpdateTemplate(RecordTemplate updateTemplate)

setViewTemplate

public void setViewTemplate(RecordTemplate viewTemplate)

getSearchResultFileName

public String getSearchResultFileName()
Returns:
the searchResultTemplateFileName

setSearchResultFileName

public void setSearchResultFileName(String searchResultFileName)
Parameters:
resultTemplateFileName - the resultTemplateFileName to set

isSearchable

public boolean isSearchable()
Description copied from interface: PublicationTemplate
Is the publication records described by this template can be searchable?

Specified by:
isSearchable in interface PublicationTemplate
Returns:
true if the records are searchable, false othersise.

getSearchResultTemplate

public RecordTemplate getSearchResultTemplate()
Returns:
the searchResultTemplate

setSearchResultTemplate

public void setSearchResultTemplate(RecordTemplate searchResultTemplate)
Parameters:
searchResultTemplate - the searchResultTemplate to set

basicClone

public PublicationTemplateImpl basicClone()
Returns:
a copy of the current PublicationTemplate implementation

getGenericRecordSetManager

protected GenericRecordSetManager getGenericRecordSetManager()
Gets an instance of a GenericRecordSet objects manager.

Returns:
a GenericRecordSetManager instance.

getSearchResultForm

public Form getSearchResultForm()
                         throws PublicationTemplateException
Description copied from interface: PublicationTemplate
Returns the Form used to view the search result records built from this template.

Specified by:
getSearchResultForm in interface PublicationTemplate
Throws:
PublicationTemplateException

getFieldsForFacets

public List<String> getFieldsForFacets()
Description copied from interface: PublicationTemplate
Returns all field names which can generate a search facet

Specified by:
getFieldsForFacets in interface PublicationTemplate
Returns:
a List of field name

getSpaces

public List<String> getSpaces()
Specified by:
getSpaces in interface PublicationTemplate

isRestrictedVisibilityToSpace

public boolean isRestrictedVisibilityToSpace()
Specified by:
isRestrictedVisibilityToSpace in interface PublicationTemplate

isRestrictedVisibilityToApplication

public boolean isRestrictedVisibilityToApplication()
Specified by:
isRestrictedVisibilityToApplication in interface PublicationTemplate

isRestrictedVisibilityToInstance

public boolean isRestrictedVisibilityToInstance()
Specified by:
isRestrictedVisibilityToInstance in interface PublicationTemplate

setSpaces

public void setSpaces(List<String> spaces)

getApplications

public List<String> getApplications()
Specified by:
getApplications in interface PublicationTemplate

setApplications

public void setApplications(List<String> applications)

getInstances

public List<String> getInstances()
Specified by:
getInstances in interface PublicationTemplate

setInstances

public void setInstances(List<String> instances)

isRestrictedVisibility

public boolean isRestrictedVisibility()
Specified by:
isRestrictedVisibility in interface PublicationTemplate

setDataEncrypted

public void setDataEncrypted(boolean dataEncrypted)

isDataEncrypted

public boolean isDataEncrypted()
Specified by:
isDataEncrypted in interface PublicationTemplate

getViewLayerAction

public int getViewLayerAction()

setViewLayerAction

public void setViewLayerAction(int viewLayerAction)

getUpdateLayerAction

public int getUpdateLayerAction()

setUpdateLayerAction

public void setUpdateLayerAction(int updateLayerAction)

getViewLayerFileName

public String getViewLayerFileName()

setViewLayerFileName

public void setViewLayerFileName(String viewLayerFileName)

getUpdateLayerFileName

public String getUpdateLayerFileName()

setUpdateLayerFileName

public void setUpdateLayerFileName(String updateLayerFileName)

isViewLayerDefined

public boolean isViewLayerDefined()

isUpdateLayerDefined

public boolean isUpdateLayerDefined()

isViewLayerExist

public boolean isViewLayerExist()
Specified by:
isViewLayerExist in interface PublicationTemplate

isUpdateLayerExist

public boolean isUpdateLayerExist()
Specified by:
isUpdateLayerExist in interface PublicationTemplate


Copyright © 2016 Silverpeas. All Rights Reserved.