Package com.appiancorp.suiteapi.process
Class AppianTypeCache
java.lang.Object
com.appiancorp.suiteapi.process.AppianTypeCache
- All Implemented Interfaces:
JSONable
,JSONCacheable
,XMLable
,Serializable
Holds the ids and display names of Appian-typed objects such as users and groups.
Generally, a cache is created for an entity such as an ActivityClass or a ProcessModel,
and when that entity is loaded, the primary keys of all of the Appian-typed objects in
the entity's object graph are added to the cache using
addAppianType(java.lang.Integer, java.lang.Long)
. After
the primary keys have been added, one can call populate(com.appiancorp.services.ServiceContext)
to fetch the display
names. Once the cache has been populated,display names can be retrieved through the
getDisplayName(java.lang.Long, java.lang.Integer)
and getDisplayNames(java.lang.Long[], java.lang.Integer)
methods.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Integer
Appian type constant for communitiesstatic final Integer
Appian type constant for contentstatic final Integer
Appian type constant for contentstatic final Integer
Appian type constant for documentsstatic final Integer
Appian type constant for email addressesstatic final Integer
static final Integer
Appian type constant for foldersstatic final Integer
Appian type constant for forumsstatic final Integer
Appian type constant for groupsstatic final Integer
Appian type constant for knowledge centersstatic final Integer
Appian type constant for messagesstatic final Integer
Appian type constant for pagesstatic final Integer
Appian type constant for process modelsstatic final Integer
Appian type constant for processesstatic final Integer
Appian type constant for process model foldersstatic final Integer
Appian type constant for threadsstatic final Integer
Appian type constant for usersFields inherited from interface com.appiancorp.suiteapi.common.JSONable
hiddenAttributes$TRANSIENT
Fields inherited from interface com.appiancorp.suiteapi.common.XMLable
DEFAULT_BUFFER_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAppianType
(Integer type_, Long id_) Adds the primary key of the given Appian type to the table of Appian-typed objects.void
addAppianType
(Integer type_, String id_) Adds a String primary key of the given Appian type to the table of Appian-typed objects.void
addAppianTypeOrTypes
(int type_, boolean isMultiple_, Object value_) void
addAppianTypes
(Integer type_, Long[] ids_) void
addAppianTypes
(Integer type_, String[] ids_) Adds String primary keys to the cache for the given type.String[]
static Integer
getAtcTypeForTypedVariableType
(int type_) Utility method to retrieve the cache key for the given TypedVariable type.getDisplayName
(LocalObject lo_, Integer type_) getDisplayName
(Long id_, Integer type_) Fetches the display name for the integer primary key of the given type.getDisplayName
(String id_, Integer type_) Fetches the display name for the string primary key of the given type.String[]
getDisplayNames
(LocalObject[] los_, Integer type_) String[]
getDisplayNames
(Long[] ids_, Integer type_) Fetches the display names for the integer primary keys of the given type.String[]
getDisplayNames
(Object id_, Integer type_) String[]
getDisplayNames
(Object id_, Integer type_, boolean isMultiple) String[]
getDisplayNames
(String[] ids_, Integer type_) Fetches the display names for the string primary keys of the given type.Returns the set of attributes (properties) that should not be included in the JSON representation of the object.boolean
Adds multiple instances of the given Appian type to the table of Appian-typed objects.Retreives the map of ids to display names for the given key.Integer[]
Retrieves the keys for the Appian types for which this cache has entries.com.appiancorp.process.design.validation.Errors
Uses the given user to populate the display names.com.appiancorp.process.design.validation.Errors
populate
(ServiceContext sc, boolean includeCurrentUser_) void
setDisplayName
(Integer type_, Long id_, String display_) void
setDisplayName
(Integer type_, String id_, String display_) toXML()
Generates an XML representation of this object (including all child objects).void
toXML
(StringBuilder buffer_) Appends an XML representation of this object (including all child objects) to the given buffer.
-
Field Details
-
AT_USERS
Appian type constant for users -
AT_GROUPS
Appian type constant for groups -
AT_FOLDERS
Appian type constant for folders -
AT_DOCS
Appian type constant for documents -
AT_PAGES
Appian type constant for pages -
AT_FORUMS
Appian type constant for forums -
AT_THREADS
Appian type constant for threads -
AT_MESSAGES
Appian type constant for messages -
AT_KCS
Appian type constant for knowledge centers -
AT_CONTENT
Appian type constant for content -
AT_CONTENT_CONSTANT
Appian type constant for content -
AT_EMAIL_ADDRESSES
Appian type constant for email addresses -
AT_PROCESS_MODELS
Appian type constant for process models -
AT_PROCESSES
Appian type constant for processes -
AT_COMMUNITIES
Appian type constant for communities -
AT_EVENTS
-
AT_PROCESSMODEL_FOLDER
Appian type constant for process model folders
-
-
Constructor Details
-
AppianTypeCache
public AppianTypeCache()
-
-
Method Details
-
getHiddenAttributes
Description copied from interface:JSONable
Returns the set of attributes (properties) that should not be included in the JSON representation of the object.- Specified by:
getHiddenAttributes
in interfaceJSONable
- Returns:
- the set of hidden attributes
-
toXML
Description copied from interface:XMLable
Generates an XML representation of this object (including all child objects). A typical implementation is to create a newStringBuilder
and calltoXML( StringBuilder )
on it. -
toXML
Description copied from interface:XMLable
Appends an XML representation of this object (including all child objects) to the given buffer. Override for performance. -
getInvalidReferences
public boolean getInvalidReferences()Adds multiple instances of the given Appian type to the table of Appian-typed objects.- Parameters:
type_
- one of the AT_XXX constantsids_
- an array of integer primary keys of Appian objects
-
addAppianTypes
-
setDisplayName
-
setDisplayName
-
addAppianType
Adds the primary key of the given Appian type to the table of Appian-typed objects.- Parameters:
type_
- one of the AT_XXX constantsid_
- an integer primary key of an Appian object
-
addAppianTypes
Adds String primary keys to the cache for the given type.- Parameters:
type_
- one of the AT_XXX constantsids_
- array of String primary keys
-
addAppianType
Adds a String primary key of the given Appian type to the table of Appian-typed objects.- Parameters:
type_
- one of the AT_XXX constantsid_
- a String primary key of an Appian object
-
addAppianTypeOrTypes
-
getPopulatedTypes
Retrieves the keys for the Appian types for which this cache has entries. If any calls to the addAppianType or addAppianTypes methods have been made with a key, the returned array will contain that key. -
populate
Uses the given user to populate the display names. -
populate
public com.appiancorp.process.design.validation.Errors populate(ServiceContext sc, boolean includeCurrentUser_) -
getAtcTypeForTypedVariableType
Utility method to retrieve the cache key for the given TypedVariable type.- Parameters:
type_
- one of the constants from TypedVariable- Returns:
- the cache key for the given type. Arrays have the same key as their corresponding scalars.
- Throws:
IllegalArgumentException
- if type_is not a valid type.- See Also:
-
getAllDisplayNames
-
getDisplayName
Fetches the display name for the integer primary key of the given type.- Parameters:
id_
- an integer primary keytype_
- one of the AT_XXX constants indicating an Appian type- Returns:
- the display name for the Appian type object of the given type and with the
given id, or
null
if no scuh object exists (or the display name has not been retrieved).
-
getDisplayNames
Fetches the display names for the integer primary keys of the given type. Display names will be in the same order as the primary keys, andnull
will correspond to any primary key for which there is no display name in the cache.- Parameters:
ids_
- an array of integer primary keystype_
- one of the AT_XXX constants indicating an Appian type
-
getDisplayName
Fetches the display name for the string primary key of the given type.- Parameters:
id_
- a String primary keytype_
- one of the AT_XXX constants indicating an Appian type- Returns:
- the display name for the Appian type object of the given type and with the
given id, or
null
if no scuh object exists (or the display name has not been retrieved).
-
getDisplayNames
Fetches the display names for the string primary keys of the given type. Display names will be in the same order as the primary keys, andnull
will correspond to any primary key for which there is no display name in the cache.- Parameters:
ids_
- an array of String primary keystype_
- one of the AT_XXX constants indicating an Appian type
-
getDisplayName
-
getDisplayNames
-
getDisplayNames
-
getDisplayNames
-
getMap
Retreives the map of ids to display names for the given key.- Parameters:
key_
- one of the AT_XXX constants- Returns:
- the corresponding map, never null
-
getFullMap
-