public class ProjectPropertyAccessor extends GenericService implements PropertyAccessor
To configure this property accessor, the name attribute of the property tag in the output specifier should specifiy a name using dot notation. For example, name="project.id". The first value in the dot notated name is a symbolic name that refers to the project object. This value can be any alphabetical string, so if 'project' conflicts with property of an item being indexed, you can simply use something else, name="TheProject.id".
Special properties: This acessor provides values for the following special property names:
Note that the $ACL values by themselves offer no security for project data. Security must be implemented by constraining queries on user's role against project.$ACL values.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTEMPTED_LOAD_ATTR_NAME |
static java.lang.String |
CACHE_ATTR_NAME |
static java.lang.String |
CLASS_VERSION
Class version string
|
static java.lang.String |
CONTEXT_ATTR_PREFIX |
static java.lang.String[] |
DEFAULT_PROJECT_ACCESS_RIGHTS |
static java.lang.String |
DEVLINE_ATTR_NAME |
static java.lang.String |
PROJECT_ATTR_NAME |
static java.lang.String |
PROP_ACL |
static java.lang.String |
RESOURCES |
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
ProjectPropertyAccessor() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
getCachedPropertyValue(Context pContext,
RepositoryItem pItem,
java.lang.String pPropertyName,
atg.repository.search.indexing.specifier.PropertyTypeEnum pType)
Get a property value.
|
java.lang.Object |
getMetaPropertyValue(Context pContext,
RepositoryItem pItem,
java.lang.String pPropertyName,
atg.repository.search.indexing.specifier.PropertyTypeEnum pType)
Get the meta property value.
|
atg.repository.search.indexing.specifier.SecurityConstraints |
getMetaSecurityConstraint(Context pContext,
RepositoryItem pItem,
java.lang.String pPropertyName,
atg.repository.search.indexing.specifier.PropertyTypeEnum pType,
java.lang.Object pPropertyValue,
atg.repository.search.indexing.specifier.SecurityConstraints pSecurityConstraints)
Get the security constraint for the specified meta property.
|
java.lang.String[] |
getProjectAccessRights()
Get the list of the names of access rights required for access to
the project.
|
protected java.lang.Object |
getProjectPropertyValue(Context pContext,
RepositoryItem pProject,
RepositoryItem pItem,
java.lang.String pPropertyName)
Read a property value from the project object.
|
protected java.util.Map |
getPropertyValueCache(Context pContext)
Get a map of cached project property values for the current
development line.
|
protected java.lang.String[] |
getRolesWithRights(RepositoryItem pProject)
Get a list of security role names with appropriate rights to
access this project.
|
java.lang.Object |
getSubItemPropertyValue(Context pContext,
RepositoryItem pItem,
java.lang.String pPropertyName)
Sub item property accessor.
|
java.lang.Object |
getTextPropertyValue(Context pContext,
RepositoryItem pItem,
java.lang.String pPropertyName)
Get the text property value.
|
atg.repository.search.indexing.specifier.SecurityConstraints |
getTextSecurityConstraint(Context pContext,
RepositoryItem pItem,
java.lang.String pPropertyName,
java.lang.Object pPropertyValue,
atg.repository.search.indexing.specifier.SecurityConstraints pSecurityConstraints)
Get the security constraint for the specified text property.
|
protected RepositoryItem |
getWorkspaceProject(Context pContext,
java.lang.String pWorkspaceName)
Return true if named workspace has an associated publishing
project.
|
protected boolean |
hasNamedAccessRight(AccessRight[] pRights,
java.lang.String pRightsName)
Check the array of access rights for an access right matching the
specified name.
|
protected boolean |
hasNamedAccessRights(AccessRight[] pRights,
java.lang.String[] pRightsNames)
Check the array of access rights names against the array of
access rights, return true if all named access rights are matched
with an AccessRight.
|
void |
onIndexingInitialization(IndexingOutputConfig pIndexingOutputConfig,
java.util.Set<java.lang.String> pPropertyNames)
Called for custom-set property accessors before each bulk or
incremental indexing process runs.
|
void |
onIndexingTermination(IndexingOutputConfig pIndexingOutputConfig,
java.util.Set<java.lang.String> pPropertyNames)
Called for custom-set property accessors after each bulk or
incremental indexing process runs.
|
protected void |
resetCachedValues(Context pContext)
Clear the cache of project property values.
|
void |
setProjectAccessRights(java.lang.String[] pProjectAccessRights)
Set the array of access right names required by a given role for
access to project data.
|
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
public static final java.lang.String CONTEXT_ATTR_PREFIX
public static final java.lang.String CACHE_ATTR_NAME
public static final java.lang.String ATTEMPTED_LOAD_ATTR_NAME
public static final java.lang.String PROJECT_ATTR_NAME
public static final java.lang.String DEVLINE_ATTR_NAME
public static final java.lang.String RESOURCES
public static final java.lang.String PROP_ACL
public static final java.lang.String[] DEFAULT_PROJECT_ACCESS_RIGHTS
public void setProjectAccessRights(java.lang.String[] pProjectAccessRights)
Note that this is not a security mechanism, it does not provide any access restrictions on indexed data. Instead, it is intended to be used in building access control constraints in query interfaces.
pProjectAccessRights
- an array of access right names
required for access to project data.public java.lang.String[] getProjectAccessRights()
Note that this is not a security mechanism, it does not provide any access restrictions on indexed data. Instead, it is intended to be used in building access control constraints in query interfaces.
public java.lang.Object getTextPropertyValue(Context pContext, RepositoryItem pItem, java.lang.String pPropertyName)
getTextPropertyValue
in interface PropertyAccessor
pContext
- The current context. Contains the current URL,
the stack of parent items, etc.pItem
- The repository item whose property to getpPropertyName
- The name of the property to getpublic java.lang.Object getMetaPropertyValue(Context pContext, RepositoryItem pItem, java.lang.String pPropertyName, atg.repository.search.indexing.specifier.PropertyTypeEnum pType)
getMetaPropertyValue
in interface PropertyAccessor
pContext
- The current context. Contains the current URL,
the stack of parent items, etc.pItem
- The repository item whose property to getpPropertyName
- The name of the property to getpType
- the type of the property. See the
PROP_TYPE_ constants in OutputItemSpecifier.public void onIndexingInitialization(IndexingOutputConfig pIndexingOutputConfig, java.util.Set<java.lang.String> pPropertyNames) throws IndexingException
onIndexingInitialization
in interface PropertyAccessor
pIndexingOutputConfig
- The IndexingOutputConfig component
initaiting the indexpPropertyNames
- The set of property names which this
property accessor is associated with in the definition file.IndexingException
public void onIndexingTermination(IndexingOutputConfig pIndexingOutputConfig, java.util.Set<java.lang.String> pPropertyNames) throws IndexingException
onIndexingTermination
in interface PropertyAccessor
pIndexingOutputConfig
- The IndexingOutputConfig component
initaiting the indexpPropertyNames
- The set of property names which this
property accessor is associated with in the definition file.IndexingException
public java.lang.Object getSubItemPropertyValue(Context pContext, RepositoryItem pItem, java.lang.String pPropertyName)
getSubItemPropertyValue
in interface PropertyAccessor
pContext
- The current context. Contains the current URL,
the stack of parent items, etc.pItem
- The repository item whose property to getpPropertyName
- The name of the property to getpublic atg.repository.search.indexing.specifier.SecurityConstraints getMetaSecurityConstraint(Context pContext, RepositoryItem pItem, java.lang.String pPropertyName, atg.repository.search.indexing.specifier.PropertyTypeEnum pType, java.lang.Object pPropertyValue, atg.repository.search.indexing.specifier.SecurityConstraints pSecurityConstraints)
getMetaSecurityConstraint
in interface PropertyAccessor
pContext
- The current context. Contains the current URL,
the stack of parent items, etc.pItem
- The repository item whose constraints to getpPropertyName
- The name of the property whose contraints to getpType
- the type of the property. See the
PROP_TYPE_ constants in OutputItemSpecifier.pPropertyValue
- The property value returned by
getMetaPropertyValue.pSecurityConstraints
- The static security constraints from
from the definition file. May be null.public atg.repository.search.indexing.specifier.SecurityConstraints getTextSecurityConstraint(Context pContext, RepositoryItem pItem, java.lang.String pPropertyName, java.lang.Object pPropertyValue, atg.repository.search.indexing.specifier.SecurityConstraints pSecurityConstraints)
getTextSecurityConstraint
in interface PropertyAccessor
pContext
- The current context. Contains the current URL,
the stack of parent items, etc.pItem
- The repository item whose constraints to getpPropertyName
- The name of the property whose constraints to getpPropertyValue
- The property value returned by
getMetaPropertyValue.pSecurityConstraints
- The static security constraints from
from the definition file. May be null.protected java.util.Map getPropertyValueCache(Context pContext)
protected void resetCachedValues(Context pContext)
pContext
- the context object where values are cachedprotected java.lang.Object getCachedPropertyValue(Context pContext, RepositoryItem pItem, java.lang.String pPropertyName, atg.repository.search.indexing.specifier.PropertyTypeEnum pType)
pContext
- the indexing contextpItem
- the repository item being indexedpPropertyName
- the property name to retrievepType
- the type or nullprotected RepositoryItem getWorkspaceProject(Context pContext, java.lang.String pWorkspaceName)
pWorkspaceName
- the name of the workspaceprotected java.lang.Object getProjectPropertyValue(Context pContext, RepositoryItem pProject, RepositoryItem pItem, java.lang.String pPropertyName) throws RepositoryException
pContext
- the indexing contextpProject
- the project repository itempItem
- the repository item being indexed (probably not
needed)pPropertyName
- the name of the property in the projectRepositoryException
protected java.lang.String[] getRolesWithRights(RepositoryItem pProject)
projectAccessRights
protected boolean hasNamedAccessRights(AccessRight[] pRights, java.lang.String[] pRightsNames)
pRights
- the access rights object arraypRightsNames
- the names of access rights to matchprotected boolean hasNamedAccessRight(AccessRight[] pRights, java.lang.String pRightsName)
pRights
- the access rights object arraypRightsName
- the access right name