Best practise to provide styling options in liferay ADTs - liferay

I am using an ADT to display i.e. a table. I want to implement an option so people who configure the ADT can for example tick a checkbox and then the table changes so that a specific column is disabled.
Is this only possible via config files or is there an option to put this into the frontend?
Why would I want this? Because I have multiple systems and the column shall only be visible on some systems.
Thank you all for suggestions!

Related

Conditional fields in Liferay Web Content editor

We have a requirement for creating a banner for which we plan to use Web Content Display.
As part of the implementation I have created a structure with the required fields like link-type (drop-down), etc and using corresponding template.
I wish to make a conditional check based on the type of selection in the link-type and show link-to-page or text-box.
I observed that there is no option to have a conditional check in the article editor rendering.
Thus I wish to check whether there is any hack or trick that we can do to achieve the above conditional thing?
Also, can we inject custom Javascript to achieve this as part of the structure?
I finally have to stick to the default options in the liferay structure. I plan to use separator provided by LR to categories the elements to avoid end user (admin) confusion.
P.S. I was not able to locate any cool doc that would help in implementing the suggestion made by #Tobias (sorry, but I guess the wiki link above assumes you to be an expert of LR, and even the sample links in there does not work).

Xpages - Value picker UI customization

I want to create a custom value picker which can have:
Same labels
Can't use simple Domino view value picker as I need to check individual entry for some business criteria
I want to show a short summary as well to help user distinguish among similar labels (I want to add some formatting to it e.g. label in bold, summary in green small chars)
I can create an Xpage for all such value pickers or I can have a custom data provider. Now, my question is, do I need to create a custom renderer as well to display Label with summary? How do I implement the picker with modal look-n-feel (I am using bootstrap theme)?
Thanks in advance
Arun
Version 12 of the Extension Library included the code I contributed for Map Picker Data Provider and Collection Picker Data Provider. Implementing data provider outside the Extension Library packages is quite complicated - there are a lot of methods used for getting options etc that are protected, so they need reproducing. They're currently designed to take a label and value only, so they would need extending to take a summary as well.
I don't think the picker can take HTML as a picker option - that would allow you to pass in the formatting for the label and the summary. I've not tried it, but if it was allowed it would impact searching etc, so that makes me suspect it's unlikely.
Creating a renderer with bootstrap look and feel is possible. I'd recommend looking at the Extension Library renderers. It looks like the picker renderers handle the link on the page and separate classes handle the dialog that's displayed.

Generic gridview for Liferay portal

Hope you are doing fine.
This is my scenario.
I have multiple (20+) Liferay portlets that use grids/tables to display data.
Each portlet retrieves data based on a different criteria.
However, the grid is the same with some common functionalities such as filtering, pagination, data export etc.
Currently, each time we have to make a change in the grid style, I have to make the change in each of the 20+ portlets.
This is really inefficient and results in a lot of time wasted.
Hence, I was wondering whether it is possible to create a generic 'portlet' or 'composite' so that it can display data from multiple portlets?
To elaborate, the generic portlet/composite will contain the grid, filtering, pagination, export etc. features.
This generic portlet/composite will receive data from the various portlets and simply display it.
Hence, if I need to make any change in the grid style, making the change in only one place will suffice.
Has any one experienced such a scenario before?
Do you have any solution?
Thanks in advance for any help.
If you need only retrieve data by different criteria, have functionality like export data,print,pagination etc, you don't need 20+ different portlets you may use one portlet and have 20+ it instances, each would be configured like enable.export, enable.print, data.criteria and so on. Inside portlet your logic would build grid and data what you need.
If you really need Generic Portlet you may try to have all your 20+portlets in one .war. You'd simply include jsp's that are common within some portlets, extend controllers etc.
Even more... If you need to send data between portlets you may create javascript controllers that will send events each other, through Ajax get data and fill in your jsps(in that case you may use some templates). Please ask if something is unclear.
The best solution would be to use one portlet for retrieving all data, and generalise the data retrieving with one interface and different implementations - not with different port lets.
You can though try to use Liferay's Interportlet Communication facility to provide data from source portlets to target portlet - http://www.liferay.com/community/wiki/-/wiki/Main/Inter-portlet+communication
But it has it's own caveats - you'd either have to submit data in browser using AJAX or JS events, or have to use JSR-286 (Portlets 2.0) events that work on server-side, but require one to trigger an action in order to make events occur (i.e. open portlet with action URL and not render URL). More on it here - http://www.liferay.com/community/wiki/-/wiki/Main/Portlet+to+Portlet+Communication

Export list of Sitecore items as Excel (or other formats)

I noticed that sitecore has the option of exporting users in an Excel format.
I need to have similar functionality for exporting 'participations', (a users can enlist to take part in an 'event', and if their entry is approved via a sitecore workflow, a 'participation' item is created in the content tree)
Since mostly everything in Sitecore is in essence based on items, and I want to export items to Excel, my question is - what are some of the best ways of doing this?
Questions:
Is there a way to re-use this functionality for regular items?
Would it be a good idea to create a custom admin page (any tips on doing this?) which has some custom code that reads the items from the database using the API?
are there sitecore plugins/shared source projects that can help me achieve this?
Or does anyone have a better idea? - would it be better to just store the participations in SQL? I'm mostly doing it this way because I want to make use of the 'free' functionality offers, for example workflow, but if that leads to me using anti-patterns please shoot me ;)
Link is different now: https://marketplace.sitecore.net/en/Modules/Advanced_System_Reporter.aspx
P.S. Couldn't leave a comment to original answer as I don't have enough reputation. Oh well :)
Found a most excellent shared source module which does exactly this (and much more)!
Basically it allows you to configure (and easily extend, if you need to) any kind of table based report on 'items'.
The report module shows up as an application in the sitecore menu (like the user manager tool) and comes with features such as xml,csv, xls export. It's also really easy to set up, once you get the hang of it.
http://trac.sitecore.net/AdvancedSystemReporter

I need to add a choice field to sharepoint that has values depending on the current selection

I need to add a choice field to sharepoint that has values depending on the current selection.
Example:
if the current selection is Open then the options have to be 'open, and In progress
**Current selection | Possible selections**
Open | Open,In progress
In progress | In progress,To be communicates,rework
Rework | Rework,In Progress
...
That way i am forcing the user to follow some specific flow
I think you won't get this field behavior out of the box but you can archive this by implementing your own CustomFieldType.
Just take a look a this:[ www.sharepointsnippets.com/post/2009/01/Cascading-Dropdown---Configuration.aspx ] You need not download any third party software. Otherwise, just google SharePoint Cascaded/cascading lookupthere are lot of such commercial tools.
Hope this snippet works!
You can achieve this sort of behavior by editing your list's EditForm.aspx page and adding some JavaScript to the page.
Although I can't seem to find any examples for making dependant drop downs, there are a couple examples of modifying the EditForm to hide fields or make them readonly:
Making a field read-only
Hiding an entire row on the edit-form
So these are 2 columns out of which one filters the other?
Sounds like a cascading drop down list, there are a few (commercial) solutions out there.
See
http://cascddlistwithfilter.codeplex.com
for a free one.

Resources