Forums de discussion

Struts Plugin Portlet

thumbnail
devi nimmagadda, modifié il y a 13 années.

Struts Plugin Portlet

Regular Member Publications: 109 Date d'inscription: 09/12/10 Publications récentes
Hi,

Can anybody know about creating struts portlet using plugin.
i have created struts portlet using plugin.

1. I have taken one service.xml file and i placed this in docroot/WEB-INF/service.xml
2. When I build the serviceBuilder I am getting Bean Locator has not set, and the exception is BeanLocatorException.
3.What is the directory structure to this portlet ?




if any body knows this topic, please help me.

thanks in advance...
thumbnail
Lalit Jugran, modifié il y a 13 années.

RE: Struts Plugin Portlet

Junior Member Publications: 33 Date d'inscription: 25/07/10 Publications récentes
Hi devi nimmagadda ,

Below is the link where you can find a war file named twitter-5.2.3.1.war.

http://code.google.com/p/liferay-twitter-portlet/



This war file is developed in liferay plugin sdk 5.2.3. you can see the directory structure inside this war file & develop a new portlet in plugin sdk 5.2.3. If you find any problem regarding this, feel free to reply me.
thumbnail
devi nimmagadda, modifié il y a 13 années.

RE: Struts Plugin Portlet

Regular Member Publications: 109 Date d'inscription: 09/12/10 Publications récentes
Hi Lalit Jugran,


Thanks for your reply. But I am getting below exception. could u please check this.

06:48:45,970 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering plugins for krish-portlet
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering plugins for krish-portlet
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.invokeDeploy(PluginPackageHotDeployListener.java:161)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:182)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.PortletContextListener.doPortalInit(PortletContextListener.java:99)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:52)
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:50)
at com.liferay.portal.kernel.servlet.PortletContextListener.contextInitialized(PortletContextListener.java:55)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
thumbnail
devi nimmagadda, modifié il y a 13 années.

RE: Struts Plugin Portlet

Regular Member Publications: 109 Date d'inscription: 09/12/10 Publications récentes
hi,

I have gone through your twitter portlet. I have seen your directory structure.

same way I did in my portlet. when i run the service.xml I am getting the classes in my package not in WEB-INF/service.

In service.xml i have given the package path as com.liferay.devi

so i am getting classes like -- >

/devi-portlet/docroot/WEB-INF/src
com.liferay.devi.model.impl
com.liferay.krish.service.base
com.liferay.krish.service.impl
com.liferay.krish.service.persistence


I have to create the WEB-INF/service , WEB-INF/src folders or it will create automatically.

is it correct way ?

Thanks in advance...
thumbnail
Lalit Jugran, modifié il y a 13 années.

RE: Struts Plugin Portlet

Junior Member Publications: 33 Date d'inscription: 25/07/10 Publications récentes
Hi devi nimmagadda,

WEB-INF/service folder is generated automatically as you generate services. Inside WEB-INF/src you create package structure for your action class only. All folders & files(META-INF & service.properties) inside it generate automatically. Inside WEB-INF/classes you get META-INF, package for you action class & service.properties after deploying your buil.xml.
thumbnail
devi nimmagadda, modifié il y a 13 années.

RE: Struts Plugin Portlet

Regular Member Publications: 109 Date d'inscription: 09/12/10 Publications récentes
hi,

yes it is generated automatically. now my portlet is working fine. Thank u very much.

Now my problem is I am using SearchContainer tags in my view.jsp page .

So I have included the file in init.jsp as

<%@ include file="/html/common/init.jsp" %>

so that i am getting below exception:

Error: /html/portlet/krish/template.jsp(17,1) /html/portlet/krish/init.jsp(32,1) File "/html/common/init.jsp" not found


Error Type: org.apache.jasper.JasperException



how to add /html/common/init.jsp to my struts portlet


Thanks for in advance
thumbnail
Lalit Jugran, modifié il y a 13 années.

RE: Struts Plugin Portlet

Junior Member Publications: 33 Date d'inscription: 25/07/10 Publications récentes
Hi devi nimmagadda,

It sounds good that you resolved your problem. First thing I would like to tell you, don't include this init.jsp, when you develop portlet in plugin sdk.

<%@ include file="/html/common/init.jsp"%>


Because in plugin sdk we develop war file which is a separate entity, & above syntax searches init.jsp from tomcat folder(you can see this file inside you tomcat folder "webapps\ROOT\html\common"). for making a separate entity you should import all your files (which you want to use in your project)in your init.jsp. you can see init.jsp of twitter portlet, available on the link which I gave you in previous post.



Hope you will also cross this hurdle. emoticonemoticon emoticon
thumbnail
devi nimmagadda, modifié il y a 13 années.

RE: Struts Plugin Portlet

Regular Member Publications: 109 Date d'inscription: 09/12/10 Publications récentes
hi,

yes, I have imported all the files that are necessary to my portlet.

Now my problem is how to generate iterateURL in my Search Container.

I have displayed Search Container in my view.jsp page. But it is not iterating.

This is the code for to display Search Container....

<%@page import="com.liferay.krish.service.KrishEntryLocalServiceUtil"%>
<%@page import="com.liferay.krish.model.KrishEntry"%>
<%@page import="java.util.List"%>
<%@ include file="/html/portlet/krish/init.jsp" %>

<%
List<KrishEntry> list = KrishEntryLocalServiceUtil.getKrishEntries(0,KrishEntryLocalServiceUtil.getKrishEntriesCount());



%>

<liferay-ui:search-container delta="20" emptyResultsMessage="Sorry. There are no employee details to
be displayed.">

<liferay-ui:search-container-results
results="<%= ListUtil.subList(list,
searchContainer.getStart(), searchContainer.getEnd()) %>"
total="<%= list.size() %>"
/>


<liferay-ui:search-container-row
className="com.liferay.krish.model.KrishEntry"
modelVar="KrishEntry"
>

<liferay-ui:search-container-column-text property="name" value="<%= list.get(0).getName()+ ""%>" />

<liferay-ui:search-container-column-text property="country" value="<%= KrishEntry.getCountry()+ ""%>" />


</liferay-ui:search-container-row>

<liferay-ui:search-iterator />
</liferay-ui:search-container>
thumbnail
devi nimmagadda, modifié il y a 13 années.

RE: Struts Plugin Portlet

Regular Member Publications: 109 Date d'inscription: 09/12/10 Publications récentes
Hi Lalit Jugran,

This is the error I am getting when I using Search container.


Error :Unable to convert string "/krish/search" to class "javax.portlet.PortletURL" for attribute "iteratorURL": Property Editor not registered with the PropertyEditorManager

Error Type : org.apache.jasper.JasperException

could you please check this,

Thank you in advance....
thumbnail
Lalit Jugran, modifié il y a 13 années.

RE: Struts Plugin Portlet

Junior Member Publications: 33 Date d'inscription: 25/07/10 Publications récentes
Hi,

Check this link, It might help you.

http://www.liferay.com/community/forums/-/message_boards/message/7110209


Because your problem is related to javax.portlet.PortletURL. So please also check your path("/krish/search") at the place where you made PortletURL.
thumbnail
devi nimmagadda, modifié il y a 13 années.

RE: Struts Plugin Portlet

Regular Member Publications: 109 Date d'inscription: 09/12/10 Publications récentes
hi,

i have gone through your portlet.

It is getting exception that is BeanLocator is Null. How can I resolve this...


I want to know about how to create iteratorURL in search container ...

I have displayed search container but it is not iterating.


if anyone knows please help me...
simon tuffle, modifié il y a 13 années.

RE: Struts Plugin Portlet

Regular Member Publications: 150 Date d'inscription: 18/05/09 Publications récentes
Hi devi,


I think you have gone wrong at the "package-path" attribute in the service-builder. Please follow the syntax:

<service-builder package-path="com.liferay.portlet.<Portlet-Name>">
.....
.....
.....
</service-builder>


And there might be other package-path(might be declared multiple times).If so remove that.



Regards,