err ... who is zombi ??? :)
BTW, im gonna be porting this to 4.1 since i need permissions there too.
What else do you have in mind for this service/component ?
On 4/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Revision: 482
http://svn.sourceforge.net/tacos/?rev=482&view=rev
Author: zombi
Date: 2007-04-04 07:14:51 -0700 (Wed, 04 Apr 2007)
Log Message:
-----------
Add permission value to the CategoryInfo.
Modified Paths:
--------------
tacos-4.0
/trunk/tacos-core/src/java/net/sf/tacos/services/CategoryInfo.java
tacos-4.0
/trunk/tacos-core/src/java/net/sf/tacos/services/impl/CategoryInfoImpl.java
tacos-4.0
/trunk/tacos-core/src/java/net/sf/tacos/services/impl/SiteMapImpl.java
Modified: tacos-4.0
/trunk/tacos-core/src/java/net/sf/tacos/services/CategoryInfo.java
===================================================================
--- tacos-4.0/trunk/tacos-core/src/java/net/sf/tacos/services/CategoryInfo.java
2007-03-12 17:01:55 UTC (rev 481)
+++ tacos-4.0/trunk/tacos-core/src/java/net/sf/tacos/services/CategoryInfo.java
2007-04-04 14:14:51 UTC (rev 482)
@@ -45,4 +45,11 @@
* @return
*/
public String getInactiveImage();
+
+ /**
+ * Get the permission associated with the category, if any.
+ * @return Permission
+ */
+ public String getPermission();
+
}
Modified: tacos-4.0
/trunk/tacos-core/src/java/net/sf/tacos/services/impl/CategoryInfoImpl.java
===================================================================
---
tacos-4.0/trunk/tacos-core/src/java/net/sf/tacos/services/impl/CategoryInfoImpl.java
2007-03-12
17:01:55 UTC (rev 481)
+++
tacos-4.0/trunk/tacos-core/src/java/net/sf/tacos/services/impl/CategoryInfoImpl.java
2007-04-04
14:14:51 UTC (rev 482)
@@ -27,6 +27,7 @@
private List pageNames;
private String image;
private String inactiveImage;
+ private String permission;
/**
* Construct named category with list of pages.
@@ -43,6 +44,17 @@
* @param name The category name
* @param pageNames The page names in this category
*/
+ public CategoryInfoImpl(String name, List pageNames, String
permission) {
+ this.name = name;
+ this.pageNames = pageNames;
+ this.permission = permission;
+ }
+
+ /**
+ * Construct named category with list of pages.
+ * @param name The category name
+ * @param pageNames The page names in this category
+ */
public CategoryInfoImpl(String name, List pageNames,
String image, String inactiveImage) {
this.name = name;
@@ -50,6 +62,19 @@
this.image = image;
this.inactiveImage = inactiveImage;
}
+ /**
+ * Construct named category with list of pages.
+ * @param name The category name
+ * @param pageNames The page names in this category
+ */
+ public CategoryInfoImpl(String name, List pageNames,
+ String image, String inactiveImage,String permissions) {
+ this.name = name;
+ this.pageNames = pageNames;
+ this.image = image;
+ this.inactiveImage = inactiveImage;
+ this.permission = permissions;
+ }
/**
* Get category name.
@@ -125,4 +150,14 @@
return new HashCodeBuilder(1471056309, 288593091).append(
this.name)
.toHashCode();
}
+
+ /**
+ * Get the permission associated with the category, if any.
+ * @return Permission
+ */
+ public String getPermission() {
+ return permission;
+ }
+
+
}
Modified: tacos-4.0
/trunk/tacos-core/src/java/net/sf/tacos/services/impl/SiteMapImpl.java
===================================================================
---
tacos-4.0/trunk/tacos-core/src/java/net/sf/tacos/services/impl/SiteMapImpl.java
2007-03-12 17:01:55 UTC (rev 481)
+++
tacos-4.0/trunk/tacos-core/src/java/net/sf/tacos/services/impl/SiteMapImpl.java
2007-04-04 14:14:51 UTC (rev 482)
@@ -298,13 +298,14 @@
String imgName = null;
String inactiveImgName = null;
+ String permission = null;
Element catnode =
(Element)document.selectSingleNode("/sitemap/[EMAIL PROTECTED]'" + name +
"']");
if (catnode != null) {
imgName = catnode.attributeValue("image-active");
inactiveImgName = catnode.attributeValue("image-inactive");
+ permission = catnode.attributeValue("permission");
}
-
//Node node = document.selectSingleNode("/sitemap/[EMAIL PROTECTED]'"
+ name + "']");
List nodes = document.selectNodes("/sitemap/[EMAIL PROTECTED]'" +
name + "']/page");
if (nodes != null) {
@@ -314,12 +315,14 @@
String pageName = node.valueOf("@name");
pageNames.add(pageName);
}
- ci = new CategoryInfoImpl(name, pageNames, imgName,
inactiveImgName);
+ ci = new CategoryInfoImpl(name, pageNames, imgName,
inactiveImgName, permission);
+
cachedCategoryInfo.put(name, ci);
+
return ci;
}
log.debug("Returning empty category info for: " + name);
- ci = new CategoryInfoImpl(name, null);
+ ci = new CategoryInfoImpl(name, null, permission);
cachedCategoryInfo.put(name, ci);
return ci;
}
This was sent by the SourceForge.net collaborative development platform,
the world's largest Open Source development site.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Tacos-changes mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tacos-changes
--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Tacos-devel mailing list
Tacos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tacos-devel