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.UseDataHolder.dataToSAX(org.xml.sax.ContentHandler, java.lang.String)
methods instead of this helperComponent for helping SAXing metadata.
-
-
Field Summary
Fields Modifier and Type Field Description protected Context
_context
Deprecated.The avalon context.protected JSONUtils
_jsonUtils
Deprecated.The JSON conversion utilities.protected AmetysObjectResolver
_resolver
Deprecated.Ametys object resolverprotected UserManager
_userManager
Deprecated.The user managerstatic String
ROLE
Deprecated.The Avalon Role.
-
Constructor Summary
Constructors Constructor Description MetadataSaxer()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected Map<String,Object>
_binaryAsJson(BinaryMetadata binaryMetadata, String prefix, String metadataName)
Deprecated.Get the JSON representation of aBinaryMetadata
protected List<String>
_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.protected Map<String,Object>
_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 Detail
-
_jsonUtils
protected JSONUtils _jsonUtils
Deprecated.The JSON conversion utilities.
-
_resolver
protected AmetysObjectResolver _resolver
Deprecated.Ametys object resolver
-
_userManager
protected UserManager _userManager
Deprecated.The user manager
-
-
Constructor Detail
-
MetadataSaxer
public MetadataSaxer()
Deprecated.
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
Deprecated.- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
public void service(ServiceManager manager) throws ServiceException
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
protected List<String> _getRefAmetysObjectIds(TraversableAmetysObject objectCollection)
Deprecated.Get the id of child Ametys objects- Parameters:
objectCollection
- The parent object collection- Returns:
- The id of child Ametys objects
-
_userAsJson
protected Map<String,Object> _userAsJson(UserIdentity userIdentity)
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
-
-