com.gentics.contentnode.rest.resource
Interface PageResource

All Superinterfaces:
AuthenticatedResource

public interface PageResource
extends AuthenticatedResource

Resource used for loading, saving and manipulating GCN pages.


Method Summary
 GenericResponse cancel(java.lang.Integer id)
          Cancel editing the page.
 PageLoadResponse create(PageCreateRequest request)
          Create a page based on the given pagecreaterequest
 TagCreateResponse createTag(java.lang.String id, java.lang.Integer constructId, java.lang.String keyword, ContentTagCreateRequest request)
          Create a new tag in the given page
 GenericResponse delete(java.lang.String id, java.lang.Integer nodeId)
          Delete the page denoted by id.
 LocalizationInfo getLocalizationInfo(java.lang.Integer id, java.lang.Integer nodeId)
          Get localization info for a page for a given channel and all master channels
 LocalizationInfo getLocalizationInfo(java.util.List<java.lang.Integer> ids, java.lang.Integer nodeId)
          Get localization info for a list of pages for a given channel and all master channels
 PageUsageListResponse getPagetagUsageInfo(java.lang.Integer skipCount, java.lang.Integer maxItems, java.lang.String sortBy, java.lang.String sortOrder, java.util.List<java.lang.Integer> pageId, java.lang.Integer nodeId, boolean returnPages, boolean template, boolean folder, boolean languageVariants)
          Get the pages containing pagetags pointing to one of the given pages
 PageUsageListResponse getPageUsageInfo(java.lang.Integer skipCount, java.lang.Integer maxItems, java.lang.String sortBy, java.lang.String sortOrder, java.util.List<java.lang.Integer> pageId, java.lang.Integer nodeId, boolean returnPages, boolean template, boolean folder, boolean languageVariants)
          Get the pages using one of the given pages
 PrivilegesResponse getPrivileges(java.lang.Integer id)
          Get the privileges of the current user on the given page
 TagListResponse getTags(java.lang.Integer id, java.lang.Integer skipCount, java.lang.Integer maxItems, TagSortAttribute sortBy, SortOrder sortOrder, java.lang.String search)
          Get the list of tags (contenttags and templatetags) for this page
 TemplateUsageListResponse getTemplateUsageInfo(java.lang.Integer skipCount, java.lang.Integer maxItems, java.lang.String sortBy, java.lang.String sortOrder, java.util.List<java.lang.Integer> pageId, java.lang.Integer nodeId, boolean returnTemplates)
          Get the templates using one of the given pages
 PageUsageListResponse getVariantsUsageInfo(java.lang.Integer skipCount, java.lang.Integer maxItems, java.lang.String sortBy, java.lang.String sortOrder, java.util.List<java.lang.Integer> pageId, java.lang.Integer nodeId, boolean returnPages, boolean template, boolean folder, boolean languageVariants)
          Get the page variants of the given pages
 PageLoadResponse load(java.lang.String id, boolean update, boolean template, boolean folder, boolean languageVariants, boolean pageVariants, boolean workflow, boolean translationStatus, boolean versionInfo, java.lang.Integer nodeId)
          Loads a page from GCN.
 GenericResponse localize(java.lang.Integer id, LocalizeRequest request)
          Localize the given page
 PagePreviewResponse preview(PagePreviewRequest request)
          Render given page in a preview (before actually saving it)
 GenericResponse publish(MultiPagePublishRequest request)
          Publish a list of pages.
 GenericResponse publish(java.lang.String id, PagePublishRequest request)
          Publish the page denoted by id (or send it in the queue when the User has not permission to publish the page).
 GenericResponse pushToMaster(java.lang.Integer id, PushToMasterRequest request)
          Push a page from a channel into a master
 GenericResponse pushToMaster(MultiPushToMasterRequest request)
          Push a list of pages from a channel into a master
 PageRenderResponse render(java.lang.String id, java.lang.Integer nodeId, java.lang.String template, boolean editMode, java.lang.String proxyprefix, LinksType linksType, boolean tagmap)
          Render the given page Info: This currently doesn't return tag render errors.
 TagListResponse restoreTag(java.lang.String pageId, java.lang.String tag, java.lang.Integer versionTimestamp)
          Restore a single tag in the page with the given version timestamp
 PageLoadResponse restoreVersion(java.lang.String id, java.lang.Integer versionTimestamp)
          Restore the page version with the given version timestamp
 GenericResponse save(java.lang.String id, PageSaveRequest request)
          Saves a page into GCN
 GenericResponse takeOffline(java.lang.String id)
          Take a specific page offline
 PageLoadResponse translate(java.lang.Integer id, java.lang.String languageCode, boolean locked, java.lang.Integer channelId)
          Translate the page into the given language.
 GenericResponse unlocalize(java.lang.Integer id, UnlocalizeRequest request)
          Unlocalize the given page
 GenericResponse unlocalize(MultiUnlocalizeRequest request)
          Unlocalize pages in a channel
 GenericResponse workflowDecline(java.lang.String id, WorkflowRequest request)
          Decline the workflow for the page (i.e.
 GenericResponse workflowRevoke(java.lang.Integer id)
          Revoke the last step of the workflow
 
Methods inherited from interface com.gentics.contentnode.rest.resource.AuthenticatedResource
setSessionId
 

Method Detail

create

PageLoadResponse create(PageCreateRequest request)
Create a page based on the given pagecreaterequest

Parameters:
request - containing data for creating the page
Returns:
PageLoadResponse with the created page

save

GenericResponse save(java.lang.String id,
                     PageSaveRequest request)
Saves a page into GCN

Parameters:
id - Id of the page to save. This can either be a local or global id
request - page save request
Returns:
GenericResponse

load

PageLoadResponse load(java.lang.String id,
                      boolean update,
                      boolean template,
                      boolean folder,
                      boolean languageVariants,
                      boolean pageVariants,
                      boolean workflow,
                      boolean translationStatus,
                      boolean versionInfo,
                      java.lang.Integer nodeId)
Loads a page from GCN. For now this page only contains meta data about the page and no contents. When using loading pages, it is important to note that the returned tag data may be loaded differently depending on whether or not the page is loaded for editing ("update" flag is set to true). Loading a page with the update flag set to false allows you to load the page without causing it to be locked for editing, but it means that any tags which have not been filled will be loaded without all their tag parts. Tags that have not been filled, and that do not have default values will be loaded with empty properties in this case. On the other hand, when loading pages for editing, any tags that have no been filled, will have their constituents part auto-generated. Consequently, when loading pages via the REST-API or GCNJSAPI, setting the update flag to true will cause all tags to be loaded with all parts data (auto-generated if necessary), whereas when loading a page with update set to false, any tags which have not had their parts filled will be loaded without their parts data.

Parameters:
id - The id of the page to load. This can either be a localid or a globalid
update - true when the page shall be locked, false if not
template - true if the template information shall be added
folder - true if the folder information shall be added
languageVariants - true if the language variants shall be added
workflow - true if the workflow information shall be added
translationStatus - true if the translationstatus information shall be added
versionInfo - true if version information shall be added
nodeId - channel id
Returns:
PageLoadResponse Response with the loaded page

preview

PagePreviewResponse preview(PagePreviewRequest request)
Render given page in a preview (before actually saving it)

Returns:
preview of the page
Throws:
NodeException

publish

GenericResponse publish(MultiPagePublishRequest request)
Publish a list of pages. Instant publishing will not be done, when using this method.

Parameters:
request - publish request
Returns:
response object

publish

GenericResponse publish(java.lang.String id,
                        PagePublishRequest request)
Publish the page denoted by id (or send it in the queue when the User has not permission to publish the page). If the page is published and the node publishes into a contentrepository with instant publishing, the page will immediately be written into the contentrepository

Parameters:
id - id of the Page to publish. This can either be a local or globalid
request - publish page request
Returns:
response object

delete

GenericResponse delete(java.lang.String id,
                       java.lang.Integer nodeId)
Delete the page denoted by id. Note that inherited or localized pages can't be deleted in a channel. However you can delete an inherited page in the master and unlocalize a localized page.

Parameters:
id - id of the Page to delete. This can either be a local or global id
nodeId - channel id
Returns:
response object

cancel

GenericResponse cancel(java.lang.Integer id)
Cancel editing the page. The page will be rolled back to the last version (changes made since the last version will be lost). The edit lock on the page will be raised, so that other users may edit the page.

Parameters:
id - id of the Page which is currently edited
Returns:
response object

render

PageRenderResponse render(java.lang.String id,
                          java.lang.Integer nodeId,
                          java.lang.String template,
                          boolean editMode,
                          java.lang.String proxyprefix,
                          LinksType linksType,
                          boolean tagmap)
Render the given page Info: This currently doesn't return tag render errors.

Parameters:
id - id of the page
nodeId - node id (if rendering a page for a channel)
template - template to render (if not set, the page's template will be rendered)
editMode - true for rendering in edit mode, false for preview mode
proxyprefix - proxyprefix
linksType - type of links (frontend or backend)
tagmap - true to also render the tagmap entries
Returns:
response containing the rendered page and other important information

getTags

TagListResponse getTags(java.lang.Integer id,
                        java.lang.Integer skipCount,
                        java.lang.Integer maxItems,
                        TagSortAttribute sortBy,
                        SortOrder sortOrder,
                        java.lang.String search)
Get the list of tags (contenttags and templatetags) for this page

Parameters:
id - id of the page
Returns:
response object

getPrivileges

PrivilegesResponse getPrivileges(java.lang.Integer id)
Get the privileges of the current user on the given page

Parameters:
id - id of the page
Returns:
privileges response

createTag

TagCreateResponse createTag(java.lang.String id,
                            java.lang.Integer constructId,
                            java.lang.String keyword,
                            ContentTagCreateRequest request)
Create a new tag in the given page

Parameters:
id - id of the page. This can either be a local or globalid
constructId - id of the tags construct
keyword - keyword of the construct
request - tag create request
Returns:
response containing the rendered tag

restoreVersion

PageLoadResponse restoreVersion(java.lang.String id,
                                java.lang.Integer versionTimestamp)
Restore the page version with the given version timestamp

Parameters:
id - The id of the page that should be restored. This can either be a local or globalid
versionTimestamp - version timestamp

restoreTag

TagListResponse restoreTag(java.lang.String pageId,
                           java.lang.String tag,
                           java.lang.Integer versionTimestamp)
Restore a single tag in the page with the given version timestamp

Parameters:
pageId - id of the page. This can either be a local or globalid
tag - id or name of the tag
versionTimestamp - version timestamp
Returns:
restored tag

translate

PageLoadResponse translate(java.lang.Integer id,
                           java.lang.String languageCode,
                           boolean locked,
                           java.lang.Integer channelId)
Translate the page into the given language. When the language variant of the page exists, it is just locked and returned, otherwise the page is copied into the language variant and returned. This method fails, if the requested language is not available for the node of the page or the user has no permission to create/edit the given language variant

Parameters:
id - id of the page to translate
languageCode - code of the language into which the page shall be translated
locked - true if the translation shall be locked, false if not
channelId - for multichannelling, specify channel in which to create page (can be 0 or equal to node ID to be ignored)
Returns:
page load response

workflowRevoke

GenericResponse workflowRevoke(java.lang.Integer id)
Revoke the last step of the workflow

Parameters:
id - id of the page
Returns:
generic response

workflowDecline

GenericResponse workflowDecline(java.lang.String id,
                                WorkflowRequest request)
Decline the workflow for the page (i.e. give it back to a lower group)

Parameters:
id - id of the page. This can either be a local or globalid
request - request object containing what should be changed about the workflow
Returns:
generic response

getPagetagUsageInfo

PageUsageListResponse getPagetagUsageInfo(java.lang.Integer skipCount,
                                          java.lang.Integer maxItems,
                                          java.lang.String sortBy,
                                          java.lang.String sortOrder,
                                          java.util.List<java.lang.Integer> pageId,
                                          java.lang.Integer nodeId,
                                          boolean returnPages,
                                          boolean template,
                                          boolean folder,
                                          boolean languageVariants)
Get the pages containing pagetags pointing to one of the given pages

Parameters:
skipCount - number of items to be skipped, set to 0 for skipping no items
maxItems - maximum number of items to be returned, set to -1 for returning all items
sortby - (optional) attribute to sort by. defaults to name
sortorder - (optional) result sort order - may be "asc" for ascending or "desc" for descending other strings will be ignored. defaults to "asc".
pageId - list of page ids
nodeId - id of the node
returnPages - true (default) if the pages shall be returned, false for only returning the counts
template - true for adding template info to the pages, default is false
folder - true for adding folder info to the pages, default is false
languageVariants - true for adding the language variants to the pages, default is false
Returns:
list of pages

getVariantsUsageInfo

PageUsageListResponse getVariantsUsageInfo(java.lang.Integer skipCount,
                                           java.lang.Integer maxItems,
                                           java.lang.String sortBy,
                                           java.lang.String sortOrder,
                                           java.util.List<java.lang.Integer> pageId,
                                           java.lang.Integer nodeId,
                                           boolean returnPages,
                                           boolean template,
                                           boolean folder,
                                           boolean languageVariants)
Get the page variants of the given pages

Parameters:
skipCount - number of items to be skipped, set to 0 for skipping no items
maxItems - maximum number of items to be returned, set to -1 for returning all items
sortby - (optional) attribute to sort by. defaults to name
sortorder - (optional) result sort order - may be "asc" for ascending or "desc" for descending other strings will be ignored. defaults to "asc".
pageId - list of page ids
nodeId - id of the node
returnPages - true (default) if the pages shall be returned, false for only returning the counts
template - true for adding template info to the pages, default is false
folder - true for adding folder info to the pages, default is false
languageVariants - true for adding the language variants to the pages, default is false
Returns:
list of page variants

getPageUsageInfo

PageUsageListResponse getPageUsageInfo(java.lang.Integer skipCount,
                                       java.lang.Integer maxItems,
                                       java.lang.String sortBy,
                                       java.lang.String sortOrder,
                                       java.util.List<java.lang.Integer> pageId,
                                       java.lang.Integer nodeId,
                                       boolean returnPages,
                                       boolean template,
                                       boolean folder,
                                       boolean languageVariants)
Get the pages using one of the given pages

Parameters:
skipCount - number of items to be skipped, set to 0 for skipping no items
maxItems - maximum number of items to be returned, set to -1 for returning all items
sortby - (optional) attribute to sort by. defaults to name
sortorder - (optional) result sort order - may be "asc" for ascending or "desc" for descending other strings will be ignored. defaults to "asc".
pageId - list of page ids, for which the usage shall be fetched
nodeId - id of the node
returnPages - true (default) if the pages shall be returned, false for only returning the counts
template - true for adding template info to the pages, default is false
folder - true for adding folder info to the pages, default is false
languageVariants - true for adding the language variants to the pages, default is false
Returns:
list of pages using the given pages

getTemplateUsageInfo

TemplateUsageListResponse getTemplateUsageInfo(java.lang.Integer skipCount,
                                               java.lang.Integer maxItems,
                                               java.lang.String sortBy,
                                               java.lang.String sortOrder,
                                               java.util.List<java.lang.Integer> pageId,
                                               java.lang.Integer nodeId,
                                               boolean returnTemplates)
Get the templates using one of the given pages

Parameters:
skipCount - number of items to be skipped, set to 0 for skipping no items
maxItems - maximum number of items to be returned, set to -1 for returning all items
sortby - (optional) attribute to sort by. defaults to name
sortorder - (optional) result sort order - may be "asc" for ascending or "desc" for descending other strings will be ignored. defaults to "asc".
pageId - list of page ids, for which the usage shall be fetched
nodeId - id of the node
returnTemplates - true (default) if the templates shall be returned, false for only returning the counts
Returns:
response

pushToMaster

GenericResponse pushToMaster(java.lang.Integer id,
                             PushToMasterRequest request)
Push a page from a channel into a master

Parameters:
id - id of the page
request - request
Returns:
generic response

pushToMaster

GenericResponse pushToMaster(MultiPushToMasterRequest request)
Push a list of pages from a channel into a master

Parameters:
request - request
Returns:
generic response

unlocalize

GenericResponse unlocalize(java.lang.Integer id,
                           UnlocalizeRequest request)
Unlocalize the given page

Parameters:
id - id of the page to unlocalize
request - request
Returns:
generic response

unlocalize

GenericResponse unlocalize(MultiUnlocalizeRequest request)
Unlocalize pages in a channel

Parameters:
request - request
Returns:
generic response

localize

GenericResponse localize(java.lang.Integer id,
                         LocalizeRequest request)
Localize the given page

Parameters:
id - id of the page to localize
request - request
Returns:
generic response

getLocalizationInfo

LocalizationInfo getLocalizationInfo(java.util.List<java.lang.Integer> ids,
                                     java.lang.Integer nodeId)
Get localization info for a list of pages for a given channel and all master channels

Parameters:
ids - list of page ids
nodeId - id of the node to start with
Returns:
localization info

getLocalizationInfo

LocalizationInfo getLocalizationInfo(java.lang.Integer id,
                                     java.lang.Integer nodeId)
Get localization info for a page for a given channel and all master channels

Parameters:
id - id of the page
nodeId - id of the node to start with
Returns:
localization info

takeOffline

GenericResponse takeOffline(java.lang.String id)
Take a specific page offline

Parameters:
id - ID of the page
Returns:
Generic response


Copyright © 2014 Gentics Software GmbH. All Rights Reserved.