Author: chathura
Date: Sat Dec 15 06:04:21 2007
New Revision: 11161
Log:
Now multiple tags has to be separeted using commas.
That means, you can apply tags with spaces in them (e.g. Sri Lanka)
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
==============================================================================
---
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
(original)
+++
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
Sat Dec 15 06:04:21 2007
@@ -444,8 +444,8 @@
String userID = User.getCurrentUser();
- // break the space separated words into multiple tags
- String[] tags = tag.split(" ");
+ // break the comma separated words into multiple tags
+ String[] tags = tag.split(",");
try {
conn.setAutoCommit(false);
@@ -458,6 +458,8 @@
for (int i = 0; i < tags.length; i++) {
+ tags[i] = tags[i].trim();
+
if (tags[i].length() == 0 || tags[i].equals(" ")) {
continue;
}
@@ -504,7 +506,7 @@
public TaggedResourcePath[] getResourcePathsWithTag(String tag) throws
RegistryException {
// break the tags from spaces
- String[] tags = tag.trim().split(" ");
+ String[] tags = tag.trim().split(",");
//List pathList = new ArrayList();
List taggedPaths = new ArrayList();
@@ -521,6 +523,7 @@
taggedResourcePath.setResourcePath(path);
for (int i = 0; i < tags.length; i++) {
+ tags[i] = tags[i].trim();
long count = tagsDAO.getTagCount(path, tags[i], conn);
taggedResourcePath.addTagCount(tags[i], count);
}
_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev