Page History
...
Actual Implementation
Project setup
Create a module and empty webapp using the maven archetype selector, then change the parent pom and module pom to thisCheck out the project from git here.
Slightly modified Content app
Import the following configuration as you can see, we slightly modified certain fields of a "standard" content app.
Adding categorization
Categorization was added in the same way as for 4.5:
Basically you add a tab and extend /modules/categorization/dialogs/generic/tabCategorization.
Linking the image to use stuff from the assets
Instead of using the image uploader we will link the image field of the restaurant to a Node in the assets. Uploading assets will be done using the asset app. It is foreseen to be able to upload as well assets directly through the content app (probably 5.1).
This is done by adding the following:
Or link to the asset will be stored under the image node, to retrieve it in our page, we can use the DAMTemplating API, we can use it as follows:
Code Block | ||
---|---|---|
| ||
//restoNode is the node in our restaurant workspace that holds the restaurant we want to submit. ContentMap cm = new ContentMap(restoNode); Asset asset = damTemplatingFunctions.getAssetForId((String)cm.get("image")); |
Adding an activation action
We duplicate the activation action we can find in ... the Pages app and add it under the actions, add an acticate the corresponding activate action in the actionbar.
As you can see we only allowed superuser to activate content, this is because we would like to add a sort of activation authorization command or a basic approval workflow.
Adding the public instance
...
We want to show a notification so we need the Shell.
Giving the correct rights to the activation action and request for activation action
We want to disable the "direct" publishing for the mobile author and enable only the "request for activation" button so this is how we restrict it.
Adding a messageView
We need to register a messageView so that the pulse can find it and open it. So we add a messageview to the addresto app as follows.
...