public class AlfrescoEmbUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALFRESCO_DAO_UTILS_BEAN_ID |
static java.util.List<org.alfresco.service.namespace.QName> |
internalAlfrescoProperties |
protected static boolean |
isMultiTenancy |
Constructor and Description |
---|
AlfrescoEmbUtil() |
Modifier and Type | Method and Description |
---|---|
static EnhancedObjectProperty |
createEnhancedObjectProperty(java.lang.String propName,
java.lang.Object propValue,
org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService,
org.alfresco.service.namespace.NamespaceService namespaceService) |
static void |
createNativeDataProperties(java.lang.Object propValue,
java.util.List<EnhancedObjectProperty> eops)
Helper method to set content data properties
|
static void |
createRenditionDataProperties(java.lang.Object propValue,
java.util.List<EnhancedObjectProperty> eops)
Helper method to set content data properties
|
static java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> |
enhancedToQNameProperties(EnhancedObjectProperty[] props,
org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService,
org.alfresco.service.namespace.NamespaceService namespaceService) |
static AlfrescoEmbConfig |
getAlfrescoEmbConfig()
Wrapper function which returns the configured AlfrescoEmbConfig bean
|
static org.alfresco.service.cmr.repository.NodeRef |
getCompanyHome(org.alfresco.service.ServiceRegistry serviceRegistry) |
static java.lang.String |
getIdByPathOrId(org.alfresco.service.ServiceRegistry serviceRegistry,
java.lang.String pathOrId)
This method takes in a string that could represent either a path or an objectId
and if it's a path, it returns the object Id
|
static org.alfresco.service.cmr.repository.NodeRef |
getNodeRefByPath(org.alfresco.service.ServiceRegistry serviceRegistry,
java.lang.String path)
There are unfortunately a bunch of different ways that a path could be formatted.
|
static org.alfresco.service.cmr.repository.NodeRef |
getWorkingCopy(org.alfresco.service.ServiceRegistry serviceRegistry,
org.alfresco.service.cmr.repository.NodeRef nodeRef)
Helper method that returns the nodeRef of the working copy for a node if a working copy exists.
|
static org.alfresco.service.cmr.repository.NodeRef |
getWorkingCopyIfExists(org.alfresco.service.ServiceRegistry serviceRegistry,
org.alfresco.service.cmr.repository.NodeRef nodeRef)
Deprecated.
- Use getWorkingCopy
Helper method that returns the nodeRef of the working copy for a node if a working copy exists. If there is no working copy, the original nodeRef is returned.
|
static boolean |
isChainVersionable(org.alfresco.service.ServiceRegistry serviceRegistry,
org.alfresco.service.cmr.repository.NodeRef nodeRef)
Returns true if the Chain Versionable module is currently active in OC,
and if so, if the node is itself Chain Versionable.
|
static boolean |
isControlledDoc(org.alfresco.service.ServiceRegistry serviceRegistry,
org.alfresco.service.cmr.repository.NodeRef nodeRef)
Returns true is the nodeRef is a controlled document.
|
static boolean |
isLegacyType(org.alfresco.service.ServiceRegistry serviceRegistry,
org.alfresco.service.cmr.repository.NodeRef nodeRef)
Returns true if the nodeRef is a legacy type controlled document.
|
static boolean |
isQualityDoc(org.alfresco.service.ServiceRegistry serviceRegistry,
org.alfresco.service.cmr.repository.NodeRef nodeRef)
Returns true if the nodeRef is a quality document.
|
static EnhancedObjectProperty[] |
nodeRefToEnhancedProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> nodeProps,
java.util.List<org.alfresco.service.namespace.QName> propsToConvert,
org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService,
org.alfresco.service.namespace.NamespaceService namespaceService) |
static java.util.List<QueryResultRow> |
parseSearchResults(java.util.List<org.alfresco.service.cmr.repository.NodeRef> searchResults,
boolean distinctQuery,
boolean allAttributes,
java.util.List<org.alfresco.service.namespace.QName> selectAttrs,
org.alfresco.service.ServiceRegistry serviceRegistry) |
static boolean |
propertyChanged(org.alfresco.service.namespace.QName propToCheckForChange,
java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> before,
java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> after)
Helper method to determine if a property value has changed or not.
|
static java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> |
propertyMapToQNameProperties(java.util.Map<java.lang.String,java.lang.Object> props,
org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService,
org.alfresco.service.namespace.NamespaceService namespaceService) |
static EnhancedObjectProperty[] |
qnameToEnhancedProperties(java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> nodeProps,
org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService,
org.alfresco.service.namespace.NamespaceService namespaceService)
Converts a map of properties keyed by QName into an EnhancedObjectProperty array.
|
static java.lang.String |
qnameToOCName(org.alfresco.service.namespace.QName qName,
org.alfresco.service.namespace.NamespacePrefixResolver prefixResolver)
Accepts a QName and a prefix resolver and returns prefix_local (the OC name)
|
void |
setIsMultiTenancy(boolean isMultiTenancy) |
static void |
updateVersionHistory(org.alfresco.service.ServiceRegistry serviceRegistry,
org.alfresco.service.cmr.repository.NodeRef nodeRef)
This method takes the properties of the given node and ensures those properties are persisted to its backing versionStore node,
as Alfresco's default behavior is to let versionStore nodes languish with only the properties in the state that they were
at the time of the version's creation.
|
protected static boolean isMultiTenancy
public static final java.util.List<org.alfresco.service.namespace.QName> internalAlfrescoProperties
public static final java.lang.String ALFRESCO_DAO_UTILS_BEAN_ID
public void setIsMultiTenancy(boolean isMultiTenancy)
public static org.alfresco.service.cmr.repository.NodeRef getCompanyHome(org.alfresco.service.ServiceRegistry serviceRegistry)
public static java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> propertyMapToQNameProperties(java.util.Map<java.lang.String,java.lang.Object> props, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService, org.alfresco.service.namespace.NamespaceService namespaceService)
public static boolean isLegacyType(org.alfresco.service.ServiceRegistry serviceRegistry, org.alfresco.service.cmr.repository.NodeRef nodeRef)
serviceRegistry
- nodeRef
- public static boolean isQualityDoc(org.alfresco.service.ServiceRegistry serviceRegistry, org.alfresco.service.cmr.repository.NodeRef nodeRef)
serviceRegistry
- nodeRef
- public static boolean isControlledDoc(org.alfresco.service.ServiceRegistry serviceRegistry, org.alfresco.service.cmr.repository.NodeRef nodeRef)
serviceRegistry
- nodeRef
- public static java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> enhancedToQNameProperties(EnhancedObjectProperty[] props, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService, org.alfresco.service.namespace.NamespaceService namespaceService)
public static EnhancedObjectProperty[] nodeRefToEnhancedProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> nodeProps, java.util.List<org.alfresco.service.namespace.QName> propsToConvert, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService, org.alfresco.service.namespace.NamespaceService namespaceService)
public static java.lang.String qnameToOCName(org.alfresco.service.namespace.QName qName, org.alfresco.service.namespace.NamespacePrefixResolver prefixResolver)
qName
- alfresco qualified nameprefixResolver
- alfresco namespace prefix resolverpublic static EnhancedObjectProperty[] qnameToEnhancedProperties(java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> nodeProps, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService, org.alfresco.service.namespace.NamespaceService namespaceService)
nodeProps
- the properties keyed by QName to convert to an EnhancedObjectProperty array.dictionaryService
- the Alfresco dictionaryService to use for creating our EOP.namespaceService
- the Alfresco namespaceService to use for getting our prefix string for creating our EOP.public static EnhancedObjectProperty createEnhancedObjectProperty(java.lang.String propName, java.lang.Object propValue, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService, org.alfresco.service.namespace.NamespaceService namespaceService)
public static java.util.List<QueryResultRow> parseSearchResults(java.util.List<org.alfresco.service.cmr.repository.NodeRef> searchResults, boolean distinctQuery, boolean allAttributes, java.util.List<org.alfresco.service.namespace.QName> selectAttrs, org.alfresco.service.ServiceRegistry serviceRegistry)
@Deprecated public static org.alfresco.service.cmr.repository.NodeRef getWorkingCopyIfExists(org.alfresco.service.ServiceRegistry serviceRegistry, org.alfresco.service.cmr.repository.NodeRef nodeRef)
nodeRef
- public static org.alfresco.service.cmr.repository.NodeRef getWorkingCopy(org.alfresco.service.ServiceRegistry serviceRegistry, org.alfresco.service.cmr.repository.NodeRef nodeRef)
nodeRef
- public static void updateVersionHistory(org.alfresco.service.ServiceRegistry serviceRegistry, org.alfresco.service.cmr.repository.NodeRef nodeRef)
serviceRegistry
- nodeRef
- public static java.lang.String getIdByPathOrId(org.alfresco.service.ServiceRegistry serviceRegistry, java.lang.String pathOrId)
serviceRegistry
- pathOrId
- the string representing either the object path or the objectIdpublic static org.alfresco.service.cmr.repository.NodeRef getNodeRefByPath(org.alfresco.service.ServiceRegistry serviceRegistry, java.lang.String path)
serviceRegistry
- path
- the path that could be in any one of the mentioned formats for which to find a node refOCObjectNotFoundException
- if unable to find the path specifiedpublic static void createNativeDataProperties(java.lang.Object propValue, java.util.List<EnhancedObjectProperty> eops)
{Object}
- propValue{List}
- eopspublic static void createRenditionDataProperties(java.lang.Object propValue, java.util.List<EnhancedObjectProperty> eops)
{Object}
- propValue{List}
- eopspublic static boolean propertyChanged(org.alfresco.service.namespace.QName propToCheckForChange, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> before, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> after)
propToCheckForChange
- the QName of the property to check if it's been changed or not.before
- the map of properties before the properties were updated.after
- the map of properties after the properties were updated.public static AlfrescoEmbConfig getAlfrescoEmbConfig()
public static boolean isChainVersionable(org.alfresco.service.ServiceRegistry serviceRegistry, org.alfresco.service.cmr.repository.NodeRef nodeRef)
serviceRegistry
- nodeRef
-