Tuesday, August 6, 2013

what are the different tupes of staging options available on liferay?

There are two types of staging.
  • Local Live: Within the current portal environment, a clone of the current site is created. This clone contains copies all existing pages and data of portlets configured to be staged (see Staged Portlets bellow). This clone becomes the Staging environment while the original becomes the Live environment. A person with access to Staging can quickly navigate to Live and back from any page. 

  • Remote Live: A connection is made between this site and one existing in a remote server. The connection settings are essentially a persistent network configuration which defines how to locate the remote site when a publish event occurs. This site becomes the Staging environment while the remote site becomes the Live environment. 

Remote Live Connection Settings
In order to be able to pulish changes to a Remote Host/IP, the publishing server must be added to the list of allowed servers. This is done by adding the IP of the publishing server to the property tunnel.servlet.hosts.allowed in the portal-ext.properties file of the target server. Access to the /tunnel-web context on the target server must not be blocked by either proxies or firewalls. Also note that if the target server is a cluster, it is safe to set the Remote Host/IP to the load balanced address of the cluster in order to increase the high availability of the publishing process.

what is the significance of Purple and green color icons for portlets ?


All the portlets with a green icon are instanceable portlets. This means you can have
multiple instances of this portlet on a page and within a community or organization and each
of the instances can hold different data.


Portlets with a purple icon are non-instanceable portlets, meaning you can only have
one instance of this portlet across an organization or community. You cannot add this
portlet more than once to the page. Also, they share the same or common data within the
organization or community that they are in.











How can you change default portlets showing in Add menu?

By default, Add menu displays four commonly-used portlets
Web Content Display,
Asset Publisher,
Document Library Display
 Navigation portlets.

You can also change the list of the default portlets by modifying the dockbar.add.portlets property in the portalext. properties file. You need to specify the portlet ID in a comma-separated list.

Saturday, August 3, 2013

what are the possible elements in liferay-hook.xml?

The following elements are possible


<!ELEMENT portal-properties (#PCDATA)>

<!ELEMENT language-properties (#PCDATA)>

<!ELEMENT custom-jsp-dir (#PCDATA)>

<!ELEMENT service (service-type, service-impl)>

<!ELEMENT service-type (#PCDATA)>

<!ELEMENT service-impl (#PCDATA)>

Can you list portal properties can be overridden using hooks?

<!--
Not all portal properties can be overridden via a hook. The supported properties
are:

<pre>
admin.default.group.names
admin.default.role.names
admin.default.user.group.names
auth.forward.by.last.path
auto.deploy.listeners
application.startup.events
auth.failure
auth.max.failures
auth.pipeline.post
auth.pipeline.pre
auth.token.impl
auto.login.hooks
captcha.check.portal.create_account
captcha.engine.impl
control.panel.entry.class.default
convert.processes
default.landing.page.path
dl.hook.impl
dl.webdav.auto.unlock
dl.webdav.save.to.single.version
field.enable.com.liferay.portal.model.Contact.birthday
field.enable.com.liferay.portal.model.Contact.male
field.enable.com.liferay.portal.model.Organization.status
hot.deploy.listeners
image.hook.impl
javascript.fast.load
layout.static.portlets.all
layout.template.cache.enabled
layout.types
layout.user.private.layouts.auto.create
layout.user.private.layouts.enabled
layout.user.private.layouts.modifiable
layout.user.public.layouts.auto.create
layout.user.public.layouts.enabled
layout.user.public.layouts.modifiable
ldap.attrs.transformer.impl
login.create.account.allow.custom.password
login.events.post
login.events.pre
logout.events.post
logout.events.pre
mail.hook.impl
my.places.show.community.private.sites.with.no.layouts
my.places.show.community.public.sites.with.no.layouts
my.places.show.organization.private.sites.with.no.layouts
my.places.show.organization.public.sites.with.no.layouts
my.places.show.user.private.sites.with.no.layouts
my.places.show.user.public.sites.with.no.layouts
passwords.passwordpolicytoolkit.generator
passwords.passwordpolicytoolkit.static
portlet.add.default.resource.check.enabled
sanitizer.impl
servlet.session.create.events
servlet.session.destroy.events
servlet.service.events.post
servlet.service.events.pre
session.phishing.protected.attributes
terms.of.use.required
theme.css.fast.load
theme.images.fast.load
theme.loader.new.theme.id.on.import
theme.portlet.decorate.default
theme.portlet.sharing.default
theme.shortcut.icon
upgrade.processes
users.email.address.generator
users.email.address.required
users.full.name.generator
users.full.name.validator
users.screen.name.always.autogenerate
users.screen.name.generator
users.screen.name.validator
value.object.listener.*
</pre>
-->

How can you modify each actionURL, renderURL & resourceURL in portlet appllication?

We can use  PortletURLGenerationListener  to modify each action , resource and render URLs


public class MyUrlGenerationListener
implements PortletURLGenerationListener
{
public void filterActionURL(PortletURL actionUrl) {
try {
            actionUrl.setWindowState(WindowState.MAXIMIZED);
            actionUrl.setSecure(true);

} catch (Exception e) {
...
}
}
public void filterRenderURL(PortletURL renderUrl) {
try {
                    renderUrl.setWindowState(WindowState.MAXIMIZED);
                    renderUrl.setSecure(true);
} catch (Exception e) {
...
}
}
public void filterResourceURL
➥(ResourceURL resourceURL) {
...


If you want to add a property to all portlet URLs, you should consider using the PortletURLGenerationListener



RenderRequest Vs. ActionRequest