Commit a80f7aa1 authored by abenkaddour's avatar abenkaddour

Add actions in the controller

parent acfea85a
Pipeline #2085 passed with stages
in 1 minute and 58 seconds
......@@ -185,6 +185,34 @@ public class MetaViewController {
}
/**
* The user add the current document to the basket. An event to share this action is sent to others Portlets.
*
* @param response
* The action response
* @param model
* The model
*/
@ActionMapping(params = "action=addToBasketMeta")
public void addToBasket(final ActionResponse response, final ModelMap model) {
response.setEvent(QName.valueOf("{http://weblab.ow2.org/portlet/metaview/action}addToBasket"), (Document) model.get(MetaViewController.RESOURCE));
}
/**
* The user pin the current document to the basket. An event to share this action is sent to others Portlets.
*
* @param response
* The action response
* @param model
* The model
*/
@ActionMapping(params = "action=pinToBasketMeta")
public void pinToBasket(final ActionResponse response, final ModelMap model) {
response.setEvent(QName.valueOf("{http://weblab.ow2.org/portlet/metaview/action}pinToBasket"), (Document) model.get(MetaViewController.RESOURCE));
}
// #############################################################################
// event mapping methods #
// #############################################################################
......@@ -277,5 +305,4 @@ public class MetaViewController {
mav.addObject("message_error", ex.getMessage());
return mav;
}
}
......@@ -50,6 +50,12 @@
<supported-publishing-event>
<qname xmlns:meta="http://weblab.ow2.org/events/meta">meta:useAsSource</qname>
</supported-publishing-event>
<supported-publishing-event>
<qname xmlns:meta="http://weblab.ow2.org/events/meta">meta:addDocument</qname>
</supported-publishing-event>
<supported-publishing-event>
<qname xmlns:meta="http://weblab.ow2.org/events/meta">meta:pinDocument</qname>
</supported-publishing-event>
</portlet>
<!-- filters -->
......@@ -97,4 +103,12 @@
<qname xmlns:meta="http://weblab.ow2.org/events/meta">meta:useAsSource</qname>
<value-type>org.ow2.weblab.core.model.PieceOfKnowledge</value-type>
</event-definition>
<event-definition>
<qname xmlns:meta="http://weblab.ow2.org/events/meta">meta:addDocument</qname>
<value-type>org.ow2.weblab.core.model.Document</value-type>
</event-definition>
<event-definition>
<qname xmlns:meta="http://weblab.ow2.org/events/meta">meta:pinDocument</qname>
<value-type>org.ow2.weblab.core.model.Document</value-type>
</event-definition>
</portlet-app>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment