A resource whose content is generated entirely by rendering a Velocity template, for pages that need nothing beyond a name, a parent and a template path. It is commonly extended to add further behaviour, and is exposed to a template author as a ParameterisedResource so any data/parameter script tags declared in the template body can be read back as named parameters. Its title comes from the template itself, falling back to the resource name.

Extends: AbstractResource

Implements: GetableResource, Resource, ParameterisedResource, TitledPage


Properties

PropertyReturnsDescription
accessControlListMap<Principal,List<Priviledge>>The explicit access control list for this page.
createDateDateThe creation date for this page.
dirbooleanWhether this resource represents a directory. A templated page is always a leaf resource, never a directory.
forceAuthbooleanWhether, when a login is required, the logged in user must also pass the security manager's authorisation check for this page rather than simply being logged in.
forceLoginbooleanWhether a logged in user is required to view this page. When true and no user is authenticated, a login form is displayed instead of the page content.
modelMap<String,Object>The model of objects made available to this page's template during rendering. It is populated by buildModel just before rendering, so it is null until then.
modifiedDateDateThe last modified date for this page. Always null, because the rendered content depends on dynamic factors at render time rather than on a fixed, storable modification date.
nameStringThe name of this page, used as its path segment beneath its parent folder.
paramNamesList<String>The names of the parameters declared in this page's template, via data/parameter script tags.
parentCommonCollectionResourceThe folder that contains this page.
titleStringThe title of this page, taken from its template if the template declares one, otherwise falling back to this page's name.

Inherited from AbstractResource

Properties

PropertyReturnsDescription
asListResourceListThis resource wrapped as a single-element ResourceList, convenient for scripts that want to treat a single resource the same way as a list of resources.
attributesMap<String,Object>A mutable, request-scoped map of arbitrary attributes attached to this resource instance, for passing values between code that shares a reference to the same resource.
breadCrumbsMap<String,String>A map of breadcrumb URLs to labels for this resource, for building navigation trails. This base implementation always returns null; subclasses may override it to provide a real trail.
hrefStringThe URL-encoded path to this resource, suitable for use as a browser or WebDAV href. Collection resources get a trailing slash.
linkStringA ready-to-use HTML anchor tag linking to this resource's href, using its name as the link text.
oAuth2ProvidersMap<String,OAuth2Provider>The OAuth2 login providers available for this resource, combining the providers configured on the social login app with the platform's built-in social posting services mapped onto their OAuth2 provider templates.
pathPathThe path of this resource within its resource tree, built by appending this resource's name to its parent's path, as a Path object with convenient path manipulation methods.
principalCollectionHrefsHrefListThe hrefs of the collections that contain principals, so a WebDAV client can discover where to list users. This base implementation always returns the single href "/users/".
principalURLStringThe href of the owning principal resource for this resource, found by walking up the parent chain to the nearest principal resource.
publicbooleanWhether this resource is readable by anonymous, unauthenticated users. This base implementation always returns false; subclasses override it where public content is allowed.
readablebooleanWhether the current user, who may be null for an anonymous request, has READ_CONTENT permission on this resource.
realmStringThe HTTP authentication realm used for digest and basic authentication challenges on this resource.
uniqueIdStringA unique identifier for this resource. This base implementation always returns null; resource types that need a stable id (for example content resources) override it.
writablebooleanWhether the current user, who may be null for an anonymous request, has WRITE_CONTENT permission on this resource.

Methods

getBreadCrumbs() · getUniqueId() · getRealm() · getPrincipalURL() · getPrincipalCollectionHrefs() · getPath() · getHref() · getLink() · isPublic() · find(String path) · find(Path p) · getContentType(String accepts) · closest(String type) · closest(Class<T> c) · isReadable() · isWritable() · getAsList() · getOAuth2Providers() · getAttributes()

getBreadCrumbs()

Returns: Map<String,String>

A map of breadcrumb URLs to labels for this resource, for building navigation trails. This base implementation always returns null; subclasses may override it to provide a real trail.

getUniqueId()

Returns: String

A unique identifier for this resource. This base implementation always returns null; resource types that need a stable id (for example content resources) override it.

getRealm()

Returns: String

The HTTP authentication realm used for digest and basic authentication challenges on this resource.

getPrincipalURL()

Returns: String

The href of the owning principal resource for this resource, found by walking up the parent chain to the nearest principal resource.

getPrincipalCollectionHrefs()

Returns: HrefList

The hrefs of the collections that contain principals, so a WebDAV client can discover where to list users. This base implementation always returns the single href "/users/".

getPath()

Returns: Path

The path of this resource within its resource tree, built by appending this resource's name to its parent's path, as a Path object with convenient path manipulation methods.

getHref()

Returns: String

The URL-encoded path to this resource, suitable for use as a browser or WebDAV href. Collection resources get a trailing slash.

Returns: String

A ready-to-use HTML anchor tag linking to this resource's href, using its name as the link text.

isPublic()

Returns: boolean

Whether this resource is readable by anonymous, unauthenticated users. This base implementation always returns false; subclasses override it where public content is allowed.

find(String path)

Returns: Resource

Finds a resource within the website by its path. A relative path is evaluated relative to this resource; an absolute path is evaluated from the website root. For example find("/programs/p1") looks up the program p1 from the root, and find("../p1") looks up p1 in the folder above this resource.

ParameterDescription
paththe relative or absolute path to resolve

find(Path p)

Returns: Resource

Finds a resource by walking a Path object one part at a time, following "." and ".." segments and looking up each remaining part as a child of the current resource.

ParameterDescription
pthe path to resolve, relative to this resource or absolute

getContentType(String accepts)

Returns: String

The content type this resource should be served as. This base implementation always returns "text/html; charset=UTF-8" for getable resources (regardless of the accepts header, since XHTML is not used because of CKEditor compatibility) and an empty string otherwise. Subclasses override this where a different content type is needed.

ParameterDescription
acceptsthe client's Accept header value, currently not used to vary the result

closest(String type)

Returns: CommonResource

Finds the closest resource, starting from this one and walking up through its parents, whose is(type) returns true.

ParameterDescription
typethe type name to match, as used by is(String)

closest(Class<T> c)

Returns: T

Finds the closest resource, starting from this one and walking up through its parents, that is an instance of the given class.

ParameterDescription
cthe class to match against

isReadable()

Returns: boolean

Whether the current user, who may be null for an anonymous request, has READ_CONTENT permission on this resource.

isWritable()

Returns: boolean

Whether the current user, who may be null for an anonymous request, has WRITE_CONTENT permission on this resource.

getAsList()

Returns: ResourceList

This resource wrapped as a single-element ResourceList, convenient for scripts that want to treat a single resource the same way as a list of resources.

getOAuth2Providers()

Returns: Map<String,OAuth2Provider>

The OAuth2 login providers available for this resource, combining the providers configured on the social login app with the platform's built-in social posting services mapped onto their OAuth2 provider templates.

getAttributes()

Returns: Map<String,Object>

A mutable, request-scoped map of arbitrary attributes attached to this resource instance, for passing values between code that shares a reference to the same resource.


Methods

isForceLogin() · isForceAuth() · isDir() · getParent() · getName() · getModifiedDate() · getCreateDate() · getAccessControlList() · getModel() · getParam(String name) · getParamNames() · getTitle()

isForceLogin()

Returns: boolean

Whether a logged in user is required to view this page. When true and no user is authenticated, a login form is displayed instead of the page content.

isForceAuth()

Returns: boolean

Whether, when a login is required, the logged in user must also pass the security manager's authorisation check for this page rather than simply being logged in.

isDir()

Returns: boolean

Whether this resource represents a directory. A templated page is always a leaf resource, never a directory.

getParent()

Returns: CommonCollectionResource

The folder that contains this page.

getName()

Returns: String

The name of this page, used as its path segment beneath its parent folder.

getModifiedDate()

Returns: Date

The last modified date for this page. Always null, because the rendered content depends on dynamic factors at render time rather than on a fixed, storable modification date.

getCreateDate()

Returns: Date

The creation date for this page.

getAccessControlList()

Returns: Map<Principal,List<Priviledge>>

The explicit access control list for this page.

getModel()

Returns: Map<String,Object>

The model of objects made available to this page's template during rendering. It is populated by buildModel just before rendering, so it is null until then.

getParam(String name)

Returns: String

Reads the value of a named parameter declared in this page's template, via a data/parameter script tag.

ParameterDescription
namethe parameter name to read

getParamNames()

Returns: List<String>

The names of the parameters declared in this page's template, via data/parameter script tags.

getTitle()

Returns: String

The title of this page, taken from its template if the template declares one, otherwise falling back to this page's name.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.