Can multiple pages share the same instance of a portlet in Liferay? - portlet

For a website powered by Liferay EE 6.0 SP1, there will be cases where some pages will need to "share" the same instance of certain portlets, but other pages will have their own instances.
For example (contrived, but hopefully illustrative), consider a portlet with a preference that changes the portlet's background color.
Suppose that we have the following pages (the portlet's background color on that page follows the page name in this list):
Home (green)
├─ About (blue)
│ └─ Contact (blue)
├─ Products (orange)
│ ├─ AXL-900 (orange)
│ └─ VCC-218 (orange)
├─ Support (red)
│ └─ VIP (gold)
└─ Legal (green)
Note that on several pages, the portlet has the same background color preference. So far, that's easy enough; you just add a separate instance of the portlet to each page and set the preference appropriately.
However, the content managers don't want to manage the background color on a per-page basis; they want to, for example, change the background color for the portlet on all the "About" pages to purple, all at the same time (this makes sense; it automates what would otherwise be a manual [and by definition, error-prone] process).
For this to work, either the "About" and "Contact" pages, for example, would both have to use the same instance of the portlet... or they would have to have separate instances, but both instances would share the same preference values. Or perhaps there is a different approach.
Is there a way to make this work?

It looks like the way to go is to create named sets of settings and let each page have its own instance of the portlet.
In the example from the OP, the Products page would have a unique instance of the portlet which would be configured to use e.g., the "orange" setting set. Any changes made to the portlet's settings would subsequently affect any other portlets using the "orange" setting set.
See http://www.liferay.com/community/forums/-/message_boards/message/10361805#_19_message_10382903 for more information.

You're having a custom portlet of your own and you want it to be instanceable or non-instanceable depending on the placement where it is deployed, right? (As said on the link on your comment)
One possibility is to deploy another version of your portlet with slightly different name (portlet1 vs. portlet2) and now on another one (portlet1) you have setting instanceable and in another (portlet2) you have it non-instanceable. This is not a nice way, but some out of the box thinking.
Also if you could otherwise configure the instanciable thing so that some portlet window gets that setting on and another off, it would be perfect, but I don't know much about that. Maybe the all knowing Google or someone else can help in his/her own answer.
Btw. Why don't ask on comments the answering person on the another question also to look this one?
Edit_1:
After your comment I researched the issue again and found out Portlet Prefences property, whose application was described on Liferay pages and one forum. At least one comment on the forum I mentioned was near to the behavior you were talking about. Also the Liferay pages had examples of possibly interesting type of settings.

Yes, this is possible by creating non-instancable portlet, and using a scope for those pages. Here's Liferay wiki page on scopes: http://www.liferay.com/community/wiki/-/wiki/Main/Scope
UPD:
There are also a couple of Liferay-specific settings that allow you to control scope for portlet preferences: "preferences-company-wide", "preferences-unique-per-layout" and "preferences-owned-by-group" (all are set/unset via liferay-portlet.xml).
More on them here:
http://content.liferay.com/4.3/doc/devel/liferay_4_portlet_development_guide/multipage/ch02.html
And here:
http://www.liferay.com/community/forums/-/message_boards/message/10931559/maximized

Related

How to handle page relationships in Grav CMS?

I currently have a few projects pages and I’m looking to display a list of team members that are associated with each project (a member may be associated with multiple projects) but I’m not sure how I can create this. A taxonomy doesn’t provide enough information (ideally want to show an image with name and short bio) so I’m assuming I’ll need to create a /team-members/ page with member pages below it and pull this in somehow to each project.
How would I go about allowing team members to be added to projects through the admin panel?
Basically you can create a page for each team member. These page can be unvisible if you don't want to display them alone
Then you create one page for each project.
When you want to use one member page as a part of one project page, you just include it:
{{ page.find('/some/other.page').content }}
Note that the above code may require you to activate twig parsing on your pages.
This way you can include the same team member in several project pages and update team member content in only one place from the admin panel.
Another approach is to create a plugin that will enable you to manage projects and member as you want to, but it may be a little overkill given Grav can do what you want out of the box.

CQ5: links/paths in properties aren't updated on page rollout

When I create a live copy of a blueprint website, and rollout pages using standard rollout config, links in the pages are updated to reflect the live copy version.
ex. /content/myblueprintwebsite/home.html -> /content/mylivecopywebsite/home.html
But when those paths are buried inside properties of the page content nodes, they are not updated, and still points to the blueprint pages.
... is this the intended behavior? If so I guess I would have to write my own rollout config? Or is there another solution to this problem?
Thanks for your answers.
As per: https://docs.adobe.com/docs/en/aem/6-1/administer/sites/msm/msm-livecopy.html
"
When the blueprint source contains links and references that target a paragraph in a different chapter, the targets are not updated in the live copy pages. For example, a live copy is created from the Geometrixx Demo Site blueprint. Links in the Toolbar chapter that target the Services chapter are not updated in the live copy, and continue to target the original pages in the Geometrixx Demo Site.
"
My interpretation of the above:
- If the link to the target is created on a page that is in the ancestral line, the change will reflect in live copies.
I tested this by configuring a link to bp/en/parent/child-page on the bp/en/parent page and also on the bp/en page.
In both cases, the corresponding live-copy/... pages reflect changed paths to the live copy specific child page.
Moreover, the change is happening for links no matter what widget is used - OotB List, a customized link widget, or hyperlink configured in the text widget.
Further question:
Editors may want to create links from pages that is not in the ancestor line. What then? Is there a configuration that can be set to allow the change to happen ? Or are we required to write custom rollout action?
When ever a page rollout is done it updates all the individual content references for ex:
paths in property nodes, if it is stored individually i.e., not concatenated with any other text like: hello /content/test/master/en.
It doesnt update if the path is in the mid of other text.
And
Creating custom roll out doesn't server your purpose.If u really want to create custom roll out to meet this requirement then you have to create following custom live actions and write logic to find paths and then modify them.
1.ContentCopyActionFactoryCustom
2.ContentDeleteActionFactoryCustom
3.ContentUpdateActionFactoryCustom
Creating custom roll out is a risky option as roll out is called from many places like while creating live copy,from blue print section , roll outing a page and its sub pages and background execution etc.,We have to handle any exception caused in this explicitly.If u start changing one file then u end up changing all related files has roll out implementation on many java classes.
Ideal Solution : Save all the paths in a individual property and AEM will take care of updating there references
Cheers !!

Teamsite component or template

I was wondering if page templates can be built instead of individual components in Teamsite 7? I've seen other cMS systems where it is just a page template that has lots of functionality built I and you can "switch" on and off elements that you want to display instead of having to drag components onto a page? Is this possible?
Old question, but since I just came across it:
Yes, TeamSite supports templates (.template) files which can be partial or full page templates. The default location is iwadmin/main/livesite/template.
I recommend downloading the developer guides from Autonomy's web site for detailed information.
Templates in teamsite/livesite is like a bag that can contain components. But in order for a functionality to be developed in teamsite/livesite we need to create components. certainly we can avoid dragging and dropping components in each page by creating templates and dropping components within it for once. Keep in mind templates are bound to layouts. for each type of layout we need to create a template. Please have a look at TS_7.3_SiteDeveloper_rev1, Chapter 5.
Yes, you can create templates instead of dragging components.
Since, TeamSite supports templates (.template) files which can be partial or full page templates and resides at location : iwadmin/main/livesite/template.
So, whenever you try to create a new page everytime the HTML code required for that page gets automatically added with the template and layouts you selected.
But, again this is not good since you can have any number of templates you need but this could create confusions at times when you try to create a new page since you will need to remember every template name and contents that you will need for a particular page so it's better to have small lists of templates and layouts since then we can say that there is reusability in our application/website which we are going to develop using Teamsite and Livesite.
Please vote the solution if its helpful.
Thanks!

Publishing multiple sites on a single instance of umbraco

I am looking to setup a parallel site to one already that already uses umbraco for its content management system. The new site would share admins, templates, macros, and media resources, but not any content. If I setup multiple host headers pointing to the same directory with an umbraco install, how can I switch the top node (home vs home2) of the site based on which url is being accessed?
I believe you first have to change a setting in umbracosettings.config:
<useDomainPrefixes>true</useDomainPrefixes>
Then I think you also have to right click on each top node and click 'Manage Hostnames', then add the appropriate host name for that top node.
It already sounds like you have IIS configured correctly, so you should be good to go on that front.
It's been a while since I've worked with Umbraco, but I think I'm mostly right ;-)

How do I delete a Discipline in EPF Composer 1.5?

I'm making a method combining Scrum with the OpenUP lifecycle and deliverables. I also want to keep the OpenUP disciplines apart from "Project Management". I can "hide" it so that it's not immediately obvious in my generated method site. But when you then navigate to the "Risk List" artefact for example the PM is still seen as contributing, and if you click on the link, you get taken to the PM Discipline page.
How can I remove it completely from my method without deleting it from the OpenUP library which I'm consuming?
I've never used EPF Composer.
I did a little bit of google searches and I understand what you are looking for can be done through Configurations (select OpenUP in your Library view) and published View definitions.
See slide 83 and 84 of this PPT document. You should be able to take it from there.
An Introduction to the Eclipse Process Framework.
In case the link does not work, I searched for "EPF Composer" "Standard categories" on google and the document is at the bottom of the first results page.
Good luck.
To those who are to lazy to search and browse slides:
Slide 83:
Select sub-set of method library for publishing to HTML or exporting to MS. Use “Content” selections for course grain (Plug-in and package level) configuration. Use “Add/Subtract these Categories” for fine grain (element level) configuration.
Slide 84:
Categories group related elements
Views defined by selecting Categories