|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This container class mainly provides operations for modifying the content or state of adaptations.
Procedure| Method Summary | |
Adaptation |
doCopy(Adaptation anAdaptation)
Copies the specified adaptation instance. |
Adaptation |
doCreateChild(AdaptationName aParentName,
AdaptationReference requestedNameOrNull)
Creates a new schema instance that is the child of the parent specified by aParentName. |
Adaptation |
doCreateDeriving(PrimaryKey parentKey,
com.onwbp.adaptation.uifacade.HrNode aNode,
AdaptationTable aTable)
Deprecated. Deriving mode is no longer supported. This method throws UnsupportedOperationException. |
Adaptation |
doCreateDeriving(ValueContext parentKey,
ValueContext aContent,
AdaptationTable aTable)
Deprecated. Deriving mode is no longer supported. This method throws UnsupportedOperationException. |
Adaptation |
doCreateOcculting(ValueContext aKey,
AdaptationTable aTable)
Creates an occulting occurrence in the specified table. |
Adaptation |
doCreateOccurrence(ValueContext aContent,
AdaptationTable aTable)
Creates a record in the specified table. |
Adaptation |
doCreateOverwriting(ValueContext aContent,
AdaptationTable aTable)
Creates a record in the specified table. |
Adaptation |
doCreateRoot(SchemaLocation aSchemaLocation,
AdaptationReference requestedNameOrNull,
com.onwbp.core.org.OrganizationName owner)
Deprecated. Replaced by doCreateRoot(SchemaLocation, AdaptationReference, Profile). |
Adaptation |
doCreateRoot(SchemaLocation aSchemaLocation,
AdaptationReference requestedNameOrNull,
Profile owner)
Creates a new root adaptation instance. |
Adaptation |
doCreateRoot(ValueContext aContent,
AdaptationTable aTable)
Creates a record in the specified table. |
Adaptation |
doCreateRootChild(com.onwbp.adaptation.uifacade.HrNode rootNode,
AdaptationTable aContainer)
Deprecated. Replaced by doCreateRoot(ValueContext, AdaptationTable). |
void |
doDelete(AdaptationName aName,
boolean isDeletingChildren)
Deletes the specified adaptation. |
Adaptation |
doEditionDiscard(AdaptationName aName)
Deprecated. Since version 4.0, the notion of local edition is replaced by the more general concept of branch. This method does nothing, it just returns the specified adaptation. |
Adaptation |
doEditionRelease(AdaptationName aName)
Deprecated. Since version 4.0, the notion of local edition is replaced by the more general concept of branch. This method does nothing, it just returns the specified adaptation. |
void |
doExport(ExportSpec aSpec)
Exports the content of an adaptation to a XML or CSV document, as specified by the ExportSpec argument. |
void |
doExportArchive(Archive anArchive)
Exports the current home to the specified archive. |
void |
doExportArchive(ArchiveExportSpec exportSpec)
Exports the specified archive. |
void |
doImport(ImportSpec aSpec)
Imports an XML or CSV content into an adaptation, as specified by the ImportSpec argument.
|
void |
doImportArchive(Archive anArchive)
Imports the specified archive into the current home. |
void |
doImportArchive(ArchiveImportSpec importSpec)
Imports the specified archive into the current home. |
void |
doMergeToParent(AdaptationHome aSource)
Merges the specified source branch to the current branch. |
void |
doMergeToParent(MergeSpecForHome aMergeSpec)
Merges the source branch to the current branch with the specified selection to be merged. |
Adaptation |
doModifyContent(Adaptation aTarget,
com.onwbp.adaptation.uifacade.HrNode aRootNode)
Deprecated. Replaced by doModifyContent(Adaptation, ValueContext). |
Adaptation |
doModifyContent(Adaptation aTarget,
ValueContext aContent)
Modifies the adaptation content as specified. |
Adaptation |
doOccult(Adaptation anOccurrence)
Occults the specified adaptation occurrence. |
void |
doOptimizeByRefactoring(AdaptationName aName,
boolean includeDescendantsWithoutDelegated,
boolean includeAllDescendants)
Deprecated. Replaced by AdaptationTreeOptimizerSpec_MutualizeCommons. |
void |
doOptimizeByRemovingDuplicates(AdaptationName aName,
boolean includeDescendantsWithoutDelegated,
boolean includeAllDescendants)
Deprecated. Replaced by AdaptationTreeOptimizerSpec_RemoveDuplicates. |
AdaptationHome |
getAdaptationHome()
Returns the current home. |
int |
getCommitThreshold()
|
ValueContextForUpdate |
getContext(AdaptationName aName)
Provides an interface for reading and/or updating a persisted content. |
ValueContextForUpdate |
getContext(boolean isTriggerActivation,
ValueContextForUpdate contextToCopy,
AdaptationTable aTable)
Provides an interface for setting values on a context that conforms to any occurrence of the specified table. |
ValueContextForUpdate |
getContextForNewOccurrence(Adaptation occurrenceToCopy,
AdaptationTable aTable)
Provides an interface for copying a context from an existing occurrence. |
ValueContextForUpdate |
getContextForNewOccurrence(AdaptationTable aTable)
Provides an interface for setting values on a context that conforms to any occurrence of the specified table. |
String |
getExecutionInformation()
|
Date |
getExecutionTimestamp()
Returns the timestamp of the current procedure execution. |
String |
getExecutionUUIDString()
Returns a universally unique identifier (UUID) for the current procedure execution. |
com.onwbp.adaptation.uifacade.HrNode |
getNodeForCreatingOccurrence(AdaptationTable aTable)
Deprecated. Replaced by getContextForNewOccurrence(AdaptationTable). |
com.onwbp.adaptation.uifacade.HrNode |
getNodeForUpdatingContent(AdaptationName aName)
Deprecated. Replaced by getContext(AdaptationName). |
Session |
getSession()
Returns the current session context. |
boolean |
hasEdition(Adaptation target)
Deprecated. Since version 4.0, the notion of local edition is replaced by the more general concept of branch. |
boolean |
isAllPrivileges()
Default value is false. |
boolean |
isHistoryActivation()
|
boolean |
isPrivilegeToModifyReferenceBranch()
Default value is true. |
boolean |
isTriggerActivation()
|
void |
setAllPrivileges(boolean allPrivileges)
If true, disables all the permission checks for future operations
performed by the current run. |
void |
setCommitThreshold(int commitThreshold)
Sets the maximum size of the transaction so that intermediate commits are done during the execution of the procedure. |
void |
setExecutionInformation(String aString)
Specifies some additional information about the current execution. |
void |
setHistoryActivation(boolean isActivated)
Enables or disables the detailed description of updates made by the current run. |
void |
setInstanceActivation(Adaptation anInstance,
boolean activationState)
Activates or deactivates the specified instance. |
void |
setInstanceDescription(Adaptation anInstance,
UserMessage aDescription)
Specifies a description to the specified instance. |
void |
setInstanceLabel(Adaptation anInstance,
UserMessage aLabel)
Specifies a label to the specified instance. |
void |
setInstanceOwner(Adaptation anInstance,
Profile newOwner)
Defines the owner of the specified instance. |
void |
setPrivilegeToModifyReferenceBranch(boolean enable)
If true, disables the fact that Reference Branch is
normally not modified directly. |
void |
setTriggerActivation(boolean isActivated)
Enables or disables triggers. |
| Method Detail |
public Adaptation doCreateRoot(SchemaLocation aSchemaLocation,
AdaptationReference requestedNameOrNull,
Profile owner)
throws OperationException
aSchemaLocation - Specifies the schema of the instance to create. It must refer to an existing and
correct XML schema .requestedNameOrNull - Specifies the public and persistent reference of the instance to
create. If null, the reference is allocated randomly.owner - Specifies the profile that will own the newly created instance (required).
IllegalArgumentException - if the identifier does not conform to AdaptationReference.MAX_LENGTH
and AdaptationReference.REFERENCE_PATTERN.
OperationExceptiondoCreateChild(AdaptationName, AdaptationReference)
public Adaptation doCreateChild(AdaptationName aParentName,
AdaptationReference requestedNameOrNull)
throws OperationException
aParentName.
aParentName - Specifies the parent of the instance to create. It must refer to an existing instance
in the current home.requestedNameOrNull - Specifies the public and persistent reference of the instance to
create. If null, this reference is allocated randomly.
IllegalArgumentException - if identifier does not conform to AdaptationReference.MAX_LENGTH
and AdaptationReference.REFERENCE_PATTERN.
OperationExceptiondoCreateRoot(SchemaLocation, AdaptationReference, Profile)
public void setInstanceLabel(Adaptation anInstance,
UserMessage aLabel)
throws OperationException
OperationExceptionsetInstanceDescription(Adaptation, UserMessage)
public void setInstanceDescription(Adaptation anInstance,
UserMessage aDescription)
throws OperationException
OperationExceptionsetInstanceLabel(Adaptation, UserMessage)
public void setInstanceOwner(Adaptation anInstance,
Profile newOwner)
throws OperationException
anInstance - Instance must be a root instance.newOwner - New owner can be either a user or a role.
OperationException
public void setInstanceActivation(Adaptation anInstance,
boolean activationState)
throws OperationException
OperationException
public Adaptation doCreateOccurrence(ValueContext aContent,
AdaptationTable aTable)
throws OperationException
aContent - Specifies the content of the occurrence to create. At least, it must define its
primary key. An object of this type is obtained by calling a method
getContext...(...), for example
getContextForNewOccurrence(AdaptationTable).aTable - Specifies in which table the occurrence is defined.
OperationException
public Adaptation doCreateRoot(ValueContext aContent,
AdaptationTable aTable)
throws OperationException
This method is deprecated since it has the same contract and effect as
doCreateOccurrence(ValueContext, AdaptationTable).
OperationException
public Adaptation doCreateOverwriting(ValueContext aContent,
AdaptationTable aTable)
throws OperationException
This method is deprecated since it has the same contract and effect as
doCreateOccurrence(ValueContext, AdaptationTable).
OperationException
public Adaptation doCreateOcculting(ValueContext aKey,
AdaptationTable aTable)
throws OperationException
aKey - Specifies the key of the parent occurrence to occult.
An object of this type is obtained by calling the method
getContext(AdaptationName) (the parent reference must be
used as argument), or
getContextForNewOccurrence(AdaptationTable).aTable - Specifies in which table the occultation is made.
OperationExceptiongetContextForNewOccurrence(AdaptationTable)
public Adaptation doOccult(Adaptation anOccurrence)
throws OperationException
Depending on the occurrence specified, this method performs the following operations:
anOccurrence - the adaptation occurrence that must be occulted.
OperationException
public Adaptation doCreateDeriving(ValueContext parentKey,
ValueContext aContent,
AdaptationTable aTable)
throws OperationException
UnsupportedOperationException.
OperationException
public Adaptation doModifyContent(Adaptation aTarget,
ValueContext aContent)
throws OperationException
definition modes are handled as follows:
aTarget - Specifies the adaptation to modify.aContent - Specifies the modifications to apply.
An object of this type is typically obtained by calling the method
getContext(AdaptationName) (with the adaptation to be modified
passed as parameter).
OperationExceptiongetContext(AdaptationName)
public void doDelete(AdaptationName aName,
boolean isDeletingChildren)
throws OperationException
If the adaptation to be deleted is an
inherited record,
this method will create an
occulting record
(see method doOccult(Adaptation)).
aName - reference to the adaptation that must be deleted.isDeletingChildren - if set to true, any children will also be recursively deleted.
OperationException
public Adaptation doCopy(Adaptation anAdaptation)
throws OperationException
OperationException - if the specified adaptation is not an instance.public AdaptationHome getAdaptationHome()
public void doImport(ImportSpec aSpec)
throws OperationException
ImportSpec argument.
This operation is tolerant regarding the implicit schema of the XML source. That is, if some elements do not exist in target's schema, they are simply ignored.
The resulting adaptation may have validation errors, however for some integrity constraints violations, an exception is thrown (for example, if a primary key is not unique).
aSpec - definition of the import.
OperationException - if an error occurs during the operation (for example an integrity constraint
is violated in the source content).doExport(ExportSpec)
public void doExport(ExportSpec aSpec)
throws OperationException
ExportSpec argument.
aSpec - definition of the export.
OperationException - if an error occurs during the operation.doImport(ImportSpec)
public void doExportArchive(Archive anArchive)
throws OperationException
OperationExceptiondoExportArchive(ArchiveExportSpec)
public void doExportArchive(ArchiveExportSpec exportSpec)
throws OperationException
OperationExceptiondoImportArchive(ArchiveImportSpec)
public void doImportArchive(Archive anArchive)
throws OperationException
The behavior of this method depends on the content of the archive.
It is the same as calling doImportArchive(ArchiveImportSpec) with ArchiveImportSpecMode.DEFAULT mode.
OperationExceptiondoImportArchive(ArchiveImportSpec),
ArchiveImportSpecMode.DEFAULT
public void doImportArchive(ArchiveImportSpec importSpec)
throws OperationException
The import mode is specified by means of the method
ArchiveImportSpec.setMode(ArchiveImportSpecMode).
This method disables all permission checks (as it is done by setAllPrivileges(boolean)).
Therefore, it is important before calling this method, to guarantee that the current session
is actually able to execute the import.
For more information, see ServicePermission and Session.isUserInRole(Profile).
OperationExceptiondoExportArchive(ArchiveExportSpec),
ArchiveImportSpecMode
public void doMergeToParent(AdaptationHome aSource)
throws OperationException
This method is equivalent to doMergeToParent(MergeSpecForHome),
with all instances being selected in the source branch associated to the MergeSpecForHome.
OperationExceptiondoMergeToParent(MergeSpecForHome)
public void doMergeToParent(MergeSpecForHome aMergeSpec)
throws OperationException
For the selected content to be merged, every change between the initial version of the source and its current state is applied to the current branch. The change is applied even if it is in conflict with the changes done meanwhile on the current branch.
IllegalArgumentException - when MergeSpecForHome is null
or when MergeSpecForHome.getHomeToMerge() is:
null,OperationException - when the merge cannot be successfully completed.doMergeToParent(AdaptationHome)
public void doOptimizeByRemovingDuplicates(AdaptationName aName,
boolean includeDescendantsWithoutDelegated,
boolean includeAllDescendants)
throws OperationException
AdaptationTreeOptimizerSpec_RemoveDuplicates.
OperationException
public void doOptimizeByRefactoring(AdaptationName aName,
boolean includeDescendantsWithoutDelegated,
boolean includeAllDescendants)
throws OperationException
AdaptationTreeOptimizerSpec_MutualizeCommons.
OperationExceptionpublic int getCommitThreshold()
setCommitThreshold(int)public void setCommitThreshold(int commitThreshold)
If commitThreshold > 0, a commit will be done every time the amount of current
changes is equal to commitThreshold.
If commitThreshold = 0, only one commit is done (after the procedure
execution returns).
If not specified, the commit threshold is 0.
Internally, table records are gathered by blocks and a change relates to one block. It means that if several records are updated (created, modified or deleted) in the same block, this will be counted as only one change. Since a block groups up to 100 records, the number of records actually updated in a single commit is consequently obtained by the following formula:
commitThreshold <= Nrecords <= 100 * commitThreshold
For example, for an initial import, if the commit threshold is set to 50, a commit will occur periodically for at most 5000 record creations.
Concerning relational database transaction size, the number of SQL queries will be:
Nqueries = commitThreshold * i, where i belongs to [2;5]
Here i depends on the average size of the serialized representation of a record.
IllegalArgumentException - if commitThreshold < 0.public boolean isHistoryActivation()
setHistoryActivation(boolean)public void setHistoryActivation(boolean isActivated)
If not specified, the detailed description of updates is enabled.
public boolean isTriggerActivation()
setTriggerActivation(boolean)public void setTriggerActivation(boolean isActivated)
If not specified, the triggers are enabled.
Disabling triggers means disabling all of the triggers methods
defined by InstanceTrigger and by TableTrigger,
except for TableTrigger.handleBeforeTransactionCommit(BeforeTransactionCommitContext)
which is always executed.
public String getExecutionInformation()
setExecutionInformation(String)public void setExecutionInformation(String aString)
If specified, the information is displayed in the history log. If not specified, only the procedure class name is displayed.
The execution information plays a similar role as session tracking info, but in a more local way (in the context of a single execution).
Session.getTrackingInfo()public boolean isAllPrivileges()
false.
setAllPrivileges(boolean)public void setAllPrivileges(boolean allPrivileges)
true, disables all the permission checks for future operations
performed by the current run. If false, sets the default mode
that enables usual permission checks.
When a procedure disables all permission checks, it is important, before running it or during its execution, to guarantee that the session is actually able to execute the procedure.
Setting all privileges to true does not set privilege to modify Reference Branch
(method setPrivilegeToModifyReferenceBranch(boolean) must be called instead).
ServicePermission,
Session.isUserInRole(Profile)public boolean isPrivilegeToModifyReferenceBranch()
true.
setPrivilegeToModifyReferenceBranch(boolean)public void setPrivilegeToModifyReferenceBranch(boolean enable)
true, disables the fact that Reference Branch is
normally not modified directly. If false,
that forbids any direct modification onto Reference Branch content.
Default value is true.
setAllPrivileges(boolean)public ValueContextForUpdate getContextForNewOccurrence(AdaptationTable aTable)
This method is equivalent to getContextForNewOccurrence(isTriggerActivation(), null, aTable).
public ValueContextForUpdate getContextForNewOccurrence(Adaptation occurrenceToCopy,
AdaptationTable aTable)
doCreateRoot(ValueContext, AdaptationTable),
doCreateOverwriting(ValueContext, AdaptationTable)
public ValueContextForUpdate getContext(boolean isTriggerActivation,
ValueContextForUpdate contextToCopy,
AdaptationTable aTable)
isTriggerActivation - if false, the method
TableTrigger.handleNewContext(NewTransientOccurrenceContext)
is not invoked. See also isTriggerActivation().contextToCopy - if not null, the content is copied to the context to be returned.aTable - the new context conforms to the schema of this table.doCreateRoot(ValueContext, AdaptationTable),
doCreateOverwriting(ValueContext, AdaptationTable)public ValueContextForUpdate getContext(AdaptationName aName)
doModifyContent(Adaptation, ValueContext),
doCreateOcculting(ValueContext, AdaptationTable)public Date getExecutionTimestamp()
public String getExecutionUUIDString()
The UUID format used is the hexadecimal representation of UUID Leach-Salz variant, version 1 (time-based).
For more information, see the Internet-Draft UUIDs and GUIDs or the standards body definition at ISO/IEC 11578:1996 .
public Session getSession()
public Adaptation doCreateRoot(SchemaLocation aSchemaLocation,
AdaptationReference requestedNameOrNull,
com.onwbp.core.org.OrganizationName owner)
throws OperationException
doCreateRoot(SchemaLocation, AdaptationReference, Profile).
aSchemaLocation - Specifies the schema of the instance to be created. It must refer to an existing and
correct XML schema .requestedNameOrNull - Specifies the public and persistent reference of the instance to be
created. If null, the reference is allocated randomly.owner - Specifies the name of the organization that will own the newly created instance.
If null, the default provider organization is taken.
IllegalArgumentException - if identifier does not conform to AdaptationReference.MAX_LENGTH
and AdaptationReference.REFERENCE_PATTERN.
OperationExceptiondoCreateChild(AdaptationName, AdaptationReference)public boolean hasEdition(Adaptation target)
false.
public Adaptation doEditionRelease(AdaptationName aName)
throws OperationException
null if it does not exist in the current home.
OperationExceptionRepository
public Adaptation doEditionDiscard(AdaptationName aName)
throws OperationException
null if it does not exist in the current home.
OperationExceptionRepository
public Adaptation doModifyContent(Adaptation aTarget,
com.onwbp.adaptation.uifacade.HrNode aRootNode)
throws OperationException
doModifyContent(Adaptation, ValueContext).
OperationExceptionpublic com.onwbp.adaptation.uifacade.HrNode getNodeForUpdatingContent(AdaptationName aName)
getContext(AdaptationName).
public com.onwbp.adaptation.uifacade.HrNode getNodeForCreatingOccurrence(AdaptationTable aTable)
getContextForNewOccurrence(AdaptationTable).
public Adaptation doCreateDeriving(PrimaryKey parentKey,
com.onwbp.adaptation.uifacade.HrNode aNode,
AdaptationTable aTable)
throws OperationException
UnsupportedOperationException.
OperationException
public Adaptation doCreateRootChild(com.onwbp.adaptation.uifacade.HrNode rootNode,
AdaptationTable aContainer)
throws OperationException
doCreateRoot(ValueContext, AdaptationTable).
OperationException
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
(report a bug)
EBX.Platform 4.8.4 [0722]
Copyright Orchestra Networks 2000-2010. All rights reserved.