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

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

Related

TYPO3: Backend Module

I've installed the lfeditor extension, the backend module is registered as per below (ext_tables.php):
TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'SGalinski.lfeditor',
'user',
...
In other words, the backend module is registered as a submodule of the user main module.
I can't seem to be able to find the backend module though. Changing the second parameter to 'web' results in the link showing up under Web, but of course I don't want to change the original code.
How do I activate the user main module?
User menu was moved to the top bar, so modules added to it will be availble there ;) Right, this one should be probably be placed in other menu (System?), but I think that's an author's concept.
Try to activate one of the "User" extension, for example "User>User Settings". If you activate it, menu "USER TOOLS" should be visible.

How to add short description in ATG Component?

How to add short description for component property in ATG.
Ex: If we see loggingDebug property in a Nucleus componenet Short description will shown as True if debug log events should be generated. How to create such description for my property in component>
Simple Answer:
You cannot add a description for an individual property.
You can add a description for a component by specifying a $description in the .properties file
More Complex Answer:
For viewing in the dyn/admin screens, each Nucleus component is associated with an Admin Servlet. It is the Admin Servlet of the component that renders the admin screen (not a JSP or JHTML page).
For a given component, the admin interface determines the admin servlet to use for rendering the screen by querying the component.
ATG packages a number of admin servlets with the platform. The default one is ServiceAdminServlet and is associated with the GenericService. So anything that extends from GenericService - most of the components you write - gets an admin screen that is rendered by ServiceAdminServlet. There is a different one for the Repository class - which is why the admin screen for a repository component looks different to that for most other components.
You can implement your own admin interface for your components by implementing your own AdminServlet class, and overwriting the getAdminService() method (defined in the AdminableService interface) on your component to return an instance of your custom admin servlet.
However, GenericService already implements the interface, and provides a convenient extensible hook method createAdminServlet(), and it is preferable to extend ServiceAdminServlet than creating your own AdminServlet from scratch.
The ServiceAdminServlet class defines a printAdmin(...) method which you override to output the custom HTML needed.
Caveat:
In my original answer, I had missed out the More Complex section, because I think that it is far more effort for little gain. However, I have updated my answer to be more complete.
I have been working, very hands-on, with the ATG platform since 1998, and never once have I had reason to create my own admin interface.
I think what you need is create the MyComponentBeanInfo.java.
if you look inside the ATG_PATH\DAS\src\Java\atg\droplet, will see something like this: Component.java and your descriptor ComponentBeanInfo.java.
i have searched in oracle docs and i found this link:Oracle Docs: BeanInfo Example
inside in your componente will be:
paramDescriptors[0] = new ParamDescriptor("myProperty",
"this is my short description",
DynamoServlet.class,
false, true, outputDescriptors);
beanDescriptor = new BeanDescriptor(MyComponent.class);
beanDescriptor.setShortDescription("A custom servlet bean.");
beanDescriptor.setValue("paramDescriptors", paramDescriptors);
beanDescriptor.setValue("componentCategory", "Servlet Beans");

How to create view via fragment that is linked to applicatio model eclipse plugin

Using application.e4xmi, I want to create view via fragments using this application model. Could you please tell me the step by step procedure.
what i have tried is, i have created one fragment in the one plugin application. in that i have given application id after that i have created part stack and after that created part. Here i have given class URI is my view class(path of view class in the viewplugin project). But without that view plugin in the runconfigurations, i am unable to see view part.
As far as I understand your question, you wish to have a plugin containing a model fragment which contributes to an application model located in another plugin, and the problem is that a (View-)Part you tried to contribute that way doesn't show in the application window. I hope I didn't get you wrong there and I will assume that the error is not just that the plugin with the model fragment is not included in the run configurations... (?)
You can find a useful tutorial in Lars Vogel's webpages. However, as the various requirements may be confusing, I will summarize the process for potential future readers.
TL;DR:
You might have set a wrong Element ID and/or Featurename for your Part.
Your question implies that you maybe tried to implement a Part model element as a ViewPart, when in E4, there is no longer any interface for a (View) Part to implement, so maybe try creating the Part controls in a #PostConstruct-annotated method instead.
Another possible reason for your contributed Part not showing up is the plugin providing the model fragment not having the correct settings for the bundle options SymbolicName and/or ActivationPolicy ('Plug-in is singleton' and 'Activate when class is loaded').
Application
In order to have an application model to contribute to, we first need an Eclipse4 application project. Create one by selecting File -> New -> Other from the Eclipse main menu. Choose the wizard Eclipse 4 Application Project in the Eclipse 4 category. Name your project as you wish, choose Equinox as OSGI framework, and check the Generate an Activator... option. The newly created project will contain a file Application.e4xmi (your application model) and a *.product file (product definition). Open the latter in and make sure org.eclipse.e4.ui.workbench.swt.E4Application is set as Application in the Overview tab.
Open Application.e4xmi and append a Part Stack somewhere in the model tree, as you probably have already done anyways.
Model fragment
Create a new plugin for the model fragment. Letting it have an Activator class won't harm. It is important, however, that the options Activate this plug-in when one of its classes is loaded and This plug-in is a singleton are both checked in the Overview tab of its plugin.xml editor. Next, create a model fragment with New -> Other... -> Eclipse 4 -> Model -> New Model Fragment in the plugin's Package Explorer context menu. The wizard will automatically create an extension of org.bbaw.bts.ui.pdr.fragment specifying your model fragment file. The plugin's dependencies should include:
org.eclipse.swt
org.eclipse.jface
org.eclipse.e4.core.di
org.eclipse.e4.ui.workbench
javax.inject
org.eclipse.e4.ui.di
Open the model fragment file (fragment.e4xmi by default) and attach a Model Fragment to the Model Fragments node. Your new Model Fragment element needs to specify both an Element ID and a Featurename in order to correctly address the Application Model's element that you want to contribute to. Thus, copy the ID of the Part Stack previously created in the Application Model into the Element ID field of the Model Fragment you've just created. In the Featurename field, type children, as this is the Part stack's attribute we want to contribute to. Then, append a Part to the Model Fragment element and specify the Class URI of the Part's implementation. This class is basically a POJO, no implementation of ViewPart is necessary! It creates its GUI in a method annotated with the #PostConstruct annotation, e.g.
#PostConstruct
public final void createComposite(final Composite parent)
That should be it. When running the application project's product, the Part should appear like expected (given the plugin containing that Part is included in the run configuration...).

Liferay portlet preference settings change

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

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