Package org.ametys.cms.repository
Class SimpleIndexableAmetysObject<F extends SimpleIndexableAmetysObjectFactory>
java.lang.Object
org.ametys.plugins.repository.AbstractAmetysObject
org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
org.ametys.plugins.repository.jcr.SimpleModelAwareAmetysObject<F>
org.ametys.cms.repository.SimpleIndexableAmetysObject<F>
- Type Parameters:
F- the actual type of factory.
- All Implemented Interfaces:
IndexableAmetysObject,ModifiableIndexableAmetysObject,IndexableDataHolder,ModifiableIndexableDataHolder,IndexableJCRAmetysObject,AmetysObject,ModelAwareAmetysObject,ModifiableModelAwareAmetysObject,DataHolder,ModelAwareDataHolder,ModifiableDataHolder,ModifiableModelAwareDataHolder,JCRAmetysObject,ModelAwareJCRAmetysObject,MetadataAwareAmetysObject,ModifiableMetadataAwareAmetysObject,ModifiableAmetysObject,RemovableAmetysObject
- Direct Known Subclasses:
Catalog,ContentBackupAmetysObject,ContentConsistencyResult,DefaultIndexableTraversableAmetysObject,FormEntry,FormPageRule
public class SimpleIndexableAmetysObject<F extends SimpleIndexableAmetysObjectFactory>
extends SimpleModelAwareAmetysObject<F>
implements IndexableJCRAmetysObject
Indexable implementation of an
AmetysObject, backed by a JCR node.-
Field Summary
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIX -
Constructor Summary
ConstructorsConstructorDescriptionSimpleIndexableAmetysObject(javax.jcr.Node node, String parentPath, F factory) Creates anSimpleIndexableAmetysObject. -
Method Summary
Modifier and TypeMethodDescriptiongetComposite(String compositePath) Retrieves the composite at the given pathgetComposite(String compositePath, boolean createNew) Retrieves the composite at the given pathprotected ModifiableIndexableDataHolderReturns theDataHolderof thisAmetysObject.getExternalComposite(String compositePath) Retrieves the external composite at the given pathgetExternalComposite(String compositePath, boolean createNew) Retrieves the external composite at the given pathgetExternalRepeater(String repeaterPath) Retrieves the external repeater at the given pathgetExternalRepeater(String repeaterPath, boolean createNew) Retrieves the external repeater at the given pathgetLocalComposite(String compositePath) Retrieves the local composite at the given pathgetLocalComposite(String compositePath, boolean createNew) Retrieves the local composite at the given pathgetLocalRepeater(String repeaterPath) Retrieves the local repeater at the given pathgetLocalRepeater(String repeaterPath, boolean createNew) Retrieves the local repeater at the given pathOptional<? extends ModifiableIndexableDataHolder> Retrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the rootgetRepeater(String repeaterPath) Retrieves the repeater at the given pathgetRepeater(String repeaterPath, boolean createNew) Retrieves the repeater at the given pathRetrieves theDataHolderthat is the root of the current oneList<org.apache.solr.common.SolrInputDocument> indexData(org.apache.solr.common.SolrInputDocument document, CMSDataContext context) Indexes all data and properties of thisAmetysObjectMethods inherited from class org.ametys.plugins.repository.jcr.SimpleModelAwareAmetysObject
dataToJSON, dataToJSON, dataToJSONForEdition, dataToMap, dataToSAX, dataToSAX, dataToSAXForEdition, getDefinition, getDifferences, getDifferences, getDifferences, getDifferences, getExternalValue, getLocalValue, getModel, getModelItemTypeExtensionPoint, getRepositoryData, getStatus, getType, getValueOfType, getValueOfTypeOrDefault, getValueOrDefault, getValueWithMultiValuedPathSegments, hasDefinition, hasDifferences, hasDifferences, hasDifferences, hasDifferences, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValue, hasValueOrEmpty, isMultiple, isMultiple, removeExternalizableMetadataIfExists, removeExternalValue, removeLocalValue, removeValue, setExternalValue, setLocalValue, setStatus, setValue, setValue, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValuesMethods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesMethods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
dataToJSON, dataToSAX, equals, getDataNames, getValue, getValueOrDefault, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCodeMethods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getValue, getValueOrDefault, hasValue, hasValueOrEmptyMethods inherited from interface org.ametys.cms.data.ametysobject.IndexableAmetysObject
getSystemPropertyExtensionPoint, indexDataMethods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNodeMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareAmetysObject
getModelMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToJSON, dataToJSON, dataToJSON, dataToJSON, dataToJSONForEdition, dataToMap, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getDataNames, getDefinition, getDifferences, getDifferences, getDifferences, getDifferences, getExternalValue, getLocalValue, getModelItemTypeExtensionPoint, getStatus, getType, getValueOfType, getValueOfTypeOrDefault, getValueOrDefault, getValueWithMultiValuedPathSegments, hasDefinition, hasDifferences, hasDifferences, hasDifferences, hasDifferences, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, isMultiple, isMultipleMethods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChangesMethods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableDataHolder
getRepositoryData, removeValue, synchronizeValuesMethods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolderMethods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableModelAwareDataHolder
removeExternalizableMetadataIfExists, removeExternalValue, removeLocalValue, setExternalValue, setLocalValue, setStatus, setValue, setValue, synchronizeValues, synchronizeValues, synchronizeValuesMethods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
-
Constructor Details
-
SimpleIndexableAmetysObject
Creates anSimpleIndexableAmetysObject.- Parameters:
node- the node backing thisAmetysObjectparentPath- the parentPath in the Ametys hierarchyfactory- theSimpleIndexableAmetysObjectFactorywhich created the AmetysObject
-
-
Method Details
-
getDataHolder
Description copied from class:AbstractAmetysObjectReturns theDataHolderof thisAmetysObject.- Overrides:
getDataHolderin classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Returns:
- the
DataHolderof thisAmetysObject
-
indexData
public List<org.apache.solr.common.SolrInputDocument> indexData(org.apache.solr.common.SolrInputDocument document, CMSDataContext context) throws BadItemTypeException Description copied from interface:IndexableAmetysObjectIndexes all data and properties of thisAmetysObject- Specified by:
indexDatain interfaceIndexableAmetysObject- Parameters:
document- the solr document representing thisAmetysObjectcontext- The context of the data to index- Returns:
- additional solr documents that may have been created (ex: repeater entries)
- Throws:
BadItemTypeException- if the saxed value's type does not matches the stored data
-
getComposite
public ModifiableIndexableComposite getComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceDataHolder- Specified by:
getCompositein interfaceIndexableDataHolder- Specified by:
getCompositein interfaceModelAwareDataHolder- Specified by:
getCompositein interfaceModifiableDataHolder- Specified by:
getCompositein interfaceModifiableIndexableDataHolder- Specified by:
getCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getCompositein classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Parameters:
compositePath- path of the composite to retrieve- Returns:
- the composite or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the data holder has a model and the given composite path is not defined by this modelBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
getComposite
public ModifiableIndexableComposite getComposite(String compositePath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableDataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceModifiableDataHolder- Specified by:
getCompositein interfaceModifiableIndexableDataHolder- Specified by:
getCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getCompositein classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Parameters:
compositePath- path of the composite to retrievecreateNew-trueto create the composite if it does not exist,falseotherwise- Returns:
- the composite or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the data holder has a model and the given composite path is not defined by this modelBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalComposite
public ModifiableIndexableComposite getLocalComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the local composite at the given path- Specified by:
getLocalCompositein interfaceIndexableDataHolder- Specified by:
getLocalCompositein interfaceModelAwareDataHolder- Specified by:
getLocalCompositein interfaceModifiableIndexableDataHolder- Specified by:
getLocalCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getLocalCompositein classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Parameters:
compositePath- path of the externalizable composite to retrieve- Returns:
- the composite or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalComposite
public ModifiableIndexableComposite getLocalComposite(String compositePath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRetrieves the local composite at the given path- Specified by:
getLocalCompositein interfaceModifiableIndexableDataHolder- Specified by:
getLocalCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getLocalCompositein classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Parameters:
compositePath- path of the externalizable composite to retrievecreateNew-trueto create the composite if it does not exist,falseotherwise- Returns:
- the composite or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalComposite
public ModifiableIndexableComposite getExternalComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the external composite at the given path- Specified by:
getExternalCompositein interfaceIndexableDataHolder- Specified by:
getExternalCompositein interfaceModelAwareDataHolder- Specified by:
getExternalCompositein interfaceModifiableIndexableDataHolder- Specified by:
getExternalCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getExternalCompositein classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Parameters:
compositePath- path of the externalizable composite to retrieve- Returns:
- the composite or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalComposite
public ModifiableIndexableComposite getExternalComposite(String compositePath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRetrieves the external composite at the given path- Specified by:
getExternalCompositein interfaceModifiableIndexableDataHolder- Specified by:
getExternalCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getExternalCompositein classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Parameters:
compositePath- path of the externalizable composite to retrievecreateNew-trueto create the composite if it does not exist,falseotherwise- Returns:
- the composite or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getRepeater
public ModifiableIndexableRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the repeater at the given path- Specified by:
getRepeaterin interfaceIndexableDataHolder- Specified by:
getRepeaterin interfaceModelAwareDataHolder- Specified by:
getRepeaterin interfaceModifiableIndexableDataHolder- Specified by:
getRepeaterin interfaceModifiableModelAwareDataHolder- Overrides:
getRepeaterin classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Parameters:
repeaterPath- path of the repeater to retrieve- Returns:
- the repeater or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given repeater path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getRepeater
public ModifiableIndexableRepeater getRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRetrieves the repeater at the given path- Specified by:
getRepeaterin interfaceModifiableIndexableDataHolder- Specified by:
getRepeaterin interfaceModifiableModelAwareDataHolder- Overrides:
getRepeaterin classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Parameters:
repeaterPath- path of the repeater to retrievecreateNew-trueto create the repeater if it does not exist,falseotherwise- Returns:
- the repeater or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalRepeater
public ModifiableIndexableRepeater getLocalRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the local repeater at the given path- Specified by:
getLocalRepeaterin interfaceIndexableDataHolder- Specified by:
getLocalRepeaterin interfaceModelAwareDataHolder- Specified by:
getLocalRepeaterin interfaceModifiableIndexableDataHolder- Specified by:
getLocalRepeaterin interfaceModifiableModelAwareDataHolder- Overrides:
getLocalRepeaterin classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Parameters:
repeaterPath- path of the externalizable repeater to retrieve- Returns:
- the repeater or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given repeater path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalRepeater
public ModifiableIndexableRepeater getLocalRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRetrieves the local repeater at the given path- Specified by:
getLocalRepeaterin interfaceModifiableIndexableDataHolder- Specified by:
getLocalRepeaterin interfaceModifiableModelAwareDataHolder- Overrides:
getLocalRepeaterin classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Parameters:
repeaterPath- path of the externalizable repeater to retrievecreateNew-trueto create the repeater if it does not exist,falseotherwise- Returns:
- the repeater or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalRepeater
public ModifiableIndexableRepeater getExternalRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the external repeater at the given path- Specified by:
getExternalRepeaterin interfaceIndexableDataHolder- Specified by:
getExternalRepeaterin interfaceModelAwareDataHolder- Specified by:
getExternalRepeaterin interfaceModifiableIndexableDataHolder- Specified by:
getExternalRepeaterin interfaceModifiableModelAwareDataHolder- Overrides:
getExternalRepeaterin classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Parameters:
repeaterPath- path of the externalizable repeater to retrieve- Returns:
- the repeater or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given repeater path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalRepeater
public ModifiableIndexableRepeater getExternalRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRetrieves the external repeater at the given path- Specified by:
getExternalRepeaterin interfaceModifiableIndexableDataHolder- Specified by:
getExternalRepeaterin interfaceModifiableModelAwareDataHolder- Overrides:
getExternalRepeaterin classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Parameters:
repeaterPath- path of the externalizable repeater to retrievecreateNew-trueto create the repeater if it does not exist,falseotherwise- Returns:
- the repeater or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getParentDataHolder
Description copied from interface:DataHolderRetrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the root- Specified by:
getParentDataHolderin interfaceDataHolder- Specified by:
getParentDataHolderin interfaceIndexableDataHolder- Specified by:
getParentDataHolderin interfaceModelAwareDataHolder- Specified by:
getParentDataHolderin interfaceModifiableDataHolder- Specified by:
getParentDataHolderin interfaceModifiableIndexableDataHolder- Specified by:
getParentDataHolderin interfaceModifiableModelAwareDataHolder- Overrides:
getParentDataHolderin classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Returns:
- the parent of the current
DataHolder
-
getRootDataHolder
Description copied from interface:DataHolderRetrieves theDataHolderthat is the root of the current one- Specified by:
getRootDataHolderin interfaceDataHolder- Specified by:
getRootDataHolderin interfaceIndexableDataHolder- Specified by:
getRootDataHolderin interfaceModelAwareDataHolder- Specified by:
getRootDataHolderin interfaceModifiableDataHolder- Specified by:
getRootDataHolderin interfaceModifiableIndexableDataHolder- Specified by:
getRootDataHolderin interfaceModifiableModelAwareDataHolder- Overrides:
getRootDataHolderin classSimpleModelAwareAmetysObject<F extends SimpleIndexableAmetysObjectFactory>- Returns:
- the root
DataHolder
-