|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.web.bean.repository.Repository
public final class Repository
Helper class for accessing repository objects, convert values, escape values and service utilities.
Field Summary | |
---|---|
static java.lang.String |
ERROR_EXISTS
|
static java.lang.String |
ERROR_GENERIC
|
static java.lang.String |
ERROR_NODEREF
I18N error messages |
static java.lang.String |
ERROR_NOHOME
|
static java.lang.String |
ERROR_QUERY
|
static java.lang.String |
ERROR_SEARCH
|
Method Summary | |
---|---|
static java.lang.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,
java.util.Map 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,
java.lang.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 java.lang.String |
getDisplayPath(org.alfresco.service.cmr.repository.Path path)
Return the human readable form of the specified node Path. |
static java.lang.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 java.lang.String |
getMimeTypeForFile(javax.faces.context.FacesContext context,
java.lang.String filename,
java.io.File file)
Return the mimetype for the specified file, based on both the file name and the file's contents. |
static java.lang.String |
getMimeTypeForFileName(javax.faces.context.FacesContext context,
java.lang.String filename)
Return the mimetype for the specified file name. |
static java.lang.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 java.lang.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 java.lang.String |
getNamePath(org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.repository.Path path,
org.alfresco.service.cmr.repository.NodeRef rootNode,
java.lang.String separator,
java.lang.String prefix)
Resolve a Path by converting each element into its display NAME attribute |
static java.lang.String |
getNamePathEx(javax.faces.context.FacesContext context,
org.alfresco.service.cmr.repository.Path path,
org.alfresco.service.cmr.repository.NodeRef rootNode,
java.lang.String separator,
java.lang.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 java.util.List |
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 java.util.List |
getUsers(javax.faces.context.FacesContext context,
org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.search.SearchService searchService)
Deprecated. Use Repository.getUsers(FacesContext, NodeService, PersonService) instead |
static javax.transaction.UserTransaction |
getUserTransaction(javax.faces.context.FacesContext context)
Deprecated. |
static javax.transaction.UserTransaction |
getUserTransaction(javax.faces.context.FacesContext context,
boolean readonly)
Return a UserTransaction instance |
static java.lang.String |
guessEncoding(javax.faces.context.FacesContext context,
java.io.InputStream is,
java.lang.String mimetype)
Extract the characterset from the stream |
static java.lang.Boolean |
isNodeLocked(Node node,
org.alfresco.service.cmr.lock.LockService lockService)
Return whether a Node is currently locked |
static java.lang.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(java.lang.String str)
Creates a QName representation for the given String. |
static java.lang.String |
resolveToQNameString(java.lang.String str)
Creates a string representation of a QName for the given string. |
static java.lang.String |
safePropertyToString(java.io.Serializable value)
Convert a property of unknown type to a String value. |
static void |
setupBreadcrumbLocation(javax.faces.context.FacesContext context,
NavigationBean navBean,
java.util.List location,
org.alfresco.service.cmr.repository.NodeRef node)
Sets up the breadcrumb location representation for the given node in the given list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ERROR_NODEREF
public static final java.lang.String ERROR_GENERIC
public static final java.lang.String ERROR_NOHOME
public static final java.lang.String ERROR_SEARCH
public static final java.lang.String ERROR_QUERY
public static final java.lang.String ERROR_EXISTS
Method Detail |
---|
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, java.lang.String rootPath)
public static java.lang.String getNameForNode(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef ref)
ref
- NodeRef
public static java.lang.String getNameForCategoryNode(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef ref)
nodeService
- ref
- the category node ref
public static java.lang.String escapeQName(org.alfresco.service.namespace.QName qName)
qName
- QName to escape
public static java.lang.Boolean isNodeLocked(Node node, org.alfresco.service.cmr.lock.LockService lockService)
node
- The Node wrapper to test againstlockService
- The LockService to use
public static java.lang.Boolean isNodeOwnerLocked(Node node, org.alfresco.service.cmr.lock.LockService lockService)
node
- The Node wrapper to test againstlockService
- The LockService to use
public static java.lang.String getDisplayPath(org.alfresco.service.cmr.repository.Path path)
path
- Path to extract readable form from, excluding the final element
public static java.lang.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 path
public static java.lang.String getNamePath(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.Path path, org.alfresco.service.cmr.repository.NodeRef rootNode, java.lang.String separator, java.lang.String prefix)
path
- Path to convertseparator
- Separator to user between path elementsprefix
- To prepend to the path
public static void setupBreadcrumbLocation(javax.faces.context.FacesContext context, NavigationBean navBean, java.util.List location, org.alfresco.service.cmr.repository.NodeRef node)
context
- FacesContextnavBean
- NavigationBean instancelocation
- The location list to setupnode
- The Node being navigated topublic static java.lang.String getNamePathEx(javax.faces.context.FacesContext context, org.alfresco.service.cmr.repository.Path path, org.alfresco.service.cmr.repository.NodeRef rootNode, java.lang.String separator, java.lang.String prefix)
path
- Path to convertseparator
- Separator to user between path elementsprefix
- To prepend to the path
public static java.lang.String getMimeTypeForFileName(javax.faces.context.FacesContext context, java.lang.String filename)
The file extension will be extracted from the filename and used to lookup the mimetype.
context
- FacesContextfilename
- Non-null filename to process
public static java.lang.String getMimeTypeForFile(javax.faces.context.FacesContext context, java.lang.String filename, java.io.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 javax.transaction.UserTransaction getUserTransaction(javax.faces.context.FacesContext context)
context
- FacesContext
Repository.getRetryingTransactionHelper(FacesContext)
public static org.alfresco.repo.transaction.RetryingTransactionHelper getRetryingTransactionHelper(javax.faces.context.FacesContext context)
context
- FacesContext
public static javax.transaction.UserTransaction getUserTransaction(javax.faces.context.FacesContext context, boolean readonly)
context
- FacesContextreadonly
- Transaction readonly state
public static org.alfresco.service.ServiceRegistry getServiceRegistry(javax.faces.context.FacesContext context)
context
- Faces Context
public static org.alfresco.service.ServiceRegistry getServiceRegistry(javax.servlet.ServletContext context)
context
- Servlet Context
public 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 Context
public static boolean extractMetadata(javax.faces.context.FacesContext context, org.alfresco.service.cmr.repository.ContentReader reader, java.util.Map destination)
context
- Faces Contextreader
- Content reader for the source content to extract fromdestination
- Map of metadata to set metadata values into
public static java.lang.String guessEncoding(javax.faces.context.FacesContext context, java.io.InputStream is, java.lang.String mimetype)
context
- the Faces Contextis
- the stream of characters or datamimetype
- the stream's mimetype, or null if unknown
public static java.util.List getUsers(javax.faces.context.FacesContext context, org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.search.SearchService searchService)
Repository.getUsers(FacesContext, NodeService, PersonService)
instead
context
- Faces ContextnodeService
- The node servicesearchService
- The search service, which is ignored
public static java.util.List 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 servicesearchService
- used to perform the search
public static boolean getIsGuest(javax.faces.context.FacesContext context)
public static java.lang.String safePropertyToString(java.io.Serializable value)
value
- Property value
public static org.alfresco.service.namespace.QName resolveToQName(java.lang.String str)
str
- The string to convert
public static java.lang.String resolveToQNameString(java.lang.String str)
str
- The string to convert
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |