Revision: 18306
http://sourceforge.net/p/gate/code/18306
Author: ian_roberts
Date: 2014-09-10 11:55:06 +0000 (Wed, 10 Sep 2014)
Log Message:
-----------
Two fixes:
- when packaging an app that includes a reference to a corpus in a datastore,
include the datastore itself in the package
- when cleaning up duplicate plugin references, keep the first instance of each
rather than the last, to preserve loading order.
Modified Paths:
--------------
gate/trunk/src/main/gate/util/ant/packager/GappModel.java
Modified: gate/trunk/src/main/gate/util/ant/packager/GappModel.java
===================================================================
--- gate/trunk/src/main/gate/util/ant/packager/GappModel.java 2014-09-10
10:19:08 UTC (rev 18305)
+++ gate/trunk/src/main/gate/util/ant/packager/GappModel.java 2014-09-10
11:55:06 UTC (rev 18306)
@@ -125,10 +125,20 @@
try {
relativeResourcePathElementsXPath =
XPath
-
.newInstance("/gate.util.persistence.GateApplication/application"
+ .newInstance(
+ // URLHolder elements as map entry values
+
"/gate.util.persistence.GateApplication/application"
+
"//gate.util.persistence.PersistenceManager-URLHolder"
+ "/urlString[starts-with(., '$relpath$') "
+ "or starts-with(., '$resourceshome$') "
+ + "or starts-with(., '$gatehome$')]"
+ + " | "
+ // specific Persistence object fields of type
URLHolder
+ // (e.g. datastore location)
+ +
"/gate.util.persistence.GateApplication/application"
+ +
"//*[@class='gate.util.persistence.PersistenceManager$URLHolder']"
+ + "/urlString[starts-with(., '$relpath$') "
+ + "or starts-with(., '$resourceshome$') "
+ "or starts-with(., '$gatehome$')]");
relativePluginPathElementsXPath =
XPath
@@ -310,15 +320,15 @@
// remove duplicate plugin entries
try {
// this XPath selects all URLHolders out of the URL list that have
- // the same URL string as one of their following siblings, i.e. if
+ // the same URL string as one of their preceding siblings, i.e. if
// there are N URLs in the list with the same value then this
// XPath
- // will select all but the last one of them.
+ // will select all but the first one of them.
XPath duplicatePluginXPath =
XPath
.newInstance("/gate.util.persistence.GateApplication/urlList"
+
"/localList/gate.util.persistence.PersistenceManager-URLHolder"
- + "[urlString =
following-sibling::gate.util.persistence.PersistenceManager-URLHolder/urlString]");
+ + "[urlString =
preceding-sibling::gate.util.persistence.PersistenceManager-URLHolder/urlString]");
List<Element> duplicatePlugins =
duplicatePluginXPath.selectNodes(gappDocument);
for(Element e : duplicatePlugins) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs