Fórum

Resource importer in Lilferay 6.2.0 GE2

thumbnail
Murtaza Ghadiali, modificado 9 Anos atrás.

Resource importer in Lilferay 6.2.0 GE2

New Member Postagens: 11 Data de Entrada: 03/03/14 Postagens Recentes
Hello Everyone,

Recently, I started learning Liferay 6.2.0 version.

I created a new theme, from the development tutorial.

There is functionality to create resource in theme like (WCM) and embed that resource directly into theme. Now, I had created one WCM content which I have to show on the page. I had configured sitemap.json also.

Now, my problem is whenever I am going to deploy this theme, an extra site is created by default in my portal control panel.

So, not able to understand how to get rid of it.

Any help would be appreciated.

For reference I am pasting my liferay-plugin-package.properties.

name=custom
module-group-id=liferay
module-incremental-version=1
tags=
short-description=
change-log=
page-url=http://www.liferay.com
author=Liferay, Inc.
licenses=LGPL
long-description=
liferay-versions=6.2.0+

required-deployment-contexts=\
resources-importer-web

resources-importer-developer-mode-enabled=false


content of sitemap.json is follows:--


{
"layoutTemplateId": "1_columns",
"publicPages": [
{
"columns": [
[
{
"portletId": "56",
"portletPreferences": {
"articleId": "welcome.html",
"portletSetupShowBorders": "false"
}
}
]
],
"friendlyURL": "/welcome",
"name": "Welcome",
"title": "Welcome"
}
]
}
thumbnail
Byrån Zaugg, modificado 9 Anos atrás.

RE: Resource importer in Lilferay 6.2.0 GE2

Expert Postagens: 252 Data de Entrada: 06/04/12 Postagens Recentes
There's various ways to configure how themes deploy. What's your end goal?

Are you not wanting any Site created? Just a Site Template? One Site only and no Site Templates?
thumbnail
Murtaza Ghadiali, modificado 9 Anos atrás.

RE: Resource importer in Lilferay 6.2.0 GE2

New Member Postagens: 11 Data de Entrada: 03/03/14 Postagens Recentes
Hi Byran,

Thanks for the reply.

No I don't want to create a new Site or Site Template when I deploy my theme, just want to add the pages in my current site, what I had created Manually.

That's what I wanted to do.
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Resource importer in Lilferay 6.2.0 GE2

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Hi Murtaza,

In your lifera-plugin-package.properties file you can add this line --

resources-importer-target-class-name=


and set it's value to either com.liferay.portal.model.LayoutSetPrototypeModel (default) or com.liferay.portal.model.Group

The LayoutSetPrototypeModel is the entity that is used import the details into a Site Template. The Group one is the one that is used to import the resources into a specific Site. Base on what you have written I am guessing what you are after is the second option -- com.liferay.portal.model.Group.

Let us know if that doesn't help.
thumbnail
Murtaza Ghadiali, modificado 9 Anos atrás.

RE: Resource importer in Lilferay 6.2.0 GE2

New Member Postagens: 11 Data de Entrada: 03/03/14 Postagens Recentes
Hi Andrew,

Thanks for your reply to.

I had done following two step :-

1) Have change following value in liferay-plugin-package.properties,
resources-importer-developer-mode-enabled=false
resources-importer-target-class-name=com.liferay.portal.model.Group
resources-importer-target-value=MedShastra


There is one site in my portal name as MedShastra that is the reason I had given MedShastra in resources-importer-target-value, but it give following error.

INFO: Initializing Spring root WebApplicationContext
16:31:12,903 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]][ThemeHotDeployListener:97] Registering themes for medshastra-theme
16:31:13,472 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]][ThemeHotDeployListener:110] 1 theme for medshastra-theme is available for use
16:31:13,485 ERROR [liferay/hot_deploy-1][SerialDestination:68] Unable to process message {destinationName=liferay/hot_deploy, response=null, responseDestinationName=n
ull, responseId=null, payload=null, values={companyId=0, command=deploy, servletContextName=medshastra-theme}}
com.liferay.portal.kernel.messaging.MessageListenerException: com.liferay.portal.DuplicateGroupException
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
at com.liferay.portal.kernel.messaging.SerialDestination$1.run(SerialDestination.java:65)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.liferay.portal.DuplicateGroupException
at com.liferay.portal.service.impl.GroupLocalServiceImpl.validateName(GroupLocalServiceImpl.java:4526)
at com.liferay.portal.service.impl.GroupLocalServiceImpl.addGroup(GroupLocalServiceImpl.java:329)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
at com.sun.proxy.$Proxy30.addGroup(Unknown Source)
at com.liferay.portal.service.GroupLocalServiceUtil.addGroup(GroupLocalServiceUtil.java:888)
at com.liferay.resourcesimporter.util.BaseImporter.afterPropertiesSet(BaseImporter.java:110)
at com.liferay.resourcesimporter.messaging.ResourcesImporterHotDeployMessageListener.initialize(ResourcesImporterHotDeployMessageListener.java:204)
at com.liferay.resourcesimporter.messaging.ResourcesImporterHotDeployMessageListener.onDeploy(ResourcesImporterHotDeployMessageListener.java:278)
at com.liferay.portal.kernel.messaging.HotDeployMessageListener.doReceive(HotDeployMessageListener.java:55)
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
... 5 more
Dec 23, 2014 4:31:13 PM org.apache.catalina.core.StandardContext reload


2) Now I had remove resources-importer-target-value=MedShastra from liferay-plugin-package.properties, it deploy successfully, without any error, but it create a extra site and site template in my portal, that I don't want to do.

So, If you can help me, that how I can use resource importer in this situation it would be very helpful.
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Resource importer in Lilferay 6.2.0 GE2

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Hi Murtaza,

Ok, so to fix that you need to set the developer mode to true. Now, the downside to this is that it will basically dump whatever is "already there" and do the import from scratch.

I think the disconnect here, when I re-read over the thread, is that you might be hoping that the resource importer will do a "diff" between what is already there and what you have defined in the theme. This is not the case, it's an all or nothing type job. It's also not really intended for "migrating sites" so to speak. If you have a large amount of content it'd probably be easier for you to place a lar file in the resources-importer home directory.. public.lar and private.lar for public and private pages respectively (I think that is what the filename has to be but can't totally trust my memory emoticon )

Anyway, for your developer machine? set the developer mode to true and you'll get what you are after.
thumbnail
Murtaza Ghadiali, modificado 9 Anos atrás.

RE: Resource importer in Lilferay 6.2.0 GE2

New Member Postagens: 11 Data de Entrada: 03/03/14 Postagens Recentes
Hi Andrew,

I had put these properties in liferay-lugin-package.properties

resources-importer-developer-mode-enabled=true
resources-importer-target-class-name=com.liferay.portal.model.Group
resources-importer-target-value=MedShastra

than also the above exception error come emoticonemoticon
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Resource importer in Lilferay 6.2.0 GE2

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Hi Murtaza,

Ok -- that is exactly what I am using (minus the target-value of cource) and it is working for me. Most likely this is a caching issue of some kind. Try this --

1. Go to the cotntrol panel and delete the site.
2. While Liferay is up and running, go to the webapps/ folder and delete the theme plugin -- check the log to verify that it has been removed.
3. Shut down the server.
4. Clear out the work and temp folders (assuming that you are on TOMCAT).
5. Start the server.
6. Deploy the theme plugin .
7. Validate your site is present in the control panel.

.. I have had situations where theme changes are not applied unless the right "trigger files" are touched. Following those steps always leads me to the real results. Can you give that a shot and let me know how it goes?