public final class Repository extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ERROR_EXISTS |
static String |
ERROR_GENERIC |
static String |
ERROR_NODEREF
I18N error messages
|
static String |
ERROR_NOHOME |
static String |
ERROR_QUERY |
static String |
ERROR_SEARCH |
| Modifier and Type | Method and Description |
|---|---|
static String |
escapeQName(org.alfresco.service.namespace.QName qName)
Escape a QName value so it can be used in lucene search strings
|
static boolean |
extractMetadata(javax.faces.context.FacesContext context,
org.alfresco.service.cmr.repository.ContentReader reader,
Map<org.alfresco.service.namespace.QName,Serializable> destination)
Extracts the metadata of a "raw" piece of content into a map.
|
static org.alfresco.service.cmr.repository.NodeRef |
getCompanyRoot(javax.faces.context.FacesContext context)
Returns a company root node reference object.
|
static org.alfresco.service.cmr.repository.NodeRef |
getCompanyRoot(org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.search.SearchService searchService,
org.alfresco.service.namespace.NamespaceService namespaceService,
org.alfresco.service.cmr.repository.StoreRef storeRef,
String rootPath)
Returns a company root node reference object.
|
static org.alfresco.repo.configuration.ConfigurableService |
getConfigurableService(javax.faces.context.FacesContext context)
Return the Configurable Service
|
static String |
getDisplayPath(org.alfresco.service.cmr.repository.Path path)
Return the human readable form of the specified node Path.
|
static String |
getDisplayPath(org.alfresco.service.cmr.repository.Path path,
boolean showLeaf)
Return the human readable form of the specified node Path.
|
static boolean |
getIsGuest(javax.faces.context.FacesContext context) |
static org.alfresco.repo.content.metadata.MetadataExtracterRegistry |
getMetadataExtracterRegistry(javax.faces.context.FacesContext context)
Return the Metadata Extracter Registry
|
static String |
getMimeTypeForFile(javax.faces.context.FacesContext context,
String filename,
File file)
Return the mimetype for the specified file, based on both the
file name and the file's contents.
|
static String |
getMimeTypeForFileName(javax.faces.context.FacesContext context,
String filename)
Return the mimetype for the specified file name.
|
static String |
getNameForCategoryNode(org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.repository.NodeRef ref)
Helper to get the display name path for a category node.
|
static String |
getNameForNode(org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.repository.NodeRef ref)
Helper to get the display name for a Node.
|
static String |
getNamePath(org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.repository.Path path,
org.alfresco.service.cmr.repository.NodeRef rootNode,
String separator,
String prefix)
Resolve a Path by converting each element into its display NAME attribute
|
static String |
getNamePathEx(javax.faces.context.FacesContext context,
org.alfresco.service.cmr.repository.Path path,
org.alfresco.service.cmr.repository.NodeRef rootNode,
String separator,
String prefix)
Resolve a Path by converting each element into its display NAME attribute.
|
static org.alfresco.repo.transaction.RetryingTransactionHelper |
getRetryingTransactionHelper(javax.faces.context.FacesContext context)
Returns the transaction helper that executes a unit of work.
|
static org.alfresco.service.ServiceRegistry |
getServiceRegistry(javax.faces.context.FacesContext context)
Return the Repository Service Registry
|
static org.alfresco.service.ServiceRegistry |
getServiceRegistry(javax.servlet.ServletContext context)
Return the Repository Service Registry
|
static org.alfresco.service.cmr.repository.StoreRef |
getStoreRef()
Returns a store reference object
|
static org.alfresco.service.cmr.repository.StoreRef |
getStoreRef(javax.servlet.ServletContext context)
Returns a store reference object.
|
static List<Node> |
getUsers(javax.faces.context.FacesContext context,
org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.security.PersonService personService)
Query a list of Person type nodes from the repo
It is currently assumed that all Person nodes exist below the Repository root node
|
static List<Node> |
getUsers(javax.faces.context.FacesContext context,
org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.search.SearchService searchService)
Deprecated.
|
static UserTransaction |
getUserTransaction(javax.faces.context.FacesContext context)
Deprecated.
|
static UserTransaction |
getUserTransaction(javax.faces.context.FacesContext context,
boolean readonly)
Return a UserTransaction instance
|
static String |
guessEncoding(javax.faces.context.FacesContext context,
InputStream is,
String mimetype)
Extract the characterset from the stream
|
static Boolean |
isNodeLocked(Node node,
org.alfresco.service.cmr.lock.LockService lockService)
Return whether a Node is currently locked
|
static Boolean |
isNodeOwnerLocked(Node node,
org.alfresco.service.cmr.lock.LockService lockService)
Return whether a Node is currently locked by the current user
|
static org.alfresco.service.namespace.QName |
resolveToQName(String str)
Creates a QName representation for the given String.
|
static String |
resolveToQNameString(String str)
Creates a string representation of a QName for the given string.
|
static String |
safePropertyToString(Serializable value)
Convert a property of unknown type to a String value.
|
static void |
setupBreadcrumbLocation(javax.faces.context.FacesContext context,
NavigationBean navBean,
List<IBreadcrumbHandler> location,
org.alfresco.service.cmr.repository.NodeRef node)
Sets up the breadcrumb location representation for the given node in
the given list.
|
public static final String ERROR_NODEREF
public static final String ERROR_GENERIC
public static final String ERROR_NOHOME
public static final String ERROR_SEARCH
public static final String ERROR_QUERY
public static final String ERROR_EXISTS
public static org.alfresco.service.cmr.repository.StoreRef getStoreRef()
public static org.alfresco.service.cmr.repository.StoreRef getStoreRef(javax.servlet.ServletContext context)
public static org.alfresco.service.cmr.repository.NodeRef getCompanyRoot(javax.faces.context.FacesContext context)
public static org.alfresco.service.cmr.repository.NodeRef getCompanyRoot(org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.search.SearchService searchService,
org.alfresco.service.namespace.NamespaceService namespaceService,
org.alfresco.service.cmr.repository.StoreRef storeRef,
String rootPath)
public static String getNameForNode(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef ref)
ref - NodeRefpublic static String getNameForCategoryNode(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef ref)
nodeService - NodeServiceref - the category node refpublic static String escapeQName(org.alfresco.service.namespace.QName qName)
qName - QName to escapepublic static Boolean isNodeLocked(Node node, org.alfresco.service.cmr.lock.LockService lockService)
node - The Node wrapper to test againstlockService - The LockService to usepublic static Boolean isNodeOwnerLocked(Node node, org.alfresco.service.cmr.lock.LockService lockService)
node - The Node wrapper to test againstlockService - The LockService to usepublic static String getDisplayPath(org.alfresco.service.cmr.repository.Path path)
path - Path to extract readable form from, excluding the final elementpublic static String getDisplayPath(org.alfresco.service.cmr.repository.Path path, boolean showLeaf)
path - Path to extract readable form fromshowLeaf - Whether to process the final leaf element of the pathpublic static String getNamePath(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.Path path, org.alfresco.service.cmr.repository.NodeRef rootNode, String separator, String prefix)
path - Path to convertseparator - Separator to user between path elementsprefix - To prepend to the pathpublic static void setupBreadcrumbLocation(javax.faces.context.FacesContext context,
NavigationBean navBean,
List<IBreadcrumbHandler> location,
org.alfresco.service.cmr.repository.NodeRef node)
context - FacesContextnavBean - NavigationBean instancelocation - The location list to setupnode - The Node being navigated topublic static String getNamePathEx(javax.faces.context.FacesContext context, org.alfresco.service.cmr.repository.Path path, org.alfresco.service.cmr.repository.NodeRef rootNode, String separator, String prefix)
path - Path to convertseparator - Separator to user between path elementsprefix - To prepend to the pathpublic static String getMimeTypeForFileName(javax.faces.context.FacesContext context, String filename)
The file extension will be extracted from the filename and used to lookup the mimetype.
context - FacesContextfilename - Non-null filename to processpublic static String getMimeTypeForFile(javax.faces.context.FacesContext context, String filename, File file)
The file extension will be extracted from the filename and used along with the file contents to identify the mimetype.
context - FacesContextfilename - Non-null filename to processfile - The File object (used to read the contents)public static UserTransaction getUserTransaction(javax.faces.context.FacesContext context)
context - FacesContextgetRetryingTransactionHelper(FacesContext)public static org.alfresco.repo.transaction.RetryingTransactionHelper getRetryingTransactionHelper(javax.faces.context.FacesContext context)
context - FacesContextpublic static UserTransaction getUserTransaction(javax.faces.context.FacesContext context, boolean readonly)
context - FacesContextreadonly - Transaction readonly statepublic static org.alfresco.service.ServiceRegistry getServiceRegistry(javax.faces.context.FacesContext context)
context - Faces Contextpublic static org.alfresco.service.ServiceRegistry getServiceRegistry(javax.servlet.ServletContext context)
context - Servlet Contextpublic static org.alfresco.repo.configuration.ConfigurableService getConfigurableService(javax.faces.context.FacesContext context)
public static org.alfresco.repo.content.metadata.MetadataExtracterRegistry getMetadataExtracterRegistry(javax.faces.context.FacesContext context)
context - Faces Contextpublic static boolean extractMetadata(javax.faces.context.FacesContext context,
org.alfresco.service.cmr.repository.ContentReader reader,
Map<org.alfresco.service.namespace.QName,Serializable> destination)
context - Faces Contextreader - Content reader for the source content to extract fromdestination - Map of metadata to set metadata values intopublic static String guessEncoding(javax.faces.context.FacesContext context, InputStream is, String mimetype)
context - the Faces Contextis - the stream of characters or datamimetype - the stream's mimetype, or null if unknownpublic static List<Node> getUsers(javax.faces.context.FacesContext context, org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.search.SearchService searchService)
getUsers(FacesContext, NodeService, PersonService) insteadcontext - Faces ContextnodeService - The node servicesearchService - The search service, which is ignoredpublic static List<Node> getUsers(javax.faces.context.FacesContext context, org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.security.PersonService personService)
context - Faces ContextnodeService - The node servicepersonService - PersonServicepublic static boolean getIsGuest(javax.faces.context.FacesContext context)
public static String safePropertyToString(Serializable value)
value - Property valuepublic static org.alfresco.service.namespace.QName resolveToQName(String str)
str - The string to convertpublic static String resolveToQNameString(String str)
str - The string to convertCopyright © 2005–2018 Alfresco Software. All rights reserved.