DataHolder.toSAX(ContentHandler)
or DataHolder.toSAX(ContentHandler, Locale)
methods instead of this helper@Deprecated public class MetadataSaxer extends AbstractLogEnabled implements Component, Serviceable, Contextualizable
Modifier and Type | Field and Description |
---|---|
protected Context |
_context
Deprecated.
The avalon context.
|
protected JSONUtils |
_jsonUtils
Deprecated.
The JSON conversion utilities.
|
protected AmetysObjectResolver |
_resolver
Deprecated.
Ametys object resolver
|
protected UserManager |
_userManager
Deprecated.
The user manager
|
static String |
ROLE
Deprecated.
The Avalon Role.
|
Constructor and Description |
---|
MetadataSaxer()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
_binaryAsJson(BinaryMetadata binaryMetadata,
String prefix,
String metadataName)
Deprecated.
Get the JSON representation of a
BinaryMetadata |
protected List<String> |
_getRefAmetysObjectIds(TraversableAmetysObject objectCollection)
Deprecated.
Get the id of child Ametys objects
|
protected 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 metadata
|
void |
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.
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected JSONUtils _jsonUtils
protected AmetysObjectResolver _resolver
protected UserManager _userManager
public MetadataSaxer()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void saxMetadata(ContentHandler contentHandler, CompositeMetadata compositeMetadata) throws AmetysRepositoryException, SAXException, IOException
contentHandler
- the content handler where to SAX into.compositeMetadata
- the composite metadata.AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.public void saxMetadata(ContentHandler contentHandler, CompositeMetadata compositeMetadata, Locale locale) throws AmetysRepositoryException, SAXException, IOException
contentHandler
- the content handler where to SAX into.compositeMetadata
- the composite metadata.locale
- The locale to use for localized metadata, such as MultilingualString
. Can be null to sax all existing locales.AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.protected void _saxAllMetadata(ContentHandler contentHandler, CompositeMetadata metadata, String prefix, Locale locale) throws AmetysRepositoryException, SAXException, IOException
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 as MultilingualString
. Can be null to sax all existing locales.AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.protected void _saxMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix, Locale locale) throws AmetysRepositoryException, SAXException, IOException
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 as MultilingualString
. Can be null to sax all existing locales.AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.protected void _saxBinaryMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix) throws AmetysRepositoryException, SAXException
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.prefix
- the metadata path prefix.AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.protected void _saxRichTextMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix) throws AmetysRepositoryException, SAXException, IOException
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.prefix
- the metadata path prefix.AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.protected void _saxStringMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix) throws AmetysRepositoryException, SAXException
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.prefix
- the metadata path prefix.AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.protected void _saxMultilingualStringMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix, Locale currentLocale) throws AmetysRepositoryException, SAXException
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.AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.protected void _saxEnumeratedStringMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, Enumerator enumerator) throws AmetysRepositoryException, SAXException
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.enumerator
- The enumerator for labelisable valuesAmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.protected void _saxDateMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName, String prefix) throws AmetysRepositoryException, SAXException
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.prefix
- the metadata path prefix.AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.protected void _saxUserMetadata(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName) throws SAXException
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.SAXException
- if an error occursprotected void _saxSingleUserMetadataAsJson(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName) throws SAXException
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.SAXException
- if an error occursprotected void _saxMultipleUserMetadataAsJson(ContentHandler contentHandler, CompositeMetadata parentMetadata, String metadataName) throws SAXException
contentHandler
- the content handler where to SAX into.parentMetadata
- the parent composite metadata.metadataName
- the metadata name.SAXException
- if an error occursprotected void _saxObject(ContentHandler contentHandler, AmetysObject object, String prefix, boolean isDeep, Locale locale) throws AmetysRepositoryException, IOException, SAXException
contentHandler
- the content handler where to SAX into.object
- the AmetysObject
to sax.prefix
- the metadata path prefix.isDeep
- If true
and the AmetysObject is a MetadataAwareAmetysObject
, its metadata will be saxed.locale
- The locale to use for localized metadata, such as MultilingualString
. Can be null to sax all existing locales.AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.protected List<String> _getRefAmetysObjectIds(TraversableAmetysObject objectCollection)
objectCollection
- The parent object collectionprotected Map<String,Object> _userAsJson(UserIdentity userIdentity)
userIdentity
- The user identityprotected Map<String,Object> _binaryAsJson(BinaryMetadata binaryMetadata, String prefix, String metadataName)
BinaryMetadata
binaryMetadata
- The metadataprefix
- The prefixmetadataName
- The metadata name