The ContentDefinition object provides an extensible way to link static content, such as CSS, HTML, or JavaScript, to framework objects. The MIME type of the content is specified with the ContentDefinition object. Any framework object can define content definitions mapped by key. The following is a code example of importing CSS contents into a JSP page:

<c:out value="${mySkin.contents.css.body}"/>

The attributes of the ContentDefinition object, which are in addition to the attributes inherited from the FrameworkObject base class, are described below:

Attribute

Description

body

The body of the content being defined as an alternative to referencing the content by URL.

contentId

Logical identifier that other objects use to refer to this object, which is exposed to other objects and to the code and which is the primary external way to refer to the object.

mimeType

The type of content being defined. For example, content with a MIME type of text/css would place CSS contents in the body. Content with a MIME type of text/javascript would place JavaScript in the body. Other common content types in a web application might be text/html or text/xml or any of a wide range of established content types.

objectType

ContentDefinition

url

A URL that references the static content.

urlYn

The URL flag indicates whether the content is referenced externally by a URL. If the URL flag is false, the body of the static content is contained internally in the body attribute of the content definition.

The extension methods of the ContentDefinitionHome interface are described below:

Returns

Method

Description

ContentDefinition

findByUserSegmentAndContentId

Arguments: String appId, String contentId

Returns the ContentDefinition with the specified identifier based on the segment of the current user. If the current user does not have a segment or no object is found for the current segment, a default object is returned based on content identifier only. The appId indicates the framework application in which to look for the object.

 
loading table of contents...