com.silverpeas.publicationTemplate
Class PublicationTemplateManager

java.lang.Object
  extended by com.silverpeas.publicationTemplate.PublicationTemplateManager

public class PublicationTemplateManager
extends Object

The PublicationTemplateManager manages all the PublicationTemplate for all the Job'Peas. It is a singleton.


Field Summary
static String defaultTemplateDir
           
static String templateDir
           
 
Method Summary
 GenericRecordSet addDynamicPublicationTemplate(String externalId, String templateFileName)
           
 List<PublicationTemplate> getCryptedPublicationTemplates()
           
static PublicationTemplateManager getInstance()
          Gets the single instance of this manager.
 PublicationTemplate getPublicationTemplate(String externalId)
           
 PublicationTemplate getPublicationTemplate(String externalId, String templateFileName)
          Returns the PublicationTemplate having the given externalId.
 List<PublicationTemplate> getPublicationTemplates()
           
 List<PublicationTemplate> getPublicationTemplates(boolean onlyVisibles)
          Retrieve Publication Templates
 List<PublicationTemplate> getPublicationTemplates(GlobalContext globalContext)
           
 List<PublicationTemplate> getSearchablePublicationTemplates()
           
 boolean isPublicationTemplateVisible(String templateName, GlobalContext globalContext)
           
 PublicationTemplate loadPublicationTemplate(String xmlFileName)
          load a publicationTemplate definition from xml file to java objects
static String makePath(String dirName, String fileName)
           
protected  void registerForRenewingContentCipher()
           
 void removePublicationTemplate(String externalId)
          Removes the PublicationTemplate having the given externalId.
 void removePublicationTemplateFromCaches(String fileName)
           
 void savePublicationTemplate(PublicationTemplate template)
          Save a publicationTemplate definition from java objects to xml file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

templateDir

public static String templateDir

defaultTemplateDir

public static String defaultTemplateDir
Method Detail

getInstance

public static PublicationTemplateManager getInstance()
Gets the single instance of this manager.

Returns:
the single instance of PublicationTemplateManager.

makePath

public static String makePath(String dirName,
                              String fileName)

addDynamicPublicationTemplate

public GenericRecordSet addDynamicPublicationTemplate(String externalId,
                                                      String templateFileName)
                                               throws PublicationTemplateException
Throws:
PublicationTemplateException

getPublicationTemplate

public PublicationTemplate getPublicationTemplate(String externalId)
                                           throws PublicationTemplateException
Throws:
PublicationTemplateException

getPublicationTemplate

public PublicationTemplate getPublicationTemplate(String externalId,
                                                  String templateFileName)
                                           throws PublicationTemplateException
Returns the PublicationTemplate having the given externalId.

Parameters:
externalId -
templateFileName -
Returns:
Throws:
PublicationTemplateException

removePublicationTemplate

public void removePublicationTemplate(String externalId)
                               throws PublicationTemplateException
Removes the PublicationTemplate having the given externalId.

Parameters:
externalId -
Throws:
PublicationTemplateException

loadPublicationTemplate

public PublicationTemplate loadPublicationTemplate(String xmlFileName)
                                            throws PublicationTemplateException
load a publicationTemplate definition from xml file to java objects

Parameters:
xmlFileName - the xml file name that contains publication template definition
Returns:
a PublicationTemplate object
Throws:
PublicationTemplateException

savePublicationTemplate

public void savePublicationTemplate(PublicationTemplate template)
                             throws PublicationTemplateException,
                                    CryptoException
Save a publicationTemplate definition from java objects to xml file

Parameters:
template - the PublicationTemplate to save
Throws:
PublicationTemplateException
CryptoException
FormException

getPublicationTemplates

public List<PublicationTemplate> getPublicationTemplates(boolean onlyVisibles)
                                                  throws PublicationTemplateException
Retrieve Publication Templates

Parameters:
onlyVisibles - only visible templates boolean
Returns:
only visible PublicationTemplates if onlyVisible is true, all the publication templates else if
Throws:
PublicationTemplateException

getPublicationTemplates

public List<PublicationTemplate> getPublicationTemplates()
                                                  throws PublicationTemplateException
Returns:
only the visible PublicationTemplates
Throws:
PublicationTemplateException

getPublicationTemplates

public List<PublicationTemplate> getPublicationTemplates(GlobalContext globalContext)
                                                  throws PublicationTemplateException
Parameters:
globalContext - componentName It can be null. It is usefull when componentId is not defined.
Returns:
Throws:
PublicationTemplateException

isPublicationTemplateVisible

public boolean isPublicationTemplateVisible(String templateName,
                                            GlobalContext globalContext)
                                     throws PublicationTemplateException
Throws:
PublicationTemplateException

getSearchablePublicationTemplates

public List<PublicationTemplate> getSearchablePublicationTemplates()
                                                            throws PublicationTemplateException
Returns:
the list of PublicationTemplate which contains a search form
Throws:
PublicationTemplateException

getCryptedPublicationTemplates

public List<PublicationTemplate> getCryptedPublicationTemplates()
                                                         throws PublicationTemplateException
Returns:
the list of PublicationTemplate which are crypted
Throws:
PublicationTemplateException

removePublicationTemplateFromCaches

public void removePublicationTemplateFromCaches(String fileName)
Parameters:
fileName - the file name of the template to remove from cache

registerForRenewingContentCipher

protected void registerForRenewingContentCipher()


Copyright © 2016 Silverpeas. All Rights Reserved.