public class JCRRichText extends JCRResource implements ModifiableRichText
RichText
, based on the ametys:richText nodetype.Modifier and Type | Field and Description |
---|---|
private static String |
_ANNOTATIONS_NODE_NAME
The annotations node name.
|
private boolean |
_lockAlreadyChecked |
private AmetysObjectResolver |
_resolver |
private Node |
_rootDataNode |
Constructor and Description |
---|
JCRRichText(Node node,
AmetysObjectResolver resolver)
Constructor
|
Modifier and Type | Method and Description |
---|---|
private void |
_checkLock() |
void |
addAnnotation(String name,
String value)
Add a value to a semantic annotation
|
void |
addAnnotation(String name,
String[] values)
Add values to a semantic annotation
|
ModifiableFolder |
getAdditionalDataFolder()
Returns the Folder holding additional data.
Its internal organization is application dependant. |
String[] |
getAnnotationNames()
Get the content annotation names.
|
protected ModifiableCompositeMetadata |
getAnnotationsNode(boolean createNew)
Get the annotations container node.
|
String[] |
getAnnotationValues(String name)
Get the values of a given annotation.
|
void |
removeAnnotation(String name)
Remove a given semantic annotation
|
void |
removeAnnotations()
Return all semantic annotations
|
getEncoding, getInputStream, getLastModified, getLength, getMimeType, getNode, getOutputStream, rename, setEncoding, setInputStream, setLastModified, setMimeType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOutputStream, rename, setEncoding, setInputStream, setLastModified, setMimeType
getEncoding, getInputStream, getLastModified, getLength, getMimeType
private static final String _ANNOTATIONS_NODE_NAME
private Node _rootDataNode
private AmetysObjectResolver _resolver
private boolean _lockAlreadyChecked
public JCRRichText(Node node, AmetysObjectResolver resolver) throws AmetysRepositoryException
node
- the JCR Node backing this JCRRichText
resolver
- The resolver, used to resolve object collections.AmetysRepositoryException
- if an error occurspublic ModifiableFolder getAdditionalDataFolder()
ModifiableRichText
getAdditionalDataFolder
in interface ModifiableRichText
getAdditionalDataFolder
in interface RichText
public String[] getAnnotationNames() throws AmetysRepositoryException
RichText
getAnnotationNames
in interface RichText
AmetysRepositoryException
- if an error occurs.public String[] getAnnotationValues(String name) throws AmetysRepositoryException
RichText
getAnnotationValues
in interface RichText
name
- The name of the annotation.AmetysRepositoryException
- if an error occurs.public void addAnnotation(String name, String value) throws AmetysRepositoryException
ModifiableRichText
addAnnotation
in interface ModifiableRichText
name
- The name of the annotationvalue
- The value to appendAmetysRepositoryException
- if an error occurs.public void addAnnotation(String name, String[] values) throws AmetysRepositoryException
ModifiableRichText
addAnnotation
in interface ModifiableRichText
name
- The name of the annotationvalues
- The values to appendAmetysRepositoryException
- if an error occurs.public void removeAnnotations() throws AmetysRepositoryException
ModifiableRichText
removeAnnotations
in interface ModifiableRichText
AmetysRepositoryException
- if an error occurs.public void removeAnnotation(String name) throws AmetysRepositoryException
ModifiableRichText
removeAnnotation
in interface ModifiableRichText
name
- The name of the semantic association to removeAmetysRepositoryException
- if an error occurs.protected ModifiableCompositeMetadata getAnnotationsNode(boolean createNew) throws UnknownMetadataException, AmetysRepositoryException
createNew
- true
to create the node if it doesn't exist, false
otherwise.UnknownMetadataException
- If the node doesn't exist and createNew is false.AmetysRepositoryException
- If a repository error occurs.private void _checkLock() throws RepositoryException
RepositoryException