com.ibm.workplace.wcm.api
Interface LibraryHTMLComponent

All Superinterfaces:
Document, Editable, EditableItem, EditableLibraryComponent, Hierarchical, Item, LibraryComponent, Localized, WCMApiObject, WorkflowedDocument

public interface LibraryHTMLComponent
extends EditableLibraryComponent

Represents a HTML component that exists in the Component Library.

A LibraryHTMLComponent is a LibraryComponent and must be stored as a separate entity in the repository.

A LibraryHTMLComponent can contain HTML. This interface provides methods to retrieve and set the HTML contained within this component.

note: since v6.0.0, a LibraryComponent is referred to as a "Component" in the Authoring UI.

See Also:
LibraryComponent

Method Summary
 java.lang.String getHTML()
          Returns the HTML contained in this component as a String.
 void setHTML(java.lang.String html)
          Sets the HTML contained in this LibraryHTMLComponent from the specified html argument.
 void setHTML(java.lang.String html, com.ibm.workplace.wcm.api.EmbeddedImageMap images)
          Deprecated. This method is deprecated from version 6.0. Use setHTML(String) instead.
 
Methods inherited from interface com.ibm.workplace.wcm.api.Hierarchical
getParentId
 
Methods inherited from interface com.ibm.workplace.wcm.api.Editable
addAuthors, addCategoryIds, addContributorAccessMembers, addDeleteAccessMembers, addEditAccessMembers, addEditorAccessMembers, addHistoryLogEntry, addLiveAccessMembers, addManagerAccessMembers, addMembersForAccess, addOwners, addReadAccessMembers, addUserAccessMembers, isChanged, removeAuthors, removeCategoryIds, removeContributorAccessMembers, removeDeleteAccessMembers, removeEditAccessMembers, removeEditorAccessMembers, removeLiveAccessMembers, removeManagerAccessMembers, removeMembersForAccess, removeOwners, removeReadAccessMembers, removeUserAccessMembers, setContributorAccessInheritance, setDescriptionTextProviderKey, setDescriptionTextProviderName, setEditorAccessInheritance, setInheritance, setKeywords, setManagerAccessInheritance, setPropagation, setTitleTextProviderKey, setTitleTextProviderName, setUserAccessInheritance
 
Methods inherited from interface com.ibm.workplace.wcm.api.Document
getAuthors, getCategoryIds, getContributorAccessMembers, getCreator, getDeleteAccessMembers, getDescription, getDescriptionTextProviderKey, getDescriptionTextProviderName, getEditAccessMembers, getEditorAccessMembers, getHistoryLog, getId, getInheritedContributorAccessMembers, getInheritedEditorAccessMembers, getInheritedManagerAccessMembers, getInheritedUserAccessMembers, getKeywords, getLastModifier, getLiveAccessMembers, getManagerAccessMembers, getMembersForAccess, getMembersForInheritedAccess, getOwnerLibrary, getOwners, getProject, getReadAccessMembers, getSourceWorkspace, getTitle, getTitleTextProviderKey, getTitleTextProviderName, getUserAccessMembers, getVersionCatalog, getVersionStrategy, hasDeleteAccess, hasDeleteAccess, hasEditAccess, hasEditAccess, hasLiveAccess, hasLiveAccess, hasProfile, hasProject, hasReadAccess, hasReadAccess, isContributorAccessInherited, isEditorAccessInherited, isInherited, isManagerAccessInherited, isNew, isPropagated, isUserAccessInherited, isWorkflowed
 
Methods inherited from interface com.ibm.workplace.wcm.api.Item
getCreationDate, getDescription, getIdentity, getModifiedDate, getName, getTitle
 
Methods inherited from interface com.ibm.portal.Localized
getLocales
 
Methods inherited from interface com.ibm.workplace.wcm.api.EditableItem
setDescription, setName, setTitle
 
Methods inherited from interface com.ibm.workplace.wcm.api.WorkflowedDocument
addAdditionalViewers, addApprovers, approve, cancelDraftDocument, clearApprovers, createDraftDocument, decline, decline, getAdditionalViewers, getCurrentApprovers, getDateEnteredStage, getEffectiveDate, getExpiryDate, getGeneralDateOne, getGeneralDateTwo, getPendingWorkflowStatus, getPublishedDate, getPublishedId, getWorkflowId, getWorkflowStageId, getWorkflowStatus, hasApproverAccess, hasApproverAccess, hasDraft, isDraft, isDraftOfPublishedDocument, isExpired, isPublished, isWorkflowMovingBackward, nextWorkflowStage, nextWorkflowStage, nextWorkflowStage, previousWorkflowStage, previousWorkflowStage, removeAdditionalViewers, removeApprovers, restartWorkflow, setEffectiveDate, setExpiryDate, setGeneralDateOne, setGeneralDateTwo, setWorkflowId, setWorkflowId
 

Method Detail

getHTML

java.lang.String getHTML()
Returns the HTML contained in this component as a String.

Returns an empty String if the HTML could not be retrieved.

Returns:
the HTML

setHTML

void setHTML(java.lang.String html)
             throws com.ibm.workplace.wcm.api.exceptions.OperationFailedException
Sets the HTML contained in this LibraryHTMLComponent from the specified html argument.

Note. This method replaces any existing HTML in this component. It does not append to existing HTML. Existing images will be removed, new images will be added.

Parameters:
html - the HTML
Throws:
com.ibm.workplace.wcm.api.exceptions.OperationFailedException - if the string argument is null or the HTML could not be set

setHTML

void setHTML(java.lang.String html,
             com.ibm.workplace.wcm.api.EmbeddedImageMap images)
             throws com.ibm.workplace.wcm.api.exceptions.OperationFailedException
Deprecated. This method is deprecated from version 6.0. Use setHTML(String) instead.

Sets the HTML contained in this LibraryHTMLComponent from the specified html argument that contains embedded images. The URL from the src attribute of the img tag must have a corresponding entry in an EmbeddedImageMap object that you add via the addImage method.

A WCM resource is created for the image when you save the workspace The src attribute in the img tag will be replaced by a WCM resource's url. If the same URL appears in the HTML more than once, the same WCM resource will be used.

Note. This method replaces any existing HTML in this component. It does not append to existing HTML. Existing images will be removed, new images will be added.

Example code:

  File file = new File("C:/example/image.jpg");
  EmbeddedImageMap embeddedImage = new EmbeddedImageMap();
  embeddedImage.addImage("c:/example/image.jpg", file);

  // Set HTML
  libHtmlComponent.setHTML(html, embeddedImage);
 

Parameters:
html - the HTML
images - a map of URLs to images
Throws:
com.ibm.workplace.wcm.api.exceptions.OperationFailedException - if the string argument is null or the HTML could not be set