Class DOFRepository

java.lang.Object
org.eclnt.ccaddons.dof.util.DOFRepository

public class DOFRepository extends Object
Repository keeps the meta data. In case of the user changing the meta data it also saves the meta data.
  • Method Details

    • instance

      public static DOFRepository instance()
      Accessing the instance.
    • designTimeInstance

      public static DOFRepository designTimeInstance(DOFProjectInfo dpi)
    • readObjectType

      public DOFObjectType readObjectType(String id, boolean withError)
      Reads object type from repository.

      The reading is done in the following steps:
      1. if the object type was passed with addObjectType(DOFObjectType) before then this instance is passed.
      2. the classloader is checked for an XML file of the object type, which is an JAXB representation of DOFObjectType. The name of this resource file is built in the following way: if the id is "abc.def.Person" then the resource file is "abc/def/DOFObjectType.Person.xml".
      3. the streamstore is checked for an XML representation. The file path is built in the following way: if the id is "abc.def.Person" then the file path ist "ccdof/abc/def/DOFObjectType.Person.xml". - The streamstore by default saves/read its info within the servlet-temp directory, which is e.g. with Tomcat "tomcat/work/Catalina/localhost/...webappName.../streamstore. Read details about the stream store within the CaptainCasa Developer's Guide.
      Parameters:
      withError - If true is passed then an error is thrown e.g. if the object type is not available. If false is passed then null is returned in case of error.
    • addObjectType

      public void addObjectType(DOFObjectType objectType)
      Adds object type into repository.
    • addObjectType

      public void addObjectType(String xml)
      Adds object type into repository. The XML is a JAXB representation of the DOFObjectType.
    • saveObjectType

      public void saveObjectType(DOFObjectType ot)
      Saves the object type in the stream store.
    • marshalObjectType

      public String marshalObjectType(DOFObjectType ot)
      Get XML representation of object type.
    • readObject

      public Object readObject(String id, Class clazz)