|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.extensions.surf.site.Model
public class Model
Default implementation of the model.
Constructor Summary | |
---|---|
Model(ModelObjectManager manager)
Instantiates a new default model. |
Method Summary | |
---|---|
protected static void |
addPropertyConstraint(Map 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. |
ModelObjectManager |
getObjectManager()
Gets the object manager. |
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. |
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. |
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. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Model(ModelObjectManager manager)
manager
- the ModelObjectManagerMethod Detail |
---|
public final ModelObjectManager getObjectManager()
public Chrome getChrome(String objectId)
objectId
- the object id
public Component getComponent(String objectId)
objectId
- the object id
public Component getComponent(String scope, String regionId, String sourceId)
scope
- the scoperegionId
- the region idsourceId
- the source id
public ComponentType getComponentType(String objectId)
objectId
- the object id
public Configuration getConfiguration(String objectId)
objectId
- the object id
public ContentAssociation getContentAssociation(String objectId)
objectId
- the object id
public Page getPage(String objectId)
objectId
- the object id
public PageType getPageType(String objectId)
objectId
- the object id
public PageAssociation getPageAssociation(String objectId)
objectId
- the object id
public TemplateInstance getTemplate(String objectId)
objectId
- the object id
public TemplateType getTemplateType(String objectId)
objectId
- the object id
public Theme getTheme(String objectId)
objectId
- the object id
public Chrome newChrome()
public Chrome newChrome(String objectId)
objectId
- the object id
public Component newComponent()
public Component newComponent(String objectId)
objectId
- the object id
public Component newComponent(String scope, String regionId, String sourceId)
scope
- the scoperegionId
- the region idsourceId
- the source id
public ComponentType newComponentType()
public ComponentType newComponentType(String objectId)
objectId
- the object id
public Configuration newConfiguration()
public Configuration newConfiguration(String objectId)
objectId
- the object id
public ContentAssociation newContentAssociation()
public ContentAssociation newContentAssociation(String objectId)
objectId
- the object id
public Page newPage()
public Page newPage(String objectId)
objectId
- the object id
public PageType newPageType()
public PageType newPageType(String objectId)
objectId
- the object id
public PageAssociation newPageAssociation()
public PageAssociation newPageAssociation(String objectId)
objectId
- the object id
public TemplateInstance newTemplate()
public TemplateInstance newTemplate(String objectId)
objectId
- the object id
public TemplateType newTemplateType()
public TemplateType newTemplateType(String objectId)
objectId
- the object id
public Theme newTheme()
public Theme newTheme(String objectId)
objectId
- the object id
public boolean saveObject(ModelObject object)
object
- the object
public ModelObject getObject(String objectTypeId, String objectId)
objectTypeId
- the object type idobjectId
- the object id
public boolean removeObject(ModelObject object)
object
- the object
public boolean removeObject(String objectTypeId, String objectId)
objectTypeId
- the object type idobjectId
- the object id
public ModelObject newObject(String objectTypeId)
objectTypeId
- the object type id
public ModelObject newObject(String objectTypeId, String objectId)
objectTypeId
- the object type idobjectId
- the object id
public Map<String,ModelObject> getAllObjects(String objectTypeId)
objectTypeId
- the object type id
public Map<String,ModelObject> getAllObjects(String objectTypeId, String objectIdPattern)
Object ID patterns support wildcard '*' only i.e. "page.*.dashboard"
objectTypeId
- the object type idfilter
- the object id filter pattern
public Map<String,ModelObject> findChrome()
public Map<String,ModelObject> findChrome(String chromeType)
chromeType
- the chrome type
public Map<String,ModelObject> findConfigurations()
public Map<String,ModelObject> findConfigurations(String sourceId)
sourceId
- the source id
public Map<String,ModelObject> findPageAssociations()
public Map<String,ModelObject> findPageAssociations(String sourceId, String destId, String associationType)
sourceId
- the source iddestId
- the dest idassociationType
- the association type
public 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 id
public Map<String,ModelObject> findComponents()
public Map<String,ModelObject> findComponents(String componentTypeId)
componentTypeId
- the component type id
public Map<String,ModelObject> findComponents(String scope, String regionId, String sourceId, String componentTypeId)
scope
- the scoperegionId
- the region idsourceId
- the source idcomponentTypeId
- the component type id
public Map<String,ModelObject> findTemplates()
public Map<String,ModelObject> findTemplates(String templateType)
templateType
- the template type
public Map<String,ModelObject> findTemplateTypes()
public Map<String,ModelObject> findTemplateTypes(String uri)
uri
- the uri
public Map<String,ModelObject> findComponentTypes()
public Map<String,ModelObject> findComponentTypes(String uri)
uri
- the uri
public Map<String,ModelObject> findPages()
public Map<String,ModelObject> findPages(String templateId, String pageTypeId)
templateId
- the template idpageTypeId
- the page type id
public Map<String,ModelObject> findPageTypes()
public Map<String,ModelObject> findThemes()
public Map<String,ModelObject> findObjects(String objectTypeId)
objectTypeId
- the object type id
public void associatePage(String sourceId, String destId)
sourceId
- the source iddestId
- the dest idpublic void associatePage(String sourceId, String destId, String associationType)
sourceId
- the source iddestId
- the dest idassociationType
- the association typepublic 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)
sourceId
- the source idsourceType
- the source typedestId
- the dest idassocType
- the assoc typeformatId
- the format idpublic 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)
templateId
- the template idpageId
- the page idpublic void associateTemplate(String templateId, String pageId, String formatId)
templateId
- the template idpageId
- the page idformatId
- the format idpublic void unassociateTemplate(String pageId)
pageId
- the page idpublic void unassociateTemplate(String pageId, String formatId)
pageId
- the page idformatId
- the format idpublic void bindComponent(String componentId, String scope, String regionId, String sourceId)
componentId
- the component idscope
- the scoperegionId
- the region idsourceId
- the source idpublic void bindComponent(Component component, String scope, String regionId, String sourceId)
component
- the componentscope
- the scoperegionId
- the region idsourceId
- the source idpublic 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 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 id
public ModelObject clone(String objectTypeId, String objectId)
objectTypeId
- the object type idobjectId
- the object id
public ModelObject clone(String objectTypeId, String objectId, String newObjectId)
objectTypeId
- the object type idobjectId
- the object idnewId
- the id to set to the new object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |