掲示板

Shopping Portlet hook and service builder error

thumbnail
13年前 に chandru palaniyappan によって更新されました。

Shopping Portlet hook and service builder error

Junior Member 投稿: 85 参加年月日: 10/07/29 最新の投稿
Hi all,

I'm using liferay 6.0.4.
I am trying to hook shopping-portlet for adding default fields for the items of a particular category.
Also based on the categories i planned to change the default fields.
The portlet's default add fields is left as it is, because other than the common field for a category - item, the user may add custom field to the item.

So i created a hook plugin in pluginsdk6.0.5.
I have created a service builder like this:

<!--?xml version="1.0" encoding="UTF-8"?-->

<service-builder package-path="com.service">
	<author>chandru.p</author>
	<namespace>Shopping</namespace>

	<entity name="ShoppingCategoryField" local-service="true" remote-service="true">
			<!-- PK fields -->
			
				<column name="categoryFieldId" type="long" primary="true" />

			<!-- Group instance -->
			
				<column name="groupId" type="long" />

			<!-- Audit fields -->
			
				<column name="categoryId" type="long" />
				<column name="parentCategoryId" type="long" />
				<column name="fieldName" type="String" />
				<column name="values" type="String" />
				<column name="description" type="String" />

			<!-- Relationships -->

				<column name="name" type="String" entity="ShoppingCategory" mapping-key="categoryId" />

			<!-- Order -->

				<order by="asc">
					<order-column name="categoryFieldId" />
				</order>

				<!-- Finder methods -->

				<finder name="categoryFieldId" return-type="ShoppingCategoryField">
					<finder-column name="categoryFieldId" />
				</finder>

				<finder name="G_C" return-type="Collection">
					<finder-column name="categoryId" />
					<finder-column name="groupId" />
				</finder>
			</entity>
	<exceptions>
		<exception>FieldName</exception>
		<exception>Description</exception>
		<exception>Values</exception>
	</exceptions>
</service-builder>


when i run build services it gaves me:

[javac] Compiling 21 source files to C:\projectss\liferay\Pluginsdk6.0.5\hooks\Shopping-hook\docroot\WEB-INF\service-classes
       [javac] C:\projectss\liferay\Pluginsdk6.0.5\hooks\Shopping-hook\docroot\WEB-INF\service\com\service\model\ShoppingCategoryFieldClp.java:130: cannot find symbol
       [javac] symbol  : class ShoppingCategory
       [javac] location: class com.service.model.ShoppingCategoryFieldClp
       [javac] 		clone.setName((ShoppingCategory)getName().clone());
       [javac] 		               ^
       [javac] C:\projectss\liferay\Pluginsdk6.0.5\hooks\Shopping-hook\docroot\WEB-INF\service\com\service\model\ShoppingCategoryFieldClp.java:130: clone() has protected access in java.lang.Object
       [javac] 		clone.setName((ShoppingCategory)getName().clone());
       [javac] 		                                         ^
       [javac] Note: Some input files use unchecked or unsafe operations.
       [javac] Note: Recompile with -Xlint:unchecked for details.
       [javac] 2 errors

BUILD FAILED
C:\projectss\liferay\Pluginsdk6.0.5\build-common-plugin.xml:216: The following error occurred while executing this line:
C:\projectss\liferay\Pluginsdk6.0.5\build-common.xml:90: Compile failed; see the compiler error output for details.



To achieve my task what are the steps required?
How to hook view_items.jsp to add default fields for the categories?

  • Is there any complete example tutorial for using service builder in hook?
  • Also is there any complete service builder tutorial available?



Expecting kind suggestions,
Any help appreciated,

Chandru P
thumbnail
13年前 に chandru palaniyappan によって更新されました。

RE: Shopping Portlet hook and service builder error

Junior Member 投稿: 85 参加年月日: 10/07/29 最新の投稿
Can anyone please tell me that whether my approach is right or wrong...?
I just dont want to try it blindly...


Any one?

thanks & Regards

Chandru P
thumbnail
13年前 に Juanjo Hernández Cánovas によって更新されました。

RE: Shopping Portlet hook and service builder error

Regular Member 投稿: 183 参加年月日: 08/08/11 最新の投稿
Hi Chandru

Have you found a solution to your problem?, I'm facing a similar modification.

Thanks in advance,

Juanjo.