liferay-6

How to call specific method of portlet.java class rather then overide serveResource method?

你。 提交于 2019-12-01 20:38:48
问题 I want some help in liferay with ajax. Right now I am calling the ajax method from my view.jsp page to submit some data. Here is sample code I am using in view.jsp : <%@ include file="/init.jsp"%> <portlet:actionURL name="AddTest" var="add1" /> <portlet:resourceURL id="AddTest" var="AddTest"></portlet:resourceURL> <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript"> function addToDo(addToDo

How to make the ResourceResponse to forward the request to error page in liferay portlet

廉价感情. 提交于 2019-12-01 19:50:26
I am trying to forward my request to error page when error occurs during generating excel sheet. Here is sample code below. I am not sure why it is not getting forwarded to error page when the exception is thrown, it is displaying blank page but not going to my error page for sure.` @ResourceMapping("xyz") public void generateExcelExport(ResourceRequest request, ResourceResponse response) { try { //Do all the excel related logic response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setProperty("Content-Disposition", "attachment; filename=\"" +

How to create Structure & Template programmatically in Liferay 6

我怕爱的太早我们不能终老 提交于 2019-12-01 08:54:28
问题 I need to create the Structure and Template progrmatically through java code.I used following code snippets. Structure: public void createStructure(String userName,long userId){ log_.info("Inside create structure "); long structureId=115203; DDMStructure ddmStructure=DDMStructureLocalServiceUtil.createDDMStructure(structureId); ddmStructure.setName("MigrationStructure"); ddmStructure.setDescription("This Structure created programatically"); ddmStructure.setUserId(userId); ddmStructure

Portlet not getting deployed

梦想与她 提交于 2019-12-01 04:59:00
I have this strange problem at which I have spent stupid amount of time. To build my portlet, I haven't used sdk and I am using my own ant script do the job. It works all well till this wierd situation. I am basically using a lot class from portal-service.jar to change role settings etc. When I include it in my build path and deploy it again. It doesn't get deployed. On shell it shows the deployment, below is the log: Copying 1 file to C:\liferay-portal\tomcat-6.0.29\webapps\ch1_HelloWorld Deleting directory C:\liferay-portal\tomcat-6.0.29\temp\20121016060846753 06:08:47,887 INFO

How to override default Liferay Login authentication?

让人想犯罪 __ 提交于 2019-12-01 02:11:49
I am using Liferay 6.1, and I want to override default Liferay Login authentication and want to set up my custom authentication. Till now what I have done is, I have created a hook-plugin and have setup following properties in portal.properties file auth.pipeline.pre=com.liferay.portal.security.auth.MyCustomAuthenticator auth.pipeline.enable.liferay.check=false where MyCustomAuthenticator is my custom authenticator class ( which implements Authenticator). Currently, Liferay checks this custom authentication 1st, but then again it goes to Liferay itself for further Liferay authentication too. I

How do I make Liferay 6.1.0 always redirect to a 404 page when a resource isn't found?

戏子无情 提交于 2019-12-01 00:31:34
I have created a simple hook for a Liferay site I have. It contains a 404.jsp that overrides the default Liferay 404. It works fine if I type in a specific page. For example: Going to http://localhost:8080/jooky.jsp throws SEVERE: PWC6117: File "C%3A%5Cbundles%5Cliferay-portal-6.1.0-ce-ga1%5Cglassfish-3.1.1%5Cdomains%5Cdomain1%5Capplications%5Cliferay-portal%5Cjooky.jsp" not found in my Glassfish server log and redirects me to my custom /errors/404.jsp without a problem. However, going to http://localhost:8080/jooky throws a different error INFO: 14:07:41,790 INFO [PortalImpl:4873] Current URL

How to add nested portlets(liferay) through code

最后都变了- 提交于 2019-11-30 21:46:39
We have something called nested portlets in liferay. I want to add this portlet dynamically through code. Does anyone know the code for adding nested portlets, and add other portlets inside it? Thanks !!! Martin Gamulin for complete example i'll assume that you want to add nested portlet to current page using another portlets action handler. (if used from render action you would not see nested portlet until next view of the page) Add these methods to your code private static String addPortlet(final long p_userId, final Layout p_layout, final String p_portletId, final String p_columnId, final

Save file to Document directory in liferay 6.1 using API

只谈情不闲聊 提交于 2019-11-30 16:35:30
I need to save a uploaded file in sub directory of Document & Media folder in liferay from web-form portlet. I have extended the web Form portlet to do so, but file is getting uploaded successfully in database & not in Document & Media folder. I tried following code to upload the file in document directory but no success please help . ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); String title = file.getName(); DLFolder dlFolder = DLFolderLocalServiceUtil.getFolder(themeDisplay.getScopeGroupId(), 0, "Test"); ServiceContext serviceContext =

Save file to Document directory in liferay 6.1 using API

拟墨画扇 提交于 2019-11-30 16:17:37
问题 I need to save a uploaded file in sub directory of Document & Media folder in liferay from web-form portlet. I have extended the web Form portlet to do so, but file is getting uploaded successfully in database & not in Document & Media folder. I tried following code to upload the file in document directory but no success please help . ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); String title = file.getName(); DLFolder dlFolder =

How to close a popup window in Liferay?

↘锁芯ラ 提交于 2019-11-30 16:09:32
I load the WebContent edit portlet on a Popup window using the following code: <liferay-ui:icon image="edit" label="true" message="news-edit-url" url="${oneNews.newsEditUrl}" /> editUrl: taglibEditURL = "javascript:Liferay.Util.openWindow({dialog: {width: 960}," + "id: '" + renderResponse.getNamespace() + "'," + "title: '" + LanguageUtil.format(request.getLocale(), "edit-x", HtmlUtil.escape(assetRenderer.getTitle(request.getLocale()))) + "'," + "uri:'" + HtmlUtil.escapeURL(editPortletURLString) + "'});"; When the content is saved or published, the portlet is loaded on the popup window. I want