Package org.opencms.acacia.client.entity
Class CmsEntityBackend
- java.lang.Object
-
- org.opencms.acacia.client.entity.CmsEntityBackend
-
- All Implemented Interfaces:
I_CmsEntityBackend
public final class CmsEntityBackend extends java.lang.Object implements I_CmsEntityBackend
The editor data back-end.
-
-
Constructor Summary
Constructors Constructor Description CmsEntityBackend()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changeEntityContentValues(org.opencms.acacia.shared.CmsEntity original, org.opencms.acacia.shared.CmsEntity newContent)
Changes the original entities content to the given new content.void
clearEntities()
Clears all entities from VIE.org.opencms.acacia.shared.CmsEntity
createEntity(java.lang.String entityId, java.lang.String entityType)
Creates a new entity registering it within VIE.static org.opencms.acacia.shared.CmsEntity
createFromNativeWrapper(com.google.gwt.core.client.JavaScriptObject entityWrapper)
Method to create an entity object from a wrapped instance.org.opencms.acacia.shared.CmsType
createType(java.lang.String id)
Creates a new type.java.util.List<com.google.gwt.dom.client.Element>
getAttributeElements(java.lang.String entityId, java.lang.String attributeName, com.google.gwt.dom.client.Element context)
Returns DOM elements displaying the given attribute's value.java.util.List<com.google.gwt.dom.client.Element>
getAttributeElements(org.opencms.acacia.shared.CmsEntity entity, java.lang.String attributeName, com.google.gwt.dom.client.Element context)
Returns DOM elements displaying the given attribute's value.org.opencms.acacia.shared.CmsEntity
getEntity(java.lang.String entityId)
Returns the entity with the given id.static CmsEntityBackend
getInstance()
Returns the instance.org.opencms.acacia.shared.CmsType
getType(java.lang.String id)
Returns the type with the given id/name.org.opencms.acacia.shared.CmsEntity
registerEntity(org.opencms.acacia.shared.CmsEntity entity)
Registers the given entity within the VIE model.org.opencms.acacia.shared.CmsEntity
registerEntity(org.opencms.acacia.shared.CmsEntity entity, boolean discardIds)
Registers the given entity within the VIE model.void
registerTypes(org.opencms.acacia.shared.CmsType type, java.util.Map<java.lang.String,org.opencms.acacia.shared.CmsType> types)
Registers the type and it's sub-types.void
removeEntity(java.lang.String entityId)
Removes the given entity from VIE.protected java.util.List<com.google.gwt.dom.client.Element>
select(java.lang.String selector, com.google.gwt.dom.client.Element context)
Returns a list of DOM elements matching the given selector.
-
-
-
Constructor Detail
-
CmsEntityBackend
public CmsEntityBackend()
Constructor.
-
-
Method Detail
-
createFromNativeWrapper
public static org.opencms.acacia.shared.CmsEntity createFromNativeWrapper(com.google.gwt.core.client.JavaScriptObject entityWrapper)
Method to create an entity object from a wrapped instance.- Parameters:
entityWrapper
- the wrappe entity- Returns:
- the entity
-
getInstance
public static CmsEntityBackend getInstance()
Returns the instance.- Returns:
- the instance
-
changeEntityContentValues
public void changeEntityContentValues(org.opencms.acacia.shared.CmsEntity original, org.opencms.acacia.shared.CmsEntity newContent)
Description copied from interface:I_CmsEntityBackend
Changes the original entities content to the given new content.- Specified by:
changeEntityContentValues
in interfaceI_CmsEntityBackend
- Parameters:
original
- the original entity to changenewContent
- the new content entity- See Also:
I_CmsEntityBackend.changeEntityContentValues(org.opencms.acacia.shared.CmsEntity, org.opencms.acacia.shared.CmsEntity)
-
clearEntities
public void clearEntities()
Description copied from interface:I_CmsEntityBackend
Clears all entities from VIE.- Specified by:
clearEntities
in interfaceI_CmsEntityBackend
- See Also:
I_CmsEntityBackend.clearEntities()
-
createEntity
public org.opencms.acacia.shared.CmsEntity createEntity(java.lang.String entityId, java.lang.String entityType)
Description copied from interface:I_CmsEntityBackend
Creates a new entity registering it within VIE.- Specified by:
createEntity
in interfaceI_CmsEntityBackend
- Parameters:
entityId
- the entity identityType
- the entity type- Returns:
- the new entity
- See Also:
I_CmsEntityBackend.createEntity(java.lang.String, java.lang.String)
-
createType
public org.opencms.acacia.shared.CmsType createType(java.lang.String id)
Description copied from interface:I_CmsEntityBackend
Creates a new type.- Specified by:
createType
in interfaceI_CmsEntityBackend
- Parameters:
id
- the type id/name- Returns:
- the new type
- See Also:
I_CmsEntityBackend.createType(java.lang.String)
-
getAttributeElements
public java.util.List<com.google.gwt.dom.client.Element> getAttributeElements(org.opencms.acacia.shared.CmsEntity entity, java.lang.String attributeName, com.google.gwt.dom.client.Element context)
Description copied from interface:I_CmsEntityBackend
Returns DOM elements displaying the given attribute's value.- Specified by:
getAttributeElements
in interfaceI_CmsEntityBackend
- Parameters:
entity
- the entityattributeName
- the attribute namecontext
- the context to search within- Returns:
- the elements
- See Also:
I_CmsEntityBackend.getAttributeElements(org.opencms.acacia.shared.CmsEntity, java.lang.String, com.google.gwt.dom.client.Element)
-
getAttributeElements
public java.util.List<com.google.gwt.dom.client.Element> getAttributeElements(java.lang.String entityId, java.lang.String attributeName, com.google.gwt.dom.client.Element context)
Description copied from interface:I_CmsEntityBackend
Returns DOM elements displaying the given attribute's value.- Specified by:
getAttributeElements
in interfaceI_CmsEntityBackend
- Parameters:
entityId
- the entity id/subjectattributeName
- the attribute namecontext
- the context to search within- Returns:
- the elements
- See Also:
I_CmsEntityBackend.getAttributeElements(java.lang.String, java.lang.String, com.google.gwt.dom.client.Element)
-
getEntity
public org.opencms.acacia.shared.CmsEntity getEntity(java.lang.String entityId)
Description copied from interface:I_CmsEntityBackend
Returns the entity with the given id.- Specified by:
getEntity
in interfaceI_CmsEntityBackend
- Parameters:
entityId
- the entity id- Returns:
- the entity
- See Also:
I_CmsEntityBackend.getEntity(java.lang.String)
-
getType
public org.opencms.acacia.shared.CmsType getType(java.lang.String id)
Description copied from interface:I_CmsEntityBackend
Returns the type with the given id/name.- Specified by:
getType
in interfaceI_CmsEntityBackend
- Parameters:
id
- the type id/name- Returns:
- the type
- See Also:
I_CmsEntityBackend.getType(java.lang.String)
-
registerEntity
public org.opencms.acacia.shared.CmsEntity registerEntity(org.opencms.acacia.shared.CmsEntity entity)
Description copied from interface:I_CmsEntityBackend
Registers the given entity within the VIE model.- Specified by:
registerEntity
in interfaceI_CmsEntityBackend
- Parameters:
entity
- the entity to register- Returns:
- the new registered entity object
- See Also:
I_CmsEntityBackend.registerEntity(org.opencms.acacia.shared.CmsEntity)
-
registerEntity
public org.opencms.acacia.shared.CmsEntity registerEntity(org.opencms.acacia.shared.CmsEntity entity, boolean discardIds)
Description copied from interface:I_CmsEntityBackend
Registers the given entity within the VIE model.- Specified by:
registerEntity
in interfaceI_CmsEntityBackend
- Parameters:
entity
- the entity to registerdiscardIds
-true
to discard the entity ids and generate ids- Returns:
- the new registered entity object
- See Also:
I_CmsEntityBackend.registerEntity(org.opencms.acacia.shared.CmsEntity, boolean)
-
registerTypes
public void registerTypes(org.opencms.acacia.shared.CmsType type, java.util.Map<java.lang.String,org.opencms.acacia.shared.CmsType> types)
Description copied from interface:I_CmsEntityBackend
Registers the type and it's sub-types.- Specified by:
registerTypes
in interfaceI_CmsEntityBackend
- Parameters:
type
- the type to registertypes
- the available types- See Also:
I_CmsEntityBackend.registerTypes(org.opencms.acacia.shared.CmsType, java.util.Map)
-
removeEntity
public void removeEntity(java.lang.String entityId)
Description copied from interface:I_CmsEntityBackend
Removes the given entity from VIE.- Specified by:
removeEntity
in interfaceI_CmsEntityBackend
- Parameters:
entityId
- the entity id- See Also:
I_CmsEntityBackend.removeEntity(java.lang.String)
-
select
protected java.util.List<com.google.gwt.dom.client.Element> select(java.lang.String selector, com.google.gwt.dom.client.Element context)
Returns a list of DOM elements matching the given selector.- Parameters:
selector
- the CSS selectorcontext
- the context element- Returns:
- the matching elements
-
-