Hi all,
What I am trying to do:
Call methods in my customized Item.java class.
Background:
I have added a getViews() method and overwritten the toString() method in
the Item class located at
dspace-api/src/main/java/org/dspace/content/Item.java.
I have sucessfully modified the ItemViewer class to display "
division.addPara("Views:" + item.toString() ); ".
If I change the above modification so item.toString() becomes
item.getViews(), maven will not compile ItemViewer.java because it cannot
find the getViews() method since it is looking for getViews() in the
original Item class instead of mine.
Pottinger, Hardy J. suggest I put
<dependency>
<groupId>org.dspace</groupId>
<artifactId>dspace-api</artifactId>
</dependency>
into the pom.xml file in the proper module in this case the one for xmlui,
but it still would not compile.
Robin Taylor suggest I put my Item.java into dspace\modules\xmlui\ but I am
hestitant to do this because Item.java is part of the dspace-api not the
xmlui.
If I leave the modification to ItemViewer as item.toString(), maven will
compile it because item.toString is in both the original and my version of
Item.java.
If I deploy the changes to Tomcat and go to view the item I see
"Views:org.dspace.content.i...@7413e8" instead of "Views:TEST 3" on the page
because the webapps\xmlui\WEB-INF\lib\dspace-api-1.5.1.jar contains the
original Item.class.
I have the dspace-api folder next to the dspace folder.
Maven package creates a dspace-api/target/dspace-api-1.5.2-SNAPSHOT.jar.
This jar does contain my customized item.class.
If I take the item.class from this jar and manually insert it into the
Tomcat 6.0\webapps\xmlui\WEB-INF\lib\dspace-api-1.5.1.jar, ItemViewer
correcty displays "Views:TEST 3".
So even though dspace-api-1.5.2-SNAPSHOT.jar contains my modified
item.class. The jar never seems to be used by maven to compile or added the
the webapp lib.
I am using WinXP, Eclipse, Tomcat 6.0, and Dspace 1.5.1.
Sincerely,
Jason Gum
------------------------------------------------------------------------------
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech