I want know the purpose and the functionality of association related listeners in liferay BaseModelListener.
Ex : onBeforeAddAssociation , onAfterRemoveAssociation , onAfterAddAssociation
Any ideas are really appreciated, because no proper documentation was found.
I posted the question in liferay forum and got the answer. According to David H Nebinger these listeners will not be invoked ever.
They were intended to be used when (if) collections were supported in
the model objects. Since they are not supported They will not be
invoked.
Related
I would love to work with the number of comments within one article in the asset publisher. For example, I would love:
to display the most commented articles
add tags to the articles with most comments
or something similar that enables me to select the most commented articles. What is the easiest way to start working with articles based on number of comments?
Any examples, code, API, and similar is highly welcome!
For the second point the solution is easy: Model Listener
Just implement a model listener of comment (MBMessage should be the real name) and in the method onAfterCreate retrieve the article on which the comment has been posted and the total number of comment for it, then for example if(totalArticleCommentNumber > 99) add your tags.
Then in the configuration of the Asset Publisher you can select just the articles with your specific tag.
But, if you need some different logic (sort the articles by comment number for example) the case is more complex and you'll have to customize the Asset Publisher to add your new logic.
EDIT:
Some guide that may help you for customize the portal:
Overriding App JSP
Liferay 7 Portlet to Empower Your Custom Development: In this article there is a lot of usefull things but I want point you to the paragraph 4.3, to summarize very shortly: If a class is a OSGI Component (so has the OSGI annotation #Component) you can extend that class and through the service.ranking:Integer property of the annotation you can tell to Liferay that your class overrides the original service.
I have looked everywhere for the following issue, but unfortunately not able to find the solution. I an using JSF 2.2, richfaces, Netbeans 7.3.1 and GlassFish Server. I am trying to build a GUI for selecting multiple items in the rich:picklist, adding them to the right and clicking a submit button which would execute methods (having JDBC calls) associated with each of the selected items on the right and hence populating the tables in Database. Any working example would be greatly appreciated. Thanks!
You can see a live demo of all richfaces components here http://livedemo.exadel.com/richfaces-demo/
Here all the components usage and its tag information every thing is clearly given. Still if you feel any problem with understanding then you can post another question with a specific problem. The question you have asked is a very general one. no offense.
Hope above link helps you.
Can somebody give me a use case as to how can the PortletURLListener be used? if it can be used at all?
Like we have ModelListener can we also use PortletURLListener?
Just like in ModelListener we can inject functionality on creation of a model, on update of a model or on delete and so on.
So can we use the PortletURLListener the same way like ModelListener to do
something when a specific URL is called? Any other approach if not PortletURLListener? Since the name is such I thought that could be of help.
And can we use it in a hook? or it is just used by Liferay? Any other practical usecase you have seen or implemented by extending or using this class?
Thanks in advance.
Thanks Mark for the prompt :-)
The PortletURLListener is used e.g. for deploying and undeploying by Liferay core. For more details see Liferay sources for PortletHotDeployListener:
https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/com/liferay/portal/deploy/hot/PortletHotDeployListener.java
Answer after Update:
You can create hook and put servlet.service.events.post=com.my.MyAfterChangeAction propery to the portal.properties. The MyAfterChangeAction class must implements com.liferay.portal.kernel.events.Action.
Can anyone tell me where com.ibm.xsp.component.UIIncludeComposite is documented? I searched in the help file for UIIncludeComposite but found nothing.
There is only one brief mention of it in Mastering xPages.
com.ibm.xsp.component.UIIncludeComposite is the class for the object returned by getComponent when calling getComponent for a custom control.
In fact where is anything documented? I think the single biggest frustration as a newbie xPage programmer is the lack of documentation or where to find it.
The Java class is documented in the Javadoc available at http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Domino_Designer_Extensibility_APIs_Javadoc_8.5.3 which points to this page for the specific class:
http://public.dhe.ibm.com/software/dw/lotus/Domino-Designer/JavaDocs/DesignerAPIs/com/ibm/xsp/component/UIIncludeComposite.html
General documentation for Upgrade Pack 1 and Extension Library is available here:
http://www-10.lotus.com/ldd/ddwiki.nsf/xpViewCategories.xsp?lookupName=Domino%20Designer%20XPages%20Extension%20Library
requestScope is a com.sun.faces.context.RequestMap object, I found its methods reference at http://www.docjar.com/docs/api/com/sun/faces/context/RequestMap.html. I wonder if it belongs to the JSF API.
The packages here http://www.docjar.com/projects/Mojarra-2.0.1-code.html are different from the official reference here: download.oracle.com/docs/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/api/index.html. It seems the packages have been moved into javax.*. So what version is XPage based on?
Erik Brooks has an article about this. Or take a look at the Wikipedia page.
XPages are based on JSF 1.2
I learned the answer after I knew more about J2EE. JSF API is only the specification. com.sun.faces.* and similar things are concrete implementations.