2013-02-14 83 views
0

我只是想通過gwt項目創建一個gwt複合材料。 然後將此組合物製成罐子。 然後要添加在我的liferay項目的lib文件夾中,我的每個protlet都可以使用這個gwt組合。GWT Composite with liferay portlet

我該怎麼辦?


我做了什麼至今:

  • 創建GWT複合,刪除入口點,並重新寫.gwt.xml和創建我的類擴展複合。
  • 然後創建jar。
  • 然後複製jar liferay lib文件夾
  • 然後用jar添加源代碼(java build path> libraries>選擇jar並附上source mean gwt複合項目)[我正在使用eclipse]。
  • 然後在門戶.gwt.xml文件繼承,如:
  • 然後創建複合類的實例,並得到這個錯誤

[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

+0

你想創建gwt複合控件? liferay也是gwt項目? – Parvathy 2013-02-14 06:34:36

回答

0

GWT需要的源代碼也使用在其他項目。因此,在buildng gwt組合後,還要在jar中包含源文件。然後將它複製到lib文件夾中。然後按照這個

  • 右鍵單擊項目
  • 點擊構建路徑
  • 單擊配置構建路徑
  • 在庫添加JAR
  • 而爲了和出口
  • 添加繼承中選擇jar .gwt.xml文件

上面的jar有一個.gwt.xml文件,因爲它是gwt project否則創建一個.gwt.xml文件並在其中包含源路徑。

(這兩個項目是GWT那麼您可以在構建浴直接添加項目和Liferay的項目.gwt.xml繼承)

如果你不想在GWT項目中使用這個然後配置到Maven然後生成項目然後你會得到jar並在其他項目中重用它