The content-definition 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 content-definition object. Any framework object can define content definitions mapped by key. The following is an example of how to import CSS contents into a JSP page:

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

The attributes of the content-definition object, in addition to the attributes inherited from the FrameworkObject base class, are:

Attribute

Description

body

The text context that is defined as an alternative to referencing the content by a URL.

content-id

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

mime-type

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.

other-context

The Web context for rendering content from other Web applications.

url

A URL that references the static content.

url-yn

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 method of the ContentDefinitionHome interface is:

Returns

Method

Description

ContentDefinition

findByUserSegment
  AndContentId

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.

Arguments: String appId, String contentId


Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices