1 Assembly
Represents an assembly. Assemblies come in two flavors:
- Created in the admin application, belonging to a project.
- Created by a Portal application, belonging to the portal.
<@td.assemblies>
tag.
Represents an assembly. Assemblies come in two flavors:
<@td.assemblies>
tag.
ItemIdentifier
contextItemId
ItemIdentifier
source
ItemIdentifier
target
targetPathInProject
. RelationshipType
type
PARENT_CHILD
,
LINK
, or GRAPHIC
.
ItemIdentifier
childKey
boolean
virtualTopic
MetadataEntry[]
metadataEntries
FacetCount[]
values
Represents an HTTP request or response entity.
The contents of the entity can be accessed using the body
property. If expecting JSON-encoded content, HTML, or XML content, a parsed
representation of the content can be accessed using the json
,
html
, or xml
properties. If there are errors parsing the
content, they are available in the parseError
property.
Introduced in version 4.2.
Document
xml
body
as a parsed XML DOM structure. If parsing fails, this
property will be null
and any exceptions can be read from the
parseError
property. The DOM structure can be interrogated using
normal Freemarker XML handling; see the Freemarker documentation
( https://freemarker.apache.org/docs/xgui.html
for details. Object
json
body
as a parsed JSON object. This can also be done manually
in Freemarker using response.body?eval
; this property is provided
as a convenience. If the parsing of the JSON fails, this property will be
null
and any exceptions can be read from the parseError
property. Document
html
body
as a DOM structure generated by the Jsoup Java library
( https://jsoup.org/
). If the parsing of the body fails, this
property will be null and any exceptions can be read from the
parseError
property. String
base64
Represents the data returned by the <td.httpRequest> tag.
The contents of the response body can be accessed using the body
property. If expecting JSON-encoded content, HTML, or XML content, a parsed
representation of the content can be accessed using the json
,
html
, or xml
properties. If there are errors parsing the
content, they are available in the parseError
property. For example:
<@td.httpRequest url="https://example.com/data.json" var="response"/> <#if response.status == 200> <#if response.contentType?contains('/json')> <#assign responseStruct = response.json!''/> <#elseif response.contentType?contains('/html')> <#assign responseStruct = response.html!''/> <#elseif response.contentType?contains('/xml')> <#assign responseStruct = response.xml!''/> </#if> <#if response.parseError??> <b>ERROR: ${response.parseError.message?html}</b> <pre>${response.body?html}</pre> </#if> </#if>
All headers are available in the headers
property. The keys for the
header names are represented in all lower-case, as well as in whatever case
was presented in the actual response.
Introduced in version 4.2.
Document
xml
body
as a parsed XML DOM structure. If parsing fails, this
property will be null
and any exceptions can be read from the
parseError
property. The DOM structure can be interrogated using
normal Freemarker XML handling; see the Freemarker documentation
( https://freemarker.apache.org/docs/xgui.html
for details. Object
json
body
as a parsed JSON object. This can also be done manually
in Freemarker using response.body?eval
; this property is provided
as a convenience. If the parsing of the JSON fails, this property will be
null
and any exceptions can be read from the parseError
property. Document
html
body
as a DOM structure generated by the Jsoup Java library
( https://jsoup.org/
). If the parsing of the body fails, this
property will be null and any exceptions can be read from the
parseError
property. String
base64
ItemIdentifier
itemIdentifier
ItemProperties
properties
ProjectInfo
projectInfo
ContentRelationship[]
outgoingRelationships
ContentRelationship[]
incomingRelationships
ProjectMetadata
projectMetadata
ItemIdentifier
item
SpecifiedItemDetails
specifiedDetails
Map
embeddedMetadata
String
effectiveUrlPath
Map
propertyMap
A hash of properties set on this document. Keys common to all files are:
key
- The key of the documentname
- The name of the documentprojectKey
- The key of the Project containing this document
size
- The size of the document, in bytescontentType
- The MIME Type of the documentpath
- The path to this document within the ProjectcreateDate
- The date the document was created in Titania
DeliverylastModified
- The date the document was last modified in
Titania DeliveryKeys set on image files only are:
img_width
- The width of the image, in pixelsimg_height
- The height of the image, in pixelsKeys set on XML files only are:
xml_isWellFormed
xml_hasDTD
xml_hasSchema
xml_hasDoctype
xml_doctypeExists
xml_isValid
xml_elementCount
xml_elementIds
xml_primarySchema
xml_publicId
xml_systemId
xml_schemas
xml_rootElement
xml_rootNamespace
xml_doctypeFile
xml_doctypeProject
xml_doctypeName
xml_title
dita_navtitle
xml_validationError
xml_isDita
dita_isTopic
dita_isMap
dita_isDitabase
dita_domains
MetadataEntry[]
metadataEntries
FragmentMetadata[]
allFragmentMetadata
metadataFilters
array in PortalIdentity
.
Introduced in version 4.1.
OfflinePackageDocumentInfo[]
documents
boolean
signContents
false
. Introduced in version 4.2.
String
signaturePathPrefix
String
signaturePathSuffix
String
signatureAlgorithm
"SHA512withRSA"
. Introduced in version 4.2.
String
statusMessage
String
signature
Introduced in version 4.1.
boolean
rootDoc
$ portal
and
includes data about the Portal itself.
MetadataFilter[]
metadataFilters
PortalSearchFacet[]
searchFacets
String[]
enabledFeatures
PortalRobotsTxtBehavior
robotsTxtBehavior
searchFacets
array in
PortalIdentity
, which is available on every page in the Portal.
This object is only available to the Portal if the Portal has security (
hasSecurity
) enabled and the current user is logged in (
isAuthenticated
). If those two conditions fail, this object will be
null and any attempt to reference it will result in a Freemarker error. This
can be using the following code:
<#if hasSecurity && isAuthenticated> <#-- Can now safely reference ${user} --> </#if>
or:
<#if user??> <#-- Can now safely reference ${user} --> </#if>
String
id
String
userName
Map
properties
results
array of SearchResultGroup
and of the array
returned by the <@td.search>
tag.
String
itemKey
String
contextKey
xxnullxx
if it is
a stand-alone document. String
contextRefId
contextRefId
identifies which version the current document
represents. boolean
contextualized
true
if this document is present in a parent context document.
Equal to contextKey != xxnullxx
. String
highlight
Map
metadata
boolean
virtual
This object is the data type of the content
array of groups. It
represents a "group" of search results.
Search results are generally grouped by their DITA map context. That is, a DITA topic used in multiple DITA map contexts will have its matching search results grouped together. No other documents are grouped in this way.
nContexts
will always be >= 1 and equal to results?size
.
firstResult
will be the same SearchResultDocument
as
results[0]
.
SearchResultDocument
firstResult
results[0]
. String
groupingValue
SearchResultDocument[]
results
results?size
will always be equal to nContexts
.<@td.search>
tag, the paged items will be
SearchResultDocument
objects. When grouped, e.g. on the
searchResults.ftl
or from the <@td.groupSearch>
tag,
the contents will be SearchResultGroup
objects.
FacetField[]
facetFields
int
numberOfElements
size
. long
totalElements
String
groupedBy
td.groupSearch
directive. The default grouping field is "itemKey", meaning that DITA
topics with multiple DITA map contexts will be grouped together. This
value will be null for ungrouped searches. Introduced in version 4.2.1.
Object[]
startNextAfter
T[]
content
searchResults.ftl
, this will be a list of
SearchResultGroup
.<@td.groupSearch>
tag, the results
will also be of type SearchResultGroup
.<@td.search>
, the results will be
lists of SearchResultDocument
.An extension of UserDataStorage that is shared by all users of a portal, including anonymous users. This object exposes a number of special methods for storing data and documents in a searchable way.
Portals have an associated content project that can store documents and metadata generated by the portal. Also, each portal can have one or more searchable indexes containing arbitrary data. (Additional portal data storage capabilities for nonindexed values, counters, and lists are described under "DataStorage".)
When a portal is created, a project is automatically created and associated
with the portal as the portal content project. This project may contain
portal-generated content, and functions like any other content project. The
siteData
object provides methods for accessing portal
content items.
Indexed data can be stored and searched under user-defined index names. Each
index should hold similarly structured records. Methods for storing and
retrieving indexed data are provided in Freemarker and javascript using the
siteData
object. The administration interface also provides
access to view and download portal indexed data. IMPORTANT: The total
number of user-defined indices on the platform cannot exceed 100 at any time
(across all portals). Theme developers and platform administrators should
ensure that no more than 100 indices exist at any time.
Introduced in version 4.2.
Iterable searchIndexed( String index, String query, int [] paging)
int deleteIndexed( String index, String query)
int deleteIndexed( String index, String query, boolean waitRefresh)
false
for the waitRefresh
method will cause the method to
return before the deletion has been fully processed. The default is
true
void putIndexed( String index, Object value)
boolean putIndexed( String index, Object value, boolean waitRefresh)
false
for the
waitRefresh
method will cause the method to return before the
insertion has been fully processed. The default is true
void putFile( String location, String mimeType, CharSequence contents, Map metadata)
String getFile( String location, String representation)
String getFileDownloadURL( String location, String representation)
String getFileUploadURL( String location, boolean folderMode, String itemName)
boolean setFileMetadata( String location, Map metadata)
updateFileMetadata(String,Map)
for adding additional metadata to
a file.
boolean updateFileMetadata( String location, Map metadata)
String getProcessingPhase( String location)
ProjectItem[] getProjectRoots()
ProjectItem[] getFolderContents( String location)
void put( String dataKey, Object data)
Object get( String dataKey)
void push( String listKey, Object value, int cap)
void pushUnique( String listKey, Object value, int cap)
boolean existsInList( String listKey, Object value)
void removeFromList( String listKey, Object value)
void incrementCounter( String key, long by)
Portals can store data on the server for later retrieval. If the user is authenticated, the stored data is persisted between sessions. Otherwise, it expires when the client session expires.
There are three types of nonindexed persistent data: values, counters, and lists. Each is associated with a key. A key may have all three types of values.
Values
Values are stored via put(String, Object)
and retrieved via
get(String)
. Values can be anything that can be serialized
as JSON, including strings, numbers, booleans, lists, and data structures.
Data values are serialized as JSON when stored in the database, and
de-serialized when retrieved. If a value is a complex non-map object when it
is stored, it will be retrieved as a map.
Lists
Lists are essentially managed arrays that can be added to or removed from
without needing to retrieve the full data structure. You create/add to lists
via push(String, Object, int)
or pushUnique(String,
Object, int)
. The full list can be retrieved via
getList(String)
. Elements can be removed via
removeFromList(String, Object)
. You can check whether a
value exists in a list via existsInList(key)
. Like values,
list entries can be anything that can be serialized as JSON.
Counters
Counters are whole number values that can be easily incremented and
decremented with the atomic operation incrementCounter(String,
long)
. They can also be retrieved and stored via
getCounter()
and setCounter()
.
Important: The three values are treated independently. If you set a
value via setCounter()
, it must be retrieved by
getCounter()
; it will not be retrieved by
get()
. Similarly, lists stored with put()
cannot be modified via push()
. However, if a given key has
more than one type of value - a list and a counter, for instance - calling
delete()
on that key will delete all the associated data.
Categories
A category is implicitly defined by keys beginning with a certain prefix and a period. For example, deleteCategory('foo') would delete any entry with a key beginning with 'foo.' ('foo.a', 'foo.b', etc.). It would not delete 'foo'. There are a number of methods that allow the interaction with whole groups of entries by their category. This allows the development of features that involve an interaction of multiple keys such that they can be deleted.
Introduced in version 4.0.
void put( String dataKey, Object data)
Object get( String dataKey)
void push( String listKey, Object value, int cap)
void pushUnique( String listKey, Object value, int cap)
boolean existsInList( String listKey, Object value)
void removeFromList( String listKey, Object value)
void incrementCounter( String key, long by)
Was this helpful?