public class SearchRestriction extends TypeManagerManaged
personalization| Modifier and Type | Class and Description |
|---|---|
static interface |
SearchRestriction.SearchRestrictionImpl
interface to persistence layer
|
TypeManagerManaged.TypeManagerManagedImplLocalizableItem.LocalizableItemImplExtensibleItem.ExtensibleItemImplItem.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACTIVE |
static java.lang.String |
CODE |
static java.lang.String |
NAME |
static java.lang.String |
PRINCIPAL |
static java.lang.String |
QUERY |
static java.lang.String |
RESTRICTEDTYPE |
static java.lang.String |
RESTRICTION_TYPE_ALIAS |
AUTOCREATE, DEPRECATED, EXTENSION_NAME, GENERATELANGUAGE_FALLBACK_ENABLED_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEimpl, tenant| Constructor and Description |
|---|
SearchRestriction() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkRestrictionQuery(ComposedType restrictedType,
java.lang.String query) |
static void |
checkUniqueCodeTypePrincipal(Principal principal,
ComposedType type,
java.lang.String code)
Check that the code-type-principal combination is unique.
|
protected SearchRestriction |
createEntity(Principal principal,
ComposedType restrictedType,
java.lang.String query,
java.lang.String code,
java.lang.Boolean active) |
protected Item |
createItem(SessionContext ctx,
ComposedType type,
Item.ItemAttributeMap atts)
Has to be implemented for each concrete subtype of item.
|
java.lang.String |
exportXMLDefinition(XMLOutputter xout) |
java.util.Map |
getAllName() |
java.util.Map |
getAllName(SessionContext ctx) |
java.lang.String |
getCode() |
java.lang.String |
getCode(SessionContext ctx) |
java.util.Set<ComposedType> |
getExcludedSubtypes()
Deprecated.
since ages - not needed any longer
|
java.lang.String |
getName() |
java.lang.String |
getName(SessionContext ctx) |
protected Item.ItemAttributeMap |
getNonInitialAttributes(SessionContext ctx,
Item.ItemAttributeMap allAttributes)
Defines all attributes which should be set after item creation.
|
Principal |
getPrincipal() |
Principal |
getPrincipal(SessionContext ctx) |
java.lang.String |
getQuery() |
java.lang.String |
getQuery(SessionContext ctx) |
ComposedType |
getRestrictionType() |
ComposedType |
getRestrictionType(SessionContext ctx) |
protected SearchRestriction.SearchRestrictionImpl |
impl() |
boolean |
isActive() |
void |
setActive(boolean active) |
void |
setAllName(java.util.Map names) |
void |
setAllName(SessionContext ctx,
java.util.Map names) |
void |
setCode(SessionContext ctx,
java.lang.String code) |
void |
setCode(java.lang.String code) |
void |
setName(SessionContext ctx,
java.lang.String name)
Changes the name of this type system item for the specified language.
|
void |
setName(java.lang.String name)
Changes the name of this type system item for the current session language.
|
void |
setPrincipal(Principal p) |
void |
setPrincipal(SessionContext ctx,
Principal p) |
void |
setQuery(SessionContext ctx,
java.lang.String query) |
void |
setQuery(java.lang.String query) |
void |
setRestrictionType(ComposedType type) |
void |
setRestrictionType(SessionContext ctx,
ComposedType type) |
java.lang.String |
toString()
Returns the
String representation of this item. |
getAllNames, getAllNames, getExtensionName, getImpl, isAutocreate, isDeprecated, isGenerate, setAllNames, setAllNames, setAutocreate, setExtensionName, setGenerategetAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedPropertycreateNonClassAccessor, getAllProperties, getAllProperties, getImplementation, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyaddLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, checkRemovable, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getDefaultAttributeModes, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isMarkModifiedDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, useTA, writeReplacesetTenantpublic static final java.lang.String NAME
public static final java.lang.String CODE
public static final java.lang.String ACTIVE
public static final java.lang.String QUERY
public static final java.lang.String PRINCIPAL
public static final java.lang.String RESTRICTEDTYPE
public static final java.lang.String RESTRICTION_TYPE_ALIAS
protected SearchRestriction.SearchRestrictionImpl impl()
protected SearchRestriction createEntity(Principal principal, ComposedType restrictedType, java.lang.String query, java.lang.String code, java.lang.Boolean active) throws ConsistencyCheckException
ConsistencyCheckExceptionprotected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap atts) throws JaloBusinessException, JaloInvalidParameterException
ItemComposedType.newInstance(Map).
In case this method uses any of the attribute values during creation it is required to override
Item.getNonInitialAttributes(SessionContext, ItemAttributeMap) too.
Sn example:
public static final String MY_ATTRIBUTE = "someAttribute"; ... protected Item createItem(SessionContext
ctx, ComposedType type, Map allAttributes ) throws JaloBusinessException { MyManager man = ... return
man.createMyItem( (String)allAttributes.get(MY_ATTRIBUTE) );
// here MY_ATTRIBUTE is used for creation, so it must not be set again } protected Map getNonInitialAttributes(
SessionContext ctx, Map allAttributes ) { // let superclass remove its own initial attributes Map ret =
super.getNonInitialAttributes( ctx, allAttributes );
// remove MY_ATTRIBUTE from all attributes since if has already been set ret.remove(MY_ATTRIBUTE); return ret; }
createItem in class Itemctx - the current session context which this item is created withintype - the actual item type ( since subtypes may not provide a own jalo class this may be different from the
type which this method was implemented for )JaloBusinessException - indicates an error during creation - any changes will be rollbackedJaloInvalidParameterExceptionprotected Item.ItemAttributeMap getNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes)
ItemItem.createItem(SessionContext, ComposedType, ItemAttributeMap).
use it like this:
protected ItemAttributeMap getNonInitialAttributes( SessionContext ctx, ItemAttributeMap allAttributes ) {
// let all superclasses remove their intial attributes too final ItemAttributeMap attributes =
super.getNonInitialAttributes( ctx, allAttributes ); // remove own initial attributes here attributes.remove(
MyItem.MY_INITIAL_ATTR ); return ret; }
it is vital to optain the map via super.getNonInitialAttributes and pass it on as such since this
ensures that attribute qualifiers are treated case insensitive!getNonInitialAttributes in class Itemctx - session context with language = NULLallAttributes - a ItemAttributeMap contaning attribute values.ItemAttributeMap containing all attribute values, which belong to non-initial attributes.public java.lang.String getCode(SessionContext ctx)
public java.lang.String getCode()
public void setCode(SessionContext ctx, java.lang.String code)
public void setCode(java.lang.String code)
public boolean isActive()
public void setActive(boolean active)
public java.lang.String getName(SessionContext ctx)
getName in class TypeManagerManagedctx - the session context specifying the language to get the name forpublic java.lang.String getName()
getName in class TypeManagerManagedpublic java.util.Map getAllName(SessionContext ctx)
public java.util.Map getAllName()
public void setName(SessionContext ctx, java.lang.String name)
TypeManagerManagedsetName in class TypeManagerManagedctx - the session context defining the language to change the name forname - the new namepublic void setName(java.lang.String name)
TypeManagerManagedsetName in class TypeManagerManagedname - the new namepublic void setAllName(SessionContext ctx, java.util.Map names)
public void setAllName(java.util.Map names)
throws JaloInvalidParameterException
JaloInvalidParameterExceptionpublic java.lang.String getQuery(SessionContext ctx)
public java.lang.String getQuery()
public void setQuery(SessionContext ctx, java.lang.String query) throws JaloInvalidParameterException
JaloInvalidParameterExceptionpublic void setQuery(java.lang.String query)
throws JaloInvalidParameterException
JaloInvalidParameterExceptionpublic ComposedType getRestrictionType(SessionContext ctx)
public ComposedType getRestrictionType()
public void setRestrictionType(SessionContext ctx, ComposedType type)
public void setRestrictionType(ComposedType type)
public Principal getPrincipal(SessionContext ctx)
public Principal getPrincipal()
public void setPrincipal(SessionContext ctx, Principal p)
public void setPrincipal(Principal p)
@Deprecated public java.util.Set<ComposedType> getExcludedSubtypes()
These restrictions must have the exactly the same code but are assigned to subtypes of the original restriction.
Within FlexibleSearch queries all these subtypes are excluded from the original restriction considering that their own restrictions are inserted too.
public java.lang.String toString()
ItemString representation of this item. This is by default the representation of the primary
key of this item.public java.lang.String exportXMLDefinition(XMLOutputter xout)
exportXMLDefinition in class TypeManagerManagedprotected void checkRestrictionQuery(ComposedType restrictedType, java.lang.String query) throws JaloInvalidParameterException
JaloInvalidParameterExceptionpublic static void checkUniqueCodeTypePrincipal(Principal principal, ComposedType type, java.lang.String code)
principal - the principaltype - the typecode - the codeCopyright © 2018 SAP SE. All Rights Reserved.