You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The metadata stored in the metaData map can be used to transport data about a note to the frontend. The map is prepared in com.communote.server.web.fe.widgets.blog.ChronologicalPostListWidget and already populated with information like whether the current user likes the note or the number of user liking it. The extension point CPLNoteMetaDataProvider allows adding further data in a plugin.
The JavaScript part of the ChronologicalPostListWidget has the method getNoteMetaData(noteId) to access the metadata of a note rendered by the widget. This is for example used by the NoteActionHandler.js which provides the logic of the reply, edit, delete, .... links below the note.
To get your NotesMetaProvider automagically loaded and called you will have to add the following iPOJO annotations to your class
org.apache.felix.ipojo.annotations.Component
org.apache.felix.ipojo.annotations.Instantiate
org.apache.felix.ipojo.annotations.Provides
Moreover, you have to explicitly implement the interface com.communote.server.web.fe.widgets.extension.WidgetExtension. The maven bundle-plugin needs this to correctly resolve the OSGi imports and exports when building your Communote plugin and creating the MANIFEST.MF file (feels like a bug). Alternatively you could add the imports and exports manually via Import-Package and Export-Package instructions in the configuration part of the maven-bundle-plugin in your pom.xml.
Hi,
is there a tutorial for using the
CPLNoteMetaDataProvider
?Is there something to add?
The text was updated successfully, but these errors were encountered: