Fórum

Import native calendar plugin

Lukas Navardauskas, modificado 9 Anos atrás.

Import native calendar plugin

New Member Mensagem: 1 Data de Entrada: 09/01/15 Postagens Recentes
Hi, I'm using Liferay 6.2 CE GA2 and Liferay eclipse luna IDE. I want to import core liferay calendar portlet to modify edit and deploy, I've downloaded "liferay-plugins-6.2.x" and "liferay-portal-6.2x" sources from github. "liferay-plugins-6.2.x" is addded as plugin SDK and I have added "calendar-portlet-6.2x" to package explorer but there is some configuration errors in that portlet. All libraries are missing:

.classpath file

<!--?xml version="1.0" encoding="UTF-8"?-->
<classpath>
	<classpathentry excluding="**/.svn/**|.svn/" kind="src" path="docroot/WEB-INF/service" />
	<classpathentry excluding="**/.svn/**|.svn/" kind="src" path="docroot/WEB-INF/src" />
	<classpathentry kind="src" path="/portal-6.2.x" />
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" />
	<classpathentry excluding="**/.svn/**|.svn/" kind="src" path="test/integration" />
	<classpathentry excluding="**/.svn/**|.svn/" kind="src" path="test/unit" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/development/junit.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/development/mockito.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/development/powermock-mockito.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/development/spring-test.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/development/activation.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/development/annotations.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/development/jsp-api.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/development/mail.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/development/servlet-api.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/global/portlet.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/portal/backport-concurrent.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/portal/commons-codec.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/portal/commons-io.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/portal/commons-lang.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/portal/commons-logging.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/portal/jdom.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/portal/jstl-api.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/portal/jstl-impl.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/portal/log4j.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/portal/rome.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/portal-service/portal-service.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/util-bridges/util-bridges.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/util-java/util-java.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/util-taglib/util-taglib.jar" />
	<classpathentry kind="lib" path="docroot/WEB-INF/lib/com.google.ical.jar" />
	<classpathentry kind="lib" path="docroot/WEB-INF/lib/joda-time.jar" />
	<classpathentry kind="lib" path="docroot/WEB-INF/lib/portal-compat-shared.jar" />
	<classpathentry kind="lib" path="../../.ivy/cache/org.jboss.arquillian.junit/arquillian-junit-core/jars/arquillian-junit-core-1.1.3.Final.jar" />
	<classpathentry kind="lib" path="../../.ivy/cache/org.jboss.arquillian.test/arquillian-test-api/jars/arquillian-test-api-1.1.3.Final.jar" />
	<classpathentry kind="lib" path="/portal-6.2.x/lib/portal/ical4j.jar" />
	<classpathentry kind="output" path="bin" />
</classpath>


there is no such folder like "portal-6.2.x" and there is "required projects on the build path" "/portal-6.2.x" missing too. How to import that project?
thumbnail
Gregory Amerson, modificado 9 Anos atrás.

RE: Import native calendar plugin

Liferay Legend Postagens: 1123 Data de Entrada: 16/02/10 Postagens Recentes
Hello Lukas,

The core liferay plugins from the liferay-plugins-6.2.x branch have custom .classpath settings which are not configured for use with Liferay IDE but rather with just standard ecilpse java projects.

So the process for importing this project is to just

1. use "File > Import > Liferay > Project from existing source"
2. Point to the calendar-portlet
3. specify which runtime you are targeting (needs to be portal 6.2 obviously)
4. Finish

This process will modify the .classpath to add the runtime information and dependencies which duplicate the already existing dependencies that point to a hardcoded portal project (which you don't have checked out).

So lastly you can modify the build path (right click project > properties > java build path) and go to the Libraries tab. On this tab you can simply delete all of the entries that point to the hardcoded portal/lib folder.

Let us know if you have trouble with this process.
Vitina De Leonardis, modificado 6 Anos atrás.

RE: Import native calendar plugin

New Member Postagens: 15 Data de Entrada: 10/05/17 Postagens Recentes
Hi,

I have the same problem, I have downloaded the calendar-portlet from this link https://github.com/zion64/liferay-calendar-portlet, after I have opened eclipse (neon 3), but my Import menu item doesn't show me the functionality "File > Import > Liferay > Project from existing source", to import the project I have done the following step:

Import -> General -> Existing project into workspace -> in root directory I have passed my workspace and I have selected the portlet. As lukas says there's the reference to portal-6.2.x...How can I modify this?

I have another error in build.xml:

<project name="calendar-portlet" basedir="." default="deploy">
<import file="../build-common-portlet.xml" />
</project>

"Default target deploy doesn't exist in the project"
thumbnail
Joye Luo, modificado 6 Anos atrás.

RE: Import native calendar plugin

Regular Member Postagens: 144 Data de Entrada: 03/05/16 Postagens Recentes
Hey Vitina,

I have downloaded this portlet from https://github.com/zion64/liferay-calendar-portlet you provided.
I import it into Liferay IDE and deploy it sucessfully.
1. put it into a sdk portlet directory, for me is F:\liferay-sdk\sdk62-newest-ivy5\sdk62-newest-ivy\portlets
2. Import->Liferay->Liferay Projects From Plugin SDK, choose the calendar portlet ( It also shows 'calendar-portlet-6.2.x' is missing required Java project: 'portal-6.2.x' , but I ignored it. )
3. deploy it to liferay 6.2 portal

Following picture are the result.
Hope it can works for u.
Vitina De Leonardis, modificado 6 Anos atrás.

RE: Import native calendar plugin

New Member Postagens: 15 Data de Entrada: 10/05/17 Postagens Recentes
Hi Jove Luo,

Thanks for your time, I have tried your solution:

- Extract sdk zip file in desktop folder
- Copy and rename the build.properties file in sdk to build.username.properties and modify "app.server.parent.dir=C:\\Users\\username\\Desktop\\liferay\\liferay6.2".
- Insert the downloaded portlet calendar-portlet in apps folder of sdk: C:\Users\username\Desktop\liferay\liferay-plugins-sdk-6.2\apps\test-broken
- In Eclipse File -> Import -> Liferay -> Liferay Project From Plugin SDK

As you can see in attached image file, i see the portlet in sdk folder, but when I click finish the portlet isn't loaded in my Eclipse and nothing error message is showed.
thumbnail
Joye Luo, modificado 6 Anos atrás.

RE: Import native calendar plugin

Regular Member Postagens: 144 Data de Entrada: 03/05/16 Postagens Recentes
How about put it into C:\Users\username\Desktop\liferay\liferay-plugins-sdk-6.2\portlet folder. I can import it from this folder.
Vitina De Leonardis, modificado 6 Anos atrás.

RE: Import native calendar plugin

New Member Postagens: 15 Data de Entrada: 10/05/17 Postagens Recentes
Ok I have created this foleder and added my portlet, but I have errors on libraries as you can see following, so I have downloaded all the jar file required and added to the project build path. Now I have yet the error on porlet-6.2.x and other errors in two file.
thumbnail
Joye Luo, modificado 6 Anos atrás.

RE: Import native calendar plugin

Regular Member Postagens: 144 Data de Entrada: 03/05/16 Postagens Recentes
Hey Vitina,
I delete the orginal .classpath in original calendar portlet. So it will regenerate a new one.
As for the jsp file validation error, I will no effection to your porlet.
Vitina De Leonardis, modificado 6 Anos atrás.

RE: Import native calendar plugin

New Member Postagens: 15 Data de Entrada: 10/05/17 Postagens Recentes
Hi Joye Luo,

My errors in compiling process are related to jvm, so I have tried to modify the jre used on eclipse project as alternative jre choosing, on the installed jre, the 1.6 version; reading on the forum's comments, to compiling and deploying the portlet is necessary this jre's version. My problem aren't resolved yet as you can see in the attached image. I don't know what I can do to solve this. Have you tried to modify and compile the code?
thumbnail
Joye Luo, modificado 6 Anos atrás.

RE: Import native calendar plugin

Regular Member Postagens: 144 Data de Entrada: 03/05/16 Postagens Recentes
Hey Vitina,
I can run liferay build service and ant war sucessfully.
When I run ant compile, it show me the error log different from u.( see attatched pictures). It related to this bug in Liferay https://issues.liferay.com/browse/LPS-45207, it already fixed in the newest version. So it means the git source u have in the repo has this little bug.
U may should update it or change it.

Following are the steps I do it:
1. cope this portlet to a 62 sdk portlets dir.
2. delete .classpath file and import it to Liferay IDE
3. add jar file in docroot/WEB-INF/lib to build path
4. set IDE compile jre to jdk 6 I installed in my computer
5. set IDE ant home to external ant I installed in my computer
6. then run whatever u what, everything would be ok.

Hope that can help a little bit.

Sincerely, Joye.
thumbnail
Joye Luo, modificado 6 Anos atrás.

RE: Import native calendar plugin

Regular Member Postagens: 144 Data de Entrada: 03/05/16 Postagens Recentes
Hey Vitina,

I find a better way to solve your problem. All the things works well now. (compile, builder service, ant-war)
Enviroment:
1. Liferay IDE: 3.1 ga1
2. Liferay portal: liferay-portal-tomcat-6.2-ce-ga6-20160112152609836
3. Sdk: liferay-plugins-sdk-6.2-ce-ga6-20160112152609836.zip

Steps:
1. use liferay sdk create a portlet plugin project
2. delete the orignal file in docroot dir
3. copy calendar-portlet source code in liferay portal to docroot dir for me is F:\liferay-bundle\liferay-portal-tomcat-6.2-ee-sp20-20170717160924965\liferay-portal-6.2-ee-sp20\tomcat-7.0.62\webapps\calendar-portlet
4. delect that portlet in IDE( not in source) and add <classpathentry kind="src" path="docroot/WEB-INF/service"/> to .classpath file
5. reimport it again and point the jre to jdk 6
6. set the project compile level to 1.6
7. point the ant runtime home to the one you installed locally

Then everything will be ok now. See my attached picture below. The small error marker is just jsp validation stuff, no matter about that.

Hope that can works for u.

Sincerely,
Joye Luo
Vitina De Leonardis, modificado 6 Anos atrás.

RE: Import native calendar plugin

New Member Postagens: 15 Data de Entrada: 10/05/17 Postagens Recentes
Hi,
I have tried your solution, but it doesn't work for me, in particular way the deploy on tomcat web container goes in loop but in my Ide console I don't see nothing error. I can't attach the tomcat log file to the discussion
thumbnail
Joye Luo, modificado 6 Anos atrás.

RE: Import native calendar plugin

Regular Member Postagens: 144 Data de Entrada: 03/05/16 Postagens Recentes
Hey Vitina,

It is maybe caused by conflict with the portal orignal calendar portlet. I never try it before. You can open a new thread in portal deveolopment part instead of IDE part. And your problem may get a better solution there. I often use hook or ext project to modify the portal original portlet.

Hope it will be resolved soon.
Sincerely,
Joye Luo