Liferay portlet preference settings change - portlet

I have a portlet defined like below.
I am trying to change the portlet preference in liferay by clicking options-> default preference, then it gives me option to select different file then i select a different file and click on set preference button, the page gets refreshed but when i click on options -> default preference i see the original one not the one i have chosen before.
So the problem is i am not able to change the default preference.(Note: i have logged in with admin user).
Does it have anything to do with
preferences-company-wide,instanceable properties?
I am trying different combinations but nothing works.
what are configuration,default preference and preference options? because in some sample i have seen they use configuration option to change the preferences, is there any documentation on these? i am having tough time in changing the preferences.
Note: i use liferay 6.2
<portlet>
<description>Sample</description>
<portlet-name>Sample</portlet-name>
<display-name>Sample</display-name>
<portlet-class>com.sample.SampleCode</portlet-class>
<init-param>
<name>jspView</name>
<value>/jsp/CustomView.jsp</value>
</init-param>
<init-param>
<name>jspEdit</name>
<value>/jsp/CustomEdit.jsp</value>
</init-param>
<!-- <expiration-cache>-1</expiration-cache> -->
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
<portlet-mode>EDIT</portlet-mode>
<portlet-mode>config</portlet-mode>
<portlet-mode>edit_defaults</portlet-mode>
<portlet-mode>editpage</portlet-mode>
</supports>
<portlet-info>
<title>Sample Portlet</title>
</portlet-info>
<portlet-preferences>
<preference>
<name>portletPreference</name>
<value>sites/test/test.page</value>
</preference>
</portlet-preferences>

I think you are missing
<requires-namespaced-parameters>false</requires-namespaced-parameters>
in liferay-portlet.xml. can you try ?
similar problem
Orbeon : Liferay Form Runner Proxy Portlet Preferences not saved

Related

Navigation, menu and look and feel disappears on Liferay 7 CE

I am trying to deploy and test a portlet on Liferay 7.0 CE version. All of a sudden I realized that the menu icon on top that displays the left navigation, the Add and the configure option on the top right and the menu on the top rightof each portlet that allows you to configure has all disappeared. I had seen and used it in the past, but am not aware at what point I lost all these options. Now I am unable to clear cache, add a new portlet or remove existing ones.
Can someone give me some ideas as to what could have happened? Could it be some javascript in my portlet that's conflicting with the bundle that holds these options? Or could something else be wrong?
Looks like I had got signed out which caused all the menu icons and navigation to disappear. I could only see the Sign-in link, but when I tried to Sign-in, sign-in did not work. The Sign-in pop-up stayed as it is. I could not see errors in any logs either. I had to undeploy the portlet after which the sign-in worked. Then I redeployed the portlet and its all good until I Sign-out and the icons disappear again and Sign-in does not work again.
Has anyone faced this issue? Why does the Sign-in not work with the portlet running? Do I need to change anything with the role?
My portlet.xml has :
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
My liferay-portlet.xml has :
<role-mapper>
<role-name>administrator</role-name>
<role-link>Administrator</role-link>
</role-mapper>
<role-mapper>
<role-name>guest</role-name>
<role-link>Guest</role-link>
</role-mapper>
<role-mapper>
<role-name>power-user</role-name>
<role-link>Power User</role-link>
</role-mapper>
<role-mapper>
<role-name>user</role-name>
<role-link>User</role-link>
</role-mapper>

Page is not loading properly with editor.html in the url AEM6.1

My page is not loading properly with the url having "editor.html" (http://localhost:4502/editor.html/content/mypage.html). But when I remove editor.html, it loads perfectly (http://localhost:4502/content/mypage.html).
I am using AEM6.1. If I open the page in classic UI, its looks good. But when I open it in touch UI, its not loading properly.
I already have a property "sling:resourceSuperType = wcm/foundation/components/page"
Some of the content is coming on the page.
It can be a JS issue, but even if I remove all the js files from my component, the issue is still there.
Anyone experienced the same issue?
This issue might be due to the 'Apache Sling Main Servlet' default configuration.
And also we can observe the error message 'components could not be loaded' or 'out of memory' in browser console when we are in Touch UI editor Mode.
By default 'Apache Sling Main Servlet' is configured with 1000 calls per request. If we increase this limit then the issue will be resolved.
For updating this follow the steps.
1. Go to the http://<host>:<port-number>/system/console/configMgr (ex: http://localhost:4502/system/console/configMgr)
2. Ctrl + F and Search for "Apache Sling Main Servlet".
3. Change the value of 'Number of Calls per Request' from 1000 (defaulut value) to 1500 or 2000.
4. Click on Save.
5. Now you can go to Touch UI edit mode and can be able to edit the components.
Check in your CRXDE under the folder /libs/wcm/core/content and look for a folder called "editor.html" with the sibling of just "editor". If you delete the editor.html folder and keep "editor", then your page will start working again.

In Liferay, how do you change/add a preference for an OOTB portlet

I want to add the following portlet preference to the Asset Publisher portlet:
<preference>
<name>assetLinkBehavior</name>
<value>viewInPortlet</value>
</preference>
This should default the configuration so that when the user clicks on the title link of a shown asset, it will go directly to that asset in its context (view in context). This is a configuration in the portlet wrench configuration UI. But this is not the default behavior when I first add the Asset Publisher portlet. So I want to add this preference somewhere. Should it be in one of the xml files in a hook?
You may have to override default portlet-custom.xml and provide preferences for asset-publisher
portlet [portlet-name 101] like
<portlet-preferences>
<preference>
<name>name</name>
<value>value</value>
</preference>
</portlet-preferences>
HTH

Eclipse RAP RWT Theming

I have a question concerning RAP RWT Theming - skining or application style(theming) in Eclipse RAP can be done by extension to branding by applying our own CSS style, defining to which EntryPoint it should be applied.
My question is:
I have main Workbench APP let say in bundle/plugin A. Before Workbench window is populated I am using JAAS Security (to secure access to my App, by puting correct user name+ pass in LoginDialog). JAAS Security is let say bundle/plugin B. When I apply branding to plugin A, this is even applied to plugin B (which has loginDialog window). If I make another branding - lets say i want to have different look for LoginDialog window & different for WorkbenchWindow, I make branding in plugin B (with different CSS style applied).
Behaviour is following: branding of plugin B is applied 1st, because LoginDialog from pluginB is called, then main app start from pluginA - but second branding is never applied (looks that 1st branding from plugin B override also branding from plugin A).
I would really appreciate some help, how to make different RWT theming for different parts of RAP application. Does anybody have some experience with this ?
Thank you in advance
Tomas Kramaric
You can look on this page: RAP Developer Guide
I did another solution:
This Code is in the Plugin.xml of my Theme Plugin:
<extension
point="org.eclipse.rap.ui.themes">
<theme
file="theme/test/test.css"
id="com.yourApplicationName.theme.test"
name="Test Theme">
</theme>
And this Code is in the Plugin.xml of my EntryWindow:
<extension
id="mailapp.entrypoints"
point="org.eclipse.rap.ui.entrypoint">
<entrypoint
applicationId="yourApplicationName"
brandingId="yourApplicationName.testAPP.ui.branding.default"
id="testAPP.entrypoint"
path="/">
</entrypoint>
<entrypoint
applicationId="yourApplicationName.testAPP"
brandingId="yourApplicationName.theme.branding.test"
id="test.entrypoint"
path="/test">
</entrypoint>
</extension>
In Browser you have to type this to open your own theme: http://127.0.0.1:10080/testAPP/test

How to customize crystal_servlet_uri?

I am having a problem with Crystal Report in JSP.
The report is viewed 1st page successfully, but I could not be viewed the next page, or export.
I've used a tool to catch the error. I realize that the error cause by invalid request.
For example my project url: http://localhost:8080/myproject, but when we navigate to next page or export report, it request to http://localhost:8080/CrystalReportViewerHandler.
It should be http://localhost:8080/myproject/CrystalReportViewerHandler.
What I have tried is put crystal_servlet_uri in web.xml:
<context-param>
<param-name>crystal_servlet_uri</param-name>
<param-value>/myproject/CrystalReportViewerHandler</param-value>
</context-param>
However, the request is not change (still http://localhost:8080/CrystalReportViewerHandler).
Does any one know another solution for this problem?
Thanks!
I experienced this exact same problem. The only solution I have found that works is to place your CrystalReportsViewer.jsp in the document root of the project. As soon as you place it anywhere under WEB-INF, the 'myproject' is dropped from subsequent calls (like next page).
However, if the JSP you use to create and process the CrystalReportViewer object is placed alongside WEB-INF (not in it), then the 'myproject' re-appears and everything works. (Or at least it did for me.)
This is maybe not the best news from a security perspective, but the requester must already have a ReportClientDocument to pass to this JSP, and that part you can control access to.