public final class ScriptSiteData extends ScriptBase
A read-only root-scoped Java object for working with the Web Framework and the Web Framework object model.
Using this object, you can query the Web Framework object model, perform read and write operations and configure your web application.
Among the things that you can work against in the Web Framework object model are components, page, templates, configurations and associations.
| Modifier and Type | Class and Description |
|---|---|
static class |
ScriptSiteData.ScriptWebScript |
context, properties| Constructor and Description |
|---|
ScriptSiteData(RequestContext context,
org.springframework.context.ApplicationContext applicationContext)
Constructs a new ScriptSite object around the provided request context
|
| Modifier and Type | Method and Description |
|---|---|
void |
associateContent(String contentId,
String templateId,
String assocType,
String formatId) |
void |
associateContentType(String contentTypeId,
String templateId,
String assocType,
String formatId) |
void |
associatePage(String sourceId,
String destId) |
void |
associateTemplate(String templateId,
String pageId) |
void |
associateTemplate(String templateId,
String pageId,
String formatId) |
void |
bindComponent(ScriptModelObject componentObject,
String scope,
String regionId,
String sourceId) |
void |
bindComponent(String componentId,
String scope,
String regionId,
String sourceId) |
org.springframework.extensions.webscripts.ScriptableMap |
buildProperties() |
String |
decode(String input) |
String |
decode(String input,
String encoding) |
Object |
deleteObjectFromArray(Object o,
String targetAttributeKey,
String targetAttributeValue)
Deletes an object with the supplied id that matches the supplied value.
|
String |
encode(String input) |
String |
encode(String input,
String encoding) |
Object[] |
findChildPageAssociations(String sourceId,
String destId)
Searches for PageAssociation instances within the Web Application that
are of association type 'child' and which match the specified
constraints.
|
Object[] |
findChildPages(String sourceId)
Searches for child pages of the given page.
|
Object[] |
findComponents(String scope,
String regionId,
String sourceId,
String componentTypeId)
Searches for Component instances within the Web Application that
match the provided constraints.
|
org.mozilla.javascript.Scriptable |
findComponentsMap(String scope,
String regionId,
String sourceId,
String componentTypeId)
Provides a map of ScriptModelObjects that wrap Component instances.
|
ScriptModelObject |
findConfiguration(String sourceId)
Looks up Configuration instances and returns the first instance
that is found for the matching constraints.
|
Object[] |
findContentAssociations(String sourceId,
String sourceType,
String destId,
String assocType,
String formatId)
Searches for ContentAssociation instances within the Web Application that
match the specified constraints.
|
org.mozilla.javascript.Scriptable |
findContentAssociationsMap(String sourceId,
String sourceType,
String destId,
String assocType,
String formatId)
Provides a map of ScriptModelObjects that wrap ContentAssociation instances.
|
Object |
findObject(Object o,
String targetAttributeKey,
String targetAttributeValue)
Finds an object with the supplied id that matches the supplied value.
|
Object[] |
findPageAssociations(String sourceId,
String destId,
String associationType)
Searches for PageAssociation instances within the Web Application that
are of association type 'child' and which match the specified
constraints.
|
org.mozilla.javascript.Scriptable |
findPageAssociationsMap(String sourceId,
String destId,
String associationType)
Provides a map of ScriptModelObjects that wrap PageAssociation instances.
|
Object[] |
findParentPages(String pageId)
Searches for parent pages of the given page.
|
ScriptModelObject |
findTemplate(String pageId)
Looks up Template instances and returns the first instance
that is found for the matching constraints.
|
ScriptModelObject |
findTemplate(String pageId,
String formatId)
Looks up Template instances and returns the first instance
that is found for the matching constraints.
|
org.mozilla.javascript.Scriptable |
findTemplatesMap(String pageId)
Provides a map of ScriptModelObjects that wrap Template instances.
|
Object[] |
findWebScripts(String family)
Searches for webscript components with the given family name.
|
Object[] |
getChrome() |
ScriptModelObject |
getChrome(String objectId) |
org.mozilla.javascript.Scriptable |
getChromeMap() |
ScriptModelObject |
getComponent(String objectId) |
ScriptModelObject |
getComponent(String scope,
String regionId,
String sourceId) |
Object[] |
getComponents() |
org.mozilla.javascript.Scriptable |
getComponentsMap() |
ScriptModelObject |
getComponentType(String objectId) |
Object[] |
getComponentTypes() |
org.mozilla.javascript.Scriptable |
getComponentTypesMap() |
ScriptModelObject |
getConfiguration(String objectId) |
Object[] |
getConfigurations() |
org.mozilla.javascript.Scriptable |
getConfigurationsMap() |
ScriptModelObject |
getContentAssociation(String objectId) |
Object[] |
getContentAssociations() |
org.mozilla.javascript.Scriptable |
getContentAssociationsMap() |
org.springframework.extensions.webscripts.ScriptCredentialVault |
getCredentialVault() |
String |
getDojoPackageLocation(String name)
Finds the location of the supplied Dojo package.
|
String |
getFormatDescription(String formatId) |
String[] |
getFormatIds() |
String |
getFormatTitle(String formatId) |
Object[] |
getObjects(String objectTypeId) |
org.mozilla.javascript.Scriptable |
getObjectsMap(String objectTypeId) |
String |
getObjectTypeDescription(String objectTypeId) |
String[] |
getObjectTypeIds() |
String |
getObjectTypeName(String objectTypeId) |
ScriptModelObject |
getPage(String objectId) |
ScriptModelObject |
getPageAssociation(String objectId) |
Object[] |
getPageAssociations() |
org.mozilla.javascript.Scriptable |
getPageAssociationsMap() |
Object[] |
getPages() |
org.mozilla.javascript.Scriptable |
getPagesMap() |
ScriptModelObject |
getPageType(String objectId) |
Object[] |
getPageTypes() |
ScriptModelObject |
getRootPage()
Provides access to the root page for the web application.
|
ScriptModelObject |
getSiteConfiguration()
Provides access to the site configuration object for the web
application.
|
ScriptModelObject |
getTemplate(String objectId) |
Object[] |
getTemplates() |
org.mozilla.javascript.Scriptable |
getTemplatesMap() |
ScriptModelObject |
getTemplateType(String objectId) |
Object[] |
getTemplateTypes() |
org.mozilla.javascript.Scriptable |
getTemplateTypesMap() |
ScriptModelObject |
getTheme(String objectId) |
Object[] |
getThemes() |
org.mozilla.javascript.Scriptable |
getThemesMap() |
void |
logout() |
ScriptModelObject |
newChrome()
Creates a new Chrome instance.
|
ScriptModelObject |
newComponent()
Creates a new Component instance.
|
ScriptModelObject |
newComponent(String componentTypeId)
Creates a new Component instance of the given component type
The id for the instance is generated using the Web Framework's Random
GUID generator.
|
ScriptModelObject |
newComponent(String scope,
String regionId,
String sourceId)
Creates a new Component instance of the given component type.
|
ScriptModelObject |
newComponent(String componentTypeId,
String scope,
String regionId,
String sourceId)
Creates a new Component instance of the given component type.
|
ScriptModelObject |
newComponentType()
Creates a new ComponentType instance.
|
ScriptModelObject |
newConfiguration()
Creates a new Configuration instance.
|
ScriptModelObject |
newConfiguration(String sourceId)
Creates a new Configuration instance that is bound to the given sourceId.
|
ScriptModelObject |
newContentAssociation()
Creates a new ContentAssociation instance.
|
String |
newGUID()
Constructs a GUID
|
ScriptModelObject |
newObject(String objectTypeId)
Creates a new object for the given type id
|
ScriptModelObject |
newObject(String objectTypeId,
String objectId)
Creates a new object for the given type id
|
ScriptModelObject |
newPage()
Creates a new Page instance.
|
ScriptModelObject |
newPage(String id)
Creates a new Page instance with the specified ID.
|
ScriptModelObject |
newPage(String id,
String title,
String description)
Creates a new Page instance with the specified ID.
|
ScriptModelObject |
newPage(String id,
String title,
String titleId,
String description,
String descriptionId)
Creates a new Page instance with the specified ID.
|
ScriptModelObject |
newPageAssociation()
Creates a new PageAssociation instance.
|
ScriptModelObject |
newPageType(String objectId)
Creates a new PageType instance.
|
boolean |
newPreset(String presetId,
org.mozilla.javascript.Scriptable tokens)
Creates model objects based on a given preset id.
|
ScriptModelObject |
newTemplate()
Creates a new Template instance.
|
ScriptModelObject |
newTemplate(String templateTypeId)
Creates a new Template instance.
|
ScriptModelObject |
newTemplate(String templateTypeId,
String title,
String description)
Creates a new Template instance.
|
ScriptModelObject |
newTemplate(String templateTypeId,
String title,
String titleId,
String description,
String descriptionId)
Creates a new Template instance.
|
ScriptModelObject |
newTemplateType(String objectId)
Creates a new TemplateType instance.
|
ScriptModelObject |
newTheme(String objectId)
Creates a new Theme instance.
|
void |
reloadUser()
Reloads the current user into session
|
void |
removeTemplate(String pageId,
String formatId)
Looks up the given Page and unbinds any Template instances that
are bound to the page (keyed by formatId)
If you would like to remove the default Template instance,
set formatId to null
|
void |
unassociateContent(String contentId,
String templateId,
String formatId) |
void |
unassociateContentType(String contentTypeId,
String templateId,
String formatId) |
void |
unassociatePage(String sourceId,
String destId) |
void |
unassociateTemplate(String pageId) |
void |
unassociateTemplate(String pageId,
String formatId) |
void |
unbindComponent(String componentId) |
void |
unbindComponent(String scope,
String regionId,
String sourceId) |
getConfig, getObject, getObjectService, getProperties, getRequestContext, toStringpublic ScriptSiteData(RequestContext context, org.springframework.context.ApplicationContext applicationContext)
context - The RenderContext instance for the current requestapplicationContext - Required by the findWebScripts method.public org.springframework.extensions.webscripts.ScriptableMap buildProperties()
buildProperties in class ScriptBasepublic ScriptModelObject getRootPage()
public ScriptModelObject getSiteConfiguration()
public String[] getObjectTypeIds()
public Object[] getObjects(String objectTypeId)
public Object[] getChrome()
public Object[] getComponents()
public Object[] getComponentTypes()
public Object[] getConfigurations()
public Object[] getContentAssociations()
public Object[] getPages()
public Object[] getPageTypes()
public Object[] getPageAssociations()
public Object[] getTemplates()
public Object[] getTemplateTypes()
public Object[] getThemes()
public org.mozilla.javascript.Scriptable getObjectsMap(String objectTypeId)
public org.mozilla.javascript.Scriptable getChromeMap()
public org.mozilla.javascript.Scriptable getComponentsMap()
public org.mozilla.javascript.Scriptable getComponentTypesMap()
public org.mozilla.javascript.Scriptable getConfigurationsMap()
public org.mozilla.javascript.Scriptable getContentAssociationsMap()
public org.mozilla.javascript.Scriptable getPagesMap()
public org.mozilla.javascript.Scriptable getPageAssociationsMap()
public org.mozilla.javascript.Scriptable getTemplatesMap()
public org.mozilla.javascript.Scriptable getTemplateTypesMap()
public org.mozilla.javascript.Scriptable getThemesMap()
public ScriptModelObject newObject(String objectTypeId)
objectTypeId - Stringpublic ScriptModelObject newObject(String objectTypeId, String objectId)
objectTypeId - StringobjectId - Stringpublic ScriptModelObject newChrome()
public ScriptModelObject newComponent()
public ScriptModelObject newComponent(String componentTypeId)
componentTypeId - The id of the ComponentType which describes
the type of this componentpublic ScriptModelObject newComponent(String scope, String regionId, String sourceId)
scope - Scope - one of "global", "template" or "page"regionId - The id of the region to bind toosourceId - The source ID for the given scopepublic ScriptModelObject newComponent(String componentTypeId, String scope, String regionId, String sourceId)
componentTypeId - The id of the ComponentType which describes
the type of this component.scope - Scope - one of "global", "template" or "page"regionId - The id of the region to bind toosourceId - The source ID for the given scopepublic ScriptModelObject newComponentType()
public ScriptModelObject newConfiguration()
public ScriptModelObject newConfiguration(String sourceId)
sourceId - The value to assign to the sourceId propertypublic ScriptModelObject newContentAssociation()
public ScriptModelObject newPage()
public ScriptModelObject newPage(String id)
id - The id of the page instancepublic ScriptModelObject newPage(String id, String title, String description)
id - The id of the page instancetitle - The title of the page instancedescription - The description of the page instancepublic ScriptModelObject newPage(String id, String title, String titleId, String description, String descriptionId)
id - The id of the page instancetitle - The title of the page instancetitleId - Message bundle key used to look up the title of the page instancedescription - The description of the page instancedescriptionId - Message bundle key used to look up the description of the page instancepublic ScriptModelObject newPageAssociation()
public ScriptModelObject newPageType(String objectId)
public ScriptModelObject newTemplate()
public ScriptModelObject newTemplate(String templateTypeId)
templateTypeId - The id of the TemplateType object that describes
the type of this templatepublic ScriptModelObject newTemplate(String templateTypeId, String title, String description)
templateTypeId - The id of the TemplateType which describes
the type of this template.title - The name of the Template instancedescription - The description of the Template instancepublic ScriptModelObject newTemplate(String templateTypeId, String title, String titleId, String description, String descriptionId)
templateTypeId - The id of the TemplateType which describes
the type of this template.title - The name of the Template instancetitleId - Message bundle key used to look up the title of the Template instancedescription - The description of the Template instancedescriptionId - Message bundle key used to look up the description of the Template instancepublic ScriptModelObject newTemplateType(String objectId)
objectId - The id of the TemplateTypepublic ScriptModelObject newTheme(String objectId)
objectId - The id of the Themepublic boolean newPreset(String presetId, org.mozilla.javascript.Scriptable tokens) throws ModelObjectPersisterException
presetId - ID of the preset to generatetokens - Token name/value mapModelObjectPersisterExceptionpublic Object[] findComponents(String scope, String regionId, String sourceId, String componentTypeId)
scope - The value of the "scope" property of the instanceregionId - The value of the "region" property of the instancesourceId - The value of the "sourceId" property of the instancecomponentTypeId - The value of the "componentTypeId" property of the instancepublic Object[] findWebScripts(String family)
family - the familypublic Object[] findChildPageAssociations(String sourceId, String destId)
sourceId - The value of the "sourceId" property of the instancedestId - The value of the "destId" property of the instancepublic Object[] findPageAssociations(String sourceId, String destId, String associationType)
sourceId - The value of the "sourceId" property of the instancedestId - The value of the "destId" property of the instanceassociationType - The value of the "associationType" property of the instancepublic Object[] findChildPages(String sourceId)
sourceId - Stringpublic Object[] findParentPages(String pageId)
pageId - Stringpublic Object[] findContentAssociations(String sourceId, String sourceType, String destId, String assocType, String formatId)
sourceId - The value of the "sourceId" property of the instancesourceType - The value of "sourceType" property of the instancedestId - The value of the "destId" property of the instanceassocType - The value of the "assocType" property of the instanceformatId - The value of the "formatId" property of the instancepublic org.mozilla.javascript.Scriptable findComponentsMap(String scope, String regionId, String sourceId, String componentTypeId)
scope - The value of the "source" property of the instanceregionId - The value of the "regionId" property of the instancesourceId - The value of the "sourceId" property of the instancecomponentTypeId - The value of the "componentTypeId" property of the instancepublic org.mozilla.javascript.Scriptable findPageAssociationsMap(String sourceId, String destId, String associationType)
sourceId - The value of the "sourceId" property of the instancedestId - The value of the "destId" property of the instanceassociationType - The value of the "associationType" property of the instancepublic org.mozilla.javascript.Scriptable findContentAssociationsMap(String sourceId, String sourceType, String destId, String assocType, String formatId)
sourceId - The value of the "sourceId" property of the instancesourceType - The value of the "sourceType" property of the instancedestId - The value of the "destId" property of the instanceassocType - The value of the "assocType" property of the instanceformatId - The value of the "formatId" property of the instancepublic org.mozilla.javascript.Scriptable findTemplatesMap(String pageId)
pageId - The value of the "pageId" property of the instancepublic ScriptModelObject findConfiguration(String sourceId)
sourceId - The value of the "sourceId" propertypublic ScriptModelObject findTemplate(String pageId)
pageId - The value of the "pageId" propertypublic ScriptModelObject findTemplate(String pageId, String formatId)
pageId - The value of the "pageId" propertyformatId - The value of the "formatId" propertypublic void removeTemplate(String pageId, String formatId) throws ModelObjectPersisterException
pageId - The id of the PageformatId - The formatModelObjectPersisterExceptionpublic void bindComponent(String componentId, String scope, String regionId, String sourceId) throws ModelObjectPersisterException
ModelObjectPersisterExceptionpublic void bindComponent(ScriptModelObject componentObject, String scope, String regionId, String sourceId) throws ModelObjectPersisterException
ModelObjectPersisterExceptionpublic void unbindComponent(String componentId)
public void associateTemplate(String templateId, String pageId) throws ModelObjectPersisterException
ModelObjectPersisterExceptionpublic void associateTemplate(String templateId, String pageId, String formatId) throws ModelObjectPersisterException
ModelObjectPersisterExceptionpublic void unassociateTemplate(String pageId) throws ModelObjectPersisterException
ModelObjectPersisterExceptionpublic void unassociateTemplate(String pageId, String formatId) throws ModelObjectPersisterException
ModelObjectPersisterExceptionpublic void associatePage(String sourceId, String destId) throws ModelObjectPersisterException
ModelObjectPersisterExceptionpublic void associateContent(String contentId, String templateId, String assocType, String formatId) throws ModelObjectPersisterException
ModelObjectPersisterExceptionpublic void unassociateContent(String contentId, String templateId, String formatId)
public void associateContentType(String contentTypeId, String templateId, String assocType, String formatId) throws ModelObjectPersisterException
ModelObjectPersisterExceptionpublic void unassociateContentType(String contentTypeId, String templateId, String formatId)
public void logout()
public void reloadUser()
public org.springframework.extensions.webscripts.ScriptCredentialVault getCredentialVault()
public ScriptModelObject getChrome(String objectId)
public ScriptModelObject getComponent(String objectId)
public ScriptModelObject getComponent(String scope, String regionId, String sourceId)
public ScriptModelObject getComponentType(String objectId)
public ScriptModelObject getConfiguration(String objectId)
public ScriptModelObject getContentAssociation(String objectId)
public ScriptModelObject getPage(String objectId)
public ScriptModelObject getPageType(String objectId)
public ScriptModelObject getPageAssociation(String objectId)
public ScriptModelObject getTemplate(String objectId)
public ScriptModelObject getTemplateType(String objectId)
public ScriptModelObject getTheme(String objectId)
public String newGUID()
public String[] getFormatIds()
public Object findObject(Object o, String targetAttributeKey, String targetAttributeValue)
o - The object to search intargetAttributeKey - The key to search fortargetAttributeValue - The value that the target key should havepublic Object deleteObjectFromArray(Object o, String targetAttributeKey, String targetAttributeValue)
o - The object to search intargetAttributeKey - The key to search fortargetAttributeValue - The value that the target key should havepublic String getDojoPackageLocation(String name)
name - The name of the package to find (e.g. "dijit")Copyright © 2005–2016 Alfresco Software. All rights reserved.