Class MetadataSaxer
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.repository.metadata.MetadataSaxer
- All Implemented Interfaces:
Component
,Contextualizable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
MetadataManager
@Deprecated
public class MetadataSaxer
extends AbstractLogEnabled
implements Component, Serviceable, Contextualizable
Deprecated.
Component for helping SAXing metadata.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Context
Deprecated.The avalon context.protected JSONUtils
Deprecated.The JSON conversion utilities.protected AmetysObjectResolver
Deprecated.Ametys object resolverprotected UserManager
Deprecated.The user managerstatic final String
Deprecated.The Avalon Role. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_binaryAsJson
(BinaryMetadata binaryMetadata, String prefix, String metadataName) Deprecated.Get the JSON representation of aBinaryMetadata
_getRefAmetysObjectIds
(TraversableAmetysObject objectCollection) Deprecated.Get the id of child Ametys objectsprotected void
_saxAllMetadata
(ContentHandler contentHandler, CompositeMetadata metadata, String prefix, Locale locale) Deprecated.SAX all the metadata of a given composite metadata, with the given prefix.protected void
_saxBinaryMetadata
(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix) Deprecated.SAX a binary metadata.protected void
_saxDateMetadata
(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix) Deprecated.SAX a metadata as a Date.protected void
_saxEnumeratedStringMetadata
(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, Enumerator enumerator) Deprecated.SAX a string metadata.protected void
_saxMetadata
(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix, Locale locale) Deprecated.SAX a single metadata.protected void
_saxMultilingualStringMetadata
(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix, Locale currentLocale) Deprecated.SAX a multilingual string metadata.protected void
_saxMultipleUserMetadataAsJson
(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName) Deprecated.SAX a metadata as a User as JSON.protected void
_saxObject
(ContentHandler contentHandler, AmetysObject object, String prefix, boolean isDeep, Locale locale) Deprecated.SAX an Object, i.e.protected void
_saxRichTextMetadata
(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix) Deprecated.SAX a rich-text metadata.protected void
_saxSingleUserMetadataAsJson
(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName) Deprecated.SAX a metadata as a User as JSON.protected void
_saxStringMetadata
(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix) Deprecated.SAX a string metadata.protected void
_saxUserMetadata
(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName) Deprecated.SAX a metadata as a User._userAsJson
(UserIdentity userIdentity) Deprecated.Get the JSON representation of a User metadatavoid
contextualize
(Context context) Deprecated.void
saxMetadata
(ContentHandler contentHandler, CompositeMetadata compositeMetadata) Deprecated.SAXes a composite metadata.void
saxMetadata
(ContentHandler contentHandler, CompositeMetadata compositeMetadata, Locale locale) Deprecated.SAXes a composite metadata.void
service
(ServiceManager manager) Deprecated.Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
Deprecated.The Avalon Role. -
_jsonUtils
Deprecated.The JSON conversion utilities. -
_resolver
Deprecated.Ametys object resolver -
_context
Deprecated.The avalon context. -
_userManager
Deprecated.The user manager
-
-
Constructor Details
-
MetadataSaxer
public MetadataSaxer()Deprecated.
-
-
Method Details
-
contextualize
Deprecated.- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
Deprecated.- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
saxMetadata
public void saxMetadata(ContentHandler contentHandler, CompositeMetadata compositeMetadata) throws AmetysRepositoryException, SAXException, IOException Deprecated.SAXes a composite metadata.- Parameters:
contentHandler
- the content handler where to SAX into.compositeMetadata
- the composite metadata.- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.
-
saxMetadata
public void saxMetadata(ContentHandler contentHandler, CompositeMetadata compositeMetadata, Locale locale) throws AmetysRepositoryException, SAXException, IOException Deprecated.SAXes a composite metadata.- Parameters:
contentHandler
- the content handler where to SAX into.compositeMetadata
- the composite metadata.locale
- The locale to use for localized metadata, such asMultilingualString
. Can be null to sax all existing locales.- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.
-
_saxAllMetadata
protected void _saxAllMetadata(ContentHandler contentHandler, CompositeMetadata metadata, String prefix, Locale locale) throws AmetysRepositoryException, SAXException, IOException Deprecated.SAX all the metadata of a given composite metadata, with the given prefix.- Parameters:
contentHandler
- the content handler where to SAX into.metadata
- the composite metadata.prefix
- the metadata path prefix.locale
- The locale to use for localized metadata, such asMultilingualString
. Can be null to sax all existing locales.- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.
-
_saxMetadata
protected void _saxMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix, Locale locale) throws AmetysRepositoryException, SAXException, IOException Deprecated.SAX a single metadata.- Parameters:
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.prefix
- the metadata path prefix.locale
- The locale to use for localized metadata, such asMultilingualString
. Can be null to sax all existing locales.- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.
-
_saxBinaryMetadata
protected void _saxBinaryMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix) throws AmetysRepositoryException, SAXException Deprecated.SAX a binary metadata.- Parameters:
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.prefix
- the metadata path prefix.- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.
-
_saxRichTextMetadata
protected void _saxRichTextMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix) throws AmetysRepositoryException, SAXException, IOException Deprecated.SAX a rich-text metadata.- Parameters:
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.prefix
- the metadata path prefix.- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.
-
_saxStringMetadata
protected void _saxStringMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix) throws AmetysRepositoryException, SAXException Deprecated.SAX a string metadata.- Parameters:
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.prefix
- the metadata path prefix.- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.
-
_saxMultilingualStringMetadata
protected void _saxMultilingualStringMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix, Locale currentLocale) throws AmetysRepositoryException, SAXException Deprecated.SAX a multilingual string metadata.- Parameters:
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.prefix
- the metadata path prefixcurrentLocale
- The current locale. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.
-
_saxEnumeratedStringMetadata
protected void _saxEnumeratedStringMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, Enumerator enumerator) throws AmetysRepositoryException, SAXException Deprecated.SAX a string metadata.- Parameters:
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.enumerator
- The enumerator for labelisable values- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.
-
_saxDateMetadata
protected void _saxDateMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix) throws AmetysRepositoryException, SAXException Deprecated.SAX a metadata as a Date.- Parameters:
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.prefix
- the metadata path prefix.- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.
-
_saxUserMetadata
protected void _saxUserMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName) throws SAXException Deprecated.SAX a metadata as a User.- Parameters:
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.- Throws:
SAXException
- if an error occurs
-
_saxSingleUserMetadataAsJson
protected void _saxSingleUserMetadataAsJson(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName) throws SAXException Deprecated.SAX a metadata as a User as JSON.- Parameters:
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.- Throws:
SAXException
- if an error occurs
-
_saxMultipleUserMetadataAsJson
protected void _saxMultipleUserMetadataAsJson(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName) throws SAXException Deprecated.SAX a metadata as a User as JSON.- Parameters:
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.- Throws:
SAXException
- if an error occurs
-
_saxObject
protected void _saxObject(ContentHandler contentHandler, AmetysObject object, String prefix, boolean isDeep, Locale locale) throws AmetysRepositoryException, IOException, SAXException Deprecated.SAX an Object, i.e. its ID and name, and optionally its metadata.- Parameters:
contentHandler
- the content handler where to SAX into.object
- theAmetysObject
to sax.prefix
- the metadata path prefix.isDeep
- Iftrue
and the AmetysObject is aMetadataAwareAmetysObject
, its metadata will be saxed.locale
- The locale to use for localized metadata, such asMultilingualString
. Can be null to sax all existing locales.- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.
-
_getRefAmetysObjectIds
Deprecated.Get the id of child Ametys objects- Parameters:
objectCollection
- The parent object collection- Returns:
- The id of child Ametys objects
-
_userAsJson
Deprecated.Get the JSON representation of a User metadata- Parameters:
userIdentity
- The user identity- Returns:
- The user as JSON
-
_binaryAsJson
protected Map<String,Object> _binaryAsJson(BinaryMetadata binaryMetadata, String prefix, String metadataName) Deprecated.Get the JSON representation of aBinaryMetadata
- Parameters:
binaryMetadata
- The metadataprefix
- The prefixmetadataName
- The metadata name- Returns:
- The binary as JSON
-
DataHolder.dataToSAX(org.xml.sax.ContentHandler, java.lang.String)
methods instead of this helper