Serves the "manage" resource for a single asset in the asset manager, rendering its edit page and handling the update, delete and tagging form posts made from it. Subclasses are created per asset type (content item, image, video, text, binary or query) by AssetManager.newManageAssetResource, and each supplies its own template name and extra commands. This base class handles the commands common to every asset type: adding and removing asset types (tags), creating a translation, and replacing the asset's content when a file is posted.
Group: Resources
Extends: AbstractResource
Implements: GetableResource, PostableResource, TitledPage, DeletableResource, ContentPermissionsResource
Properties
| Property | Returns | Description |
|---|---|---|
| accessControlList | Map<Principal,List<Priviledge>> | Explicit per-principal access control list for this resource. Always null, since access is instead governed by the content-managed permissions on the underlying asset. |
| breadCrumbs | Map<String,String> | Breadcrumb trail for this resource's edit page, mapping each ancestor's href to its display label. Currently fixed to a single entry pointing at the asset manager root. |
| contentManagedPermissions | boolean | Whether access to this resource is governed by the underlying asset's content permissions rather than an explicit access control list. Always true. |
| currentTranslation | Asset | The best translation of this asset for the current profile, lazily loaded and cached. Attempts to find a translation matching the profile's selected language, and falls back to this asset itself when there is no matching translation. |
| langCode | String | Language code of this asset, as stored on the asset itself. Never null for a persisted asset with a language assigned. |
| name | String | Name this resource is addressed by in its parent collection. |
| notTranslated | List<Language> | Lists the account's configured languages that do not yet have a translation of this asset. Used to populate the "create translation" choices in the asset manager UI. |
| parent | CommonCollectionResource | The collection this resource is addressed within, ie the asset manager (or asset type) folder it was created under. |
| title | String | Page title for this resource's edit page: the asset's name prefixed with "Asset: ", or "New asset" if no asset has been set yet. |
| translations | List<Asset> | Other-language versions of this asset, lazily loaded and cached for the life of this resource. May be empty if no translations exist. |
| translationSource | Asset | The asset this one was translated from, found via its "translation-source" relation, lazily loaded and cached. Returns null if this asset has no recorded translation source. |
| viewHrefs | Map<String,String> | Builds the map of view links available for this asset, keyed by href and valued by the view's display text. Each entry comes from an asset type registered against the asset that has views configured; a view whose matcher produces a href suffix gets it appended as a query string, otherwise the asset's own href is used unchanged. Returns an empty map if the asset is not a binary or content item asset, or has no asset types with views. |
Inherited from AbstractResource
Properties
| Property | Returns | Description |
|---|---|---|
| asList | 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. |
| attributes | 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. |
| createDate | Date | The date this resource was created. This base implementation always returns null; subclasses that track creation dates override it. |
| dir | boolean | Whether this resource is a collection (folder-like) resource rather than a single item. |
| href | String | The URL-encoded path to this resource, suitable for use as a browser or WebDAV href. Collection resources get a trailing slash. |
| link | String | A ready-to-use HTML anchor tag linking to this resource's href, using its name as the link text. |
| modifiedDate | Date | The date this resource was last modified. This base implementation always returns null; subclasses that track modification dates override it. |
| oAuth2Providers | 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. |
| path | 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. |
| principalCollectionHrefs | 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/". |
| principalURL | String | The href of the owning principal resource for this resource, found by walking up the parent chain to the nearest principal resource. |
| public | boolean | Whether this resource is readable by anonymous, unauthenticated users. This base implementation always returns false; subclasses override it where public content is allowed. |
| readable | boolean | Whether the current user, who may be null for an anonymous request, has READ_CONTENT permission on this resource. |
| realm | String | The HTTP authentication realm used for digest and basic authentication challenges on this resource. |
| uniqueId | 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. |
| writable | boolean | Whether the current user, who may be null for an anonymous request, has WRITE_CONTENT permission on this resource. |
Methods
getUniqueId() · getRealm() · getPrincipalURL() · getPrincipalCollectionHrefs() · getPath() · getHref() · getLink() · isPublic() · find(String path) · find(Path p) · isDir() · getContentType(String accepts) · getModifiedDate() · getCreateDate() · closest(String type) · closest(Class<T> c) · isReadable() · isWritable() · getAsList() · getOAuth2Providers() · getAttributes()
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.
getLink()
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.
| Parameter | Description |
|---|---|
path | the 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.
| Parameter | Description |
|---|---|
p | the path to resolve, relative to this resource or absolute |
isDir()
Returns: boolean
Whether this resource is a collection (folder-like) resource rather than a single item.
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.
| Parameter | Description |
|---|---|
accepts | the client's Accept header value, currently not used to vary the result |
getModifiedDate()
Returns: Date
The date this resource was last modified. This base implementation always returns null; subclasses that track modification dates override it.
getCreateDate()
Returns: Date
The date this resource was created. This base implementation always returns null; subclasses that track creation dates override it.
closest(String type)
Returns: CommonResource
Finds the closest resource, starting from this one and walking up through its parents, whose is(type) returns true.
| Parameter | Description |
|---|---|
type | the 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.
| Parameter | Description |
|---|---|
c | the 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
getTitle() · getParent() · getName() · getAccessControlList() · getViewHrefs() · getTranslations() · getNotTranslated() · getLangCode() · getTranslationSource() · getCurrentTranslation() · isContentManagedPermissions() · getBreadCrumbs()
getTitle()
Returns: String
Page title for this resource's edit page: the asset's name prefixed with "Asset: ", or "New asset" if no asset has been set yet.
getParent()
Returns: CommonCollectionResource
The collection this resource is addressed within, ie the asset manager (or asset type) folder it was created under.
getName()
Returns: String
Name this resource is addressed by in its parent collection.
getAccessControlList()
Returns: Map<Principal,List<Priviledge>>
Explicit per-principal access control list for this resource. Always null, since access is instead governed by the content-managed permissions on the underlying asset.
getViewHrefs()
Returns: Map<String,String>
Builds the map of view links available for this asset, keyed by href and valued by the view's display text. Each entry comes from an asset type registered against the asset that has views configured; a view whose matcher produces a href suffix gets it appended as a query string, otherwise the asset's own href is used unchanged. Returns an empty map if the asset is not a binary or content item asset, or has no asset types with views.
getTranslations()
Returns: List<Asset>
Other-language versions of this asset, lazily loaded and cached for the life of this resource. May be empty if no translations exist.
getNotTranslated()
Returns: List<Language>
Lists the account's configured languages that do not yet have a translation of this asset. Used to populate the "create translation" choices in the asset manager UI.
getLangCode()
Returns: String
Language code of this asset, as stored on the asset itself. Never null for a persisted asset with a language assigned.
getTranslationSource()
Returns: Asset
The asset this one was translated from, found via its "translation-source" relation, lazily loaded and cached. Returns null if this asset has no recorded translation source.
getCurrentTranslation()
Returns: Asset
The best translation of this asset for the current profile, lazily loaded and cached. Attempts to find a translation matching the profile's selected language, and falls back to this asset itself when there is no matching translation.
isContentManagedPermissions()
Returns: boolean
Whether access to this resource is governed by the underlying asset's content permissions rather than an explicit access control list. Always true.
getBreadCrumbs()
Returns: Map<String,String>
Breadcrumb trail for this resource's edit page, mapping each ancestor's href to its display label. Currently fixed to a single entry pointing at the asset manager root.