...
- Add the property to the Media item version interface (
CustomMediaItemVersion.java
). - Add the property to the Media item version (
CustomMediaItemVersionImpl.java
). - Add the property to the form backing object (
CustomMediaItemVersionFBO.java
). - Add a label to the language files to translate “Author” in the supported languages.
- Add the field to the edit JSP (
editMetadata.jspf
).
Adding a
...
Property to the
...
Business Object
The Business object "CustomMediaItemVersion
" represents the data model of the HelloWorld media item. Since we want the author metadata field to be persisted we add this property to this class. We define the property as instance variable and add a getter and setter for it:
CustomMediaItemVersion.java
Code Block | ||
---|---|---|
| ||
/** * Returns the author of the custom media item. * @return the author of the custom media item */ String getAuthor(); /** * Sets the author of the custom media item. * @param name the author of the custom media item to set */ void setAuthor(String author); |
Adding a Metadata Field to the Media Item Version
The Business object CustomMediaItemVersionImpl.java
represents the data model of the HelloWorld media item. Since we want the author metadata field to be persisted we add this property to this class. We define the property as instance variable and add a getter and setter for it:CustomMediaItemVersionImpl.java
Code Block | ||
---|---|---|
| ||
@Property public String getAuthor() { return JcrUtil.getString(getPrivateNode(), "myJcrPrefix:author"); } public void setAuthor(String author) { JcrUtil.setString(getPrivateNode(),"myJcrPrefix:author", author); } |
...