Class PublicationTemplateImpl
- java.lang.Object
-
- org.silverpeas.core.contribution.template.publication.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 :- a RecordTemplate which describes the built records.
- a RecordSet of records built on this template,
- an update Form used to create and update the publication items
- a view Form used to show the publications.
-
-
Field Summary
Fields Modifier and Type Field Description static int
LAYER_ACTION_ADD
static int
LAYER_ACTION_NONE
static int
LAYER_ACTION_REMOVE
-
Fields inherited from interface org.silverpeas.core.contribution.template.publication.PublicationTemplate
DEFAULT_THUMBNAIL
-
-
Constructor Summary
Constructors Constructor Description PublicationTemplateImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PublicationTemplateImpl
basicClone()
List<String>
getApplications()
String
getDataFileName()
RecordTemplate
getDataTemplate()
String
getDescription()
List<String>
getDomains()
String
getExternalId()
List<String>
getFieldsForFacets()
Returns all field names which can generate a search facetString
getFileName()
protected GenericRecordSetManager
getGenericRecordSetManager()
Gets an instance of a GenericRecordSet objects manager.List<String>
getGroups()
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
isDirectoryUsage()
boolean
isLocked()
Is this publication template locked, and so not modifiable or deletable?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 visible to others?boolean
isVisibleToDomain(String domainId)
boolean
isVisibleToUser(String userId)
RecordTemplate
loadRecordTemplate(String xmlFileName)
load a recordTemplate definition from xml file to java objectsvoid
saveRecordTemplates()
This method saves current templates inside a sub directoryvoid
setApplications(List<String> applications)
void
setDataEncrypted(boolean dataEncrypted)
void
setDataFileName(String dataFileName)
void
setDescription(String description)
void
setDirectoryUsage(boolean directoryUsage)
void
setDomains(List<String> domains)
void
setExternalId(String externalId)
void
setFileName(String fileName)
void
setGroups(List<String> groups)
void
setInstances(List<String> instances)
void
setLocked(boolean locked)
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)
-
-
-
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
-
-
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
ifloadIfNull
istrue
), ornull
if not loaded andloadIfNull
isfalse
. - 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 interfacePublicationTemplate
- Throws:
PublicationTemplateException
-
getRecordSet
public RecordSet getRecordSet() throws PublicationTemplateException
Return the RecordSet of all the records built from this template.- Specified by:
getRecordSet
in interfacePublicationTemplate
- 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 interfacePublicationTemplate
- 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 interfacePublicationTemplate
- 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 interfacePublicationTemplate
- 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()
Returns the RecordTemplate of the publication view item.
-
getUpdateTemplate
public RecordTemplate getUpdateTemplate()
Returns the RecordTemplate of the publication update item.
-
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 interfacePublicationTemplate
- 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 interfacePublicationTemplate
-
getExternalId
public String getExternalId()
- Specified by:
getExternalId
in interfacePublicationTemplate
-
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 interfacePublicationTemplate
-
setName
public void setName(String name)
-
getFileName
public String getFileName()
- Specified by:
getFileName
in interfacePublicationTemplate
-
setFileName
public void setFileName(String fileName)
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfacePublicationTemplate
-
setDescription
public void setDescription(String description)
-
getThumbnail
public String getThumbnail()
- Specified by:
getThumbnail
in interfacePublicationTemplate
-
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 visible to others?- Specified by:
isVisible
in interfacePublicationTemplate
- Returns:
- true if it is visible, false otherwise.
-
isLocked
public boolean isLocked()
Description copied from interface:PublicationTemplate
Is this publication template locked, and so not modifiable or deletable?- Specified by:
isLocked
in interfacePublicationTemplate
- Returns:
- true if it is locked, false otherwise.
-
setLocked
public void setLocked(boolean locked)
-
isDirectoryUsage
public boolean isDirectoryUsage()
- Specified by:
isDirectoryUsage
in interfacePublicationTemplate
-
setDirectoryUsage
public void setDirectoryUsage(boolean directoryUsage)
-
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:
searchResultFileName
- the search result template file name 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 interfacePublicationTemplate
- 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 interfacePublicationTemplate
- 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 interfacePublicationTemplate
- Returns:
- a List of field name
-
getSpaces
public List<String> getSpaces()
- Specified by:
getSpaces
in interfacePublicationTemplate
-
isRestrictedVisibilityToSpace
public boolean isRestrictedVisibilityToSpace()
- Specified by:
isRestrictedVisibilityToSpace
in interfacePublicationTemplate
-
isRestrictedVisibilityToApplication
public boolean isRestrictedVisibilityToApplication()
- Specified by:
isRestrictedVisibilityToApplication
in interfacePublicationTemplate
-
isRestrictedVisibilityToInstance
public boolean isRestrictedVisibilityToInstance()
- Specified by:
isRestrictedVisibilityToInstance
in interfacePublicationTemplate
-
getApplications
public List<String> getApplications()
- Specified by:
getApplications
in interfacePublicationTemplate
-
getInstances
public List<String> getInstances()
- Specified by:
getInstances
in interfacePublicationTemplate
-
getDomains
public List<String> getDomains()
- Specified by:
getDomains
in interfacePublicationTemplate
-
getGroups
public List<String> getGroups()
- Specified by:
getGroups
in interfacePublicationTemplate
-
isVisibleToDomain
public boolean isVisibleToDomain(String domainId)
- Specified by:
isVisibleToDomain
in interfacePublicationTemplate
-
isVisibleToUser
public boolean isVisibleToUser(String userId)
- Specified by:
isVisibleToUser
in interfacePublicationTemplate
-
isRestrictedVisibility
public boolean isRestrictedVisibility()
- Specified by:
isRestrictedVisibility
in interfacePublicationTemplate
-
setDataEncrypted
public void setDataEncrypted(boolean dataEncrypted)
-
isDataEncrypted
public boolean isDataEncrypted()
- Specified by:
isDataEncrypted
in interfacePublicationTemplate
-
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 interfacePublicationTemplate
-
isUpdateLayerExist
public boolean isUpdateLayerExist()
- Specified by:
isUpdateLayerExist
in interfacePublicationTemplate
-
-