0
votes

I just want to create a gwt composite through gwt project. Then make this composite as jar. then want to add in lib folder of my liferay project that my every protlet can use this gwt composite.

How can I do it?


What I did so far:

  • Create gwt composite, remove entry-point and re-write .gwt.xml and create my class extends composite.
  • then create jar.
  • then copy the jar liferay lib folder
  • then attach the source with jar (java build path > libraries > select jar and attach the source mean gwt composite project)[i am using eclipse].
  • then inherit in portlet .gwt.xml file like:
  • then create instance of the composite class and get this error

[javac] Compiling 1 source file to /home/bglobal/liferay-sdk/portlets/data-grid-portlet/docroot/WEB-INF/classes
[javac] /home/bglobal/liferay-sdk/portlets/data-grid-portlet/docroot/WEB-INF/src/com/prolexic/portlet/datagrid/client/DataGridServiceEntryPoint.java:9: package com.prolexic.commonCompositeWidget.client does not exist
[javac] import com.prolexic.commonCompositeWidget.client.CommonCompositeWidget;
[javac] ^
[javac] /home/bglobal/liferay-sdk/portlets/data-grid-portlet/docroot/WEB-INF/src/com/prolexic/portlet/datagrid/client/DataGridServiceEntryPoint.java:17: cannot find symbol
[javac] symbol : class CommonCompositeWidget
[javac] location: class com.prolexic.portlet.datagrid.client.DataGridServiceEntryPoint
[javac] CommonCompositeWidget mycomposite = new CommonCompositeWidget("This is the GWT Composite portlet.");
[javac] ^
[javac] /home/bglobal/liferay-sdk/portlets/data-grid-portlet/docroot/WEB-INF/src/com/prolexic/portlet/datagrid/client/DataGridServiceEntryPoint.java:17: cannot find symbol
[javac] symbol : class CommonCompositeWidget
[javac] location: class com.prolexic.portlet.datagrid.client.DataGridServiceEntryPoint
[javac] CommonCompositeWidget mycomposite = new CommonCompositeWidget("This is the GWT Composite portlet.");
[javac] ^
[javac] 3 errors

1
you want to create gwt composite widget? and liferay is also gwt project?Parvathy

1 Answers

0
votes

Gwt need source code also for using in other project. So include source file also in jar after buildng gwt composite. Then copy it in lib folder. then follow this

  • Right click the project
  • Click build path
  • click configure build path
  • In libraries add jar
  • And select the jar in order and export
  • Add inherits in .gwt.xml file

The above jar has a .gwt.xml file because it is gwt project else create a .gwt.xml file and include source path in it.

(Both projects are GWT then you can add projects directly in build bath and inherits in .gwt.xml of liferay project)

If you dont want to use this in GWT project then configure to maven then build the project then you will get jar and reuse it in other projects