public abstract class RepositoryItemImpl extends java.lang.Object implements MutableRepositoryItem, atg.repository.RepositoryChangedItem, java.io.Serializable, java.lang.Comparable
Modifier and Type | Class and Description |
---|---|
static interface |
RepositoryItemImpl.LinkGenerator
Generate a URL for the specified repository item, if possible.
|
static class |
RepositoryItemImpl.NullObject
Placeholder that represents a 'null' value in the changes table
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
protected ItemDescriptorImpl |
mItemDescriptor |
protected RepositoryItemImpl |
mWrappedItem |
static RepositoryItemImpl.NullObject |
NULL_OBJECT |
Constructor and Description |
---|
RepositoryItemImpl(ItemDescriptorImpl pDesc)
The item descriptor for this item
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkWrappedItemForLoops(RepositoryItemImpl pWrappedItem)
Checks to see if the wrapped item is the same as this one, or wraps this one at any
point down the line.
|
int |
compareTo(java.lang.Object pOther)
Compares this item to another Object.
|
boolean |
equals(java.lang.Object pObject)
Are these the same item?
|
RepositoryItemDescriptor |
getItemDescriptor()
Returns the RepositoryItemDescriptor property, which describes
the known properties for the item.
|
protected ItemDescriptorImpl |
getItemDescriptorImpl()
Returns the item descriptor implementation class without throwing
an exception and to avoid casting on every method call.
|
java.lang.String |
getItemDisplayName()
The name of this item which can be used in a UI.
|
abstract java.lang.Object |
getOldPropertyValue(RepositoryPropertyDescriptor pDesc)
Returns the value of this property not including any changes made by
this transaction.
|
java.lang.Object |
getPropertyValue(RepositoryPropertyDescriptor pDesc)
This method is typically overridden by sub-classes.
|
java.lang.Object |
getPropertyValue(java.lang.String pPropertyName)
Returns the property of the given name.
|
Repository |
getRepository()
Returns the Repository which contains this item
|
abstract java.lang.String |
getRepositoryId()
Returns the unique id associated with this object in the
repository.
|
protected RepositoryImpl |
getRepositoryImpl() |
RepositoryItemImpl |
getWrappedItem() |
int |
hashCode()
Make sure that the hashCode's match the equals method.
|
boolean |
isBeingCheckedOut() |
boolean |
isMutable()
Is this repository mutable?
|
abstract boolean |
isRemoved()
Returns true if this item has been removed.
|
abstract boolean |
isTransient()
Is this item in the repository yet?
|
protected void |
preReadObject(java.io.ObjectInputStream pStream)
initialize objects before deserialization
|
java.lang.String |
printItem()
Returns the String representation of this object.
|
java.lang.String |
printItem(boolean pEscapeHtml,
RepositoryItemImpl.LinkGenerator pLinkGenerator)
Returns the String representation of this object.
|
abstract void |
removePropertyValueFromCache(RepositoryPropertyDescriptor pDesc)
This method is called from user defined property types when they want
to remove the value in the cache for this particular property.
|
void |
setBeingCheckedOut(boolean pBeingCheckedOut)
Flag that indicates this item is in the process of being checked out.
|
void |
setItemDescriptor(RepositoryItemDescriptor pItemDescriptor)
This method should only be used by adapter implementations, not by
clients of the repository api.
|
abstract void |
setPropertyValue(RepositoryPropertyDescriptor pDesc,
java.lang.Object pValue)
Sets the given property for a particular property descriptor.
|
void |
setPropertyValue(java.lang.String pPropertyName,
java.lang.Object pPropertyValue)
Sets the property of the given name with the supplied object.
|
abstract void |
setPropertyValueInCache(RepositoryPropertyDescriptor pDesc,
java.lang.Object pValue)
This method is called from user defined property types when they want
to store a value in the cache for this particular property.
|
protected void |
setPropertyValueUnChecked(java.lang.String pPropertyName,
java.lang.Object pPropertyValue)
Sets the property of the given name with the supplied object.
|
protected abstract void |
setRemoved(boolean pRemoved)
Called from the readObject method when we try to restore a reference
to an item which has been removed.
|
abstract void |
setRepositoryId(java.lang.String pId)
If a user changes the id of an "id property", you need to implement
this method.
|
protected abstract void |
setTransient(boolean pTransient)
Called from the readObject method to make this item transient
|
void |
setWrappedItem(RepositoryItemImpl pWrappedItem)
Sets the property WrappedItem.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getContextMemberships
public static java.lang.String CLASS_VERSION
public static final RepositoryItemImpl.NullObject NULL_OBJECT
protected transient ItemDescriptorImpl mItemDescriptor
protected transient RepositoryItemImpl mWrappedItem
public RepositoryItemImpl(ItemDescriptorImpl pDesc)
public abstract java.lang.String getRepositoryId()
getRepositoryId
in interface RepositoryItem
public abstract void setRepositoryId(java.lang.String pId)
public abstract boolean isRemoved() throws RepositoryException
RepositoryException
public java.lang.Object getPropertyValue(java.lang.String pPropertyName)
getPropertyValue
in interface RepositoryItem
public abstract java.lang.Object getOldPropertyValue(RepositoryPropertyDescriptor pDesc)
getOldPropertyValue
in interface atg.repository.RepositoryChangedItem
pPropertyDescriptor
- property to getpublic abstract void setPropertyValue(RepositoryPropertyDescriptor pDesc, java.lang.Object pValue)
public abstract void setPropertyValueInCache(RepositoryPropertyDescriptor pDesc, java.lang.Object pValue)
public abstract void removePropertyValueFromCache(RepositoryPropertyDescriptor pDesc)
public void setPropertyValue(java.lang.String pPropertyName, java.lang.Object pPropertyValue)
This method is in here despite the fact that this is not a MutableRepositoryItem. If your implementation uses this base class for its mutable repository, you can just use this method to do preprocessing and then implement the version which takes a RepositoryPropertyDescriptor instead of a name.
setPropertyValue
in interface MutableRepositoryItem
protected void setPropertyValueUnChecked(java.lang.String pPropertyName, java.lang.Object pPropertyValue)
This method is in here despite the fact that this is not a MutableRepositoryItem. If your implementation uses this base class for its mutable repository, you can just use this method to do preprocessing and then implement the version which takes a RepositoryPropertyDescriptor instead of a name. Note: Internal method to allow bypassing various checks
public java.lang.Object getPropertyValue(RepositoryPropertyDescriptor pDesc)
public Repository getRepository()
getRepository
in interface RepositoryItem
public final RepositoryItemDescriptor getItemDescriptor()
getItemDescriptor
in interface RepositoryItem
public void setItemDescriptor(RepositoryItemDescriptor pItemDescriptor)
public java.lang.String getItemDisplayName()
DisplayableItem
getItemDisplayName
in interface DisplayableItem
public boolean isMutable()
protected RepositoryImpl getRepositoryImpl()
protected ItemDescriptorImpl getItemDescriptorImpl()
public abstract boolean isTransient()
isTransient
in interface RepositoryItem
protected abstract void setTransient(boolean pTransient)
protected abstract void setRemoved(boolean pRemoved)
public int compareTo(java.lang.Object pOther)
ClassCastException
.Nota Bene: the item descriptor is not considered in the comparsion for performance, and because Collections of repository items sorted with this method are intended to have the same item descriptor. This means that this method is not consistent with equals. In order to put RepositoryItems into a SortedSet or SortedMap the Set or Map must have a non null Comparator anyway, since RepositoryItem does not currently implement Comparable.
compareTo
in interface java.lang.Comparable
pOther
- the Object
to be compared.getRepositoryId().compareTo(pOther.getRepositoryId())
ClassCastException
- if the argument is not a
RepositoryItem
.java.util.Comparable
,
SortedSet
,
SortDirectives
public boolean equals(java.lang.Object pObject)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String printItem()
public java.lang.String printItem(boolean pEscapeHtml, RepositoryItemImpl.LinkGenerator pLinkGenerator)
pEscapeHtml
- whether to escape characters, HTMLpLinkGenerator
- a link generator to generate links to
references to repository items.public java.lang.String toString()
toString
in class java.lang.Object
public void setBeingCheckedOut(boolean pBeingCheckedOut)
pBeingCheckedOut
- is this item being checked out?public boolean isBeingCheckedOut()
public void setWrappedItem(RepositoryItemImpl pWrappedItem)
pWrappedItem
- new value to setpublic RepositoryItemImpl getWrappedItem()
public boolean checkWrappedItemForLoops(RepositoryItemImpl pWrappedItem)
protected void preReadObject(java.io.ObjectInputStream pStream) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException