public abstract class PDefRow extends PDefComponentObjectBase implements ValidationManager
PersistableDefObject.CustomizationType, PersistableDefObject.PersonalizationTypeAPPLY_PERS_DEFAULT, APPLY_PERS_PROPS, APPLY_PERS_QUERY, APPLY_PERS_STRUCT, mUserPDefLoggermEditedProperties, mEditedPropertyExprsDEF_MDS_CLIENT_KEY, DEF_SCOPE_ALL, DEF_SCOPE_PERS, DEF_SCOPE_SESSION, DEF_SCOPE_SHARED, DEF_SCOPE_SITE, DEF_SCOPE_USER, mBaseDefObject, mExtendedDefObjects, mObjectResolved, PERSDEF_MDS_CLIENT_KEY, PROPERTY_EXPRMAPmFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX, RESID_SUFFIXXML_STATEMENT| Constructor and Description |
|---|
PDefRow() |
PDefRow(DefinitionObject staticDef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListBindingDef(ListBindingDef lbDef) |
void |
addRowOperation(OperationDefinitionImpl opDef)
For internal framework use only.
|
OperationDefinitionImpl |
addScriptRowOperation(java.lang.String id,
java.lang.String name,
java.lang.String returnType,
java.util.LinkedHashMap<java.lang.String,java.lang.String> params,
java.lang.String body)
For internal framework use only.
|
void |
addValidator(JboValidatorInterface intf) |
void |
addViewAccessorDef(ViewAccessorDef va) |
void |
applyDiffChildren(DifferDetails dif,
DiffResolver resolver)
Applies changes to children defs.
|
void |
applyDiffContents(DifferDetails dif,
DiffResolver resolver)
When diff/merge operation is requested, we have the following
three def objects:
|
DifferDetails |
diffChildren(DiffMergeable docDef,
DiffMergeable orgDef,
DifferDetails difDetails)
Performs diff of children defs.
|
DifferDetails |
diffContents(DiffMergeable docDef,
DiffMergeable orgDef,
DifferDetails difDetails)
Performs diff of scalar values.
|
AttributeDef |
findAttributeDef(java.lang.String name) |
ListBindingDef |
findListBindingDef(java.lang.String name) |
OperationDefinitionImpl |
findRowOperationDefinition(java.lang.String id)
For internal framework use only.
|
ViewAccessorDef |
findViewAccessorDef(java.lang.String name) |
java.util.HashMap |
getAllProperties(java.util.HashMap map,
LocaleContext locale) |
protected java.util.Map |
getAttrDefsMap() |
int |
getAttributeCount() |
AttributeDef |
getAttributeDef(int index) |
java.util.ArrayList |
getAttributeDefs() |
AttributeDef[] |
getAttributeDefs2() |
int |
getAttributeIndexOf(java.lang.String name) |
PDefRow |
getChildDefOwner(java.lang.Object obj) |
java.lang.String |
getColumnNameForQuery(int index) |
java.lang.String |
getDefXMLNameSpace() |
java.lang.String |
getEditVersionsAsString() |
java.lang.String[] |
getHiddenAttributes() |
java.util.ArrayList |
getHiddenAttributesList() |
oracle.jbo.server.InheritPersonalization |
getInheritPersonalizationValue() |
java.util.ArrayList |
getListBindingDefs() |
protected int |
getLoadSubclassLevel() |
int |
getMajorVersion() |
int |
getMinorVersion() |
protected java.lang.String |
getNoPersDefObjectName(java.lang.String metaObjectName) |
java.util.ArrayList |
getPersonalizedAttributes() |
OperationDefinitionsImpl |
getRowOperationDefinitions()
For internal framework use only.
|
java.util.ArrayList |
getValidators() |
java.util.ArrayList |
getViewAccessorDefs() |
void |
hideAttribute(java.lang.String attrName) |
protected void |
loadDefVersions(DefElement xmlElement) |
AttributeDef |
lookupAttributeDef(java.lang.String attrName) |
ExprDef |
lookupExprDef(OwnerType type,
java.lang.String path)
Search for an ExprDef in the ComponentOperationsManager's namespace.
|
ListBindingDef |
lookupListBindingDef(java.lang.String name) |
PDefAttribute |
lookupPersonalizedAttribute(java.lang.String attrName) |
OperationDefinitionImpl |
lookupRowOperationDefinition(java.lang.String id) |
ViewAccessorDef |
lookupViewAccessorDef(java.lang.String name) |
PDefAttribute |
personalizeAttribute(java.lang.String attrName) |
protected abstract void |
processAccessors() |
void |
removeAttribute(java.lang.String attrName) |
void |
removeHiddenAttribute(java.lang.String attrName) |
void |
removeListBindingDef(java.lang.String name) |
void |
removePersonalizedAttribute(java.lang.String attrName) |
void |
removeRowOperation(java.lang.String id)
For internal framework use only.
|
void |
removeViewAccessorDef(java.lang.String name) |
protected java.lang.Object |
resolvePropertyRaw(java.lang.String property,
LocaleContext locale) |
void |
setEditable(boolean b) |
void |
setInheritPersonalizationStrValue(java.lang.String s) |
void |
writeChildren(DefWriter jos)
Writes the Object's children to the Persistent storage
|
addOperation, addScriptOperation, applyDiffChildrenPDefComponentOperations, beginDiffObjects, diffChildrenPDefComponentOperations, editCodeSource, ensureCodeSource, ensureVariableManager, findOperationDefinition, getMessageBundleClass, getOperationDefinitions, getPersonalizedVariables, getResourceBundleDef, getResourcePrefix, getVariableManager, hasPersonalizedComponentOperations, hasVariables, loadXMLContents, lookupCodeSource, lookupOperationDefinition, lookupPersonalizedVariable, lookupRowOperationDefinition, personalizeOperations, personalizeVariable, removeOperation, removePersonalizedVariable, setVariableManager, updateMdsKeyFromTip, writeContentsapplyPersonalization, applyPersonalization, applyPropertiesPersonalization, deregisterDefObject, findStaticDefinitionObject, getBasePackage, getFileName, getStaticDef, getStaticDefWithCheck, getTrimmedFullName, getTrimmedFullNameForDef, hasStaticDefElem, isAuditEnabled, isAuditEnabled, isDeprecated, loadSubclassXMLContents, loadXMLContents, mergePropertyMap, raiseCustomAuditEvent, registerDefObject, registerSessionDefObject, removeProperty, resolveDefObject, saveXMLContents, setDefinitionState, setFullName, setFullName, setProperty, setPropertyExpression, setPropertyMap, setStaticDef, setStaticDefPublicaddDefImport, addExtendedDefObject, addSavedDocName, adjustPropertyMapForWrite, allocatePropertyMap, allocatePropertyMapForEdits, checkEditable, checkStructWithOld, close, createFromXML, deregisterSessionObject, diffObjects, ensureDifferDetails, findDefImport, finishedLoading, getBaseDir, getDefImports, getDefManager, getDefTypeName, getDefWriter, getDefXMLElementTag, getEditedPropertiesMap, getEditedPropertyExpressionsMap, getEditedPropertyMap, getEditObject, getExtendedDefObjectsInternal, getFullDirName, getFullFileName, getMergeableFullName, getMergeableName, getOrigObject, getPropertyMap, getSavedDocNames, getSessionSyncLock, getSubstitutedNames, getSyncLock, getXMLElementTag, guaranteePath, hasExtendedDefObjects, includeCustomizationLayerInfo, isCustomizationEnabled, isCustomizationEnabled, isDirty, isEditable, isFromTip, isLoadBase, isMajorVersionChanged, isMinorVersionChanged, isNew, isPersonalizationEnabled, isPersonalizationEnabled, isPropertyExpression, loadDefImports, loadDefObject, loadXMLContentsNoResolve, lockDefinitionContext, mergeChanges, objectRemoved, reapplyChanges, registerClass, registerSiteDefObject, remove, removeAndDelete, removeDefImport, removeExtendedDefObject, setCustomizationEnabled, setCustomizationEnabled, setDefaultBaseDir, setDefMgr, setDirty, setEditableFlag, setEditableObject, setFullNameInternal, setLoadBase, setMajorVersionChanged, setNew, setOrigObject, setPersonalizationEnabled, setPersonalizationEnabled, setupDefWriterFromMO, staticUpdateChildrenList, unlockDefinitionContext, updateChildrenList, verifyVersion, verifyVersionNullCheck, writeHeaderForNew, writeObject, writeVersion, writeXMLContentsaddPropertySetName, enableUpdateCheck, getAllExtendedDefObjects, getBaseDefObject, getContainerDef, getContainerName, getDefinitionState, getDefScope, getExtendedDefObjects, getMdsKey, getMdsReference, getPropertySetName, getPropertySetNames, getRootBaseDefObject, isBaseDefFor, isComponentDefinition, isDynamicDefinitionObject, isObjectResolved, isSubtypeOf, isSuppressUpdateCheck, loadCustomProperties, loadProperties, loadPropertiesInMap, loadPropertySetNames, loadSchemaProperties, resolveReferences, setBaseDefObject, setBaseDefObject, setDefScope, setMdsKey, setMdsReference, setName, setObjectResolved, setParent, setPropertySetName, staticLoadCustomProperties, staticLoadSchemaProperties, suppressUpdateCheckgetFullName, getName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyExpressionDef, getPropertyExpressionsMap, getPropertyNamesSet, getRawPropertyValue, getResourcesFromBundle, getStringFromMessageBundle, refreshProperty, removeProperty, requiresNamePrefixedResId, resolveObjectProperty, setPropertiesMap, setPropertiesMap2, setPropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFullName, getName, getResourceBundleDefgetNamegetFullNamegetFullNamepublic PDefRow()
public PDefRow(DefinitionObject staticDef)
public void setEditable(boolean b)
setEditable in class PDefComponentObjectBaseprotected abstract void processAccessors()
protected java.util.Map getAttrDefsMap()
public AttributeDef[] getAttributeDefs2()
public java.util.ArrayList getAttributeDefs()
public AttributeDef findAttributeDef(java.lang.String name)
public AttributeDef lookupAttributeDef(java.lang.String attrName)
public int getAttributeCount()
public AttributeDef getAttributeDef(int index)
public int getAttributeIndexOf(java.lang.String name)
public PDefRow getChildDefOwner(java.lang.Object obj)
public java.lang.String getColumnNameForQuery(int index)
public java.util.ArrayList getPersonalizedAttributes()
public PDefAttribute lookupPersonalizedAttribute(java.lang.String attrName)
public PDefAttribute personalizeAttribute(java.lang.String attrName)
public void removeAttribute(java.lang.String attrName)
public void removePersonalizedAttribute(java.lang.String attrName)
public void hideAttribute(java.lang.String attrName)
public void removeHiddenAttribute(java.lang.String attrName)
public java.lang.String[] getHiddenAttributes()
public java.util.ArrayList getViewAccessorDefs()
public ViewAccessorDef lookupViewAccessorDef(java.lang.String name)
public ViewAccessorDef findViewAccessorDef(java.lang.String name)
public void addViewAccessorDef(ViewAccessorDef va)
public void removeViewAccessorDef(java.lang.String name)
public java.util.ArrayList getListBindingDefs()
public ListBindingDef lookupListBindingDef(java.lang.String name)
public ListBindingDef findListBindingDef(java.lang.String name)
public void addListBindingDef(ListBindingDef lbDef)
public void removeListBindingDef(java.lang.String name)
public OperationDefinitionImpl lookupRowOperationDefinition(java.lang.String id)
public OperationDefinitionImpl findRowOperationDefinition(java.lang.String id)
public OperationDefinitionsImpl getRowOperationDefinitions()
getRowOperationDefinitions in interface OperationContainergetRowOperationDefinitions in class PDefComponentObjectBasepublic void addRowOperation(OperationDefinitionImpl opDef)
public OperationDefinitionImpl addScriptRowOperation(java.lang.String id, java.lang.String name, java.lang.String returnType, java.util.LinkedHashMap<java.lang.String,java.lang.String> params, java.lang.String body)
public void removeRowOperation(java.lang.String id)
public void writeChildren(DefWriter jos)
PersistentDefinitionwriteChildren in interface PersistentDefinitionwriteChildren in class PDefComponentObjectBasejos - the Output storage for persistencepublic java.util.ArrayList getHiddenAttributesList()
public DifferDetails diffChildren(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
DiffMergeabledifDetails and
return it at the end.
For example, if this def has Child1 and Child2, its implementation should look something like:
public DifferDetails diffChildren(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
{
difDetails = diffChildrenChild1(docDef, orgDef, difDetails);
difDetails = diffChildrenChild1(docDef, orgDef, difDetails);
return difDetails;
}
where diffChildrenChild1() uses DifferChildren's
helper method diffChildrenList to diff the child defs.
diffChildren in interface DiffMergeablediffChildren in class PDefComponentObjectBasedocDef - the document-level definitionorgDef - the original definition. It could be
null if the definition did not exist originallydifDetails - the DifferDetails that accumulate
the details of diff from the document-level (top-level) defDifferDetails that has all the details
of diffpublic void applyDiffChildren(DifferDetails dif, DiffResolver resolver)
DiffMergeabledif contains the
changes to be applied to the children. For each child def, this method
should first retrieve the diff details for the child, which is of type
DifferChildren. Then, it should call
DifferChildren.applyDiffChanges(oracle.jbo.mom.DiffChildrenMerge, oracle.jbo.mom.DiffResolver) to perform
the change operation.
applyChanges() requires a
DiffChildrenMerge object, which has the insert,
update, and remove methods. 'this' def object must
provide implmementation of these operations.
Here is a sample:
public void applyDiffChildren(DifferDetails dif, DiffResolver resolver)
{
DifferChangeMap detailMap = dif.getDetailMap();
if (detailMap != null)
{
DifferChildren difChild1 = (DifferChildren) detailMap.getValue();
if (difVCs != null)
{
DiffChildrenMerge dm = new DiffChildrenMerge()
{
public void insertChild(Object id, Object value)
{
.. perform insert op for Child1 ..
}
public void updateChild(Object id, Object value, Object oldValue)
{
.. perform update op for Child1 ..
}
public void removeChild(Object id)
{
.. perform remove op for Child1 ..
}
};
difChild1.applyDiffChanges(dm, resolver);
}
// Similarly for Child2
}
}
applyDiffChildren in interface DiffMergeableapplyDiffChildren in class PDefComponentObjectBasepublic ExprDef lookupExprDef(OwnerType type, java.lang.String path)
ComponentOperationsManagerlookupExprDef in interface ComponentOperationsManagerlookupExprDef in class PDefComponentObjectBasetype - the {@link oracle.jbo.common.OwnerType) of the expressionpath - the (@link ExprDef#getPath} of the expressionpublic void addValidator(JboValidatorInterface intf)
addValidator in interface ValidationManagerpublic java.util.ArrayList getValidators()
getValidators in interface ValidationManagerpublic oracle.jbo.server.InheritPersonalization getInheritPersonalizationValue()
public void setInheritPersonalizationStrValue(java.lang.String s)
protected int getLoadSubclassLevel()
public java.lang.String getEditVersionsAsString()
getEditVersionsAsString in class PersistableDefObjectpublic int getMajorVersion()
getMajorVersion in class PersistableDefObjectpublic int getMinorVersion()
getMinorVersion in class PersistableDefObjectprotected void loadDefVersions(DefElement xmlElement)
protected java.lang.String getNoPersDefObjectName(java.lang.String metaObjectName)
protected java.lang.Object resolvePropertyRaw(java.lang.String property,
LocaleContext locale)
resolvePropertyRaw in class NamedObjectImplpublic java.util.HashMap getAllProperties(java.util.HashMap map,
LocaleContext locale)
getAllProperties in class NamedObjectImplpublic java.lang.String getDefXMLNameSpace()
getDefXMLNameSpace in interface PersistentDefinitiongetDefXMLNameSpace in class PersistableDefObjectpublic DifferDetails diffContents(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
DiffMergeableorgDef. Then, help
methods on DifferBase can be used to diff the attr values
and accumulate the details of diff in difDetails.
Here is example code snippet:
private static final String DIFF_STRING_ELEMS[] =
{
"MyStringVal1",
"MyStringVal2"
};
private static final String DIFF_INT_ELEMS[] =
{
"MyIntVal",
}
public DifferDetails diffContents(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
{
orgDefImpl = () orgDef;
final String editStringValues[] =
{
this.getMyStringVal1(),
this.getMyStringVal2()
};
String orgStringValues[] = null;
if (orgDef != null)
{
String orgV[] =
{
orgDefImpl.getMyStringVal1(),
orgDefImpl.getMyStringVal2()
};
orgStringValues = orgV;
}
final int editIntValues[] =
{
this.getMyIntVal(),
};
int orgIntValues[] = null;
if (orgDef != null)
{
int orgV[] =
{
orgDefImpl.getMyIntVal()
};
orgIntValues = orgV;
}
difDetails = DifferBase.diffStringArray(this, DIFF_STRING_ELEMS, editStringValues, orgStringValues, difDetails);
difDetails = DifferBase.diffIntArray(this, DIFF_INT_ELEMS, editIntValues, orgIntValues, difDetails);
return difDetails;
}
diffContents in interface DiffMergeablediffContents in class PersistableDefObjectdocDef - the document-level definitionorgDef - the original definition. It could be
null if the definition did not exist originallydifDetails - the DifferDetails that accumulate
the details of diff from the document-level (top-level) defDifferDetails that has all the details
of diffpublic void applyDiffContents(DifferDetails dif, DiffResolver resolver)
DiffMergeable
orgDef - original def object (from the branch point)
editDef - def object into which changes are to be merge
toMergeDef - def object to be merged (source of changes)
For sandbox refresh operation, orgDef comes from the branch
point, editDef from the sandbox, toMergeDef from the
mainline of the repos. With these three defs, we first diff editDef
against orgDef, producing editDifDetails.
Similarly, toMergeDef is diffed against orgDef,
producing toMergeDifDetails. The diff engine then
walks through these two sets of diffs and identifies conflicts.
After the conflicts are all resolved, we apply appropriate
changes to editDef.
applyDiffContents is called to apply changes to
scalar values. dif contains the changed values to
be applied to 'this' object. Use sample code like
the following:
public void applyDiffContents(DifferDetails dif, DiffResolver resolver)
{
DifferChangeMap detailMap = dif.getDetailMap();
Object[] updValues;
// DIFF_STRING_ELEMS from the above example code
for (int j = 0; j < DIFF_STRING_ELEMS.length; j++)
{
if ((updValues = (Object[]) detailMap.getValue(DIFF_STRING_ELEMS[j])) != null)
{
switch(j)
{
case 0:
setMyStringVal1((String) updValues[0]);
break;
case 1:
setMyStringVal2((String) updValues[0]);
break;
}
}
}
for (int j = 0; j < DIFF_INT_ELEMS.length; j++)
{
if ((updValues = (Object[]) detailMap.getValue(DIFF_INT_ELEMS[j])) != null)
{
switch(j)
{
case 0:
setMyIntVal((Integer) updValues[0]);
break;
}
}
}
}
Notice that the index specified in the case
statement is the array index of the attr in the String, int,
or boolean array.
applyDiffContents in interface DiffMergeableapplyDiffContents in class PersistableDefObjectdif - changes to be applied to 'this' defresolver - the diff resolver used in diff/merge operation