Class SisCoreHelper
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionstatic WTCollectioncheckout(WTCollection paramWTCollection, Folder paramFolder, String paramString) Checks out a WTCollection of Workable objects to the specified folder.static CheckoutLinkCheckout a workable object.static WTSetRemoves the specified persistable objects from the datastore.static WTKeyedMapgetAttributesFromPersistables(WTKeyedMap objToattrNames) * Retrieves the list of attribute values from passed in persistablesstatic WTValuedMapgetCabinetBasedToFolderMap(WTCollection foldereds) Get the parent folders for the given collection of CabinetBased objects.static List<ConfigSpec> getConfigSpecFor(NavCriteriaContext context) Lookup theGetConfigSpecForDelegate2delegate and use its methods to get a list of ConfigSpecs.static WTContainerRefgetContainerByPath(String path) Finds a container based on a path.static WTKeyedMapgetContentFromHolders(WTCollection holders) A multi object api version of getContentFromHolder to reduce number of jdbc calls.static ContentHoldergetContents(ContentHolder holder) Set the cookie in an ContentHolder object to contain all ContentItems associated with it.static QueryResultgetUsesWTParts(WTPart paramWTPart, ConfigSpec paramConfigSpec) Applies the configSpec to the result of navigating the WTPartUsageLink along the uses role; returns a QueryResult of Persistable[], in which the WTPartUsageLinks are at the 0th position and the corresponding iterations (or master if there is no corresponding iteration) in the 1th position.static WTCollectionmodify(WTCollection a_objects) Updates the specified Persistable objects in the datastore.static Persistablemodify(Persistable paramPersistable) Updates the given Persistable object in the datastore.static QueryResultnavigate(Persistable obj, String role, Class linkClass, boolean onlyOtherSide) Retrieves objects related to the given persistable object given a role and link class.static Persistablerefresh(Persistable paramPersistable) Retrieves the given Persistable object from the database to restore its state.static Persistablerefresh(Persistable obj, boolean fullRefresh, boolean inPlace, boolean lock) Retrieves the given Persistable object from the database to restore its state.static WTCollectionsave(WTCollection objects) Invokes the modify method on the objects that are already persisted, otherwise invokes the store method.static WTPartInvokes the modify method on the object that is already persisted, otherwise invokes the store method.static booleansetAccessEnforced(boolean b) Suspends or resumes all access invalid input: '&' authorization enforcement.static voidsetAttributesOnPersistables(WTKeyedMap updateTargets, boolean persist, boolean checkout) Sets the specified attributes with the specified values on the collection of specified objects assuming all target objects are checked in.static voidsetAuthentication(Object auth) Set the authentication object associated with the Method context.
-
Method Details
-
getContentFromHolders
A multi object api version of getContentFromHolder to reduce number of jdbc calls.
Supported API: true
- Parameters:
holders- A WTCollection of content holders.- Returns:
- WTKeyedMap containing the contentholder to content mappings
- Throws:
WTException-
Supported API: true
-
setAttributesOnPersistables
public static void setAttributesOnPersistables(WTKeyedMap updateTargets, boolean persist, boolean checkout) throws WTException Sets the specified attributes with the specified values on the collection of specified objects assuming all target objects are checked in.- Parameters:
updateTargets- A map of persistable keys mapped to a map containing attribute name and attribute value pairspersist- boolean to specify if the updated persistables should be persisted once the update has been processed- Throws:
WTException-
Supported API: true
-
modify
Updates the specified Persistable objects in the datastore. The modify method ensures that the operation is valid before updating the Persistable objects in the datastore.The target for this operations dispatched event is the specified Persistable object for a single object event listener (the listener is called once for each object in the collection) and a WTCollection containing the specified Persistable object for a multiple object event listener.
The modify method performs the following operations.
- Dispatches a
PersistenceManagerEvent.PRE_MODIFYevent. - Ensures that each Persistable object is persistent.
- Ensures that attributes are valid (by invoking
Persistable.checkAttributes()for each object). - Uses Access Control to determine if the user is allowed to modify each business object.
- Updates the Persistable objects in the database, ensuring that the objects have not gone stale (that is, someone else has already modified this object in the database). Note that any attributes derived from values that exist in other tables are not updated in the database.
- Sets new values in the persistent information attributes, such as update count and modify timestamp.
- Dispatches a
PersistenceManagerEvent.UPDATEevent. - Dispatches a
PersistenceManagerEvent.POST_MODIFYevent. - Returns the collection of Persistable objects to the caller.
Supported API: true- Parameters:
a_objects- The objects to be modified in the datastore- Returns:
- WTCollection
- Throws:
WTException
- Dispatches a
-
checkout
public static WTCollection checkout(WTCollection paramWTCollection, Folder paramFolder, String paramString) throws NonLatestCheckoutException, WorkInProgressException, WTPropertyVetoException, PersistenceException, WTException Checks out a WTCollection of Workable objects to the specified folder. A multi-object PRE_CHECKOUT WorkInProgressServiceEvent is emitted within a transaction before the collection of objects is checked out, and a multi-object POST_CHECKOUT WorkInProgressServiceEvent is emitted within the same transaction after the objects have been checked out. The provided note is used as the comment for the checkout operation.
Supported API: true- Parameters:
paramWTCollection- The WTCollection of objects to be checked out.paramFolder- The Folder the objects are to be checked out to.paramString- The comment for the checkout operation.- Returns:
- WTCollection - The collection returned contains the set of CheckoutLink objects resulting from the operation.
- Throws:
NonLatestCheckoutExceptionWorkInProgressExceptionWTPropertyVetoExceptionPersistenceExceptionWTException
-
save
Invokes the modify method on the objects that are already persisted, otherwise invokes the store method.
Supported API: true- Parameters:
objects- The persistable objects to be saved- Returns:
- WTCollection
- Throws:
WTException
-
save
Invokes the modify method on the object that is already persisted, otherwise invokes the store method.
Supported API: true- Parameters:
object- The persistable object to be saved- Returns:
- WTPart
- Throws:
WTException
-
delete
Removes the specified persistable objects from the datastore. If a given Persistable object in the set participates as either a role A or role B member, then referential integrity processing will occur as specified for that role. The delete method ensures that the operation is valid before removing the Persistable objects from the datastore.The target for this operations dispatched event is the specified Persistable object for a single object event listener (the listener is called once for each object in the collection) and a WTCollection containing the specified Persistable object for a multiple object event listener. Note that the PRE_REMOVE event is not supported for a single object event listener.
The delete performs the following operations.
- Dispatches a
PersistenceManagerEvent.PRE_DELETEevent. - Ensures that this Persistable objects are persistent.
- Ensures that attributes are valid (by invoking
Persistable.checkAttributes()for each object). - Uses Access Control to determine if the user is allowed to delete the business objects.
- Deletes associated
BinaryLinkobjects that are owned by the role objects that are being deleted. - Dispatches a
PersistenceManagerEvent.CLEANUP_LINKevent. - Dispatches a
PersistenceManagerEvent.PRE_REMOVEevent. - Deletes the Persistable objects in the datastore, ensuring that the objects have not gone stale (that is, someone else has already modified this object in the datastore).
- Sets new values in the persistent information attributes to indicate that this objects have been deleted.
- Dispatches a
PersistenceManagerEvent.REMOVEevent. - For any objects that are of type
BinaryLink, cascaded role objects are deleted. - Dispatches a
PersistenceManagerEvent.POST_DELETEevent. - Returns the collection of Persistable objects to the caller.
Before the commit of the transaction that this delete operation occurs in, the persistence service verifies that no
BinaryLinkobjects exist that reference any of the removed objects.
Supported API: true- Parameters:
a_objects- The objects to be deleted from the datastore.- Returns:
- WTSet
- Throws:
WTException- See Also:
- Dispatches a
-
getAttributesFromPersistables
public static WTKeyedMap getAttributesFromPersistables(WTKeyedMap objToattrNames) throws WTException * Retrieves the list of attribute values from passed in persistables- Parameters:
objToattrNames- Map wtih key as the persistable object to retrieve the values from and values as the list of attributes to attempt to retrieve the value for- Returns:
- A map containing the attribute and the attribute value retrieved from each passed in persistable
- Throws:
WTException-
Supported API: true
-
getUsesWTParts
public static QueryResult getUsesWTParts(WTPart paramWTPart, ConfigSpec paramConfigSpec) throws WTException Applies the configSpec to the result of navigating the WTPartUsageLink along the uses role; returns a QueryResult of Persistable[], in which the WTPartUsageLinks are at the 0th position and the corresponding iterations (or master if there is no corresponding iteration) in the 1th position. This API does not support filtering.
Supported API: true- Parameters:
part- The WTPart to navigate.configSpec- The ConfigSpec to use to specify the iterations for the masters used.- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
modify
Updates the given Persistable object in the datastore. The modify method ensures that the operation is valid before updating the Persistable object in the datastore.The target for this operations dispatched event is the specified Persistable object for a single object event listener and a WTCollection containing the specified Persistable object for a multiple object event listener.
The modify method performs the following operations.
- Dispatches a
PersistenceManagerEvent.PRE_MODIFYevent. - Ensures that this Persistable object is persistent.
- Ensures that attributes are valid (by invoking
Persistable.checkAttributes()). - Uses Access Control to determine if the user is allowed to modify this business object.
- Updates this Persistable object in the database, ensuring that the object has not gone stale (that is, someone else has already modified this object in the database). Note that any attributes derived from values that exist in other tables are not updated in the database.
- Sets new values in the persistent information attributes, such as update count and modify timestamp.
- Dispatches a
PersistenceManagerEvent.UPDATEevent. - Dispatches a
PersistenceManagerEvent.POST_MODIFYevent. - Returns the Persistable object to the caller.
Supported API: true- Parameters:
obj- The object to be modified in the datastore- Returns:
- Persistable
- Throws:
WTException
- Dispatches a
-
refresh
public static Persistable refresh(Persistable paramPersistable) throws ObjectNoLongerExistsException, WTException Retrieves the given Persistable object from the database to restore its state. Object references for the target object are not refreshed and the object is not refreshed in place.
Supported API: true- Parameters:
obj- The persistable object to be refreshed- Returns:
- Persistable
- Throws:
WTExceptionObjectNoLongerExistsException
-
getContainerByPath
Finds a container based on a path. The path is of the form:
path ::= path_element (path_element)* path_element ::= '/' class_name '=' container_name class_name ::= the fully qualified name of a container class container_name :: = the name of a container instance
Supported API: true- Parameters:
path-- Returns:
- WTContainerRef
- Throws:
WTException
-
checkout
public static CheckoutLink checkout(Workable object, Folder folder, String note) throws WTException, WorkInProgressException, NonLatestCheckoutException, WTPropertyVetoException, PersistenceException Checkout a workable object. A PRE_CHECKOUT WorkInProgressServiceEvent is emitted within a transaction before the object is checked out, and a POST_CHECKOUT WorkInProgressServiceEvent is emitted within the same transaction after the object has been checked out.
Supported API: true- Parameters:
object-folder-note-- Returns:
- CheckoutLink
- Throws:
WTExceptionWorkInProgressExceptionNonLatestCheckoutExceptionWTPropertyVetoExceptionPersistenceException
-
setAuthentication
Set the authentication object associated with the Method context.
Supported API: true -
getCabinetBasedToFolderMap
Get the parent folders for the given collection of CabinetBased objects. If any of the objects are Cabinets, then they are mapped to null.If any of the objects are Foldered, then the implementation will first check to see if their FolderingInfos contain a cached reference to their parent folder, and use the cached instance as the return value. So in some cases this API will not require a trip to the server.
Supported API: true- Parameters:
objects- The CabinetBased objects to find folders for- Returns:
- A mapping of the objects to their parent folders
- Throws:
FolderNotFoundExceptionWTException
-
setAccessEnforced
public static boolean setAccessEnforced(boolean b) Suspends or resumes all access invalid input: '&' authorization enforcement. If the argument is false then access/authorization enforcement is suspended; otherwise it is resumed. The method returns true if the access/authorization checks are being enforced or false otherwise.This method can be used to temporarily suspend access/authorization enforcement using a try/finally block, in which the enforcement is suspended in the try block and restored in the finally block. The return value can be used to restore the value to whatever it was before the enforcement was suspended.
Supported API: true- Parameters:
enforce-- Returns:
- boolean
-
refresh
public static Persistable refresh(Persistable obj, boolean fullRefresh, boolean inPlace, boolean lock) throws WTException, ObjectNoLongerExistsException Retrieves the given Persistable object from the database to restore its state.
Supported API: true- Parameters:
obj- The persistable object to be refreshedfullRefresh- Set to true if the object references for the target object should be refreshed as well.inPlace- Set to true if the target object should be refreshed in place.lock- Specifies whether the object should be locked as part of the refresh. This value should only be true when the call is within the context of a server-side transaction.- Returns:
- Persistable
- Throws:
WTExceptionObjectNoLongerExistsException- See Also:
-
getContents
public static ContentHolder getContents(ContentHolder holder) throws WTException, PropertyVetoException Set the cookie in an ContentHolder object to contain all ContentItems associated with it. This need to be called only once and refreshing can be done as needed.
Supported API: true- Parameters:
holder-- Returns:
- ContentHolder
- Throws:
WTExceptionPropertyVetoException
-