diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-16 10:44:20 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-16 10:44:20 +0000 |
commit | 1a586c8d892fe33438796a175e1160217faaa4d5 (patch) | |
tree | 6faeee6a37ea570e53797cd82698860c63acd7bb /branches/sca-java-1.5.1/modules | |
parent | 9239e9506e6b2f9173e65d4263288d07bdab0c76 (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@815714 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5.1/modules')
-rw-r--r-- | branches/sca-java-1.5.1/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.5.1/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/QuickStartServiceImpl.java b/branches/sca-java-1.5.1/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/QuickStartServiceImpl.java index cf9e5b67fc..9c2092656e 100644 --- a/branches/sca-java-1.5.1/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/QuickStartServiceImpl.java +++ b/branches/sca-java-1.5.1/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; } |