com.plumtree.remote.prc.content.presentationtemplate
Interface IPresentationTemplate


public interface IPresentationTemplate

Represents a Presentation Template in Publisher. A Presentation Template includes template text and various publishing-related attributes that define the layout of a content item when it is published.

A new Presentation Template can be created using IPresentationTemplateManager.createPresentationTemplate and stored permanently using store. Any field modification of the Presentation Template will not be persisted until store is called.

The template text in Presentation Template is used for determining the layout of a content item when published. A publishable content item needs a Presentation Template with a valid template text and the Presentation Template must be attached to the Data Entry Template of the content item.

To attach a Presentation Template to a Data Entry Template, IDataEntryTemplateManager.attachPresentationTemplate can be used.

An example using IPresentationTemplate can be found in the documentation for IPresentationTemplateManager.

A portlet can be associated with a Presentation Template directly or indirectly:

  • 1) Directly - Associate a portlet with a Presentation Template by setting the portlet ID to the template.
  • 2) Indirectly - Associate a portlet to one of the template's containing folders by adding the portlet ID to the folder. The folder must contain either a publishable Presentation Template or a content item that has already been associated to the same portlet. The folder can be either the folder containing the template, or any parent folder of that containing folder.
  • Refer to the Administrator Guide for AquaLogic Interaction Publisher for additional details on Presentation Template and portlet association.


    Method Summary
     void clearAssociatedPortletID()
              Clears the portlet association for this Presentation Template.
     int getAssociatedPortletID()
              Returns the object ID of the portlet associated with this Presentation Template or 0 if there is no portlet association.
     IDataEntryTemplate getAttachedDataEntryTemplate()
              Returns the attached Data Entry Template by retrieving the latest information about the attached Data Entry Template from Publisher.
     IFolder getContainingFolder()
              Returns the IFolder that contains this Presentation Template.
     java.lang.String getExtension()
              Returns the filename extension of the files that are produced when a content item is published with this Presentation Template.
     java.util.Date getLastPublishedDate()
              Returns the last time the Presentation Template was published.
     int getLastPublishedUserID()
              Returns the ID of the user who last published the IPresentationTemplate or throws an IllegalStateException if the IPresentationTemplate has not been published.
     java.lang.String getName()
              Returns the Presentation Template name.
     java.lang.String getPreviewURL()
              Returns the URL to preview the Presentation Template.
     java.lang.String getPublishURL()
              Returns the URL to the published Presentation Template.
     java.lang.String getTemplateText()
              Returns the template text of this Presentation Template.
     java.lang.String getUUID()
              Returns the Presentation Template UUID.
     boolean hasLastPublishedDate()
              Returns true if tbe last published date is available, otherwise returns false.
     boolean isExpired()
              Returns a boolean value indicating whether or not the Presentation Template is expired.
     boolean isPublishable()
              Returns a boolean indicating whether or not the Presentation Template can be published.
     boolean isPublished()
              Returns a boolean value indicating whether or not the Presentation Template is currently published.
     boolean isSearchable()
              Returns a boolean value indicating whether a content item published with this Presentation Template could be indexed by the Search server at publishing time.
     void setAssociatedPortletID(int portletID)
              Sets the portlet ID associated with this Presentation Template.
     void setExtension(java.lang.String text)
              Sets the filename extension for the files that are produced when a content item is published with this Presentation Template.
     void setName(java.lang.String name)
              Sets the name for this Presentation Template.
     void setSearchable(boolean flag)
              Sets the boolean value indicating whether a content item published with this Presentation Template could be indexed by the Search server at publishing time.
     void setTemplateText(java.lang.String templateText)
              Sets the template text of the Presentation Template.
     void store()
              Stores the Presentation Template.
     

    Method Detail

    clearAssociatedPortletID

    public void clearAssociatedPortletID()
    Clears the portlet association for this Presentation Template. The portlet that was previously associated with this Presentation Template can be associated to a different Presentation Template or content item after this method is called and the Presentation Template is persisted.

    The portlet disassociation will not be persisted until store is called on the template.

    Calling this method twice in a row on a Presentation Template that does not have an associated portlet will not result in an exception.

    Throws:
    java.lang.IllegalStateException - if the Presentation Template has been deleted
    See Also:
    setAssociatedPortletID(int), getAssociatedPortletID()

    getAssociatedPortletID

    public int getAssociatedPortletID()
    Returns the object ID of the portlet associated with this Presentation Template or 0 if there is no portlet association.

    Returns:
    the portlet object ID associated with this Presentation Template
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has been deleted
    See Also:
    setAssociatedPortletID(int), clearAssociatedPortletID()

    getAttachedDataEntryTemplate

    public IDataEntryTemplate getAttachedDataEntryTemplate()
                                                    throws ContentSecurityException,
                                                           ContentException,
                                                           java.rmi.RemoteException
    Returns the attached Data Entry Template by retrieving the latest information about the attached Data Entry Template from Publisher.

    Returns:
    the attached Data Entry Template or null there is not an attached Data Entry Template
    Throws:
    ContentSecurityException - if the user does not have permission to access the attached Data Entry Template
    ContentException - if the method call resulted in a Publisher exception
    java.lang.IllegalStateException - if the Data Entry Template has not been persisted or has already been removed
    java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call
    See Also:
    IPublishablePresentationTemplateManager

    getContainingFolder

    public IFolder getContainingFolder()
                                throws ContentSecurityException,
                                       ContentException,
                                       java.rmi.RemoteException
    Returns the IFolder that contains this Presentation Template.

    Returns:
    the IFolder that contains this Presentation Template
    Throws:
    ContentSecurityException - if the user does not have permission to access the containing folder
    ContentException - if the method call resulted in a Publisher exception
    java.lang.IllegalStateException - if the Presentation Template has not been stored or has already been removed
    java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

    getExtension

    public java.lang.String getExtension()
    Returns the filename extension of the files that are produced when a content item is published with this Presentation Template. The default filename extension is "html".

    Returns:
    the filename extension of the files that are produced when a content item is published with this Presentation Template
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has already been removed

    getLastPublishedDate

    public java.util.Date getLastPublishedDate()
    Returns the last time the Presentation Template was published. The publish time is set when the IPresentationTemplate is created on the published target. Use hasLastPublishedDate to determine if a date is available.

    Returns:
    the last time the Presentation Template was published
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has not been persisted, has been removed or has not been published
    See Also:
    IPublishablePresentationTemplateManager.publishPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate), IPublishablePresentationTemplateManager.publishPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate)

    getLastPublishedUserID

    public int getLastPublishedUserID()
    Returns the ID of the user who last published the IPresentationTemplate or throws an IllegalStateException if the IPresentationTemplate has not been published. Use isPublished to check if the IPresentationTemplate has been published.

    Returns:
    the ID of the user who last published the IPresentationTemplate
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has not been persisted, has been removed or has not been published
    See Also:
    IPublishablePresentationTemplateManager.publishPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate), IPublishablePresentationTemplateManager.publishPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate)

    getName

    public java.lang.String getName()
    Returns the Presentation Template name.

    Returns:
    the Presentation Template name
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has already been removed

    getPreviewURL

    public java.lang.String getPreviewURL()
    Returns the URL to preview the Presentation Template. The preview URL will only be valid if IPublishablePresentationTemplateManager.previewPresentationTemplate is called prior to this method.

    Note: The returned URL is a non-gatewayed URL.

    Returns:
    the URL to preview the Presentation Template
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has not been persisted or has already been removed
    See Also:
    IPublishablePresentationTemplateManager.previewPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate), IPublishablePresentationTemplateManager.previewPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate)

    getPublishURL

    public java.lang.String getPublishURL()
    Returns the URL to the published Presentation Template. The publish URL will only be valid if IPublishablePresentationTemplateManager.publishPresentationTemplate is called prior to this method. If the Presentation Template is not currently published an IllegalStateException will be thrown.

    Note: The returned URL is a non-gatewayed URL.

    Returns:
    the URL to the published Presentation Template
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has not been persisted, has been removed, or is not published
    See Also:
    IPublishablePresentationTemplateManager.publishPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate), IPublishablePresentationTemplateManager.publishPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate)

    getTemplateText

    public java.lang.String getTemplateText()
    Returns the template text of this Presentation Template.

    Returns:
    the template text
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has already been removed

    getUUID

    public java.lang.String getUUID()
    Returns the Presentation Template UUID. This UUID can be used in IPresentationTemplateManager.getPresentationTemplate to retrieve the template.

    Returns:
    the Presentation Template UUID
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has not yet been stored or has already been removed

    hasLastPublishedDate

    public boolean hasLastPublishedDate()
    Returns true if tbe last published date is available, otherwise returns false.

    Returns:
    true if the last published date is available, otherwise false
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has been removed
    See Also:
    IPublishablePresentationTemplateManager.publishPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate)

    isExpired

    public boolean isExpired()
    Returns a boolean value indicating whether or not the Presentation Template is expired. Presentation Templates can be published and expired via IPublishablePresentationTemplateManager.

    Returns:
    a boolean value indicating whether or not the Presentation Template is expired
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has already been removed
    See Also:
    IPublishablePresentationTemplateManager.expirePresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate), IPublishablePresentationTemplateManager.expirePresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate)

    isPublishable

    public boolean isPublishable()
                          throws ContentSecurityException,
                                 ContentException,
                                 java.rmi.RemoteException
    Returns a boolean indicating whether or not the Presentation Template can be published. Returns true if the Presentation Template has been persisted and there is no attached IDataEntryTemplate. otherwise returns false.

    Returns:
    a boolean indicating whether or not the Presentation Template can be published
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has already been removed
    ContentException - if the method call resulted in a Publisher exception
    ContentSecurityException - if the user does not have permission to access the containing folder
    java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call
    See Also:
    IPublishablePresentationTemplateManager.publishPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate), IPublishablePresentationTemplateManager.publishPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate)

    isPublished

    public boolean isPublished()
    Returns a boolean value indicating whether or not the Presentation Template is currently published. Presentation Templates can be published via IPublishablePresentationTemplateManager.

    Returns:
    a boolean value indicating whether or not the Presentation Template is published
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has already been removed
    See Also:
    IPublishablePresentationTemplateManager.publishPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate), IPublishablePresentationTemplateManager.publishPresentationTemplate(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate)

    isSearchable

    public boolean isSearchable()
    Returns a boolean value indicating whether a content item published with this Presentation Template could be indexed by the Search server at publishing time.

    Default value is true.

    In order for a content item to be searchable, at publishing time its Presentation Template isSearchable must be true and the content item or its folder must have an associated portlet ID. A folder is associated with portlet ID if the folder itself has an associated portlet ID or one of its parent folders has an associated portlet ID. Use IContentItem.getAssociatedPortletID or IFolder.getAssociatedPortletIDs to determine if a content item or its containing folder has an associated portlet ID. For information about associating portlet IDs with content items, refer to the Administrator Guide for AquaLogic Interaction Publisher.

    Note: Publisher does not support making a publishable Presentation Template searchable.

    Returns:
    a boolean value indicating whether a content item published with this Presentation Template will be searchable in the Search server
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has already been removed
    See Also:
    IContentItem.getAssociatedPortletID(), getAssociatedPortletID(), IFolder.getAssociatedPortletIDs()

    setAssociatedPortletID

    public void setAssociatedPortletID(int portletID)
    Sets the portlet ID associated with this Presentation Template.

    Note: The recommended way to associate a portlet with a Presentation Template is through the portlet administration settings in the portal.

    The Presentation Template can only be associated with one portlet ID at a time. If this method is called several times on the same Presentation Template, the last call will override the previous calls.

    The portlet ID must refer to a valid portlet otherwise a ContentException will be thrown when store is called on the template.

    A portlet can only be associated with one Presentation Template or content item at a time. If the portlet ID is already associated with another Presentation Template or content item, an IllegalStateException will be thrown when store is called on the template.

    The ID of a portlet can be retrieved using methods in com.plumtree.remote.prc.IPortletManager or com.plumtree.remote.prc.IPortletTemplateManager.

    The association will not be persisted until store is called.

    Parameters:
    portletID - the portlet ID to associate with the template
    Throws:
    java.lang.IllegalStateException - if the template has been deleted
    java.lang.IllegalArgumentException - if the portlet ID less than or equal to 0
    See Also:
    IFolder.addAssociatedPortletID(int)

    setExtension

    public void setExtension(java.lang.String text)
    Sets the filename extension for the files that are produced when a content item is published with this Presentation Template. The default filename extension is "html", while any extension can be used that is valid for a basic text file (.html, .js, .jsp, .asp, .xml, .txt, etc).

    Parameters:
    text - the filename extension to be set; cannot be null, empty, or longer than 255 characters
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has already been removed
    java.lang.IllegalArgumentException - if the extension is empty or longer than 255 characters

    setName

    public void setName(java.lang.String name)
    Sets the name for this Presentation Template.

    Parameters:
    name - name of the Presentation Template; cannot be null, empty, or longer than 255 characters. The string used for the name will be trimmed of leading and trailing whitespace when it is stored and is case-insensitive during name comparison.
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has already been removed
    java.lang.IllegalArgumentException - if the name is an empty string or longer than 255 characters

    setSearchable

    public void setSearchable(boolean flag)
    Sets the boolean value indicating whether a content item published with this Presentation Template could be indexed by the Search server at publishing time.

    Default value is true.

    In order for a content item to be searchable, at publishing time its Presentation Template isSearchable must be true and the content item or its folder must have an associated portlet ID. A folder is associated with portlet ID if the folder itself has an associated portlet ID or one of its parent folders has an associated portlet ID. Use IContentItem.getAssociatedPortletID or IFolder.getAssociatedPortletIDs to determine if a content item or its containing folder has an associated portlet ID. For information about associating portlet IDs with content items, refer to the Administrator Guide for AquaLogic Interaction Publisher. Merely setting setSearchable to true is insufficient to enable an item to be searchable; the item or its folder must have an associated portlet ID.

    Parameters:
    flag - a boolean value indicating whether a content item published with this Presentation Template will be searchable in the Search server
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has already been removed
    See Also:
    IContentItem.setAssociatedPortletID(int), IFolder.addAssociatedPortletID(int)

    setTemplateText

    public void setTemplateText(java.lang.String templateText)
    Sets the template text of the Presentation Template. The template text will determine the layout of a content item when published. It can contain one or more PCS tags which are part of the Publisher Templating Language syntax. Refer to the Administrator Guide for AquaLogic Interaction Publisher for more details about template text and its sample values.

    No exceptions will be thrown for invalid PCS tags. IPresentationTemplateManager.validateTemplateText can be used to validate the template text. An ContentExceptions will be thrown if a Presentation Template contains invalid template text when IContentItemManager.previewContentItem, IContentItemManager.publishContentItem, or IPresentationTemplateManager.validateTemplateText is called. Any template text modification will not be stored permanently until store is called.

    Parameters:
    templateText - the template text to be set; cannot be null but the text can be empty. There is no limit on the length of the template text.
    Throws:
    java.lang.IllegalStateException - if the Presentation Template has already been removed
    See Also:
    IPresentationTemplateManager.createPresentationTemplate(com.plumtree.remote.prc.content.folder.IFolder, java.lang.String, java.lang.String), IPresentationTemplateManager.validateTemplateText(com.plumtree.remote.prc.content.presentationtemplate.IPresentationTemplate, java.lang.String)

    store

    public void store()
               throws ContentSecurityException,
                      NameAlreadyInUseException,
                      ContentException,
                      java.rmi.RemoteException
    Stores the Presentation Template. This method is used to persist a newly-created Presentation Template or persist modifications to an existing Presentation Template, including template text or any field modification.

    Throws:
    ContentSecurityException - if the user does not have the permission to store the Presentation Template
    NameAlreadyInUseException - if there is already a Presentation Template with the given name existed in the same folder
    ContentException - if the Presentation Template is associated with an invalid portlet ID, or the method call resulted in a Publisher exception
    java.lang.IllegalStateException - if the Presentation Template has already been removed, or if the containing folder has been removed
    java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call


    For additional information on the Oracle® WebCenter Interaction Development Kit, including tutorials, blogs, code samples and more, see the Oracle Technology Network (http://www.oracle.com/technology/index.html).

    Copyright ©2010 Oracle® Corporation. All Rights Reserved.