.. java:import:: org.apache.shiro SecurityUtils .. java:import:: org.caosdb.server.datatype CollectionValue .. java:import:: org.caosdb.server.datatype IndexedSingleValue .. java:import:: org.caosdb.server.datatype ReferenceValue .. java:import:: org.caosdb.server.entity EntityInterface .. java:import:: org.caosdb.server.entity Message .. java:import:: org.caosdb.server.utils EntityStatus .. java:import:: org.caosdb.server.utils TransactionLogMessage .. java:import:: org.jdom2 Attribute .. java:import:: org.jdom2 Element EntityToElementStrategy ======================= .. java:package:: org.caosdb.server.entity.xml :noindex: .. java:type:: public class EntityToElementStrategy implements ToElementStrategy Base class for the generation of a JDOM (XML) representation for entities. Record and RecordType entities use this class only. Properties, Parents, Files and other entities have specialized sub classes. :author: Timm Fitschen Fields ------ tagName ^^^^^^^ .. java:field:: protected final String tagName :outertype: EntityToElementStrategy Constructors ------------ EntityToElementStrategy ^^^^^^^^^^^^^^^^^^^^^^^ .. java:constructor:: public EntityToElementStrategy(String tagName) :outertype: EntityToElementStrategy Methods ------- addPermissions ^^^^^^^^^^^^^^ .. java:method:: protected void addPermissions(EntityInterface entity, Element element) :outertype: EntityToElementStrategy addToElement ^^^^^^^^^^^^ .. java:method:: @Override public Element addToElement(EntityInterface entity, Element parent, SerializeFieldStrategy serializeFieldStrategy) :outertype: EntityToElementStrategy setDatatype ^^^^^^^^^^^ .. java:method:: public void setDatatype(EntityInterface entity, Element element) :outertype: EntityToElementStrategy Set the data type of this entity as a JDOM \ :java:ref:`Attribute`\ of the given element. If the data type has a name, the name is used, otherwise the id is used. :param entity: :param element: setValue ^^^^^^^^ .. java:method:: public void setValue(EntityInterface entity, Element element, SerializeFieldStrategy serializeFieldStrategy) :outertype: EntityToElementStrategy Set the value of the entity. The setFieldStrategy decides if the value is to be set at all. If the value is a reference, the setFieldStrategy decides whether the referenced entity is added as a deep Element tree (as a whole, so to speak) or just the ID of the referenced entity. :param entity: :param element: :param serializeFieldStrategy: sparseEntityToElement ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public void sparseEntityToElement(Element element, EntityInterface entity, SerializeFieldStrategy serializeFieldStrategy) :outertype: EntityToElementStrategy Set all properties of the entity that are considered to be part of the sparse entity, e.g. name, description, etc, as \ :java:ref:`Attribute`\ of the given element. The setFieldStrategy decides which attributes are set if present and which are omitted in any case. :param element: :param entity: :param serializeFieldStrategy: toElement ^^^^^^^^^ .. java:method:: @Override public Element toElement(EntityInterface entity, SerializeFieldStrategy serializeFieldStrategy) :outertype: EntityToElementStrategy