public class ModelObjectService extends Object
| Constructor and Description |
|---|
ModelObjectService() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
addPropertyConstraint(Map<String,Object> propertyConstraintMap,
String propertyName,
Object propertyValue)
Adds the property constraint.
|
void |
associateContent(String sourceId,
String sourceType,
String destId,
String assocType,
String formatId)
Associates content to a given presentation object.
|
void |
associatePage(String sourceId,
String destId)
Associates a source Page instance to a destination Page instance.
|
void |
associatePage(String sourceId,
String destId,
String associationType)
Associates a source Page instance to a destination Page instance.
|
void |
associateTemplate(String templateId,
String pageId)
Associates a Template to a Page given their respective ids.
|
void |
associateTemplate(String templateId,
String pageId,
String formatId)
Associates a Template to a Page given their respective ids.
|
void |
bindComponent(Component component,
String scope,
String regionId,
String sourceId)
Binds a Component to a given scope, region id and source id.
|
void |
bindComponent(String componentId,
String scope,
String regionId,
String sourceId)
Binds a Component to a given scope, region id and source id.
|
ModelObject |
clone(String objectTypeId,
String objectId)
Clones a given model object
|
ModelObject |
clone(String objectTypeId,
String objectId,
String newObjectId)
Clones a given model object
|
Map<String,ModelObject> |
findChrome()
Returns a map of Chrome instances
|
Map<String,ModelObject> |
findChrome(String chromeType)
Returns a filtered map of Chrome instances.
|
Map<String,ModelObject> |
findComponents()
Returns a map of Component instances.
|
Map<String,ModelObject> |
findComponents(String componentTypeId)
Returns a filtered map of Component instances.
|
Map<String,ModelObject> |
findComponents(String scope,
String regionId,
String sourceId,
String componentTypeId)
Returns a filtered map of Component instances.
|
Map<String,ModelObject> |
findComponentTypes()
Returns a map of Component Type instances.
|
Map<String,ModelObject> |
findComponentTypes(String uri)
Returns a fitlered map of Component Type instances.
|
Map<String,ModelObject> |
findConfigurations()
Returns a map of Configuration instances.
|
Map<String,ModelObject> |
findConfigurations(String sourceId)
Returns a filtered map of Configuration instances.
|
Map<String,ModelObject> |
findContentAssociations()
Returns a map of Content Association instances.
|
Map<String,ModelObject> |
findContentAssociations(String sourceId,
String sourceType,
String destId,
String assocType,
String formatId)
Returns a filtered map of Content Association instances.
|
Map<String,ModelObject> |
findObjects(String objectTypeId)
Returns a map of objects of the given type
|
protected Map<String,ModelObject> |
findObjects(String objectTypeId,
Map<String,Object> propertyConstraintMap)
Filtering function that looks up objects of a given type id
and then applies the provided property constraint map.
|
Map<String,ModelObject> |
findPageAssociations()
Returns a map of Page Association instances.
|
Map<String,ModelObject> |
findPageAssociations(String sourceId,
String destId,
String associationType)
Returns a filtered map of Page Association instances.
|
Map<String,ModelObject> |
findPages()
Returns a map of Page instances.
|
Map<String,ModelObject> |
findPages(String templateId,
String pageTypeId)
Returns a filtered map of Page instances.
|
Map<String,ModelObject> |
findPageTypes()
Returns a map of Page Type instances.
|
Map<String,ModelObject> |
findTemplates()
Returns a map of Template instances.
|
Map<String,ModelObject> |
findTemplates(String templateType)
Returns a filtered map of Template instances.
|
Map<String,ModelObject> |
findTemplateTypes()
Returns a map of Template Type instances.
|
Map<String,ModelObject> |
findTemplateTypes(String uri)
Returns a filtered map of Template Type instances.
|
Map<String,ModelObject> |
findThemes()
Returns a map of Theme instances.
|
Map<String,ModelObject> |
getAllObjects(String objectTypeId)
Returns a map with all object instances of the given type.
|
Map<String,ModelObject> |
getAllObjects(String objectTypeId,
String objectIdPattern)
Returns a map with all object instances of the given type filtered
by the given object ID filter pattern.
|
Chrome |
getChrome(String objectId)
Gets the Chrome instance with the given id.
|
Component |
getComponent(String objectId)
Gets the component instance with the given id.
|
Component |
getComponent(String scope,
String regionId,
String sourceId)
Gets the component instance by its binding
|
ComponentType |
getComponentType(String objectId)
Gets the Component Type instance with the given id
|
Configuration |
getConfiguration(String objectId)
Gets the Configuration instance with the given id
|
ContentAssociation |
getContentAssociation(String objectId)
Gets the Content Association instance with the given id
|
ModelObject |
getObject(String objectTypeId,
String objectId)
Gets an object instance of the given type and with the given id.
|
ObjectPersistenceService |
getObjectPersistenceService()
Gets the object persistence service
|
Page |
getPage(String objectId)
Gets the Page instance with the given id
|
PageAssociation |
getPageAssociation(String objectId)
Gets the Page Association instance with the given id
|
PageType |
getPageType(String objectId)
Gets the Page Type instance with the given id.
|
SurfBug |
getSurfBug(String objectId)
Gets the SurfBug instance for the id provided.
|
TemplateInstance |
getTemplate(String objectId)
Gets the Template instance with the given id
|
TemplateType |
getTemplateType(String objectId)
Gets the Template Type instance with the given id.
|
Theme |
getTheme(String objectId)
Gets the Theme instance with the given id.
|
boolean |
hasObject(String objectTypeId,
String objectId) |
boolean |
hasPage(String objectId) |
Chrome |
newChrome()
Creates a new Chrome instance.
|
Chrome |
newChrome(String objectId)
Creates a new Chrome instance with the given id.
|
Component |
newComponent()
Creates a new Component instance.
|
Component |
newComponent(String objectId)
Creates a new Component instance with the given id.
|
Component |
newComponent(String scope,
String regionId,
String sourceId)
Creates a new Component instance with the given binding properties.
|
ComponentType |
newComponentType()
Creates a new Component Type instance.
|
ComponentType |
newComponentType(String objectId)
Creates a new Component Type instance with the given id.
|
Configuration |
newConfiguration()
Creates a new Configuration instance.
|
Configuration |
newConfiguration(String objectId)
Creates a new Configuration instance with the given id.
|
ContentAssociation |
newContentAssociation()
Creates a new Content Association instance.
|
ContentAssociation |
newContentAssociation(String objectId)
Creates a new Content Association instance with the given id.
|
ModelObject |
newObject(String objectTypeId)
Creates a new object instance with the given object type id.
|
ModelObject |
newObject(String objectTypeId,
String objectId)
Creates new object instance with teh given object type id and object id.
|
Page |
newPage()
Creates a new Page instance.
|
Page |
newPage(String objectId)
Creates a new Page instance with the given id.
|
PageAssociation |
newPageAssociation()
Creates a new Page Association instance.
|
PageAssociation |
newPageAssociation(String objectId)
Creates a new Page Association instance with the given id.
|
PageType |
newPageType()
Creates a new Page Type instance.
|
PageType |
newPageType(String objectId)
Creates a new Page Type instance with the given id.
|
protected Map<String,Object> |
newPropertyConstraintMap()
Creates a new property constraint map.
|
TemplateInstance |
newTemplate()
Creates a new Template instance.
|
TemplateInstance |
newTemplate(String objectId)
Creates a new Template instance with the given id.
|
TemplateType |
newTemplateType()
Creates a new Template Type instance.
|
TemplateType |
newTemplateType(String objectId)
Creates a new Template Type instance with the given id.
|
Theme |
newTheme()
Creates a new Theme instance.
|
Theme |
newTheme(String objectId)
Creates a new Theme instance with the given id.
|
boolean |
removeObject(ModelObject object)
Removes the given object.
|
boolean |
removeObject(String objectTypeId,
String objectId)
Removes the object with the given object type and object id.
|
boolean |
saveObject(ModelObject object)
Saves the given object.
|
boolean |
saveObjects(List<ModelObject> objects)
Saves the given objects.
|
void |
setObjectPersistenceService(ObjectPersistenceService service)
Sets the object persistence service
|
void |
unassociateContent(String objectAssociationId)
Unassociates content given a Content Association instance id.
|
void |
unassociateContent(String sourceId,
String sourceType,
String destId,
String assocType,
String formatId)
Unassociates content from a given presentation object.
|
void |
unassociatePage(String pageAssociationId)
Unassociates a page given its Page Association instance id.
|
void |
unassociatePage(String sourceId,
String destId)
Unassociates a destination Page instance from a source Page instance.
|
void |
unassociatePage(String sourceId,
String destId,
String associationTypeId)
Unassociates a destination Page instance from a source Page instance.
|
void |
unassociateTemplate(String pageId)
Unassociates a Template from a Page.
|
void |
unassociateTemplate(String pageId,
String formatId)
Unassociates a Template from a Page.
|
void |
unbindComponent(String componentId)
Removes a Component binding with the given Component id.
|
void |
unbindComponent(String scope,
String regionId,
String sourceId)
Removes a Component binding with the given binding properties.
|
public void setObjectPersistenceService(ObjectPersistenceService service)
service - object persistence servicepublic ObjectPersistenceService getObjectPersistenceService()
public Chrome getChrome(String objectId)
objectId - the object idpublic SurfBug getSurfBug(String objectId)
Gets the SurfBug instance for the id provided. The instance of SurfBug that
will be used for debugging should be specified by through the <surfbug> config
element in the Spring Surf configuration. The default SurfBug instance is
defined in "default-surfbug.xml" but is can be overridden by application config.
objectId - The id of the SurfBug to locate.public Component getComponent(String objectId)
objectId - the object idpublic Component getComponent(String scope, String regionId, String sourceId)
scope - the scoperegionId - the region idsourceId - the source idpublic ComponentType getComponentType(String objectId)
objectId - the object idpublic Configuration getConfiguration(String objectId)
objectId - the object idpublic ContentAssociation getContentAssociation(String objectId)
objectId - the object idpublic Page getPage(String objectId)
objectId - the object idpublic PageType getPageType(String objectId)
objectId - the object idpublic PageAssociation getPageAssociation(String objectId)
objectId - the object idpublic TemplateInstance getTemplate(String objectId)
objectId - the object idpublic TemplateType getTemplateType(String objectId)
objectId - the object idpublic Theme getTheme(String objectId)
objectId - the object idpublic Chrome newChrome()
public Chrome newChrome(String objectId)
objectId - the object idpublic Component newComponent()
public Component newComponent(String objectId)
objectId - the object idpublic Component newComponent(String scope, String regionId, String sourceId)
scope - the scoperegionId - the region idsourceId - the source idpublic ComponentType newComponentType()
public ComponentType newComponentType(String objectId)
objectId - the object idpublic Configuration newConfiguration()
public Configuration newConfiguration(String objectId)
objectId - the object idpublic ContentAssociation newContentAssociation()
public ContentAssociation newContentAssociation(String objectId)
objectId - the object idpublic Page newPage()
public Page newPage(String objectId)
objectId - the object idpublic PageType newPageType()
public PageType newPageType(String objectId)
objectId - the object idpublic PageAssociation newPageAssociation()
public PageAssociation newPageAssociation(String objectId)
objectId - the object idpublic TemplateInstance newTemplate()
public TemplateInstance newTemplate(String objectId)
objectId - the object idpublic TemplateType newTemplateType()
public TemplateType newTemplateType(String objectId)
objectId - the object idpublic Theme newTheme()
public Theme newTheme(String objectId)
objectId - the object idpublic boolean saveObject(ModelObject object) throws ModelObjectPersisterException
object - the objectModelObjectPersisterExceptionpublic boolean saveObjects(List<ModelObject> objects) throws ModelObjectPersisterException
objects - the objectsModelObjectPersisterExceptionpublic ModelObject getObject(String objectTypeId, String objectId)
objectTypeId - the object type idobjectId - the object idpublic boolean removeObject(ModelObject object)
object - the objectpublic boolean removeObject(String objectTypeId, String objectId)
objectTypeId - the object type idobjectId - the object idpublic ModelObject newObject(String objectTypeId)
objectTypeId - the object type idpublic ModelObject newObject(String objectTypeId, String objectId)
objectTypeId - the object type idobjectId - the object idpublic Map<String,ModelObject> getAllObjects(String objectTypeId)
objectTypeId - the object type idpublic Map<String,ModelObject> getAllObjects(String objectTypeId, String objectIdPattern)
Object ID patterns support wildcard '*' only i.e. "page.*.dashboard"
objectTypeId - the object type idobjectIdPattern - the object id filter patternpublic Map<String,ModelObject> findChrome()
public Map<String,ModelObject> findChrome(String chromeType)
chromeType - the chrome typepublic Map<String,ModelObject> findConfigurations()
public Map<String,ModelObject> findConfigurations(String sourceId)
sourceId - the source idpublic Map<String,ModelObject> findPageAssociations()
public Map<String,ModelObject> findPageAssociations(String sourceId, String destId, String associationType)
sourceId - the source iddestId - the dest idassociationType - the association typepublic Map<String,ModelObject> findContentAssociations()
public Map<String,ModelObject> findContentAssociations(String sourceId, String sourceType, String destId, String assocType, String formatId)
sourceId - the source idsourceType - the source typedestId - the dest idassocType - the assoc typeformatId - the format idpublic Map<String,ModelObject> findComponents()
public Map<String,ModelObject> findComponents(String componentTypeId)
componentTypeId - the component type idpublic Map<String,ModelObject> findComponents(String scope, String regionId, String sourceId, String componentTypeId)
scope - the scoperegionId - the region idsourceId - the source idcomponentTypeId - the component type idpublic Map<String,ModelObject> findTemplates()
public Map<String,ModelObject> findTemplates(String templateType)
templateType - the template typepublic Map<String,ModelObject> findTemplateTypes()
public Map<String,ModelObject> findTemplateTypes(String uri)
uri - the uripublic Map<String,ModelObject> findComponentTypes()
public Map<String,ModelObject> findComponentTypes(String uri)
uri - the uripublic Map<String,ModelObject> findPages()
public Map<String,ModelObject> findPages(String templateId, String pageTypeId)
templateId - the template idpageTypeId - the page type idpublic Map<String,ModelObject> findPageTypes()
public Map<String,ModelObject> findThemes()
public Map<String,ModelObject> findObjects(String objectTypeId)
objectTypeId - the object type idpublic void associatePage(String sourceId, String destId) throws ModelObjectPersisterException
sourceId - the source iddestId - the dest idModelObjectPersisterExceptionpublic void associatePage(String sourceId, String destId, String associationType) throws ModelObjectPersisterException
sourceId - the source iddestId - the dest idassociationType - the association typeModelObjectPersisterExceptionpublic void unassociatePage(String sourceId, String destId)
sourceId - the source iddestId - the dest idpublic void unassociatePage(String sourceId, String destId, String associationTypeId)
sourceId - the source iddestId - the dest idassociationTypeId - the association type idpublic void unassociatePage(String pageAssociationId)
pageAssociationId - the page association idpublic void associateContent(String sourceId, String sourceType, String destId, String assocType, String formatId) throws ModelObjectPersisterException
sourceId - the source idsourceType - the source typedestId - the dest idassocType - the assoc typeformatId - the format idModelObjectPersisterExceptionpublic void unassociateContent(String sourceId, String sourceType, String destId, String assocType, String formatId)
sourceId - the source idsourceType - the source typedestId - the dest idassocType - the assoc typeformatId - the format idpublic void unassociateContent(String objectAssociationId)
objectAssociationId - the object association idpublic void associateTemplate(String templateId, String pageId) throws ModelObjectPersisterException
templateId - the template idpageId - the page idModelObjectPersisterExceptionpublic void associateTemplate(String templateId, String pageId, String formatId) throws ModelObjectPersisterException
templateId - the template idpageId - the page idformatId - the format idModelObjectPersisterExceptionpublic void unassociateTemplate(String pageId) throws ModelObjectPersisterException
pageId - the page idModelObjectPersisterExceptionpublic void unassociateTemplate(String pageId, String formatId) throws ModelObjectPersisterException
pageId - the page idformatId - the format idModelObjectPersisterExceptionpublic void bindComponent(String componentId, String scope, String regionId, String sourceId) throws ModelObjectPersisterException
componentId - the component idscope - the scoperegionId - the region idsourceId - the source idModelObjectPersisterExceptionpublic void bindComponent(Component component, String scope, String regionId, String sourceId) throws ModelObjectPersisterException
component - the componentscope - the scoperegionId - the region idsourceId - the source idModelObjectPersisterExceptionpublic void unbindComponent(String componentId)
componentId - the component idpublic void unbindComponent(String scope, String regionId, String sourceId)
scope - the scoperegionId - the region idsourceId - the source idprotected Map<String,Object> newPropertyConstraintMap()
protected static void addPropertyConstraint(Map<String,Object> propertyConstraintMap, String propertyName, Object propertyValue)
propertyConstraintMap - the property constraint mappropertyName - the property namepropertyValue - the property valueprotected Map<String,ModelObject> findObjects(String objectTypeId, Map<String,Object> propertyConstraintMap)
propertyConstraintMap - the property constraint mapobjectTypeId - the object type idpublic boolean hasPage(String objectId)
objectId - to test forpublic boolean hasObject(String objectTypeId, String objectId)
objectTypeId - to test forobjectId - to test forpublic ModelObject clone(String objectTypeId, String objectId)
objectTypeId - the object type idobjectId - the object idpublic ModelObject clone(String objectTypeId, String objectId, String newObjectId)
objectTypeId - the object type idobjectId - the object idnewObjectId - the id to set to the new objectCopyright © 2005–2016 Alfresco Software. All rights reserved.