Sun GlassFish Web Space Server 10.0 Administration Guide

Web Content Portlets

The Web Content application consists of Web Content, Web Content Display, Web Content List, and Web Content Search portlets.

The Web Content portlet is used to create all CMS content. The Web Content Display and Web Content List portlets are used to display those contents. This portlet enables writers to easily edit content displayed on web pages without having to sort through complex code.

Overview of Web Content Portlets

Structures, templates, and articles are the backbone of the Web Content portlet functionality.

The point of a structure is to unify journal articles with the same numbers and types of items. For example, a Management Bio section of a web site might have ten biographies, each requiring an image for the executive headshot, a text for the headline, and a text area for the main biography. A structure could be created with one image, one text, and one text area, each named accordingly. This structure enables writers to create the individual biographies and other texts without needing to re-create the page structure for each biography.

Designers can create several templates for one structure to allow for a variety of presentations or give writers discretion in deciding the best layout.

All specific text and images are entered when a user adds or edits an article. The user chooses the layout based on the templates affiliated with a structure. Because multiple templates can be associated to a structure, the user can select the most suitable template.

Structures

A structure can be used by any number of templates and articles within the community in which the structure is defined. When you create a structure, you have to define an XML schema for it.

ProcedureTo create a Structure

  1. Log in to Web Space Server.

  2. Navigate to Control Panel -> Content -> Web Content from the Welcome menu.

  3. To create a structure, click the Structures tab in the Web Content portlet, and then click on the Add Structure button.

    The structure creation page is displayed.

    Figure 6–5 Creating a Structure

    Creating a Structure

  4. Type an ID, or select the Autogenerate ID option for the system to generate an ID.

    Choosing your own ID means that the structure will be easier to identify when associating it with templates and articles. The convention is to separate words in the ID with a hyphen, NEWS-LETTER-STRUCTURE. The structure ID cannot be changed once your structure has been saved, so be sure you provide the ID exactly how you want it to appear.

  5. Type a name and a description for the structure.

  6. Design your XML Schema Definition.

    1. Click Add Row button to add the XML scheme from the user interface.

    2. In the new field, type a name and a content type for the field image, text, Boolean flag, and so on.


      Tip –

      If you are comfortable with XML or HTML you can edit the XSL directly by clicking Launch Editor. One simple approach is to add a few elements using the GUI. Then edit the XML directly by copying the syntax for the already added elements.

      Empty spaces are not allowed within a field name. Rows can be moved up or down by clicking on Arrow buttons. You can use the Plus button to add multiple levels of rows nested inside one another. A field can be repeatable or non-repeatable. Selecting the Repeatable option makes a field repeatable. If a field is repeatable, you can repeat the field in an article using the structure. You will be able to add the field as many times as it is desired, by clicking a plus sign.


  7. Click Save.

    The Structure is created and the system generates a WebDAV URL for the structure. WebDAV (Web-based distributed authoring and versioning) enables remote access of the structure. To determine the WebDAV URL for the structure, open the structure in edit mode after creating it.

    For details about WebDAV, go to:

    http://en.wikipedia.org/wiki/WebDAV

    http://www.webdav.org/.

ProcedureTo Edit a Structure

  1. Log in to Web Space Server.

  2. Navigate to Control Panel -> Content -> Web Content from the Welcome menu.

  3. Click the Structures tab.

  4. Click the Actions button corresponding to a structure, and choose Edit from the menu.

    The Structure opens in Edit mode.

    You can edit anything in the structure except for the structure ID, which can not be changed once the structure has been created.

  5. Backup the current XML file by clicking the Download button so you can easily revert to your old structure if necessary.

  6. Edit the structure.

    Editing the name and description will not affect other features of the Web Content portlet, but adding, deleting, and modifying fields will affect the templates and articles that are associated with the structure.

    If you add fields, the articles associated will have extra fields for additional content. If you delete fields, associated content in associated articles will be deleted.

  7. Click Save to save changes.

ProcedureTo Delete a Structure

  1. Log in to Web Space Server.

  2. Navigate to Control Panel -> Content -> Web Content from the Welcome menu.

  3. Click the Structures tab.

    To delete a structure, you must first delete all the articles and disassociate or delete all the templates associated with that structure.

  4. To delete all articles,

    1. Click the Actions button and choose View Articles from the menu.

      All the articles associated with the Structure are listed.

    2. Select all articles, and click on the Delete button.

  5. Click the Structure tab again.

  6. Click the Actions button corresponding to a Structure, and select View Templates from the menu.

    All the templates associated with the structure are listed.

  7. To delete all the remplates associated with the structure, select all templates and then click the Delete button.

  8. Select the structure and click the Delete button to delete the structure.

    Alternatively, click the Actions button and choose Delete from the menu.

Templates

This section describes how to create, edit, and delete a template.

ProcedureTo Create a Template

  1. Log in to Web Space Server.

  2. Navigate to Control Panel -> Content -> Web Content from the Welcome menu.

  3. Click the Templates tab and click the Add Template button to create a template.

    The Template page appears.

  4. Type an ID, Name and Description for the template. Click the Select button to select a Structure for the template.

    The Select and Remove buttons corresponding to the Structure field can be used to associate or to disassociate a structure from the Template.

    A window for selecting Structures is launched.

  5. Select a structure.

  6. To edit the template layout content, you can use one of two methods.

    • To create a new template:

      1. Click the Launch Editor button.

        An Editor appears.

      2. Select an Editor Type: Plain or Rich. Plain is the default.

      3. Click Update after making changes to the template.

    • To use an existing template:

      1. Select a language from the Language Type list: VM, SXL, CSS.

        VM, SXL, and CSS are the available language options.

      2. Click the Browse button to upload the script for an existing template.

      3. Select the Format Script option.

      4. Click Launch Editor to open the browsed script.

      5. Modify the template.

      6. Click Update after making changes to the script.

  7. If desired, add a small image to represent the template in the description fields by selecting the Use Small Image option.

    You can type the URL path for an image in the Small Image URL field, or you can browse an image using the Browse button.

  8. Click Save.

    The template is created successfully and the system generates a WebDAV URL for the template. WebDAV (web-based distributed authoring and versioning) enables remote access of the template. To determine the WebDAV URL for the template, open the template in edit mode.

    For details about WebDAV go to:

    http://en.wikipedia.org/wiki/WebDAV

    http://www.webdav.org/

ProcedureTo Edit a Template

Before editing the actual template, you might want to view the associated articles whoselayout will be affected by any changes made to your template. Click View Articles from the Action menu to view associated articles.

  1. Log in to Web Space Server.

  2. Navigate to Control Panel -> Content -> Web Content from the Welcome menu.

  3. Click the Templates tab.

  4. Click the Actions button corresponding to a template, and choose Edit from the menu.

  5. Edit the template as desired.

    In the edit screen, you can edit anything in the template except for the template ID, which cannot be changed once the template has been created.

  6. Click Save.

  7. If desired, click View Articles to see the articles with the new template layout.

ProcedureTo Delete a Template

  1. Log in to Web Space Server.

  2. Navigate to Control Panel -> Content -> Web Content from the Welcome menu.

  3. Click the Templates tab.

    To delete a template, you must first delete all the articles associated with that template.

  4. To delete all articles, click the Actions button and choose View Articles from the menu.

    All the articles associated with the Template are listed.

  5. Select all articles, and click Delete.

    A dialog box with the message “Are you sure you want to delete the selected articles?” appears. Click OK to delete all articles.

  6. Click the Templates tab once again.

  7. Select the template and click Delete.

    Click OK on the dialog box to confirm deleting the template.

Articles

This section describes how to create, edit, and delete an article.

ProcedureTo Create an Article

  1. Log in to Web Space Server.

  2. Navigate to Control Panel -> Content -> Web Content from the Welcome menu.

  3. Click the Web Content tab.

    All articles are listed.

  4. To create a new article, click the Add Web Content button.

    You can create a basic or an advanced article.

    • To create a basic article:

      A basic article does not make use of a template, workflow, or other advanced articles.

      1. Click Basic in the top-right corner of the portlet window.

        Skip this step if you are already on this page.

      2. Provide a name, abstract, and the body of content for the article.

      3. Click Save.

    • To create an advanced article:

      You can apply additional options for an advanced article.

      1. Click Advanced in the top-right corner of the portlet window.

      2. To select a Structure and a Template for the article, click the Select button besides the Template field under Form and Presentation.

        A dialog box appears with the message “Selecting a new template will change the structure, available input fields, and available templates? Do you want to proceed?” appears.

      3. Click OK.

        The Templates window appears.

      4. To select a template, click on the name of the template. In this example, click NEWS-LETTER-TEMPLATE to select it as the template for the article.

        The structure used by the template is added to the article. Note that the structure of the article has changed.


        Note –

        If you want to remove the template or the structure applied to an article, click Remove corresponding to the structure.


      5. Type a name for the article.

      6. Select the Type for Categorization for the article.

        These details help users to search an article and help organize articles.

      7. Set the Schedule details.

        Set values for Display Date, Expiration Date, and Review Date fields. The default setting does not set an expiration date and review date.

      8. Click Save to create the article.

ProcedureTo Edit an Article

  1. Log in to Web Space Server.

  2. Navigate to Control Panel -> Content -> Web Content from the Welcome menu.

  3. Click the Web Content tab.

    All articles are listed.

  4. Click on the Actions button for an article and select Edit from the menu.

    The article appears in edit mode. You can edit anything in the article except for the article ID, which can not be changed once the article has been created.

    You can choose to increment the version every time you edit the article to help all users see how often the article has been changed. If you feel that the changes you are making are very minor, you can choose not to increment it.

    Note that if you set the expiration date to a date earlier to the current date, you will no longer be able to select that article for use in the Web Content Display portlet.

  5. Make the desired changes and click Save.

ProcedureTo Delete an Article

  1. Log in to Web Space Server.

  2. Navigate to Control Panel -> Content -> Web Content from the Welcome menu.

  3. Click the Web Content tab.

    All articles are listed.

  4. Click the Actions button for an article and choose Delete from the menu.

    Alternatively, select the article ID and click the Delete button.