AquaLogic Interaction Development Kit (IDK) 6.0.0

Plumtree.Remote.PRC.Content.Item Namespace

Provides interfaces for creating, modifying, managing, and retrieving content items. (See Content Item Examples.) This complete command-line sample includes major content item functionality, folder retrieval, Data Entry Template creation and property value updates.

Also see the IContentItem documentation for details and code samples on how to create, check out, check in, preview, and publish a content item.

Refer to the Administrator Guide for AquaLogic Interaction Publisher for additional details on content item functionality.

Note: Content item names cannot be an empty string, cannot be longer than 255 characters and are case-insensitive.

A content item will be automatically deleted if the underlying Data Entry Template has been deleted.

The steps below describe common interactions between different Publisher objects.
1. Create a Data Entry Template.
2. Add one or more properties to the Data Entry Template and store the template.
3. Create a Presentation Template for the Data Entry Template.
4. Attach the Presentation Template to the Data Entry Template and store the Data Entry Template.
5. Create one or more content items using the Data Entry Template.
6. Set values for properties on the content item and check in the content item.
7. Preview and publish the content item.
Note: One or more content items can be created using the same Data Entry Template; however, only one Presentation Template can be attached to a Data Entry Template.

Since IDK 5.2

Namespace hierarchy

Interfaces

InterfaceDescription
IContentItem Represents a content item. Manages property value modification and retrieval, and encapsulates a content item's metadata.

To update property values for a new content item, use SetPropertyValue for the various property types and then persist the values with IContentItemManager.CheckInItem.

To update property values for an existing content item, first check out the item with IContentItemManager.CheckOutItem, modify property values with Get/SetPropertyValue, and then persist the modifications with IContentItemManager.CheckInItem.

For information about the conditions that make a content item searchable in ALI Search, refer to the documentation in IPresentationTemplate.Searchable.

Note: To use any file upload/download functionality for setting/retreving a file or image property value, WSE 2.0 (http://msdn.microsoft.com/webservices/building/wse/) must be installed.

The following example code determines what types of properties exist on a content item and how to modify their values:
//To modify property values on an existing item, first check-out the item.
itemManager.CheckOutItem(contentItem);

//Retrieve all the properties on the content item
IBaseProperty[] allProps = contentItem.GetAllProperties();

for (int i = 0; i < allProps.Length; i++)
{
  //Test if the property a text block property
  if (allProps[i] is ITextBlockProperty)
  {
      String oldValue = "";
      if (contentItem.HasPropertyValue(allProps[i]))
      {
        //Retrieve the old text block value if it has been set previously
        oldValue = contentItem.GetTextBlockPropertyValue(allProps[i]);
       }
       //Set the new value
       contentItem.SetTextBlockPropertyValue(allProps[i], "Updated Value: " + oldValue);
  }
  //Test if the property is an integer property
  else if (allProps[i] is IIntegerProperty)
  {
       int oldValue = 0;
       if (contentItem.HasPropertyValue(allProps[i]))
       {
          oldValue = contentItem.GetIntegerPropertyValue(allProps[i]);
       }
       contentItem.SetIntegerPropertyValue(allProps[i], 100 + oldValue);

        //Test for rest of the property types...
  }
}

//Finally, check-in the item to persist the updated values
itemManager.CheckInItem(contentItem, "Check In Comment");
Note: A content item will be automatically deleted if the underlying Data Entry Template has been deleted.

A content item can be indexed and made searchable, if it
  • 1) is published, and
  • 2) at publish time:
  • - has the attached Presentation Template's Searchable set to true, and
  • - has a portlet associated with the item.
  • A portlet can be associated with a content item directly or indirectly:
  • 1) Directly - Associate a portlet with a content item by setting the portlet ID on the item. The content item and the portlet thus become a Portlet Item.
  • 2) Indirectly - Associate a portlet to one of the item'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 item, or any parent folder of that containing folder.
  • Refer to the Administrator Guide for AquaLogic Interaction Publisher for additional details on content item and portlet association.
    IContentItemManager Interface for managing IContentItem instances. Handles content item creation, removal, retrieval, check-in, check-out, and publishing.

    To retrieve or update property values of an existing content item call CheckOutItem to check out the item then IContentItem.Get/SetPropertyValue to modify the property values. When you are finished use IContentItemManager.CheckInItem to check in the item and persist the changes.

    For information about the conditions that make a content item searchable in the Search Server, refer to IPresentationTemplate.Searchable.

    Refer to the Administrator Guide for AquaLogic Interaction Publisher for additional details on Content Item functionality.

    The following example demonstrates creating and publishing a content item.
    // Create a property to use in the content item
    ITextLineProperty textLineProperty = propertyManager.CreateTextLineProperty("TextLineProperty", "A line of text.");
    String templateText = "TextLineProperty=<pcs:value expr=\"TextLineProperty\">unset</pcs:value>\n";
    IPresentationTemplate presentationTemplate = presentationTemplateManager.CreatePresentationTemplate(containingFolder, "PresentationTemplate", templateText);
    presentationTemplate.Store();
     
    // Create Presentation Template text that uses the property
    IDataEntryTemplate dataEntryTemplate = dataEntryTemplateManager.CreateDataEntryTemplate(containingFolder, "DataEntryTemplate");
    dataEntryTemplate.AddProperty(textLineProperty);
    dataEntryTemplate.AttachPresentationTemplate(presentationTemplate);
    dataEntryTemplate.Store();
     
    // Create a content item and set a value for the property
    IContentItem contentItem = contentItemManager.CreateContentItem(containingFolder, "ContentItem", dataEntryTemplate);
    contentItem.SetTextLinePropertyValue(textLineProperty, "This is the string value that will appear in the published content item.");
    contentItemManager.CheckInItem(contentItem, "Initial checkin.");
     
    // Publish the content item
    contentItemManager.PublishContentItem(contentItem);
    // Use contentItem.PublishURL to access the published item