portlet

Liferay开发学习Part4:portlet工程结构

我的未来我决定 提交于 2019-11-27 14:00:24
src:源代码包 web.xml:和普通的Web工程的web.xml一样 build.xml:ant的构建文件,不需要修改继承自SDK portlet.xml:portlet定义的描述文件,这里定义了portlet的名称、初始化参数、模式类型、portlet相关信息、权限等;此文件中可以看到view-template对应的XXX.jsp,当我们在liferay里面添加portlet后,看到的页面内容就是XXX.jsp的内容 liferay-portlet.xml:定义Portlet默认可用的用户组、默认模板、是否支持多个实例等。这个文件中的 portlet-name 必须匹配 portlet.xml 中的 portlet- name。 liferay-display.xml:描述portlet所属类别 来源: oschina 链接: https://my.oschina.net/u/589482/blog/104936

How to use Ext.define in ExtJS 4?

浪尽此生 提交于 2019-11-27 10:54:43
问题 I'm new to ExtJS 4 and need some help understanding how the Ext.define works, please. In fact what I want to do is something similar to the portlets in the portal example, in my application I will need so many objects to add in my different tabs, so in order to organize my code and not have just one very big script, I want to define each component I need in a separate file and then call it in the main script when I need it (I will mainly use the examples so this is why I want to know how Ext

Passing array from .jsp to javascript function

雨燕双飞 提交于 2019-11-27 07:10:09
问题 I have a Liferay portlet where I pass a String array from action phase to render phase in my .jsp file. I am able to access the array and iterate through it like this: <c:forEach var="item" items="${arrayItems}"> <p>${item}</p> </c:forEach> This is just to check that passing the data works fine... However, I would like to pass this whole array to my javascript function (that handles rendering the data to canvas). Any idea how to do this? So far, I have tried the following: <% String[] items;

respond to http request with json object in portlet

谁说胖子不能爱 提交于 2019-11-27 05:18:38
I am a beginner in liferay portlet development and I am developing a portlet that receives a http get request, processes some information and than it has to return a json object. My problem is that my portlet sends a whole html page instead of just the json object. This is my code: HttpServletResponse servletResponse = PortalUtil.getHttpServletResponse((renderResponse)); servletResponse.setHeader("Content-type", "application/json"); servletResponse.setCharacterEncoding("application/json"); PrintWriter out = servletResponse.getWriter(); out.write(EntityUtils.toString(responseEntity)); out.flush

Accessing the user from a liferay portlet?

被刻印的时光 ゝ 提交于 2019-11-26 17:23:10
问题 I'm attempting to develop a portlet for liferay. How can I get access to the username and password (and other data liferay has) of the user that's currently logged in? I'd also like to be able to execute some code when users change their password. 回答1: You can get the User ID by calling getRemoteUser() in the PortletRequest object. This is defined by JSR-168 therefore it's cross-portal compatible. Once you have the ID you can fetch the additional informations by calling getUserById() (a

respond to http request with json object in portlet

纵然是瞬间 提交于 2019-11-26 11:32:55
问题 I am a beginner in liferay portlet development and I am developing a portlet that receives a http get request, processes some information and than it has to return a json object. My problem is that my portlet sends a whole html page instead of just the json object. This is my code: HttpServletResponse servletResponse = PortalUtil.getHttpServletResponse((renderResponse)); servletResponse.setHeader(\"Content-type\", \"application/json\"); servletResponse.setCharacterEncoding(\"application/json\

What exactly is Field Injection and how to avoid it?

夙愿已清 提交于 2019-11-26 03:02:05
问题 I read in some posts about Spring MVC and Portlets that field injection is not recommended. Cause i\'m trying to get a So i asked myself if i\'m using field injection and i can\'t answer it. As i understand it field injection is if you inject a Bean into a attribute with @Autowired like this: CartController.java: ... @Autowired private Cart cart; ... BookshopConfiguartion.java: @Configuration public class BookShopConfiguration { @Bean public Cart cart(){ return new Cart(); } //more