diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-16 11:19:49 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-16 11:19:49 +0000 |
commit | 761ae75185e9e18da36d59433adcd31d6df4f1eb (patch) | |
tree | c674beb93426ec17121b71f53fae3bcd94677116 /branches/sca-java-1.x/modules/domain-manager | |
parent | 1a586c8d892fe33438796a175e1160217faaa4d5 (diff) |
TUSCANY-3266 use the last fragment of the composite URI path to compare against the composite from the composite collection to give a better chance of finding the right composite.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@815725 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/domain-manager')
-rw-r--r-- | branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/QuickStartServiceImpl.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/QuickStartServiceImpl.java b/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/QuickStartServiceImpl.java index cf9e5b67fc..9c2092656e 100644 --- a/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/QuickStartServiceImpl.java +++ b/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/QuickStartServiceImpl.java @@ -100,16 +100,17 @@ public class QuickStartServiceImpl extends HttpServlet { String compositeURI = request.getParameter("composite"); String start = request.getParameter("start"); - logger.fine("Composite Quick Start."); - logger.fine("Contribution URI: " + contributionURI); - logger.fine("Contribution location: " + contributionLocation); - logger.fine("Composite URI: " + compositeURI); + logger.info("Composite Quick Start."); + logger.info("Contribution URI: " + contributionURI); + logger.info("Contribution location: " + contributionLocation); + logger.info("Composite URI: " + compositeURI); // Look for the contribution in the workspace Entry<String, Item>[] contributionEntries = contributionCollection.getAll(); Entry<String, Item> contributionEntry = null; for (Entry<String, Item> entry: contributionEntries) { - if (contributionURI.equals(entry.getKey())) { + if (entry.getKey() != null && + contributionURI.equals(entry.getKey())) { contributionEntry = entry; break; } @@ -127,13 +128,17 @@ public class QuickStartServiceImpl extends HttpServlet { Entry<String, Item>[] deployableEntries = deployableCollection.query("contribution=" + contributionURI); for (Entry<String, Item> entry: deployableEntries) { Item item = entry.getData(); - if (contributionURI.equals(contributionURI(entry.getKey())) && item.getAlternate().endsWith(compositeURI)) { + String compositeFileName = compositeURI.substring(compositeURI.lastIndexOf("/") + 1); + if (contributionURI.equals(contributionURI(entry.getKey())) && + (item.getAlternate().endsWith(compositeURI) || + item.getAlternate().endsWith(compositeFileName))) { compositeKey = entry.getKey(); break; } } if (compositeKey == null) { + logger.info("Composite not found"); response.sendError(HttpServletResponse.SC_NOT_FOUND, compositeURI); return; } |