org.eclipse.stardust.engine.core.runtime.beans
Class DocumentTypeUtils

java.lang.Object
  extended by org.eclipse.stardust.engine.core.runtime.beans.DocumentTypeUtils

public final class DocumentTypeUtils
extends Object


Method Summary
static List<Data> getDataUsingDocumentType(DeployedModel model, DocumentType documentType)
          Retrieves Document and DocumentList data from the given model which uses the type definition defined by the given DocumentType.
static List<DocumentType> getDeclaredDocumentTypes(Model model)
          Creates DocumentType objects based on the Document and DocumentList data having a TypeDeclaration assigned in the given model.
static List<DocumentType> getDeclaredDocumentTypes(Model model, Map<Integer,Model> referenceModels)
          Creates DocumentType objects based on the Document and DocumentList data having a TypeDeclaration assigned in the given model.
static DocumentType getDocumentType(String typeDeclarationId, Model model)
           
static DocumentType getDocumentTypeFromData(Model model, Data data)
          Retrieves the DocumentType used in the specified data.
static Set<DocumentType> getDocumentTypesFromData(Model model, List<Data> dataList)
          Retrieves the DocumentTypes used in the specified data.
static String getMetaDataTypeDeclarationId(Data data)
           
static List<Data> getReferencedDocumentData(DeployedModel model)
          Retrieves data which are of type Document or DocumentList and having a Reference to an external TypeDefinition or data which is externally defined itself.
static String getUnversionedInfoPath(String documentTypeId)
          This folder hosts version unspecific settings for all Document Types of a particular Document Type ID
static String getVersionedInfoPath(String documentTypeId, String schemaLocation)
          This folder hosts version specific settings for a particular Document Type with the specified Document Type Schema Location
static String getXsdDocumentName()
          The document name all xsd schemas are stored and retrieved with.
static String getXsdDocumentPath(String schemaLocation)
           
static String getXsdFolderPath(String schemaLocation)
           
static DocumentType inferDocumentType(org.eclipse.stardust.engine.api.model.IData data)
          For internal use only.
static DocumentType inferDocumentTypeAndStoreDocument(org.eclipse.stardust.engine.api.model.IData data, Document document, DocumentManagementService dms)
          For internal use only.
static boolean isDmsDocumentData(String dataTypeId)
           
static boolean isValidForDeployment(DocumentInfo documentInfo)
          for internal use Checks if the xsd referenced by DocumentType.getSchemaLocation exists in the repository.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isValidForDeployment

public static boolean isValidForDeployment(DocumentInfo documentInfo)
for internal use Checks if the xsd referenced by DocumentType.getSchemaLocation exists in the repository. If it is not found it is searched across all deployed models and resynced if it was found. If the documentType only contains a DocumentTypeId, all currently active models document types matching the DocumentTypeId are retrieved and the schemaLocation is set to the first match. If no match is found the document type is considered invalid.

Parameters:
documentInfo -
Returns:
returns true for valid document types

inferDocumentType

public static DocumentType inferDocumentType(org.eclipse.stardust.engine.api.model.IData data)
For internal use only.

Parameters:
data -
Returns:
document type of the data if it is available

inferDocumentTypeAndStoreDocument

public static DocumentType inferDocumentTypeAndStoreDocument(org.eclipse.stardust.engine.api.model.IData data,
                                                             Document document,
                                                             DocumentManagementService dms)
For internal use only.

Parameters:
data -
document -
dms -
Returns:
document type of the data if it is available
Throws:
org.eclipse.stardust.common.error.InvalidValueException - if a incompatible document type is set on the document.

getDocumentType

public static DocumentType getDocumentType(String typeDeclarationId,
                                           Model model)

isDmsDocumentData

public static boolean isDmsDocumentData(String dataTypeId)

getMetaDataTypeDeclarationId

public static String getMetaDataTypeDeclarationId(Data data)

getDeclaredDocumentTypes

public static List<DocumentType> getDeclaredDocumentTypes(Model model)
Creates DocumentType objects based on the Document and DocumentList data having a TypeDeclaration assigned in the given model.
It does not resolve the DocumentType of Document or DocumentList data referencing a TypeDeclaration from a external model reference or externally referenced data.

Parameters:
model - The model to search for declared DocumenTypes.
Returns:
A list of DocumentType that are declared within the specified model.
See Also:
getDeclaredDocumentTypes(Model, Map)

getDeclaredDocumentTypes

public static List<DocumentType> getDeclaredDocumentTypes(Model model,
                                                          Map<Integer,Model> referenceModels)
Creates DocumentType objects based on the Document and DocumentList data having a TypeDeclaration assigned in the given model.

Parameters:
model - The model to search for declared DocumenTypes.
referenceModels - A map of models by modelOID. It should contain all models which could be referenced by the specified model.
Returns:
A list of DocumentType that are declared within the specified model.

getReferencedDocumentData

public static List<Data> getReferencedDocumentData(DeployedModel model)
Retrieves data which are of type Document or DocumentList and having a Reference to an external TypeDefinition or data which is externally defined itself.

Parameters:
model - The model to search for data referencing DocumentTypes.
Returns:
A List of data referencing DocumentTypes.

getDataUsingDocumentType

public static List<Data> getDataUsingDocumentType(DeployedModel model,
                                                  DocumentType documentType)
Retrieves Document and DocumentList data from the given model which uses the type definition defined by the given DocumentType.

Parameters:
model - The model containing the data and type definitions.
documentType - The documentType to retrieve matching data for. If documentType is null data not having a documentType assigned are returned.
Returns:
Data using the specified DocumentType.

getDocumentTypesFromData

public static Set<DocumentType> getDocumentTypesFromData(Model model,
                                                         List<Data> dataList)
Retrieves the DocumentTypes used in the specified data.

Parameters:
model -
dataList -
Returns:
Set of DocumentType's of the data's

getDocumentTypeFromData

public static DocumentType getDocumentTypeFromData(Model model,
                                                   Data data)
Retrieves the DocumentType used in the specified data.

Parameters:
model -
data -
Returns:
DocumentType of the data

getUnversionedInfoPath

public static String getUnversionedInfoPath(String documentTypeId)
This folder hosts version unspecific settings for all Document Types of a particular Document Type ID

Parameters:
documentTypeId -
Returns:
the path for the document type ID

getVersionedInfoPath

public static String getVersionedInfoPath(String documentTypeId,
                                          String schemaLocation)
This folder hosts version specific settings for a particular Document Type with the specified Document Type Schema Location

Parameters:
documentTypeId -
schemaLocation -
Returns:
the path for the document type ID

getXsdDocumentName

public static String getXsdDocumentName()
The document name all xsd schemas are stored and retrieved with.

Returns:
The XSD document name

getXsdDocumentPath

public static String getXsdDocumentPath(String schemaLocation)
Parameters:
schemaLocation -
Returns:
path of the schema location and the XSD document in the repository

getXsdFolderPath

public static String getXsdFolderPath(String schemaLocation)
Parameters:
schemaLocation -
Returns:
path of the schema location in the repository


Copyright © 2017 Eclipse Stardust. All Rights Reserved.