Studio Developer Manual / Version 2207
Table Of Contents
A @coremedia/studio-client.cap-rest-client/content/Content
object
represents a document or folder in the CoreMedia system. It can be obtained through the
methods getChild(...)
or getContent(string)
of the content
repository. Note that unlike in Unified
API, the string
parameter to the latter method is not an ID, but a
URI path. You can get the URI path of a Content
with the
Content#getUriPath()
method (inherited from
@coremedia/studio-client.client-core/data/RemoteBean
).
You can also initiate a search request using the search service returned by
getSearchService()
or by navigating to a content from the root folder returned
by getRoot()
.
Using getProperties()
, it is possible to navigate to a secondary bean of type
@coremedia/studio-client.cap-rest-client/content/ContentProperties
that contains all schema-defined
properties of a content item. When updating properties, use the inherited, generic
set(property, value)
method of @coremedia/studio-client.client-core/data/Bean
with
Calendar
,
string
, or
number
objects or
arrays of Content
objects
as appropriate for the individual properties. Refrain from setting blob-valued and
XML-valued properties at this time. As for all remote beans, the method
flush(callback)
can be called to force properties to be written to the server
immediately.
The Content
object itself is only responsible for the meta properties that are
the same for all contents, for example the name property. The class
ContentPropertyNames
lists all these property names for your reference. As
usual, these are also the property names for the events that are sent when a content
changes.
The property lifecycleStatus
is a special property that does not correspond to
any Unified API feature. It indicates the simplified way
in which Studio represents the approval, deletion, and
publication flags to the user. The class LifecycleStatus
contains constants for
the supported states.
Following the Unified API, every content object is
associated to a ContentType
object by means of the getType()
method. You can also retrieve types by name from the content repository. Given a type, you
can create new instances of the type by means of the create(Content, string, AnyFunction)
method.
The move()
and rename()
methods are shortcuts for setting the
parent
and name
properties. As such, a callback provided with
these calls receives a FlushResult
as its single argument. The methods
copy()
, checkIn()
, checkOut()
, revert()
,
and doDelete()
correspond to the equivalent Unified
API methods. (The unusual name of the doDelete()
method is caused by
delete
being a reserved word in TypeScript.)
All operations receive result objects indicating whether the operation was successful. The
result of a delete operation is recorded in a DeleteResult
, with result codes
being documented in DeleteResultCodes
. Similarly, there are
CopyResult
and CheckInResult
objects. Please see the ASDoc for
details.
Through the method getIssues()
, a Content
object provides access
to issues detected by the server-side validators. See Section 5.3.3, “Issues” for
details about the issue API.