From: <fg...@us...> - 2011-06-14 15:24:19
|
Revision: 3536 http://openutils.svn.sourceforge.net/openutils/?rev=3536&view=rev Author: fgiust Date: 2011-06-14 15:24:12 +0000 (Tue, 14 Jun 2011) Log Message: ----------- MGNLUTILS-27 availability based on repository Modified Paths: -------------- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/templating/ExtendedTemplate.java Modified: trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/templating/ExtendedTemplate.java =================================================================== --- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/templating/ExtendedTemplate.java 2011-06-13 15:57:39 UTC (rev 3535) +++ trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/templating/ExtendedTemplate.java 2011-06-14 15:24:12 UTC (rev 3536) @@ -55,6 +55,8 @@ private Set<String> parentTemplates = new HashSet<String>(); + private Set<String> repositories = new HashSet<String>(); + /** * Logger. */ @@ -106,6 +108,23 @@ } /** + * @param repositories + */ + public void setRepositories(String repositories) + { + synchronized (this.repositories) + { + this.repositories.clear(); + + String[] repositoriesString = StringUtils.split(repositories); + for (String string : repositoriesString) + { + this.repositories.add(StringUtils.trim(string)); + } + } + } + + /** * {@inheritDoc} */ @Override @@ -118,6 +137,22 @@ return false; } + if (repositories != null && !repositories.isEmpty()) + { + try + { + if (repositories.contains(node.getWorkspace())) + { + return true; + } + } + catch (RepositoryException e) + { + // ignore, should never happen + } + return false; + } + if (levels != null && !levels.isEmpty()) { try This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-12-01 17:51:18
|
Revision: 3720 http://openutils.svn.sourceforge.net/openutils/?rev=3720&view=rev Author: fgiust Date: 2011-12-01 17:51:12 +0000 (Thu, 01 Dec 2011) Log Message: ----------- fix check on repository name Modified Paths: -------------- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/templating/ExtendedTemplate.java Modified: trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/templating/ExtendedTemplate.java =================================================================== --- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/templating/ExtendedTemplate.java 2011-12-01 10:06:26 UTC (rev 3719) +++ trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/templating/ExtendedTemplate.java 2011-12-01 17:51:12 UTC (rev 3720) @@ -168,7 +168,7 @@ { try { - if (repositories.contains(node.getWorkspace())) + if (repositories.contains(node.getWorkspace().getName())) { return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-12-19 10:18:13
|
Revision: 3730 http://openutils.svn.sourceforge.net/openutils/?rev=3730&view=rev Author: fgiust Date: 2011-12-19 10:17:54 +0000 (Mon, 19 Dec 2011) Log Message: ----------- Check on repository name: combine with other options Modified Paths: -------------- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/templating/ExtendedTemplate.java Modified: trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/templating/ExtendedTemplate.java =================================================================== --- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/templating/ExtendedTemplate.java 2011-12-02 15:39:01 UTC (rev 3729) +++ trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/templating/ExtendedTemplate.java 2011-12-19 10:17:54 UTC (rev 3730) @@ -168,19 +168,18 @@ { try { - if (repositories.contains(node.getWorkspace().getName())) + if (!repositories.contains(node.getWorkspace().getName())) { - return true; + return false; } } catch (RepositoryException e) { // ignore, should never happen } - return false; } - if (levels != null && !levels.isEmpty()) + if (available && (levels != null && !levels.isEmpty())) { try { @@ -196,7 +195,7 @@ } } - if (StringUtils.isNotBlank(parentPath)) + if (available && StringUtils.isNotBlank(parentPath)) { if (!StringUtils.contains(node.getHandle(), parentPath)) { @@ -204,7 +203,7 @@ } } - if (parentTemplates != null && !parentTemplates.isEmpty()) + if (available && (parentTemplates != null && !parentTemplates.isEmpty())) { try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |