You can subscribe to this list here.
| 2004 |
Jan
|
Feb
(11) |
Mar
(106) |
Apr
(146) |
May
(79) |
Jun
(233) |
Jul
(218) |
Aug
(160) |
Sep
(155) |
Oct
(80) |
Nov
(176) |
Dec
(115) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(77) |
Feb
(106) |
Mar
(10) |
Apr
(54) |
May
(29) |
Jun
(29) |
Jul
(65) |
Aug
(80) |
Sep
|
Oct
(42) |
Nov
(45) |
Dec
(33) |
| 2006 |
Jan
(49) |
Feb
(52) |
Mar
(8) |
Apr
(3) |
May
(108) |
Jun
(43) |
Jul
(13) |
Aug
(1) |
Sep
(58) |
Oct
(66) |
Nov
(70) |
Dec
(115) |
| 2007 |
Jan
(26) |
Feb
(3) |
Mar
(17) |
Apr
(1) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
(10) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
| 2009 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Philipp H. <p-...@us...> - 2006-05-02 12:53:55
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25962/src/org/cobricks/discussion Modified Files: categoryontology.xml Log Message: Index: categoryontology.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/categoryontology.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- categoryontology.xml 2 May 2006 11:56:31 -0000 1.2 +++ categoryontology.xml 2 May 2006 12:53:51 -0000 1.3 @@ -28,40 +28,4 @@ -<!-- -<class name="category" javaclassname="de.cobricks.category.Category"> -<description lang="en">Generic Category Class</description> -<attr name="catid" type="int"/> -<attr name="globalid" type="string(64)"/> -<attr name="categoryclass" type="string(50)"/> -<attr name="title" type="string(10)" multilanguage="true"> - <description lang="en">Title</description> - <description lang="de">Titel</description> -</attr> -<attr name="visible" type="boolean"> - <default>true</default> -</attr> -<attr name="creator" type="user"/> -<attr name="creationtime" type="datetime"/> -<attr name="updater" type="user"/> -<attr name="updatetime" type="datetime"/> -<attr name="parent" type="category"/> -<attr name=âiterestusersâ type=âuser[]â/> <!âTBD: context class ï -</class> - -<class name="privatefolder" parent="category"> -<description lang="en">Private Folder (for Items)</description> -<attr name="owner" type="user"/> <!âtbd context class ï -</class> - -<class name="community" parent="category"> -<description lang="en">Category that can be closed (have members)</description> -<attr name=âmembersâ type=âuser[]â/> <!âtbd: context class ï -<attr name="admins" type="user[]"/> -<attr name=âopenâ type=âbooleanâ> - <default>true</default> -</attr> -<attr name=âinvitationpwâ type=âstring(20)â/> -</class> - --> </categoryontology> \ No newline at end of file |
|
From: Philipp H. <p-...@us...> - 2006-05-02 12:09:59
|
Update of /cvsroot/cobricks/cobricks2/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24735/web Modified Files: pageheader.html Log Message: Added Discussion to main menu. Visible only if discussion module started Index: pageheader.html =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/pageheader.html,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- pageheader.html 13 Feb 2006 23:33:29 -0000 1.17 +++ pageheader.html 2 May 2006 12:09:50 -0000 1.18 @@ -43,7 +43,10 @@ <a href="$contextPath/message/index.html">MESSAGE</a> | <a href="$contextPath/course/index.html">COURSE</a> | <a href="$contextPath/portal/index.html">PORTAL</a> | -<a href="$contextPath/agent/index.html">AGENT</a> +<a href="$contextPath/agent/index.html">AGENT</a> +#if ($discussionManager) | +<a href="$contextPath/discussion/index.html">DISCUSSION</a> +#end </font> </td> </tr> |
|
From: Philipp H. <p-...@us...> - 2006-05-02 12:09:59
|
Update of /cvsroot/cobricks/cobricks2/web/discussion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24735/web/discussion Modified Files: index.html Log Message: Added Discussion to main menu. Visible only if discussion module started Index: index.html =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/discussion/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- index.html 2 May 2006 11:56:49 -0000 1.1 +++ index.html 2 May 2006 12:09:49 -0000 1.2 @@ -2,7 +2,7 @@ <em><a href="index.html.en">Discussion Component</a></em> -<h1>Cobricks2 - Discussion Component</h1> +<h1>Cobricks2 - Discussion Component (Under development)</h1> #if (!$discussionManager) <h2>Couldn't find Discussion Component</h2> |
|
From: Philipp H. <p-...@us...> - 2006-05-02 11:56:55
|
Update of /cvsroot/cobricks/cobricks2/web/discussion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14909/web/discussion Added Files: index.html Removed Files: index.html.en Log Message: --- NEW FILE: index.html --- #parse ( "pageheader.html" ) <em><a href="index.html.en">Discussion Component</a></em> <h1>Cobricks2 - Discussion Component</h1> #if (!$discussionManager) <h2>Couldn't find Discussion Component</h2> <p> Please make sure, that every part of the component has been loaded without errors. </p> #elseif (!$categoryManager) <h2>Couldn't find Category Component</h2> <p> Please make sure, that every part of the component has been loaded without errors. </p> #else <h2>Welcome to the Discussion Component start page</h2> #set($cat_list = $categoryPresenter.getCategories("discussion_category", "", "")) <h3>Categories ($cat_list.size())</h3> #foreach( $i in $cat_list ) Title: $i.getTitle()<br/> order: $!i.getAttribute("order")<p/> #end #end #parse ( "pagefooter.html" ) --- index.html.en DELETED --- |
|
From: Philipp H. <p-...@us...> - 2006-05-02 11:56:35
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14746/src/org/cobricks/discussion Modified Files: itemontology.xml categoryontology.xml Log Message: ontology change Index: categoryontology.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/categoryontology.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- categoryontology.xml 6 Apr 2006 16:25:53 -0000 1.1 +++ categoryontology.xml 2 May 2006 11:56:31 -0000 1.2 @@ -6,10 +6,6 @@ <default>true</default> </attr> <attr name="order" type="int" /> -<attr name="long_title" type="string(100)" multilanguage="true"> - <description lang="en">Long Title</description> - <description lang="de">Langer Titel</description> -</attr> <attr name="description" type="string(200)" multilanguage="true"> <description lang="en">Description</description> <description lang="de">Beschreibung</description> @@ -19,20 +15,18 @@ <class name="discussion_forum" parent="discussion_category"> <description lang="en">Forum for the discussion component</description> -<attr name="forumtype" type="int"> - <description lang="de">Typ des Forums (1:Forum, 2:FAQ, 3:Weblog)</description> +<attr name="forumtype" type="string"> + <description lang="de">Typ des Forums </description> <description lang="en">Forum typ (1:Forum, 2:FAQ, 3:Weblog)</description> - <default>1</default> - <value>1</value> <!-- forum --> - <value>2</value> <!-- faq --> - <value>3</value> <!-- weblog--> + <default>Forum</default> + <value>Forum</value> <!-- forum --> + <value>FAQ</value> <!-- faq --> + <value>Weblog</value> <!-- weblog--> + <value>Guestbook</value> <!-- guestbook --> </attr> </class> -<class name="discussion_topic" parent="discussion_category"> -<description lang="en">Topic in the discussion component</description> -<attr name="first_posting" type="item" /> -</class> + <!-- <class name="category" javaclassname="de.cobricks.category.Category"> Index: itemontology.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/itemontology.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- itemontology.xml 6 Apr 2006 16:25:53 -0000 1.2 +++ itemontology.xml 2 May 2006 11:56:31 -0000 1.3 @@ -8,10 +8,18 @@ <attr name="children" type="item[]" /> <attr name="parent" type="item" /> --> -<class name="posting" parent="item"> +<class name="discussion_topic" parent="item"> +<description lang="en">Topic in the discussion component</description> +<attr name="first_posting" type="item" /> +<attr name="parent_cat" type="discussion_forum" /> +<attr name="test_int" type="int" /> +<attr name="test_boolean" type="boolean" /> +</class> + +<class name="discussion_posting" parent="item"> <description lang="de">Beitrag</description> <description lang="en">Posting</description> -<attr name="forumid" type="category" /> +<attr name="topicid" type="item" /> <attr name="children" type="posting[]" /> <attr name="parent" type="posting" /> |
|
From: Philipp H. <p-...@us...> - 2006-05-02 11:56:17
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14531/src/org/cobricks/core Modified Files: OntologyHelper.java Log Message: corrected 2 spelling mistakes Index: OntologyHelper.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/OntologyHelper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- OntologyHelper.java 11 Aug 2005 11:20:17 -0000 1.2 +++ OntologyHelper.java 2 May 2006 11:56:09 -0000 1.3 @@ -80,7 +80,7 @@ * * @param attrs Contains all attributes to verify against the ontology * @param oc The OntologyClass to verify against - * @param performTypeCheck Check if the values profided for attributes + * @param performTypeCheck Check if the values provided for attributes * defined in the ontology match the required type * @param includeErrors If true a set of InputErrors is included in * the return map (with the key "errors") in case there were errors. @@ -327,9 +327,9 @@ * * @param avalue The input attribute * @param ontType The ontology data type for the attribute - * @return hasBracktes=true: A Set of valid Integers (or null in case there + * @return hasBrackets=true: A Set of valid Integers (or null in case there * where no valid ints) - * hasBracktes=false: Integer object in case everything is OK, null otherwise + * hasBrackets=false: Integer object in case everything is OK, null otherwise */ private static Object checkIntAttrValue(Object avalue, OntologyDataType ontType) |
|
From: Philipp H. <p-...@us...> - 2006-05-02 11:55:45
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/category In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13986/src/org/cobricks/category Modified Files: CategoryPresenter.java CategoryManagerImpl.java CategoryServlet.java Category.java Log Message: Solved problem with entering boolean and integers Index: CategoryPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/CategoryPresenter.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- CategoryPresenter.java 10 Aug 2005 13:35:33 -0000 1.16 +++ CategoryPresenter.java 2 May 2006 11:55:41 -0000 1.17 @@ -22,8 +22,6 @@ import org.cobricks.core.ComponentDirectory; import org.cobricks.core.ComponentEvent; -import org.cobricks.core.ComponentEventListener; -import org.cobricks.core.ComponentManagerInterface; import org.cobricks.core.CoreManager; import org.cobricks.core.Ontology; import org.cobricks.core.OntologyClass; @@ -443,13 +441,15 @@ } typeName = odat.getTypeName(); - + logger.debug("attributeName: "+attr); + logger.debug("typeName: "+typeName); if (odat.hasMaxLength()) { maxLength = odat.getMaxLength(); } } if (rows == -1) { + logger.debug("rows == -1"); for (int i = 0; i < LONG_DATATYPES.length; i++) { if (typeName.equals(LONG_DATATYPES[i])) { rows = ROWS_FOR_LONG_INPUT; @@ -465,9 +465,11 @@ if (attr.equalsIgnoreCase("title")) { rows = 1; } + logger.debug("rows = "+rows); } if ((oca != null) && !oca.getValues().isEmpty()) { + logger.debug("in dropDown if"); //There are possible values if (requestVal != null) { result += printDropDown(categoryClass, aname, requestVal, lang, @@ -478,6 +480,7 @@ } } else if(typeName.equals("category")){ + logger.debug("in category if"); Map attrs = new HashMap(); List ret = categoryManager.searchCategories(attrs); result += "<select name=\""+aname+"\" size=\"1\">"; @@ -499,6 +502,7 @@ result += "</select>"; } else if(typeName.equals("user")) { + logger.debug("in user if"); if (userList == null) { Map attrs = new HashMap(); @@ -592,12 +596,53 @@ result += "</table>\n"; } else if (typeName.equals("boolean")) { - result += "<input type=\"checkbox\" name=\""+aname+"\" value=\"1\""; - if(requestVal != null && requestVal.equals("1")) - result += " checked "; + logger.debug("in boolean if"); + +// result += "<input type=\"checkbox\" name=\""+aname+"\" value=\"true\""; +// if(requestVal != null && requestVal.equals("true")) +// result += " checked "; // result += ">"; + result = "<input type=\"radio\" name=\"" + aname + "\""; + + result += " value=\"true\""; + + if ((requestVal != null) && requestVal.equals("true")) { + result += " checked=\"checked\""; + } + + if (readonly) { + result += " readonly=\"readonly\""; + } + + result += "> true </input><input type=\"radio\""; + result += (" name=\"" + aname + "\" value=\"false\""); + + if ((requestVal != null) && requestVal.equals("false")) { + result += " checked=\"checked\""; + } + + if (readonly) { + result += " readonly=\"readonly\""; + } + + result += "> false </input>"; +// result += "<input type=\"radio\""; +// result += (" name=\"" + aname + "\" value=\"\""); +// +// if ((defaultVal != null) && defaultVal.equals("")) { +// result += " checked=\"checked\""; +// } +// +// if (readonly) { +// result += " readonly=\"readonly\""; +// } +// +// result += "> no value </input>"; + + } else if ((rows <= 1)) { + logger.debug("rows <= 1"); result += ("<input name=\"" + aname + "\" type=\"text\""); if (maxLength > -1) { @@ -638,6 +683,7 @@ .toLocalizedPattern() + ")"); } } else { + logger.debug("in the else branch"); result += ("<textarea name=\"" + aname + "\""); result += (" cols=\"" + cols + "\" rows=\"" + rows + "\""); @@ -655,6 +701,7 @@ result += "</textarea>"; } + logger.debug("result: "+result); return result; } @@ -892,6 +939,7 @@ boolean multiple, boolean readonly) { + logger.debug("in printDropDown"); String result = "<select name=\"" + submitName + "\""; if (type.equals("language")) { @@ -942,7 +990,35 @@ + LANGUAGES[i][1] + "</option>\n"); } } else { - return ""; + logger.debug("printDropDown type equals discussion_forum"); + OntologyClassAttr oca = + this.ontology.getClass(categoryClass).getAttribute(submitName); + logger.debug("oca.getName: "+oca.getName()); + List values = oca.getValues(); + logger.debug("oca.getValues(): "); + for (Iterator iter = values.iterator(); iter.hasNext();) + { + String element = (String) iter.next(); + logger.debug("value: "+element); + + result += "<option"; + + String[] selList = selected.split(","); + for(int s = 0;s<selList.length;s++){ + if (element.equals(selList[s].trim())) { + result += " selected=\"selected\""; + break; + } + } + + result += " value=\"" + element + "\">"; + if(element.equals("Guestbook") && lang.equals("de")){ + result += "Gästebuch"; + }else { + result += element; + } + result += "</option>\n"; + } } result += "</select>"; Index: CategoryServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/CategoryServlet.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- CategoryServlet.java 22 Aug 2005 13:52:06 -0000 1.14 +++ CategoryServlet.java 2 May 2006 11:55:41 -0000 1.15 @@ -13,29 +13,24 @@ package org.cobricks.category; import java.io.PrintWriter; -import java.net.URL; -import java.util.Date; -import java.util.ArrayList; +import java.text.DateFormat; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; -import java.util.List; import java.util.Map; import java.util.Set; import java.util.StringTokenizer; import javax.servlet.ServletConfig; import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.cobricks.core.ComponentDirectory; -import org.cobricks.core.ComponentManagerInterface; import org.cobricks.core.Ontology; import org.cobricks.core.OntologyClass; import org.cobricks.core.OntologyClassAttr; +import org.cobricks.core.OntologyHelper; import org.cobricks.core.util.LogUtil; +import org.cobricks.portal.PortalPresenter; import org.cobricks.portal.PortalRequest; import org.cobricks.portal.PortalServletAdaptor; import org.cobricks.portal.PortalUser; @@ -157,6 +152,25 @@ count++; } + Set attrsKeys = attrs.keySet(); + + DateFormat dateTimeFormatter = PortalPresenter. + getDateTimeFormatter(prequest.getRequestParameter("_lang"), true); + DateFormat dateFormatter = PortalPresenter. + getDateTimeFormatter(prequest.getRequestParameter("_lang"), false); + + for (Iterator iter = attrsKeys.iterator(); iter.hasNext();) + { + String key = (String) iter.next(); + if (attrs.get(key) instanceof String) + { + Object newValue = OntologyHelper.instantiateAttrExternal((String)attrs.get(key), key, oc, coreManager, dateTimeFormatter, dateFormatter); + attrs.put(key, newValue); + } + } + + + try { Category catid = categoryManager. Index: Category.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/Category.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Category.java 22 Aug 2005 13:52:06 -0000 1.13 +++ Category.java 2 May 2006 11:55:41 -0000 1.14 @@ -21,8 +21,6 @@ import org.apache.log4j.Logger; import org.cobricks.core.DataObject; -import org.cobricks.core.db.DBAccess; -import org.cobricks.core.db.DBAccess; /** * Base class for the data concept "category". @@ -258,5 +256,11 @@ set.add(auserid); } + /** + * + */ + public String getCategoryClass(){ + return ontologyclassname; + } } Index: CategoryManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/CategoryManagerImpl.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- CategoryManagerImpl.java 5 Apr 2006 08:38:57 -0000 1.26 +++ CategoryManagerImpl.java 2 May 2006 11:55:41 -0000 1.27 @@ -12,9 +12,6 @@ package org.cobricks.category; -import java.io.File; -import java.sql.Array; -import java.sql.Timestamp; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -28,12 +25,9 @@ import org.apache.log4j.Logger; -import org.cobricks.core.ComponentManagerInterface; import org.cobricks.user.User; -import org.cobricks.core.CobricksException; import org.cobricks.core.ComponentEvent; import org.cobricks.core.ComponentEventImpl; -import org.cobricks.core.ComponentEventListener; import org.cobricks.core.ComponentManagerAdaptor; import org.cobricks.core.CoreManager; import org.cobricks.core.DataObject; @@ -45,7 +39,6 @@ import org.cobricks.core.db.DBAccess; import org.cobricks.core.util.LogUtil; import org.cobricks.core.util.UUID; -import org.cobricks.user.User; import org.cobricks.user.UserManager; import org.cobricks.user.AccessControl; import org.cobricks.user.AccessHandler; @@ -261,7 +254,10 @@ } logger.info("getCategory("+catid+")"); result = loadCategory(catid); - categoryCache.insert(result); + if ( result != null) + { + categoryCache.insert(result); + } return result; } @@ -536,7 +532,6 @@ attrs.put("categoryclass", categoryClassName); // Check the attributes against the ontology - logger.info("createCategory attrs="+attrs.toString()); // check attributes and remove non fitting attributes attrs = OntologyHelper. checkAttrsAgainstOntology(attrs, oc, true, true, coreManager, |
|
From: Philipp H. <p-...@us...> - 2006-05-02 11:55:23
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/category/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13741/src/org/cobricks/category/db Modified Files: category.xml Log Message: field 'categoryclass' from varchar(15) to varchar(30) cause 15 is to short Index: category.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/db/category.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- category.xml 24 Jun 2004 06:55:34 -0000 1.1 +++ category.xml 2 May 2006 11:55:07 -0000 1.2 @@ -4,7 +4,7 @@ <column name="catid" type="int" primarykey="true"/> <column name="globalid" type="varchar(64)" notnull="true"/> - <column name="categoryclass" type="varchar(15)"/> + <column name="categoryclass" type="varchar(30)"/> <column name="creatorid" type="int"/> <column name="creationtime" type="timestamp"/> <column name="updaterid" type="int"/> |
|
From: Philipp H. <p-...@us...> - 2006-04-06 16:51:44
|
Update of /cvsroot/cobricks/cobricks2/web/category In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14980/web/category Modified Files: index.html Log Message: threw nullpointer exception for $categoryManager.getCategory(0) if there was no parent. Now it only call getTitle() if $catogory is not NULL Index: index.html =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/category/index.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- index.html 19 Jan 2005 15:29:57 -0000 1.7 +++ index.html 6 Apr 2006 16:51:39 -0000 1.8 @@ -65,7 +65,13 @@ </td> <td> <a href="update_start.html?catid=$i.getId()">$!i.getTitle()</a> - </td><td>$!categoryManager.getCategory($i.getParentId()).getTitle()</td> + </td><td> + #set ( $category = false ) + #set ( $category = $categoryManager.getCategory($i.getParentId()) ) + #if ( $category ) + $category.getTitle() + #end + </td> <!-- <td> #if ( $!i.getCategoryClass() == "community" ) |
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29694/src/org/cobricks/discussion Modified Files: DiscussionAccessHandler.java DiscussionManager.java DiscussionServlet.java properties.txt itemontology.xml DiscussionPresenter.java DiscussionManagerImpl.java Added Files: categoryontology.xml Log Message: category and item ontology (first version) Index: itemontology.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/itemontology.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- itemontology.xml 2 Mar 2006 21:24:42 -0000 1.1 +++ itemontology.xml 6 Apr 2006 16:25:53 -0000 1.2 @@ -1,11 +1,19 @@ <itemontology> +<!-- Forum as Category <class name="forum" parent="item" javaclassname="org.cobricks.discussion.Forum"> <description lang="de">Forum</description> <description lang="en">Forum</description> <attr name="forumid" type="int" /> <attr name="children" type="item[]" /> <attr name="parent" type="item" /> +--> +<class name="posting" parent="item"> +<description lang="de">Beitrag</description> +<description lang="en">Posting</description> +<attr name="forumid" type="category" /> +<attr name="children" type="posting[]" /> +<attr name="parent" type="posting" /> Index: properties.txt =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/properties.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- properties.txt 2 Mar 2006 21:24:42 -0000 1.1 +++ properties.txt 6 Apr 2006 16:25:53 -0000 1.2 @@ -1,19 +1,14 @@ # # Cobricks properties - "discussion" component # -# Configuration settings for the item component of the Cobricks platform -# -# ! Do not change this file for local customization. In this file we -# ! will add or change standard properties when the component is -# ! updated. Use the $CONFDIR/localproperties.txt file for overloading -# ! any of the properties defined in this file. +# Configuration settings for the discussion component of the Cobricks platform # # component information org.cobricks.discussion.comp.manager.name=discussionManager org.cobricks.discussion.comp.manager.class=org.cobricks.discussion.DiscussionManagerImpl -#org.cobricks.discussion.comp.presenter.1.name=discussionPresenter -#org.cobricks.discussion.comp.presenter.1.class=org.cobricks.discussion.discussionPresenter +org.cobricks.discussion.comp.presenter.1.name=discussionPresenter +org.cobricks.discussion.comp.presenter.1.class=org.cobricks.discussion.DiscussionPresenter org.cobricks.discussion.comp.listento= # Encoding settings - changing may cause problems - see doc @@ -25,4 +20,14 @@ discussion.presenter.timestyle=short discussion.languages=en,de -#item.display.template.details.voting=/voting/itemtemplate-voting.html +#item.display.template.details.posting=/discussion/itemtemplate-posting.html + +#---------------------------------- +# settings for the discussion component + +# org.cobricks.discussion.settings.open=true +# (true: everyone can view the discussion component +# false: only users with accessControll to discussion.read can enter) + +# org.cobricks.discussion.settings.test=value +# (description) \ No newline at end of file Index: DiscussionAccessHandler.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/DiscussionAccessHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DiscussionAccessHandler.java 2 Mar 2006 21:24:41 -0000 1.1 +++ DiscussionAccessHandler.java 6 Apr 2006 16:25:53 -0000 1.2 @@ -30,17 +30,17 @@ { static Logger logger = Logger.getLogger(DiscussionAccessHandler.class); - static final String domain = "voting"; + static final String domain = "discussion"; - static final String[] domainactions = { "create", "delete", "vote" }; + static final String[] domainactions = { "*", "view", "read", "createCat","create", "delete", "vote" }; static final String[][] domainactionattrs = { - // create - { "votingclass" }, - // delete - { "votingId", "votingclass" }, - // vote - { "votingId", "votingclass" } }; + // create + { "votingclass" }, + // delete + { "votingId", "votingclass" }, + // vote + { "votingId", "votingclass" } }; List actions; @@ -58,7 +58,7 @@ public void init(CoreManager coreManager, DBAccess dbAccess) { - logger.info("Initializing voting access handler"); + logger.info("PAH_ "+"Initializing discussion access handler"); super.init(coreManager, dbAccess); actions = new ArrayList(); actionAttrs = new HashMap(); @@ -98,6 +98,7 @@ String action, Map attrs) { + //todo // check capabilities of roles with status = "all" // tbd --- NEW FILE: categoryontology.xml --- <categoryontology> <class name="discussion_category" parent="category"> <description lang="en">Category for the discussion component</description> <attr name="open" type="boolean"> <default>true</default> </attr> <attr name="order" type="int" /> <attr name="long_title" type="string(100)" multilanguage="true"> <description lang="en">Long Title</description> <description lang="de">Langer Titel</description> </attr> <attr name="description" type="string(200)" multilanguage="true"> <description lang="en">Description</description> <description lang="de">Beschreibung</description> </attr> </class> <class name="discussion_forum" parent="discussion_category"> <description lang="en">Forum for the discussion component</description> <attr name="forumtype" type="int"> <description lang="de">Typ des Forums (1:Forum, 2:FAQ, 3:Weblog)</description> <description lang="en">Forum typ (1:Forum, 2:FAQ, 3:Weblog)</description> <default>1</default> <value>1</value> <!-- forum --> <value>2</value> <!-- faq --> <value>3</value> <!-- weblog--> </attr> </class> <class name="discussion_topic" parent="discussion_category"> <description lang="en">Topic in the discussion component</description> <attr name="first_posting" type="item" /> </class> <!-- <class name="category" javaclassname="de.cobricks.category.Category"> <description lang="en">Generic Category Class</description> <attr name="catid" type="int"/> <attr name="globalid" type="string(64)"/> <attr name="categoryclass" type="string(50)"/> <attr name="title" type="string(10)" multilanguage="true"> <description lang="en">Title</description> <description lang="de">Titel</description> </attr> <attr name="visible" type="boolean"> <default>true</default> </attr> <attr name="creator" type="user"/> <attr name="creationtime" type="datetime"/> <attr name="updater" type="user"/> <attr name="updatetime" type="datetime"/> <attr name="parent" type="category"/> <attr name=âiterestusersâ type=âuser[]â/> <!âTBD: context class ï </class> <class name="privatefolder" parent="category"> <description lang="en">Private Folder (for Items)</description> <attr name="owner" type="user"/> <!âtbd context class ï </class> <class name="community" parent="category"> <description lang="en">Category that can be closed (have members)</description> <attr name=âmembersâ type=âuser[]â/> <!âtbd: context class ï <attr name="admins" type="user[]"/> <attr name=âopenâ type=âbooleanâ> <default>true</default> </attr> <attr name=âinvitationpwâ type=âstring(20)â/> </class> --> </categoryontology> Index: DiscussionManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/DiscussionManagerImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DiscussionManagerImpl.java 2 Mar 2006 21:24:42 -0000 1.1 +++ DiscussionManagerImpl.java 6 Apr 2006 16:25:53 -0000 1.2 @@ -1,18 +1,26 @@ package org.cobricks.discussion; import java.util.Iterator; +import java.util.List; +import java.util.Map; import java.util.Properties; import org.apache.log4j.Logger; +import org.cobricks.category.Category; +import org.cobricks.category.CategoryManager; import org.cobricks.core.ComponentManagerAdaptor; import org.cobricks.core.CoreManager; +import org.cobricks.core.Ontology; +import org.cobricks.core.OntologyHelper; import org.cobricks.core.db.DBAccess; +import org.cobricks.item.Item; import org.cobricks.item.ItemManager; public class DiscussionManagerImpl extends ComponentManagerAdaptor implements DiscussionManager { - private static Logger logger = Logger.getLogger(DiscussionManagerImpl.class); + private static Logger logger = Logger + .getLogger(DiscussionManagerImpl.class); /** * Component name @@ -28,22 +36,30 @@ * Reference to the itemManager. */ private ItemManager itemManager; + /** + * Reference to the categoryManager. + */ + private CategoryManager categoryManager; - public DiscussionManagerImpl(String componentId, - String managerId, - Properties p, - CoreManager coreManager, - DBAccess dbAccess) - { - super(componentId, managerId, p, coreManager, dbAccess); - logger.info("PAH_DiscussionManagerImpl Constructor1"); - } + private Ontology categoryOntology; - public DiscussionManagerImpl() - { - super(); - logger.info("PAH_DiscussionManagerImpl Constructor2"); - } + private Ontology itemOntology; + + // public DiscussionManagerImpl(String componentId, + // String managerId, + // Properties p, + // CoreManager coreManager, + // DBAccess dbAccess) + // { + // super(componentId, managerId, p, coreManager, dbAccess); + // logger.info("PAH_DiscussionManagerImpl Constructor1"); + // } + // + // public DiscussionManagerImpl() + // { + // super(); + // logger.info("PAH_DiscussionManagerImpl Constructor2"); + // } public String getComponentName() { @@ -61,19 +77,116 @@ CoreManager coreManager, DBAccess dbAccess) throws Exception { + logger.info("PAH_ " + "init(...) start"); super.init(componentId, managerId, properties, coreManager, dbAccess); this.itemManager = (ItemManager) componentDirectory .getManager("itemManager"); + this.categoryManager = (CategoryManager) componentDirectory + .getManager("categoryManager"); + + categoryOntology = coreManager.getOntology("category"); + itemOntology = coreManager.getOntology("item"); + String managerList = ""; - logger.info("PAH_ "+managerList); - for (Iterator iter = componentDirectory.getCompList().iterator(); iter.hasNext();) + for (Iterator iter = componentDirectory.getManagerNames().iterator(); iter + .hasNext();) { - + managerList += (String) iter.next(); + if (iter.hasNext()) + { + managerList += ", "; + } } + logger.info("PAH_ " + managerList); + logger.info("PAH_ " + "init(...) end"); + // } - - public String getTestString(){ - return "testString<br>"; + + public Category createCategory(Map attrs) + { + + // if there is a long_title and no title in the attrs map + // create title with the first 10 chars in long_title + if (attrs.get("long_title") == null) + { + attrs.put("long_title", ""); + } + if (attrs.get("title") == null) + { + attrs.put("title", ((String) attrs.get("long_title")).substring( + 0, 10)); + } + // categoryclass has to be discussion_category + // test if it exists, if not add it + // , if test if value is "discussion_category" + // if not change it + String catClass = (String) attrs.get("categoryclass"); + if(catClass != null){ + if(!catClass.equals("discussion_category")){ + attrs.put("categoryclass", "discussion_category"); + } + } + + //todo ob der check so correct ist + Map checkedMap = OntologyHelper.checkAttrsAgainstOntology( + attrs, categoryOntology.getClass("discussion_category"), false, false, + coreManager, categoryOntology); + if(checkedMap== null){ + logger.error("Failed inserting an item with null attributes."); + return null; + } + + return categoryManager.createCategory(attrs); + } + + public Category createForum(Map attrs) + { + // TODO Auto-generated method stub + return null; + } + + public Category createTopic(Map attrs) + { + // TODO Auto-generated method stub + return null; + + } + + public Item createPosting(Map attrs) + { + // TODO Auto-generated method stub + return null; + + } + + public List getCategories() + { + // TODO Auto-generated method stub + return null; + } + + public List getForums() + { + // TODO Auto-generated method stub + return null; + } + + public List getForums(int catid) + { + // TODO Auto-generated method stub + return null; + } + + public List getTopics(int catid) + { + // TODO Auto-generated method stub + return null; + } + + public List getPostings(int forumid) + { + // TODO Auto-generated method stub + return null; } } Index: DiscussionServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/DiscussionServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DiscussionServlet.java 2 Mar 2006 21:24:42 -0000 1.1 +++ DiscussionServlet.java 6 Apr 2006 16:25:53 -0000 1.2 @@ -1,17 +1,159 @@ package org.cobricks.discussion; +import java.io.PrintWriter; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; + +import org.apache.log4j.Logger; +import org.cobricks.category.Category; +import org.cobricks.category.CategoryManager; +import org.cobricks.core.ComponentDirectory; +import org.cobricks.core.Ontology; +import org.cobricks.core.OntologyClass; +import org.cobricks.core.OntologyClassAttr; +import org.cobricks.core.util.LogUtil; +import org.cobricks.item.ItemManager; +import org.cobricks.portal.PortalRequest; import org.cobricks.portal.PortalServletAdaptor; +import org.cobricks.portal.PortalUser; public class DiscussionServlet extends PortalServletAdaptor { + private static Logger logger = Logger.getLogger(DiscussionServlet.class); /** * */ private static final long serialVersionUID = -9161779391791151120L; + private Ontology categoryOntology; + private Ontology itemOntology; - public DiscussionServlet() { - super(); - // TODO Auto-generated constructor stub + /** + * + */ + public void init(ServletConfig config) + throws ServletException + { + super.init(config); + + this.addTarget("createCat", "performCreateCat", "", true); +// this.addTarget("delete", "performDelete", "", true); +// this.addTarget("update", "performUpdate", "", true); +// this.addTarget("add_interessted_user", +// "performAddInterestedUser", "", true); +// this.addTarget("add_community_user", +// "performAddCommunityUser", "", true); +// this.addTarget("add_community_user_password", +// "performAddCommunityUserWithPassword","",true); +// this.addTarget("remove_user", "performRemoveUser", "", true); + + + categoryOntology = coreManager.loadOntology("category"); + itemOntology = coreManager.loadOntology("item"); + ComponentDirectory componentDirectory = + coreManager.getComponentDirectory(); + categoryManager = (CategoryManager) + componentDirectory.getManager("categoryManager"); + itemManager = (ItemManager) + componentDirectory.getManager("itemManager"); + if (categoryManager==null) { + logger.error("Did not find category manager in ComponentDirectory!"); + } + if (itemManager==null) { + logger.error("Did not find category manager in ComponentDirectory!"); + } } + /** + * This method performs category creation using the request parameters. + * The request parameters must have a special format: + * if a custom category class is desired there must be a parameter + * category class with a correct category class name. + * All cmd.* are ignored. + * new attributes are also here defiened. + * The function ismultilang will be used to show wich attributes have + * multilanguages and for each used language an entry + * + * @param classname String of the categoryclass to create + * @param prequest Portal request to gather the data to create a new category + * @param out Is not used. + * @return "error": In case there are errors, also a context object named + * errors is set (a Set of InputErrors). "success" If everything is o.k. + */ + private String performCreate(PortalRequest prequest, PrintWriter out) + { + logger.info("perfomCreateCategory"); + + // check access rights + PortalUser portalUser = prequest.getPortalUser(); + if (!userManager.getAccessControl(). + checkPermission(portalUser.getUserId(), + "discussion", "createCat", null)) { + // prequest.setReturnCode(2000); + return "noaccess"; + } + //Map for the attributes + Map attrs = new HashMap(); + + //get ontology classname request parameter + String classname = prequest.getRequestParameter("categoryclass"); + //get language request parameter + String lang = prequest.getRequestParameter("lang"); + //add classname to attrs Map + attrs.put("categoryclass", classname); + + OntologyClass oc = categoryOntology.getClass(classname); + //get set of ontology attribute names + Set attr_list = oc.getAttributeNames(); + //iterate over all attribute names + Iterator it = attr_list.iterator(); + while(it.hasNext()){ + String aname = (String)it.next(); //get next attribute name + OntologyClassAttr oca = oc.getAttribute(aname); + if (oca.isMultiLanguage()){ //check if multilingual + String[] usedLangs = lang.split(","); + logger.info("lang = "+lang); + for (int j =0;j<usedLangs.length;j++){ + String avalue = + prequest.getRequestParameter(aname+"_"+usedLangs[j]); + attrs.put(aname+"_"+usedLangs[j],avalue); + } + } + else { + String avalue = prequest.getRequestParameter(aname.toString()); //todo toString() ??? wieso ist doch schon einer + attrs.put(aname,avalue); + } + } + + int count = 1; + while (true) { + String aname = + prequest.getRequestParameter("aname"+Integer.toString(count)); + if (aname != null && aname.trim().length()>0) { + String avalue = + prequest. + getRequestParameter("avalue"+Integer.toString(count)); + attrs.put(aname, avalue); + } + if (aname == null) + break; + count++; + } + + try { +// Category catid = + categoryManager. + createCategory(attrs, prequest.getPortalUser().getUser()); + prequest.setReturnCode(1011); + return "success"; + } catch (Exception e) { + logger.error(LogUtil.ex("failed creating category", e)); + } + prequest.setReturnCode(2011); + return "error"; + } } Index: DiscussionManager.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/DiscussionManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DiscussionManager.java 2 Mar 2006 21:24:42 -0000 1.1 +++ DiscussionManager.java 6 Apr 2006 16:25:53 -0000 1.2 @@ -1,8 +1,81 @@ package org.cobricks.discussion; +import java.util.List; +import java.util.Map; + +import org.cobricks.category.Category; import org.cobricks.core.ComponentManagerInterface; +import org.cobricks.item.Item; public interface DiscussionManager extends ComponentManagerInterface { + /** + * Constant for the Forum Type in the category "forum" + */ + public static int FORUM = 1; + /** + * Constant for the FAQ Type in the category "forum" + */ + public static int FAQ = 2; + /** + * Constant for the Weblog Type in the category "forum" + */ + public static int WEBLOG = 3; + + /** Create a category with the attributes given in the Map + * + * @param attrs A Map will all the attributes for the category + */ + public Category createCategory(Map attrs); + + /** Create a forum with the attributes given in the Map + * + * @param attrs A Map will all the attributes for the forum + */ + public Category createForum(Map attrs); + + /** Create a topic with the attributes given in the Map + * + * @param attrs A Map will all the attributes for the topic + */ + public Category createTopic(Map attrs); + /** Create a posting with the attributes given in the Map + * + * @param attrs A Map will all the attributes for the posting + */ + public Item createPosting(Map attrs); + + /** + * Returns all categories in a List + * @return List the returned categories + */ + public List getCategories(); + + /** + * Returns all forums in a List + * @return List the returned forums + */ + public List getForums(); + + /** + * Returns all forums in a List with the attribute partent is catid + * @param int catid the Id from the partent categorie + * @return List the returned forums + */ + public List getForums(int catid); + + /** + * Returns all topics in a List with the attribute partent is catid + * @param int catid the Id from the partent categorie + * @return List the returned topics + */ + public List getTopics(int catid); + + /** + * Returns all postings in a List with the attribute forumid is catid + * @param int catid the Id from the partent categorie + * @return List the returned postings + */ + public List getPostings(int forumid); } Index: DiscussionPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/DiscussionPresenter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DiscussionPresenter.java 2 Mar 2006 21:24:42 -0000 1.1 +++ DiscussionPresenter.java 6 Apr 2006 16:25:53 -0000 1.2 @@ -2,20 +2,25 @@ import java.util.Properties; +import org.apache.log4j.Logger; import org.cobricks.core.ComponentPresenterInterface; import org.cobricks.core.CoreManager; public class DiscussionPresenter implements ComponentPresenterInterface { + private static Logger logger = Logger.getLogger(DiscussionPresenter.class); + public DiscussionPresenter() { - super(); +// super(); // TODO Auto-generated constructor stub + logger.info("PAH_ "+ "constructor"); } public void init(String presenterId, Properties properties, CoreManager coreManager) throws Exception { // TODO Auto-generated method stub + logger.info("PAH_ "+ "init(...)"); } } |
|
From: Michael K. <ko...@us...> - 2006-04-05 08:39:08
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/category In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24953 Modified Files: CategoryManagerImpl.java categoryontology.xml Log Message: Index: categoryontology.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/categoryontology.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- categoryontology.xml 13 Dec 2005 09:05:01 -0000 1.6 +++ categoryontology.xml 5 Apr 2006 08:38:57 -0000 1.7 @@ -5,7 +5,7 @@ <attr name="catid" type="int"/> <attr name="globalid" type="string(64)"/> <attr name="categoryclass" type="string(50)"/> -<attr name="title" type="string(60)" multilanguage="true"> +<attr name="title" type="string(200)" multilanguage="true"> <description lang="en">Title</description> <description lang="de">Titel</description> </attr> Index: CategoryManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/CategoryManagerImpl.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- CategoryManagerImpl.java 16 Feb 2006 15:21:05 -0000 1.25 +++ CategoryManagerImpl.java 5 Apr 2006 08:38:57 -0000 1.26 @@ -555,7 +555,7 @@ Iterator i = attrs.keySet().iterator(); while (i.hasNext()) { String aname = (String)i.next(); - String atype = null; + String atype = "string"; if (oc != null) { OntologyClassAttr oca = oc.getAttribute(aname); if (oca != null) { |
|
From: lochmann <loc...@us...> - 2006-03-12 22:58:38
|
Update of /cvsroot/cobricks/cobricks2/web/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3805/web/user Modified Files: user-buddylist-search.html.en user-buddylist.html.en search.html.en card.html.en user-allpaths.html.en user.html.en Log Message: Social Networks. Index: user-buddylist.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/user/user-buddylist.html.en,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- user-buddylist.html.en 12 Feb 2006 19:07:48 -0000 1.3 +++ user-buddylist.html.en 12 Mar 2006 22:58:34 -0000 1.4 @@ -1,167 +1,167 @@ -#parse ( "pageheader.html" ) -<em><a href="index.html">User Component</a> - -<a href="user-buddylist.html">User Profile Buddylist</a></em> - -#set ( $auserlogin = "$!auserlogin" ) -#if ( $auserlogin == "" ) -#set ( $auserlogin = $userLogin ) -#end -#set ( $auserid = $userManager.getUserIdForUserLogin($auserlogin) ) -#set ($auser = $userManager.getUser($auserid)) -#set ($auserclass = $auser.getUserClass() ) - -<h1>User Profile - Buddylist</h1> - -#set ( $auth = $userPresenter.checkPermission($userId, "user", "read", "userid=$auserid") ) -#if ( "$auth" != "true" ) - #if ( "$auserlogin" == "$userLogin" ) - #set ( $auth = "true" ) - #end -#end -#if ( $auth != "true" ) - -<div class="error">You do not have the access permission to read user -information of user "$auserlogin".</div> -<p> -Please log in as user with the specified permission or ask the platform -administrator to assign the permission to your account. - -#else - -#if ($auserid == 0) - <p><div class="error">User with user login <b>$auserlogin</b> does not exist!</div></p> -#else - -#if ($returnCode == 1001) -<p><div class="error">User with user login $!newUserLogin does not exist, please check your input!</div></p> -<p><div class="info">And try again!</div></p> -#end -#if ($returnCode == 1002) -<p><div class="info">The user you try to add, is already in your buddylist.</div></p> -#end -#if ($returnCode == 1003) -<p><div class="info">It is impossible to add yourself into your buddylist!</div></p> -#end -#if ($returnCode == 1010) -<p><div class="info">Your input is empty!</div></p> -#end -#if ($returnCode == 2001) -<p><div class="info">You have added one new member in your buddylist.</div></p> -#end - -<p>User Login: $auserlogin</p> - -<form action="/USER" method="post"> -<input type="hidden" name="cmd" value="deleteListMember" /> -<input type="hidden" name="cmd.success" value="/user/user-buddylist.html" /> -<input type="hidden" name="cmd.error" value="/user/user-buddylist.html" /> -<input type="hidden" name="path" value="$portalRequest.getPagePath()"/> -<input type="hidden" name="aname" value="pim.network.buddylist" /> -<input type="hidden" name="uid" value="$auserid" /> - -<p> -<table border="1pt" width="100%" cellspacing="0pt" cellpadding="0pt"> -<tr bgcolor="#eeeeee"> -<td> -<table border="0" cellpadding="5pt"><tr><td> -<em><a href="user.html?auserlogin=$auserlogin">basic</a> - -<a href="user-interests.html?auserlogin=$auserlogin">interests</a> - -<a href="user-buddylist.html?auserlogin=$auserlogin">buddylist</a> - -<a href="user-roles.html?auserlogin=$auserlogin">access roles</a><em></td> -</td></tr></table></td> -<td align="right"> -<table border="0" cellpadding="5pt"><tr><td> -<em><a href="change_password.html?auserlogin=$auserlogin">change password</a></em> -</td></tr></table> -</td></tr> -<tr><td colspan="2"> - -<table border="0" cellpadding="8pt"> -<tr><td> - -<b>Buddylist of user <i>$userManager.getUser($auserid).getName()</i></b> - -<br><br> -<table width="100%"> - <tr bgcolor="dfdfdf"> - <td width="7%"> - <b>Delete</b> - </td> - <td width="12%"> - <b>Image</b> - </td> - <td width="43%"> - <b>Name</b> - </td> - <td width="38%"> - <b>E-Mail</b> - </td> - </tr> - #set ($result = $userPresenter.getUserAttrSet($auserid, "pim.network.buddylist")) - #if ($result.size() > 0) - #foreach ($i in $result) - <tr bgcolor="dfdfdf"> - <td align="center"><input type="checkbox" name="id" value="$i.getId()"></td> - <td valign=center> - #set ($imageuri = "") - #set ($imageuri = $i.getAttribute("basic.personal.imageuri")) - #if ("$!imageuri"!="") - <img src="$imageuri" width="32" height=32> - #end - </td> - <td><a href="/user/card.html?auserlogin=$i.getUserLogin()">$i.getName()</a></td> - <td> - #if ($i.getAttribute("basic.contact-work.online.email")) - $!i.getAttribute("basic.contact-work.online.email") - #else - $!i.getAttribute("basic.contact-private.online.email") - #end</td> - </tr> - #end - #else - <tr><td colspan = "3">Your buddylist has no entries yet. You can fill it using text field below.</td></tr> - #end -</table> -<br> -<input type="submit" value="Delete"> -</form> - -<p> - -<form action="/USER" method="post" name=frm1 id=frm1> -<input type="hidden" name="cmd" value="addListMember" /> -<input type="hidden" name="cmd.success" value="/user/user-buddylist.html" /> -<input type="hidden" name="cmd.error" value="/user/user-buddylist.html" /> -<input type="hidden" name="path" value="$portalRequest.getPagePath()"/> -<input type="hidden" name="aname" value="pim.network.buddylist" /> -<input type="hidden" name="uid" value="$auserid" /> -In order to add somebody to your buddylist please enter his/her -<b><font color="black">userlogin</font></b> into the text field below and -click the button "Add to the list". -</p> -<br> -<input type="submit" value="Add to the list"> -<input name="newUserLogin" size="20" value="$!newUserLogin"> - -<script type="text/javascript"> -// <!-- - document.write("<input type=button value=Search onClick=\"window.open('/user/user-buddylist-search.html?print=true&auserlogin=$auserlogin','usersearch','width=500,height=500,scrollbar=yes,menu=no');\">"); -// --> -</script> - -<noscript> - <a href="/user/user-buddylist-search.html?auserlogin=$auserlogin">Search</a> -</noscript> - -</td></tr></table> - -</td></tr></table> - -</form> - -#end - -#end - - -#parse ( "pagefooter.html" ) +#parse ( "pageheader.html" ) +<em><a href="index.html">User Component</a> - +<a href="user-buddylist.html">User Profile Buddylist</a></em> + +#set ( $auserlogin = "$!auserlogin" ) +#if ( $auserlogin == "" ) +#set ( $auserlogin = $userLogin ) +#end +#set ( $auserid = $userManager.getUserIdForUserLogin($auserlogin) ) +#set ($auser = $userManager.getUser($auserid)) +#set ($auserclass = $auser.getUserClass() ) + +<h1>User Profile - Buddylist</h1> + +#set ( $auth = $userPresenter.checkPermission($userId, "user", "read", "userid=$auserid") ) +#if ( "$auth" != "true" ) + #if ( "$auserlogin" == "$userLogin" ) + #set ( $auth = "true" ) + #end +#end +#if ( $auth != "true" ) + +<div class="error">You do not have the access permission to read user +information of user "$auserlogin".</div> +<p> +Please log in as user with the specified permission or ask the platform +administrator to assign the permission to your account. + +#else + +#if ($auserid == 0) + <p><div class="error">User with user login <b>$auserlogin</b> does not exist!</div></p> +#else + +#if ($returnCode == 1001) +<p><div class="error">User with user login $!newUserLogin does not exist, please check your input!</div></p> +<p><div class="info">And try again!</div></p> +#end +#if ($returnCode == 1002) +<p><div class="info">The user you try to add, is already in your buddylist.</div></p> +#end +#if ($returnCode == 1003) +<p><div class="info">It is impossible to add yourself into your buddylist!</div></p> +#end +#if ($returnCode == 1010) +<p><div class="info">Your input is empty!</div></p> +#end +#if ($returnCode == 2001) +<p><div class="info">You have added one new member in your buddylist.</div></p> +#end + +<p>User Login: $auserlogin</p> + +<form action="/USER" method="post"> +<input type="hidden" name="cmd" value="deleteListMember" /> +<input type="hidden" name="cmd.success" value="/user/user-buddylist.html" /> +<input type="hidden" name="cmd.error" value="/user/user-buddylist.html" /> +<input type="hidden" name="path" value="$portalRequest.getPagePath()"/> +<input type="hidden" name="aname" value="pim.network.buddylist" /> +<input type="hidden" name="uid" value="$auserid" /> + +<p> +<table border="1pt" width="100%" cellspacing="0pt" cellpadding="0pt"> +<tr bgcolor="#eeeeee"> +<td> +<table border="0" cellpadding="5pt"><tr><td> +<em><a href="user.html?auserlogin=$auserlogin">basic</a> - +<a href="user-interests.html?auserlogin=$auserlogin">interests</a> - +<a href="user-buddylist.html?auserlogin=$auserlogin">buddylist</a> - +<a href="user-roles.html?auserlogin=$auserlogin">access roles</a><em></td> +</td></tr></table></td> +<td align="right"> +<table border="0" cellpadding="5pt"><tr><td> +<em><a href="change_password.html?auserlogin=$auserlogin">change password</a></em> +</td></tr></table> +</td></tr> +<tr><td colspan="2"> + +<table border="0" cellpadding="8pt"> +<tr><td> + +<b>Buddylist of user <i>$userManager.getUser($auserid).getName()</i></b> + +<br><br> +<table width="100%"> + <tr bgcolor="dfdfdf"> + <td width="7%"> + <b>Delete</b> + </td> + <td width="12%"> + <b>Image</b> + </td> + <td width="43%"> + <b>Name</b> + </td> + <td width="38%"> + <b>E-Mail</b> + </td> + </tr> + #set ($result = $userPresenter.getUserAttrSet($auserid, "pim.network.buddylist")) + #if ($result.size() > 0) + #foreach ($i in $result) + <tr bgcolor="dfdfdf"> + <td align="center"><input type="checkbox" name="id" value="$i.getId()"></td> + <td valign=center> + #set ($imageuri = "") + #set ($imageuri = $i.getAttribute("basic.personal.imageuri")) + #if ("$!imageuri"!="") + <img src="$imageuri" width="32" height=32> + #end + </td> + <td><a href="/user/card.html?auserlogin=$i.getUserLogin()">$i.getName()</a></td> + <td> + #if ($i.getAttribute("basic.contact-work.online.email")) + $!i.getAttribute("basic.contact-work.online.email") + #else + $!i.getAttribute("basic.contact-private.online.email") + #end</td> + </tr> + #end + #else + <tr><td colspan = "3">Your buddylist has no entries yet. You can fill it using text field below.</td></tr> + #end +</table> +<br> +<input type="submit" value="Delete"> +</form> + +<p> + +<form action="/USER" method="post" name=frm1 id=frm1> +<input type="hidden" name="cmd" value="addListMember" /> +<input type="hidden" name="cmd.success" value="/user/user-buddylist.html" /> +<input type="hidden" name="cmd.error" value="/user/user-buddylist.html" /> +<input type="hidden" name="path" value="$portalRequest.getPagePath()"/> +<input type="hidden" name="aname" value="pim.network.buddylist" /> +<input type="hidden" name="uid" value="$auserid" /> +In order to add somebody to your buddylist please enter his/her +<b><font color="black">userlogin</font></b> into the text field below and +click the button "Add to the list". +</p> +<br> +<input type="submit" value="Add to the list"> +<input name="newUserLogin" size="20" value="$!newUserLogin"> + +<script type="text/javascript"> +// <!-- + document.write("<input type=button value=Search onClick=\"window.open('/user/user-buddylist-search.html?print=true&auserlogin=$auserlogin','usersearch','width=500,height=500,scrollbar=yes,menu=no');\">"); +// --> +</script> + +<noscript> + <a href="/user/user-buddylist-search.html?auserlogin=$auserlogin">Search</a> +</noscript> + +</td></tr></table> + +</td></tr></table> + +</form> + +#end + +#end + + +#parse ( "pagefooter.html" ) Index: card.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/user/card.html.en,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- card.html.en 12 Feb 2006 19:07:48 -0000 1.12 +++ card.html.en 12 Mar 2006 22:58:34 -0000 1.13 @@ -1,129 +1,131 @@ - -#parse ( "pageheader.html" ) -<em><a href="index.html">User Component</a> - -<a href="card.html">User Card</a></em> - -#set ( $auserlogin = "$!auserlogin" ) -#if ( $auserlogin == "" ) -#set ( $auserlogin = $userLogin ) -#end -#set ( $auserid = $userManager.getUserIdForUserLogin($auserlogin) ) -#if ($auserid == 0) - <p><div class="error">User with user login <b>$auserlogin</b> does not exist!</div></p> -#else - -<h1>User (Business) Card</h1> -<p>for user: $auserlogin</p> - -#set ($auser = $userManager.getUser($auserid)) -#set ($auserclass = $auser.getUserClass()) - -#set ($imageuri = $auser.getAttribute("basic.personal.imageuri")) -#if ("$!imageuri"!="") -<img align="right" src="$imageuri"> -#end - -<h2>$auser.getName()</h2> -#if ("$auserclass"!="user") -User class: $!auserclass<p> -#end - -Email (priv): $!auser.getAttribute("basic.contact-priv.online.email")<br> -Email (work): $!auser.getAttribute("basic.contact-work.online.email") - -<br clear="all"/> -<p> - -<hr> - -#set ( $loggedinid = $userManager.getUserIdForUserLogin($userLogin) ) - -<h3>Path to this user</h3> - -(<a href="/user/user-allpaths?usera=$userLogin&userb=$auserlogin">show all paths</a>) -<br> - -#set ($result = $userPresenter.getUserPath($loggedinid, $auserid)) -#set ($resultsize = $result.size()) -#set ($maxindex = $resultsize - 1) - -#if ($resultsize == 0) - No path to this user found. -#else - <table border=0 style="table-layout:fixed;"> - <tr> - #set ($index = 0) - #foreach ($i in $result) - <td height=32 valign=bottom align=center style="border:1px solid #DFDFDF;"> - #set ($imageuri = "") - #set ($imageuri = $i.getAttribute("basic.personal.imageuri")) - #if ($imageuri == "") - #set ($imageuri = "/images/nouser.png") - #end - - <img src="$imageuri" width=32 height=32> - - #set ($userLogin = $i.getUserLogin()) - - <br> $userLogin - </td> - #if($index != $maxindex) - <td valign=middle rowspan=2 align=center> - <img src="/images/arrow.png"> - </td> - #end - #set ($index = $index + 1) - #end - <!-- - </tr><tr> - #foreach ($i in $result) - #set ($userLogin = $i.getUserLogin()) - <td align=center> - $userLogin - </td> - #end - --> - </tr> - </table> -#end - -<hr> - -<h3>All public attributes</h3> - -#set ($attrNames = []) -#set ($attrValues = []) - -<table border="0"> -<tr bgcolor="#dfdfdf"> - <td> - <b>Attribute Name</b> - </td> - <td> - <b>Attribute Value</b> - </td> -</tr> - -$userPresenter.getUserAttributes($auserid, $attrNames, $attrValues, false, $lang) - - #set ($count = 0) - #foreach ($i in $attrNames) - <tr bgcolor="#dfdfdf"> - <td>$i</td> - <td>$attrValues.get($count)</td> - </tr> - #set ($count = $count + 1) - #end -</table> -<br> -#end - -#set ($foafuri = $auser.getAttribute("basic.personal.foafuri")) -#if ("$!foafuri"!="") -<a href="$foafuri"><img border="0" src="/images/foaf.gif" /></a> -#else -<a href="card-foaf.xml?auserid=$auserid"> -<img border="0" src="/images/foaf.gif" /></a> -#end - -#parse ( "pagefooter.html" ) + +#parse ( "pageheader.html" ) +<em><a href="index.html">User Component</a> - +<a href="card.html">User Card</a></em> + +#set ( $auserlogin = "$!auserlogin" ) +#if ( $auserlogin == "" ) +#set ( $auserlogin = $userLogin ) +#end +#set ( $auserid = $userManager.getUserIdForUserLogin($auserlogin) ) +#if ($auserid == 0) + <p><div class="error">User with user login <b>$auserlogin</b> does not exist!</div></p> +#else + +<h1>User (Business) Card</h1> +<p>for user: $auserlogin</p> + +#set ($auser = $userManager.getUser($auserid)) +#set ($auserclass = $auser.getUserClass()) + +#set ($imageuri = $auser.getAttribute("basic.personal.imageuri")) +#if ("$!imageuri"!="") +<img align="right" src="$imageuri"> +#end + +<h2>$auser.getName()</h2> +#if ("$auserclass"!="user") +User class: $!auserclass<p> +#end + +Email (priv): $!auser.getAttribute("basic.contact-priv.online.email")<br> +Email (work): $!auser.getAttribute("basic.contact-work.online.email") + +<br clear="all"/> +<p> + +<hr> + +#set ( $loggedinusername = $userLogin ) +#set ( $loggedinid = $userManager.getUserIdForUserLogin($userLogin) ) + +<h3>Path to this user</h3> + +#if ($loggedinid == 0 ) + <p>No user is logged in.</p> +#else + +#set ($result = $userPresenter.getUserPath($loggedinid, $auserid)) +#set ($resultsize = $result.size()) +#set ($maxindex = $resultsize - 1) + +#if ($resultsize == 0) + No path to this user found. +#else + <table border=0 style="table-layout:fixed;"> + <tr> + #set ($index = 0) + #foreach ($i in $result) + <td height=32 valign=bottom align=center style="border:1px solid #DFDFDF;"> + #set ($imageuri = "") + #set ($imageuri = $i.getAttribute("basic.personal.imageuri")) + #if ($imageuri == "") + #set ($imageuri = "/images/nouser.png") + #end + + + + #set ($userLogin = $i.getUserLogin()) + + <a href="card.html?auserlogin=$userLogin"><img src="$imageuri" width=32 height=32></a> + <br> + <a href="card.html?auserlogin=$userLogin">$userLogin</a> + </td> + #if($index != $maxindex) + <td valign=middle rowspan=2 align=center> + <img src="/images/arrow.png"> + </td> + #end + #set ($index = $index + 1) + #end + + </tr> + </table> + + <br> + + (<a href="/user/user-allpaths?usera=$loggedinusername&userb=$auserlogin">show all paths</a>) +#end + +#end + +<hr> + +<h3>All public attributes</h3> + +#set ($attrNames = []) +#set ($attrValues = []) + +<table border="0"> +<tr bgcolor="#dfdfdf"> + <td> + <b>Attribute Name</b> + </td> + <td> + <b>Attribute Value</b> + </td> +</tr> + +$userPresenter.getUserAttributes($auserid, $attrNames, $attrValues, false, $lang) + + #set ($count = 0) + #foreach ($i in $attrNames) + <tr bgcolor="#dfdfdf"> + <td>$i</td> + <td>$attrValues.get($count)</td> + </tr> + #set ($count = $count + 1) + #end +</table> +<br> +#end + +#set ($foafuri = $auser.getAttribute("basic.personal.foafuri")) +#if ("$!foafuri"!="") +<a href="$foafuri"><img border="0" src="/images/foaf.gif" /></a> +#else +<a href="card-foaf.xml?auserid=$auserid"> +<img border="0" src="/images/foaf.gif" /></a> +#end + +#parse ( "pagefooter.html" ) Index: search.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/user/search.html.en,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- search.html.en 11 Aug 2004 15:12:28 -0000 1.8 +++ search.html.en 12 Mar 2006 22:58:34 -0000 1.9 @@ -1,188 +1,188 @@ - -#parse ( "pageheader.html" ) -<em><a href="index.html">User Component</a> -<a href="search.html">User search</a></em> - -<h1>User Search</h1> - -<form action="search.html" method="get"> - -<INPUT TYPE="hidden" NAME="cmd" VALUE="search" /> - -#set ( $tmp = "$!auserlogin$!firstname$!lastname" ) -#if ( $tmp != "") - #set ($attrsInit = true) -Search for users with search criteria -#else - #set ($attrsInit = false) - All users (no search criteria): -#end -<ul> - #if ("$!auserlogin" != "") - <li>Login name: - #if ($compare_func_auserlogin == "2") - like '$!auserlogin' - #else - is equal '$!auserlogin' - #end - </td> - #end - #if ($firstname.length() > 0) - <li>Firstname: - #if ($compare_func_firstname == "2") - like '$!firstname' - #else - is equal '$!firstname' - #end - </td> - #end - #if ($lastname.length() > 0) - <li>Lastname: - #if ($compare_func_lastname == "2") - like '$!lastname' - #else - is equal '$!lastname' - #end - </td> - #end -</ul> - -#set ($localCount = 0) - -#set ( $login = "$!auserlogin" ) -#set ( $fname = "$!firstname" ) -#set ( $lname = "$!lastname" ) - -#set ( $loginCond = "$!compare_func_auserlogin" ) -#set ( $fnameCond = "$!compare_func_firstname" ) -#set ( $lnameCond = "$!compare_func_lastname" ) - -#set ( $listNames = ["auserlogin", "basic.personal.firstname", "basic.personal.lastname"] ) -#set ( $listConditions = [$loginCond, $fnameCond, $lnameCond] ) -#set ( $listValues = [$login, $fname, $lname] ) - -#set ($orFlag = false) -#if ("$!SearchLogik" == "or") - #set ($orFlag = true) -#end - -#set ($sortBy = "$!sort") - -#set ($result = $userPresenter.searchUsers($!listNames, $!listConditions, $!listValues, $!orFlag, $!sortBy, -1, "user")) -#if (($result)) - #if ($attrsInit == true) - <p> - has $result.size() results. - </p> - - #end -#else -<p> - <div class="info">The search for users has no results</div> - Please, try to change one or more search criteria. -</p> -#end - -<table width="100%"> - <tr bgcolor="#dfdfdf"> - <td> - <b>User Login</b> - </td> - <td> - <b>Name</b> - </td> - <td> - <b>E-Mail</b> - </td> - </tr> - #set( $number = 0 ) - #foreach ($i in $result) - #set ($uId = $i.getUserId()) - <tr bgcolor = "#dfdfdf"> - #set( $number = $number + 1 ) - <td> -#set ($imageuri = "") -#set ($imageuri = $i.getAttribute("basic.personal.imageuri")) -#if ("$!imageuri"!="") -<img src="$imageuri" width="16"> -#end - <a href="card.html?auserlogin=$i.getUserLogin()"> $i.getUserLogin()</a> - </td> - <td> - $i.getName() - </td> - <td> - $!i.getAttribute("basic.contact.online.email") - </td> - </tr> - #end - #if ($number == 0) - <tr><td>No results.</td></tr> - #end -</table> - - -<p> - Please enter search criteria into the form below. <br> - It is possible to enter several values in comma-separated form into one field. -</p> -##<input type="hidden" name="first" value="$!first" /> -<table border="0"> - <tr> - <TD>Login Name:</TD> - <TD><input name="auserlogin" size=20 value="$!auserlogin"></td> - <td> <select width="15" name="compare_func_auserlogin" > - <option value="1">is equal - <option value="2">like - </select> - </td> - </tr> - <tr> - <TD>Firstname:</TD><TD><input name="firstname" size=20 value="$!firstname"></td> - <td> <select width="15" name="compare_func_firstname" > - <option value="1">is equal - <option value="2">like - </select> - </td> - </tr> - <tr> - <TD>Lastname:</TD><TD><input name="lastname" size=20 value="$!lastname"></td> - <td> - <select width="15" name="compare_func_lastname" > - <option value="1">is equal - <option value="2">like - </select> - </td> - </tr> - - <tr> - <td> - order by: - </td> - <td> - <select width="40" name="sort" > - <option value="1">Login name - <option value="2">Lastname - <option value="3">Firstname - </select> - </td> - <td width="100"></td> - </tr> -</table> -<TABLE BORDER="0"> - <tr> - <td> - <input type="radio" name="SearchLogik" value="or"> OR - </td> - <td> - <input type="radio" name="SearchLogik" value="and" checked> AND - </td> - <td> - </td> - </tr> -</table> - -<p><input type="submit" value="Search"></p> -</form> - -#parse ( "pagefooter.html" ) + +#parse ( "pageheader.html" ) +<em><a href="index.html">User Component</a> +<a href="search.html">User search</a></em> + +<h1>User Search</h1> + +<form action="search.html" method="get"> + +<INPUT TYPE="hidden" NAME="cmd" VALUE="search" /> + +#set ( $tmp = "$!auserlogin$!firstname$!lastname" ) +#if ( $tmp != "") + #set ($attrsInit = true) +Search for users with search criteria +#else + #set ($attrsInit = false) + All users (no search criteria): +#end +<ul> + #if ("$!auserlogin" != "") + <li>Login name: + #if ($compare_func_auserlogin == "2") + like '$!auserlogin' + #else + is equal '$!auserlogin' + #end + </td> + #end + #if ($firstname.length() > 0) + <li>Firstname: + #if ($compare_func_firstname == "2") + like '$!firstname' + #else + is equal '$!firstname' + #end + </td> + #end + #if ($lastname.length() > 0) + <li>Lastname: + #if ($compare_func_lastname == "2") + like '$!lastname' + #else + is equal '$!lastname' + #end + </td> + #end +</ul> + +#set ($localCount = 0) + +#set ( $login = "$!auserlogin" ) +#set ( $fname = "$!firstname" ) +#set ( $lname = "$!lastname" ) + +#set ( $loginCond = "$!compare_func_auserlogin" ) +#set ( $fnameCond = "$!compare_func_firstname" ) +#set ( $lnameCond = "$!compare_func_lastname" ) + +#set ( $listNames = ["auserlogin", "basic.personal.firstname", "basic.personal.lastname"] ) +#set ( $listConditions = [$loginCond, $fnameCond, $lnameCond] ) +#set ( $listValues = [$login, $fname, $lname] ) + +#set ($orFlag = false) +#if ("$!SearchLogik" == "or") + #set ($orFlag = true) +#end + +#set ($sortBy = "$!sort") + +#set ($result = $userPresenter.searchUsers($!listNames, $!listConditions, $!listValues, $!orFlag, $!sortBy, -1, "user")) +#if (($result)) + #if ($attrsInit == true) + <p> + has $result.size() results. + </p> + + #end +#else +<p> + <div class="info">The search for users has no results</div> + Please, try to change one or more search criteria. +</p> +#end + +<table width="100%"> + <tr bgcolor="#dfdfdf"> + <td> + <b>User Login</b> + </td> + <td> + <b>Name</b> + </td> + <td> + <b>E-Mail</b> + </td> + </tr> + #set( $number = 0 ) + #foreach ($i in $result) + #set ($uId = $i.getUserId()) + <tr bgcolor = "#dfdfdf"> + #set( $number = $number + 1 ) + <td> +#set ($imageuri = "") +#set ($imageuri = $i.getAttribute("basic.personal.imageuri")) +#if ("$!imageuri"!="") +<img src="$imageuri" width="16"> +#end + <a href="card.html?auserlogin=$i.getUserLogin()"> $i.getUserLogin()</a> + </td> + <td> + $i.getName() + </td> + <td> + $!i.getAttribute("basic.contact.online.email") + </td> + </tr> + #end + #if ($number == 0) + <tr><td>No results.</td></tr> + #end +</table> + + +<p> + Please enter search criteria into the form below. <br> + It is possible to enter several values in comma-separated form into one field. +</p> +##<input type="hidden" name="first" value="$!first" /> +<table border="0"> + <tr> + <TD>Login Name:</TD> + <TD><input name="auserlogin" size=20 value="$!auserlogin"></td> + <td> <select width="15" name="compare_func_auserlogin" > + <option value="1">is equal + <option value="2">like + </select> + </td> + </tr> + <tr> + <TD>Firstname:</TD><TD><input name="firstname" size=20 value="$!firstname"></td> + <td> <select width="15" name="compare_func_firstname" > + <option value="1">is equal + <option value="2">like + </select> + </td> + </tr> + <tr> + <TD>Lastname:</TD><TD><input name="lastname" size=20 value="$!lastname"></td> + <td> + <select width="15" name="compare_func_lastname" > + <option value="1">is equal + <option value="2">like + </select> + </td> + </tr> + + <tr> + <td> + order by: + </td> + <td> + <select width="40" name="sort" > + <option value="1">Login name + <option value="2">Lastname + <option value="3">Firstname + </select> + </td> + <td width="100"></td> + </tr> +</table> +<TABLE BORDER="0"> + <tr> + <td> + <input type="radio" name="SearchLogik" value="or"> OR + </td> + <td> + <input type="radio" name="SearchLogik" value="and" checked> AND + </td> + <td> + </td> + </tr> +</table> + +<p><input type="submit" value="Search"></p> +</form> + +#parse ( "pagefooter.html" ) Index: user-allpaths.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/user/user-allpaths.html.en,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- user-allpaths.html.en 12 Feb 2006 19:07:48 -0000 1.1 +++ user-allpaths.html.en 12 Mar 2006 22:58:34 -0000 1.2 @@ -12,55 +12,68 @@ <h1>Social Networks</h1> <p> - Paths from user <em> $usernamea </em> to user <em> $usernameb </em> + This page shows the path from + user <em>$usernamea</em> to user <em>$usernameb</em>. +</p> + +<p> + The paths are calculated using the relationship defined by the + attribute "pim.network.buddylist". Since the buddylists are + also based on this attribute, these paths are based on the entries of + the buddylists. </p> +<p> + <a href="card.html?auserlogin=$usernameb">Back to the user-card</a> + #set ( $paths = $userPresenter.getUserPaths($userida, $useridb) ) #set ( $pathssize = $paths.size() ) #set ( $pathsmaxindex = $pathssize - 1 ) <p> - Number of found paths: $pathssize<br> - Showing only the first 10 results. + Number of found paths: $pathssize<br> + Showing only the first 10 results. </p> #set ( $first = 1 ) #set ( $indexpath = 0 ) <table border=0 style="table-layout:fixed;"> - #foreach ($j in $paths) - #set ( $indexpath = $indexpath + 1 ) - #if ( $indexpath < 10 ) - - <tr> - <td>$indexpath</td> - - #set ( $maxindex = $j.size() - 1 ) - #set ( $index = 0 ) - #foreach ($i in $j) - #set ( $useri = $userManager.getUser($i) ) - <td height=32 valign=bottom align=center style="border:1px solid #DFDFDF;"> - - #set ($imageuri = "") - #set ($imageuri = $useri.getAttribute("basic.personal.imageuri")) - #if ($imageuri == "") - #set ($imageuri = "/images/nouser.png") - #end - - <img src="$imageuri" width=32 height=32> - - #set ($userLogin = $useri.getUserLogin()) - - <br> $userLogin - </td> - #if($index != $maxindex) - <td valign=middle align=center> - <img src="/images/arrow.png"> - </td> - #end - #set ($index = $index + 1) - #end - </tr> - #end - #end + #foreach ($j in $paths) + #set ( $indexpath = $indexpath + 1 ) + #if ( $indexpath < 10 ) + + <tr> + <td>$indexpath</td> + + #set ( $maxindex = $j.size() - 1 ) + #set ( $index = 0 ) + #foreach ($i in $j) + #set ( $useri = $userManager.getUser($i) ) + <td height=32 valign=bottom align=center style="border:1px solid #DFDFDF;"> + + #set ($imageuri = "") + #set ($imageuri = $useri.getAttribute("basic.personal.imageuri")) + #if ($imageuri == "") + #set ($imageuri = "/images/nouser.png") + #end + + + + #set ($userLogin = $useri.getUserLogin()) + + <a href="card.html?auserlogin=$userLogin"><img src="$imageuri" width=32 height=32></a> + <br> + <a href="card.html?auserlogin=$userLogin">$userLogin</a> + </td> + #if($index != $maxindex) + <td valign=middle align=center> + <img src="/images/arrow.png"> + </td> + #end + #set ($index = $index + 1) + #end + </tr> + #end + #end </table> #parse ( "pagefooter.html" ) Index: user.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/user/user.html.en,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- user.html.en 29 Nov 2005 07:14:46 -0000 1.21 +++ user.html.en 12 Mar 2006 22:58:34 -0000 1.22 @@ -1,191 +1,191 @@ -#parse ( "pageheader.html" ) -<em><a href="index.html">User Component</a> - -<a href="user.html">User Profile</a></em> - -#set ( $auserlogin = "$!auserlogin" ) -#if ( $auserlogin == "" ) -#set ( $auserlogin = $userLogin ) -#end -#set ( $auserid = $userManager.getUserIdForUserLogin($auserlogin) ) -#set ($auser = $userManager.getUser($auserid)) -#set ($auserclass = $auser.getUserClass() ) - -<h1>User Profile</h1> - -#set ( $auth = $userPresenter.checkPermission($userId, "user", "read", "userid=$auserid") ) -#if ( "$auth" != "true" ) - #if ( "$auserlogin" == "$userLogin" ) - #set ( $auth = "true" ) - #end -#end -#if ( $auth != "true" ) - -<div class="error">You do not have the access permission to read user -information of user "$auserlogin".</div> -<p> -Please log in as user with the specified permission or ask the platform -administrator to assign the permission to your account. - -#else - -#if (($returnCode != 2010) && ($returnCode != 1001)) -#if ($auserid == 0) - <p><div class="error">User with user login <b>$auserlogin</b> does not exist!</div></p> -#else - -#set ($imageuri = $auser.getAttribute("basic.personal.imageuri")) -#if ("$!imageuri"!="") -<img align="right" width="70" src="$imageuri"> -#end - -<p>User Login: $auserlogin</p> - -<form action="/USER" method="post" enctype="multipart/form-data"> -<INPUT TYPE="hidden" NAME="cmd" VALUE="update" /> -<input type="hidden" name="cmd.success" value="/user/user.html" /> -<input type="hidden" name="cmd.error" value="/user/user.html" /> -<input type="hidden" name="path" value="$portalRequest.getPagePath()"/> -<input type="hidden" name="auserid" value="$auserid" /> - -<p> -#if ($returnCode == 1011) - <p><div class="error">Login name $auserlogin is already taken by another user</div></p> -#end -#if ($returnCode == 1020) - <p><div class="error">Failed updating attributes for user $auserlogin</div></p> -#end -#if ($returnCode == 2001) - <p><div class="info">Your changes are saved. Your data is updated successfully.</div></p> -#end -#if ($returnCode == 2002) - <p><div class="info">You have done no changes.</div></p> -#end - -<p> -<table border="1pt" width="100%" cellspacing="0pt" cellpadding="0pt"> -<tr bgcolor="#eeeeee"> -<td> -<table border="0" cellpadding="5pt"><tr><td> -<em><a href="user.html?auserlogin=$auserlogin">basic</a> - -<a href="user-interests.html?auserlogin=$auserlogin">interests</a> - -<a href="user-buddylist.html?auserlogin=$auserlogin">buddylist</a> - -<a href="user-roles.html?auserlogin=$auserlogin">access roles</a><em></td> -</td></tr></table></td> -<td align="right"> -<table border="0" cellpadding="5pt"><tr><td> -<em><a href="change_password.html?auserlogin=$auserlogin">change password</a></em> -</td></tr></table> -</td></tr> -<tr><td colspan="2"> - -<table border="0" cellpadding="8pt"> -<tr><td> - -<table border="0"> -<tr><td>$userPresenter.printDescription($auserid, "basic.personal.firstname", $lang):</td> -<td>$userPresenter.printUserAttrInput($auserid, "basic.personal.firstname")</td></tr> -<tr><td>$userPresenter.printDescription($auserid, "basic.personal.lastname", $lang):</td> -<td>$userPresenter.printUserAttrInput($auserid, "basic.personal.lastname")</td></tr> -<tr><td>$userPresenter.printDescription($auserid, "basic.demographics.gender", $lang):</td> -<td>$userPresenter.printUserAttrInput($auserid, "basic.demographics.gender")</td></tr> -<tr><td>$userPresenter.printDescription($auserid, "basic.contact-priv.online.email", $lang):</td> -<td>$userPresenter.printUserAttrInput($auserid, "basic.contact-priv.online.email")</td></tr> -<tr><td>$userPresenter.printDescription($auserid, "preference.language", $lang):</td> -<td>$userPresenter.printUserAttrInput($auserid, "preference.language")</td></tr> -<tr><td valign=top>$userPresenter.printDescription($auserid, "basic.personal.languagesspoken", $lang):</td> -<td>$userPresenter.printUserAttrInput($auserid, "basic.personal.languagesspoken")</td></tr> -</table> - -<table border="0"> -<tr><td>$userPresenter.printDescription($auserid, "basic.personal.imageuri", $lang):</td> -<td>$userPresenter.printUserAttrInput($auserid, "basic.personal.imageuri")</td></tr> -</table> - -<p>If you do not have a possibility to upload a portrait to a Web server, -you can upload an image file (gif, png or jpg) to our server. Just select a -file from you local file system:<br> -<input type="file" size="40" name="uploadimage"> - -<p> - -You can load your user profile from a FOAF/RDF user profile -representation. Just enter the URL of your FOAF description here and -the content of this file will be loaded intot your local Cobricks user -profile. - -<table border="0"> -<tr><td>$userPresenter.printDescription($auserid, "basic.personal.foafuri", $lang): -$userPresenter.printUserAttrInput($auserid, "basic.personal.foafuri")</td></tr> -</table> - -<p> -<input type="submit" value="Update"> - -</td></tr></table> - -</td></tr></table> - -<hr> -<p><h3>All attributes (from user ontology for class "$auserclass")</h3> - -#set ($attrNames = $userManager.getOntologyClass($auserclass).getAttributeNames() ) -#set ($attrNames = $corePresenter.sortList($attrNames) ) - -<table border="0"> - #foreach ($j in $attrNames) - <tr> - <td valign="top"> - $userPresenter.printDescription($auserid, $j, $lang)<br> - ($j) - </td> - <td> - $userPresenter.printUserAttrInput($auserid, $j) - </td> - </tr> - #end -</table> - -<input type="hidden" name="anames" value="$attrNames"> - -<input type="submit" value="Update"> - -#end -#end -</form> - -<form action="/USER" method="post"> -<input type="hidden" name="cmd" value="delete"/> -<input type="hidden" name="cmd.success" value="/user/user.html"> -<input type="hidden" name="cmd.error" value="/user/user.html"> -<input type="hidden" name="path" value="$portalRequest.getPagePath()"/> - -#if ($auserid == 0) - -#else - -#set ($userloginToDelete = $auserlogin) -##set ($test="$uLogin") - #if ($returnCode == 1001) - <div class="error"> - User with login name <i>$auserlogin</i> does not exist. - </div> - #end - #if ($returnCode == 2010) - <div class="info"> - User $userloginToDelete was deleted successful. - </div> - $portalPresenter.doLogout($portalRequest) - #else - <input type="hidden" name="auserlogin" value="$auserlogin" /> - <input type="hidden" name="auserid" value="$auserid" /> - <input type="submit" value="Delete User" /> - #end - -</form> - -#end - -#end - - -#parse ( "pagefooter.html" ) +#parse ( "pageheader.html" ) +<em><a href="index.html">User Component</a> - +<a href="user.html">User Profile</a></em> + +#set ( $auserlogin = "$!auserlogin" ) +#if ( $auserlogin == "" ) +#set ( $auserlogin = $userLogin ) +#end +#set ( $auserid = $userManager.getUserIdForUserLogin($auserlogin) ) +#set ($auser = $userManager.getUser($auserid)) +#set ($auserclass = $auser.getUserClass() ) + +<h1>User Profile</h1> + +#set ( $auth = $userPresenter.checkPermission($userId, "user", "read", "userid=$auserid") ) +#if ( "$auth" != "true" ) + #if ( "$auserlogin" == "$userLogin" ) + #set ( $auth = "true" ) + #end +#end +#if ( $auth != "true" ) + +<div class="error">You do not have the access permission to read user +information of user "$auserlogin".</div> +<p> +Please log in as user with the specified permission or ask the platform +administrator to assign the permission to your account. + +#else + +#if (($returnCode != 2010) && ($returnCode != 1001)) +#if ($auserid == 0) + <p><div class="error">User with user login <b>$auserlogin</b> does not exist!</div></p> +#else + +#set ($imageuri = $auser.getAttribute("basic.personal.imageuri")) +#if ("$!imageuri"!="") +<img align="right" width="70" src="$imageuri"> +#end + +<p>User Login: $auserlogin</p> + +<form action="/USER" method="post" enctype="multipart/form-data"> +<INPUT TYPE="hidden" NAME="cmd" VALUE="update" /> +<input type="hidden" name="cmd.success" value="/user/user.html" /> +<input type="hidden" name="cmd.error" value="/user/user.html" /> +<input type="hidden" name="path" value="$portalRequest.getPagePath()"/> +<input type="hidden" name="auserid" value="$auserid" /> + +<p> +#if ($returnCode == 1011) + <p><div class="error">Login name $auserlogin is already taken by another user</div></p> +#end +#if ($returnCode == 1020) + <p><div class="error">Failed updating attributes for user $auserlogin</div></p> +#end +#if ($returnCode == 2001) + <p><div class="info">Your changes are saved. Your data is updated successfully.</div></p> +#end +#if ($returnCode == 2002) + <p><div class="info">You have done no changes.</div></p> +#end + +<p> +<table border="1pt" width="100%" cellspacing="0pt" cellpadding="0pt"> +<tr bgcolor="#eeeeee"> +<td> +<table border="0" cellpadding="5pt"><tr><td> +<em><a href="user.html?auserlogin=$auserlogin">basic</a> - +<a href="user-interests.html?auserlogin=$auserlogin">interests</a> - +<a href="user-buddylist.html?auserlogin=$auserlogin">buddylist</a> - +<a href="user-roles.html?auserlogin=$auserlogin">access roles</a><em></td> +</td></tr></table></td> +<td align="right"> +<table border="0" cellpadding="5pt"><tr><td> +<em><a href="change_password.html?auserlogin=$auserlogin">change password</a></em> +</td></tr></table> +</td></tr> +<tr><td colspan="2"> + +<table border="0" cellpadding="8pt"> +<tr><td> + +<table border="0"> +<tr><td>$userPresenter.printDescription($auserid, "basic.personal.firstname", $lang):</td> +<td>$userPresenter.printUserAttrInput($auserid, "basic.personal.firstname")</td></tr> +<tr><td>$userPresenter.printDescription($auserid, "basic.personal.lastname", $lang):</td> +<td>$userPresenter.printUserAttrInput($auserid, "basic.personal.lastname")</td></tr> +<tr><td>$userPresenter.printDescription($auserid, "basic.demographics.gender", $lang):</td> +<td>$userPresenter.printUserAttrInput($auserid, "basic.demographics.gender")</td></tr> +<tr><td>$userPresenter.printDescription($auserid, "basic.contact-priv.online.email", $lang):</td> +<td>$userPresenter.printUserAttrInput($auserid, "basic.contact-priv.online.email")</td></tr> +<tr><td>$userPresenter.printDescription($auserid, "preference.language", $lang):</td> +<td>$userPresenter.printUserAttrInput($auserid, "preference.language")</td></tr> +<tr><td valign=top>$userPresenter.printDescription($auserid, "basic.personal.languagesspoken", $lang):</td> +<td>$userPresenter.printUserAttrInput($auserid, "basic.personal.languagesspoken")</td></tr> +</table> + +<table border="0"> +<tr><td>$userPresenter.printDescription($auserid, "basic.personal.imageuri", $lang):</td> +<td>$userPresenter.printUserAttrInput($auserid, "basic.personal.imageuri")</td></tr> +</table> + +<p>If you do not have a possibility to upload a portrait to a Web server, +you can upload an image file (gif, png or jpg) to our server. Just select a +file from you local file system:<br> +<input type="file" size="40" name="uploadimage"> + +<p> + +You can load your user profile from a FOAF/RDF user profile +representation. Just enter the URL of your FOAF description here and +the content of this file will be loaded intot your local Cobricks user +profile. + +<table border="0"> +<tr><td>$userPresenter.printDescription($auserid, "basic.personal.foafuri", $lang): +$userPresenter.printUserAttrInput($auserid, "basic.personal.foafuri")</td></tr> +</table> + +<p> +<input type="submit" value="Update"> + +</td></tr></table> + +</td></tr></table> + +<hr> +<p><h3>All attributes (from user ontology for class "$auserclass")</h3> + +#set ($attrNames = $userManager.getOntologyClass($auserclass).getAttributeNames() ) +#set ($attrNames = $corePresenter.sortList($attrNames) ) + +<table border="0"> + #foreach ($j in $attrNames) + <tr> + <td valign="top"> + $userPresenter.printDescription($auserid, $j, $lang)<br> + ($j) + </td> + <td> + $userPresenter.printUserAttrInput($auserid, $j) + </td> + </tr> + #end +</table> + +<input type="hidden" name="anames" value="$attrNames"> + +<input type="submit" value="Update"> + +#end +#end +</form> + +<form action="/USER" method="post"> +<input type="hidden" name="cmd" value="delete"/> +<input type="hidden" name="cmd.success" value="/user/user.html"> +<input type="hidden" name="cmd.error" value="/user/user.html"> +<input type="hidden" name="path" value="$portalRequest.getPagePath()"/> + +#if ($auserid == 0) + +#else + +#set ($userloginToDelete = $auserlogin) +##set ($test="$uLogin") + #if ($returnCode == 1001) + <div class="error"> + User with login name <i>$auserlogin</i> does not exist. + </div> + #end + #if ($returnCode == 2010) + <div class="info"> + User $userloginToDelete was deleted successful. + </div> + $portalPresenter.doLogout($portalRequest) + #else + <input type="hidden" name="auserlogin" value="$auserlogin" /> + <input type="hidden" name="auserid" value="$auserid" /> + <input type="submit" value="Delete User" /> + #end + +</form> + +#end + +#end + + +#parse ( "pagefooter.html" ) Index: user-buddylist-search.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/user/user-buddylist-search.html.en,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- user-buddylist-search.html.en 12 Feb 2006 19:07:48 -0000 1.1 +++ user-buddylist-search.html.en 12 Mar 2006 22:58:34 -0000 1.2 @@ -3,174 +3,174 @@ <h1>Search user</h1> <form action="user-buddylist-search.html" method=get> - <input type=hidden name=auserlogin value=$!auserlogin> - <input type=hidden name=print value=$!print> - - <table border=0> - <tr> - <td>User login</td> - <td> - <input type=text name=searchUserLogin> - </td> - </tr> - <tr> - <td>First name</td> - <td> - <input type=text name=searchFirstName> - </td> - </tr> - <tr> - <td>Last name</td> - <td> - <input type=text name=searchLastName> - </td> - </tr> - <tr> - <td>Sort by</td> - <td> - <select width="40" name="sort"> - <option value="1">Login name</option> - <option value="2">Lastname</option> - <option value="3">Firstname</option> - </select> - </td> - </select> - <tr> - <td> - <input type=submit name=cmd value=Search> - </td> - </tr> - </table> + <input type=hidden name=auserlogin value=$!auserlogin> + <input type=hidden name=print value=$!print> + + <table border=0> + <tr> + <td>User login</td> + <td> + <input type=text name=searchUserLogin> + </td> + </tr> + <tr> + <td>First name</td> + <td> + <input type=text name=searchFirstName> + </td> + </tr> + <tr> + <td>Last name</td> + <td> + <input type=text name=searchLastName> + </td> + </tr> + <tr> + <td>Sort by</td> + <td> + <select width="40" name="sort"> + <option value="1">Login name</option> + <option value="2">Lastname</option> + <option value="3">Firstname</option> + </select> + </td> + </select> + <tr> + <td> + <input type=submit name=cmd value=Search> + </td> + </tr> + </table> </form> - + <br><br> <script type="text/javascript"> //<!-- - function OkSubmit() { - selected = ""; - for(i=0; i < document.getElementById("frm").elements.length; i++) { - if(document.getElementById("frm").elements[i].name == "newUserLogin") { - if(document.getElementById("frm").elements[i].checked == true) { - selected = document.getElementById("frm").elements[i].value; - } - } - } - opener.document.getElementById("frm1").newUserLogin.value = selected; - window.close(); - } - - function openerGoTo(s) { - opener.location.href = s; - window.close(); - } + function OkSubmit() { + selected = ""; + for(i=0; i < document.getElementById("frm").elements.length; i++) { + if(document.getElementById("frm").elements[i].name == "newUserLogin") { + if(document.getElementById("frm").elements[i].checked == true) { + selected = document.getElementById("frm").elements[i].value; + } + } + } + opener.document.getElementById("frm1").newUserLogin.value = selected; + window.close(); + } + + function openerGoTo(s) { + opener.location.href = s; + window.close(); + } - document.write("<form name=frm id=frm onSubmit=\"OkSubmit();return false;\">"); + document.write("<form name=frm id=frm onSubmit=\"OkSubmit();return false;\">"); // --> </script> <noscript> - <form action="user-buddylist.html" method=get> + <form action="user-buddylist.html" method=get> </noscript> - <input type=hidden name=auserlogin value=$!auserlogin> + <input type=hidden name=auserlogin value=$!auserlogin> - <table border=0 width="100%"> - <tr bgcolor="#dfdfdf"> - <td> - - </td> - <td> - <b>Image</b> - </td> - - <td> - <b>Login</b> - </td> - <td> - <b>Name</b> - </td> - <td> - <b>e-mail</b> - </td> - </tr> - + <table border=0 width="100%"> + <tr bgcolor="#dfdfdf"> + <td> + + </td> + <td> + <b>Image</b> + </td> + + <td> + <b>Login</b> + </td> + <td> + <b>Name</b> + </td> + <td> + <b>e-mail</b> + </td> + </tr> + #set ( $cmd = $!cmd ) #if ($cmd == "Search") - #set ( $loginCond = "1" ) - #set ( $fnameCond = "1" ) - #set ( $lnameCond = "1" ) + #set ( $loginCond = "1" ) + #set ( $fnameCond = "1" ) + #set ( $lnameCond = "1" ) - #set ( $login = $!searchUserLogin ) - #set ( $fname = $!searchFirstName ) - #set ( $lname = $!searchLastName ) + #set ( $login = $!searchUserLogin ) + #set ( $fname = $!searchFirstName ) + #set ( $lname = $!searchLastName ) - #set ( $listNames = ["auserlogin", "basic.personal.firstname", "basic.personal.lastname"] ) - #set ( $listConditions = [$loginCond, $fnameCond, $lnameCond] ) - #set ( $listValues = [$login, $fname, $lname] ) - #set ( $orFlag = false ) - #set ( $sortBy = "$!sort" ) + #set ( $listNames = ["auserlogin", "basic.personal.firstname", "basic.personal.lastname"] ) + #set ( $listConditions = [$loginCond, $fnameCond, $lnameCond] ) + #set ( $listValues = [$login, $fname, $lname] ) + #set ( $orFlag = false ) + #set ( $sortBy = "$!sort" ) - #set ($result = $userPresenter.searchUsers($!listNames, $!listConditions, $!listValues, $!orFlag, $!sortBy, -1, "user")) + #set ($result = $userPresenter.searchUsers($!listNames, $!listConditions, $!listValues, $!orFlag, $!sortBy, -1, "user")) - #if (($result)) - #set( $number = 0 ) - #foreach ($i in $result) - #set ($uId = $i.getUserId()) - #set( $number = $number + 1 ) - <tr bgcolor = "#dfdfdf"> - <td> - <input type=radio name=newUserLogin value="$i.getUserLogin()"> - </td> - <td> - #set ($imageuri = "") - #set ($imageuri = $i.getAttribute("basic.personal.imageuri")) - #if ("$!imageuri"!="") - <img src="$imageuri" width="32" height=32> - #end - - </td> - - <td> - - <script type="text/javascript"> - // <!-- - document.write("<a href=\"javascript:openerGoTo('/user/card.html?auserlogin=$i.getUserLogin()');\"> $i.getUserLogin()</a>"); - // --> - </script> - - <noscript> - <a href="card.html?auserlogin=$i.getUserLogin()"> $i.getUserLogin()</a> - </noscript> - - </td> - <td> - $i.getName() - </td> - <td> - $!i.getAttribute("basic.contact.online.email") - </td> - </tr> - #end - #else - <tr bgcolor="#dfdfdf"> - <td colspan=4> - <div class="info">The search for users has no results</div> - </td> - </tr> - #end + #if (($result)) + #set( $number = 0 ) + #foreach ($i in $result) + #set ($uId = $i.getUserId()) + #set( $number = $number + 1 ) + <tr bgcolor = "#dfdfdf"> + <td> + <input type=radio name=newUserLogin value="$i.getUserLogin()"> + </td> + <td> + #set ($imageuri = "") + #set ($imageuri = $i.getAttribute("basic.personal.imageuri")) + #if ("$!imageuri"!="") + <img src="$imageuri" width="32" height=32> + #end + + </td> + + <td> + + <script type="text/javascript"> + // <!-- + document.write("<a href=\"javascript:openerGoTo('/user/card.html?auserlogin=$i.getUserLogin()');\"> $i.getUserLogin()</a>"); + // --> + </script> + + <noscript> + <a href="card.html?auserlogin=$i.getUserLogin()"> $i.getUserLogin()</a> + </noscript> + + </td> + <td> + $i.getName() + </td> + <td> + $!i.getAttribute("basic.contact.online.email") + </td> + </tr> + #end + #else + <tr bgcolor="#dfdfdf"> + <td colspan=4> + <div class="info">The search for users has no results</div> + </td> + </tr> + #end #else - <tr bgcolor="#dfdfdf"> - <td colspan=4> - No search was performed - </td> - </tr> + <tr bgcolor="#dfdfdf"> + <td colspan=4> + No search was performed + </td> + </tr> #end - </table> - <input type=submit value=OK> + </table> + <input type=submit value=OK> </form> |
|
From: lochmann <loc...@us...> - 2006-03-12 22:58:07
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3265/src/org/cobricks/user Modified Files: UserPresenter.java UserManagerImpl.java Log Message: Social Networks. Index: UserPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/UserPresenter.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- UserPresenter.java 12 Feb 2006 19:08:25 -0000 1.32 +++ UserPresenter.java 12 Mar 2006 22:57:55 -0000 1.33 @@ -84,13 +84,13 @@ */ public User getUserById(String idstring) { - User result = null; - try { - int id = Integer.parseInt(idstring); - result = userManager.getUser(id); + User result = null; + try { + int id = Integer.parseInt(idstring); + result = userManager.getUser(id); } catch (Exception e) { - logger.warn("Failed parsing user id '"+idstring+"'"); - } + logger.warn("Failed parsing user id '"+idstring+"'"); + } return result; } @@ -815,7 +815,7 @@ List erg = new ArrayList(l.size()); Iterator i = l.iterator(); while(i.hasNext()) { - Integer userid = (Integer) i.next(); + Integer userid = (Integer) i.next(); User user = userManager.getUser(userid); erg.add(user); } @@ -837,7 +837,7 @@ public List getUserPaths(int startuserid, int enduserid) { try { - return this.userManager.getUserPaths(startuserid, enduserid); + return this.userManager.getUserPaths(startuserid, enduserid); } catch (Exception e) { logger.error(LogUtil.ex("Failed to get UserPaths.", e)); } Index: UserManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/UserManagerImpl.java,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- UserManagerImpl.java 26 Feb 2006 15:51:14 -0000 1.59 +++ UserManagerImpl.java 12 Mar 2006 22:57:59 -0000 1.60 @@ -65,2461 +65,2544 @@ */ public class UserManagerImpl extends ComponentManagerAdaptor implements - UserManager { + UserManager { - static Logger logger = Logger.getLogger(UserManagerImpl.class); + static Logger logger = Logger.getLogger(UserManagerImpl.class); - static String COMP_NAME = "Cobricks-2 User Component"; + static String COMP_NAME = "Cobricks-2 User Component"; [...4643 lines suppressed...] + /* + * A path ('from' => 'to') was found. It has the + * structure: ('from' => 'intermed' => 'to'). + * The new path is generated and stored in the + * matrix. + */ + floydWarshallMatrix[from][to] = new ArrayList( + floydWarshallMatrix[from][intermed]); + floydWarshallMatrix[from][to].add(new Integer( + intermed)); + floydWarshallMatrix[from][to] + .addAll(floydWarshallMatrix[intermed][to]); + } + } + } + } + } + } + } +} |
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12864/src/org/cobricks/discussion Added Files: DiscussionAccessHandler.java DiscussionManager.java DiscussionServlet.java properties.txt itemontology.xml DiscussionPresenter.java DiscussionManagerImpl.java Log Message: New Discussion Componenten first classes --- NEW FILE: itemontology.xml --- <itemontology> <class name="forum" parent="item" javaclassname="org.cobricks.discussion.Forum"> <description lang="de">Forum</description> <description lang="en">Forum</description> <attr name="forumid" type="int" /> <attr name="children" type="item[]" /> <attr name="parent" type="item" /> </class> </itemontology> --- NEW FILE: DiscussionManager.java --- package org.cobricks.discussion; import org.cobricks.core.ComponentManagerInterface; public interface DiscussionManager extends ComponentManagerInterface { } --- NEW FILE: DiscussionAccessHandler.java --- package org.cobricks.discussion; import org.apache.log4j.Logger; import org.cobricks.core.CoreManager; import org.cobricks.core.db.DBAccess; import org.cobricks.user.AccessHandler; import org.cobricks.user.AccessHandlerAdaptor; import java.util.List; import java.util.Map; import java.util.HashMap; import java.util.ArrayList; /** * DiscussionAccessHandler.java * * Created on 10. März 2004, 11:12 * * @author Alexander Camek * @version $Date: 2006/03/02 21:24:41 $ * * Copyright (c) 2004 Alexander Camek, ale...@ca... * */ public class DiscussionAccessHandler extends AccessHandlerAdaptor implements AccessHandler { static Logger logger = Logger.getLogger(DiscussionAccessHandler.class); static final String domain = "voting"; static final String[] domainactions = { "create", "delete", "vote" }; static final String[][] domainactionattrs = { // create { "votingclass" }, // delete { "votingId", "votingclass" }, // vote { "votingId", "votingclass" } }; List actions; Map actionAttrs; /** Creates a new instance of DiscussionAccessHandler */ public DiscussionAccessHandler() { super(); } /** * */ public void init(CoreManager coreManager, DBAccess dbAccess) { logger.info("Initializing voting access handler"); super.init(coreManager, dbAccess); actions = new ArrayList(); actionAttrs = new HashMap(); for (int i = 0; i < domainactions.length; i++) { actions.add(domainactions[i]); List attrs = new ArrayList(); String[] sarr = domainactionattrs[i]; for (int j = 0; j < sarr.length; j++) { attrs.add(sarr[j]); } actionAttrs.put(domainactions[i], attrs); } } public String getDomain() { return domain; } public List getDomainActions() { return actions; } public List getDomainActionAttributes(String action) { return (List) actionAttrs.get(action); } /** * */ public boolean checkPermission(int userid, String domain, String action, Map attrs) { // check capabilities of roles with status = "all" // tbd // anonymous user? if (userid == 0) return false; // get capabilities of roles with status = "login" // get capabilities of roles with user as member (inclusive // parent roles of those) // check if access is covered by any of the capabilities return true; } } --- NEW FILE: DiscussionManagerImpl.java --- package org.cobricks.discussion; import java.util.Iterator; import java.util.Properties; import org.apache.log4j.Logger; import org.cobricks.core.ComponentManagerAdaptor; import org.cobricks.core.CoreManager; import org.cobricks.core.db.DBAccess; import org.cobricks.item.ItemManager; public class DiscussionManagerImpl extends ComponentManagerAdaptor implements DiscussionManager { private static Logger logger = Logger.getLogger(DiscussionManagerImpl.class); /** * Component name */ private static final String COMP_NAME = "Cobricks-2 Discussion Manager"; /** * Component version */ private static final String COMP_VERSION = "V0.01 (March 2006)"; /** * Reference to the itemManager. */ private ItemManager itemManager; public DiscussionManagerImpl(String componentId, String managerId, Properties p, CoreManager coreManager, DBAccess dbAccess) { super(componentId, managerId, p, coreManager, dbAccess); logger.info("PAH_DiscussionManagerImpl Constructor1"); } public DiscussionManagerImpl() { super(); logger.info("PAH_DiscussionManagerImpl Constructor2"); } public String getComponentName() { return COMP_NAME; } public String getComponentVersion() { return COMP_VERSION; } public void init(String componentId, String managerId, Properties properties, CoreManager coreManager, DBAccess dbAccess) throws Exception { super.init(componentId, managerId, properties, coreManager, dbAccess); this.itemManager = (ItemManager) componentDirectory .getManager("itemManager"); String managerList = ""; logger.info("PAH_ "+managerList); for (Iterator iter = componentDirectory.getCompList().iterator(); iter.hasNext();) { } } public String getTestString(){ return "testString<br>"; } } --- NEW FILE: DiscussionServlet.java --- package org.cobricks.discussion; import org.cobricks.portal.PortalServletAdaptor; public class DiscussionServlet extends PortalServletAdaptor { /** * */ private static final long serialVersionUID = -9161779391791151120L; public DiscussionServlet() { super(); // TODO Auto-generated constructor stub } } --- NEW FILE: properties.txt --- # # Cobricks properties - "discussion" component # # Configuration settings for the item component of the Cobricks platform # # ! Do not change this file for local customization. In this file we # ! will add or change standard properties when the component is # ! updated. Use the $CONFDIR/localproperties.txt file for overloading # ! any of the properties defined in this file. # # component information org.cobricks.discussion.comp.manager.name=discussionManager org.cobricks.discussion.comp.manager.class=org.cobricks.discussion.DiscussionManagerImpl #org.cobricks.discussion.comp.presenter.1.name=discussionPresenter #org.cobricks.discussion.comp.presenter.1.class=org.cobricks.discussion.discussionPresenter org.cobricks.discussion.comp.listento= # Encoding settings - changing may cause problems - see doc #item.java.file.encoding=UTF-8 #item.xml.encoding=UTF-8 # discussion presentation discussion.presenter.datestyle=short discussion.presenter.timestyle=short discussion.languages=en,de #item.display.template.details.voting=/voting/itemtemplate-voting.html --- NEW FILE: DiscussionPresenter.java --- package org.cobricks.discussion; import java.util.Properties; import org.cobricks.core.ComponentPresenterInterface; import org.cobricks.core.CoreManager; public class DiscussionPresenter implements ComponentPresenterInterface { public DiscussionPresenter() { super(); // TODO Auto-generated constructor stub } public void init(String presenterId, Properties properties, CoreManager coreManager) throws Exception { // TODO Auto-generated method stub } } |
|
From: Philipp H. <p-...@us...> - 2006-03-02 21:24:54
|
Update of /cvsroot/cobricks/cobricks2/web/ADMIN/org.cobricks.discussion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12864/web/ADMIN/org.cobricks.discussion Added Files: index.html Log Message: New Discussion Componenten first classes --- NEW FILE: index.html --- #parse ( "/ADMIN/pageheader.html" ) <em><a href="/ADMIN/index.html">Admin</a> - <a href="/ADMIN/org.cobricks.discussion/index.html">Discussion Component</a></em> <h1>Discussion Component</h1> <h3>Version: $discussionManager.getComponentVersion()</h3> #parse ( "/ADMIN/pagefooter.html" ) |
|
From: Philipp H. <p-...@us...> - 2006-03-02 21:24:50
|
Update of /cvsroot/cobricks/cobricks2/web/discussion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12864/web/discussion Added Files: index.html.en Log Message: New Discussion Componenten first classes --- NEW FILE: index.html.en --- #parse ( "pageheader.html" ) <em><a href="index.html.en">Discussion Component</a></em> <h1>Cobricks2 - Discussion Component</h1> #if (!$discussionManager) <h2>Couldn't find Discussion Component</h2> <p> Please make sure, that every part of the component has been loaded without errors. </p> #else <h2>Welcome to the Discussion Component start page</h2> $discussionManager.getTestString() #end #parse ( "pagefooter.html" ) |
|
From: Philipp H. <p-...@us...> - 2006-03-02 21:24:37
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12783/src/org/cobricks/discussion Log Message: Directory /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion added to the repository |
|
From: Philipp H. <p-...@us...> - 2006-03-02 21:24:36
|
Update of /cvsroot/cobricks/cobricks2/web/discussion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12783/web/discussion Log Message: Directory /cvsroot/cobricks/cobricks2/web/discussion added to the repository |
|
From: Philipp H. <p-...@us...> - 2006-03-02 21:24:36
|
Update of /cvsroot/cobricks/cobricks2/web/ADMIN/org.cobricks.discussion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12783/web/ADMIN/org.cobricks.discussion Log Message: Directory /cvsroot/cobricks/cobricks2/web/ADMIN/org.cobricks.discussion added to the repository |
|
From: lochmann <loc...@us...> - 2006-02-26 15:51:24
|
Update of /cvsroot/cobricks/cobricks2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3768 Modified Files: build.xml Log Message: Social Networks (Floyd-Warshall-Algorithm) Index: build.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/build.xml,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- build.xml 16 Feb 2006 15:18:18 -0000 1.53 +++ build.xml 26 Feb 2006 15:51:14 -0000 1.54 @@ -17,11 +17,11 @@ <property name="app.path" value=""/> <property name="app.version" value="0.9"/> <property name="build.home" value="${basedir}/build"/> -<property name="java.home.dir" value="/usr/local/java"/> -<property name="catalina.home" value="/usr/proj/java/jakarta-tomcat-5.0.28"/> +<property name="java.home.dir" value="C:\Sun\AppServer\jdk"/> +<property name="catalina.home" value="C:\Programme\tomcat5.0.28\jakarta-tomcat-5.0.28"/> <!-- we currently support tomcat version 5.0 and 5.5 --> <property name="catalina.version" value="5.0"/> -<property name="axis.home" value="/usr/proj/java/axis-1.3"/> +<property name="axis.home" value="C:\Programme\axis13\axis-1_3"/> <property name="dist.home" value="${basedir}/dist"/> <property name="distbin" value="${basedir}/dist/cobricks2-v0.36"/> <property name="distsrc" value="${basedir}/dist/cobricks2-v0.36-src"/> |
|
From: lochmann <loc...@us...> - 2006-02-26 15:51:24
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3768/src/org/cobricks/user Modified Files: UserManagerImpl.java Log Message: Social Networks (Floyd-Warshall-Algorithm) Index: UserManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/UserManagerImpl.java,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- UserManagerImpl.java 16 Feb 2006 15:21:08 -0000 1.58 +++ UserManagerImpl.java 26 Feb 2006 15:51:14 -0000 1.59 @@ -34,6 +34,7 @@ import java.util.StringTokenizer; import java.util.TreeSet; import java.util.LinkedHashMap; +import java.util.TreeMap; import org.apache.log4j.Logger; @@ -55,2342 +56,2470 @@ import org.cobricks.user.attribute.UserJoin; import org.cobricks.user.liberty.idff.LAIdffBridge; [...4522 lines suppressed...] + // + from + // + "-" + // + intermed + // + "-" + // + to); + floydWarshallMatrix[from][to] = new ArrayList( + floydWarshallMatrix[from][intermed]); + floydWarshallMatrix[from][to].add(new Integer( + intermed)); + floydWarshallMatrix[from][to] + .addAll(floydWarshallMatrix[intermed][to]); + } + } + } + } + } + } + } +} \ No newline at end of file |
|
From: Michael K. <ko...@us...> - 2006-02-16 15:21:43
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/category In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8500/org/cobricks/category Modified Files: CategoryManagerImpl.java Log Message: Index: CategoryManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/CategoryManagerImpl.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- CategoryManagerImpl.java 29 Nov 2005 07:18:38 -0000 1.24 +++ CategoryManagerImpl.java 16 Feb 2006 15:21:05 -0000 1.25 @@ -642,9 +642,12 @@ // and send an event ... ComponentEvent event = - new ComponentEventImpl("org.cobricks.category", "category", "create"); + new ComponentEventImpl("org.cobricks.category", "category", + "create"); event.setObjectId(catid); - User creator = (User)result.getAttributeQualified("creator", coreManager); + event.setContent(result); + User creator = (User) + result.getAttributeQualified("creator", coreManager); if (creator != null) event.setUserId(creator.getId()); this.publishEvent(event); @@ -675,6 +678,7 @@ */ public void updateCategory(int catid, Map attrs, User updater) { + Category category = getCategory(catid); try { String categoryclass = (String)attrs.get("categoryclass"); OntologyClass oc = ontology.getClass(categoryclass); @@ -800,9 +804,11 @@ // and send an event ... if (updater != null) { ComponentEvent event = - new ComponentEventImpl("org.cobricks.category", "category", "update"); + new ComponentEventImpl("org.cobricks.category", "category", + "update"); event.setObjectId(catid); event.setUserId(updater.getId()); + event.setContent(category); this.publishEvent(event); } @@ -864,6 +870,8 @@ **/ public void deleteCategory(int catid, User user) { + Category category = getCategory(catid); + // update this2parent relation of the children of this category Map attrsC = new HashMap(); attrsC.put("parent", new Integer(-1)); @@ -895,8 +903,10 @@ // and send an event ... ComponentEvent event = - new ComponentEventImpl("org.cobricks.category", "category", "delete"); + new ComponentEventImpl("org.cobricks.category", "category", + "delete"); event.setObjectId(catid); + event.setContent(category); if (user != null) event.setUserId(user.getId()); this.publishEvent(event); |
|
From: Michael K. <ko...@us...> - 2006-02-16 15:21:17
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/message In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8500/org/cobricks/message Modified Files: ChannelEmail.java ChannelMailbox.java MessageManager.java MessageManagerImpl.java Subscription.java properties.txt Added Files: ChannelNewsletter.java Log Message: --- NEW FILE: ChannelNewsletter.java --- /* * Copyright (c) 2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software * License, either version 1.0 of the License, or (at your option) any * later version (see www.cobricks.org). * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. */ package org.cobricks.message; import java.io.*; import java.util.*; import org.apache.log4j.Logger; import org.cobricks.core.CoreManager; import org.cobricks.core.SchedulerTask; import org.cobricks.core.util.LogUtil; import org.cobricks.user.User; import org.cobricks.user.UserManager; /** * Message channel storing the message for use in a newsletter. * * @author mic...@ac... * @version $Date: 2006/02/16 15:21:08 $ */ public class ChannelNewsletter implements MessageChannel, SchedulerTask { static Logger logger = Logger.getLogger(ChannelNewsletter.class); private String name; private String description; private CoreManager coreManager; private MessageManager messageManager; private String smtphost; private String fromemail; public ChannelNewsletter() { } // for MessageChannel public void init(String name, CoreManager coreManager) { this.name = name; this.description = "Newsletter"; this.coreManager = coreManager; messageManager = (MessageManager) coreManager.getComponentDirectory().getManager("messageManager"); } // for SchedulerTask public void init(CoreManager coreManager) { this.coreManager = coreManager; messageManager = (MessageManager) coreManager.getComponentDirectory().getManager("messageManager"); } public String getName() { return name; } public String getDescription() { return description; } public boolean sendMessage(Message message, int recipientid) { logger.info("store message for newsletter for user "+recipientid); messageManager.addMessageToNewsletter(recipientid, name, message); return true; } /** * Method for the SchedulerTask interface - is called regularly * and handles sending the newsletters */ public void doIt(String[] args) { String nlname = "newsletterd"; for (int i=0; i<args.length; i++) { String tmps = args[i]; if (tmps.startsWith("nlname=")) nlname = tmps.substring(7); } // load properties this.smtphost = coreManager.getProperty("message.email.smtphost"); if (smtphost == null || smtphost.trim().length()<1) { logger.warn("no SMTP host defined"); } this.fromemail = coreManager.getProperty("message.email.defaultfrom"); // check if there are entries in the newsletter table that match .. List msgs = messageManager.getNewsletterMessages(nlname); //TBD messageManager.removeNewsletterMessages(nlname); // ... and send mails Integer userid = null; ListIterator i = msgs.listIterator(); StringBuffer msgcontent = new StringBuffer(""); while (i.hasNext()) { Map m = (Map)i.next(); Integer useridtmp = (Integer)m.get("userid"); if (!useridtmp.equals(userid)) { if (userid != null) { sendEmail(userid.intValue(), msgcontent.toString()); msgcontent = new StringBuffer(""); } userid = useridtmp; } } if (userid != null) { sendEmail(userid.intValue(), msgcontent.toString()); } } public void sendEmail(int recipientId, String msgcontent) { if (smtphost == null) return; if (msgcontent == null || msgcontent.length()<1) return; logger.debug("sending newsletter mail to user "+recipientId); try { UserManager userManager = (UserManager) coreManager.getComponentDirectory().getManager("userManager"); User user = userManager.getUser(recipientId); if (user == null) return; String emailto = user.getAttributeAsString(User.EMAIL); // from address String emailfrom = this.fromemail; // subject String subject = "Newsletter"; // TBD // and now send email logger.info("sending email to "+emailto); //MailUtil. //sendMail(smtphost, emailto, emailfrom, subject, msgcontent); } catch (Exception e) { logger.error("failed sending email: "+e.toString()); } } } Index: ChannelEmail.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/message/ChannelEmail.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ChannelEmail.java 10 Aug 2005 13:35:34 -0000 1.4 +++ ChannelEmail.java 16 Feb 2006 15:21:08 -0000 1.5 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -15,7 +15,7 @@ import java.io.*; import java.util.*; -import org.apache.log4j.*; +import org.apache.log4j.Logger; import org.cobricks.core.CoreManager; import org.cobricks.core.util.LogUtil; @@ -46,10 +46,12 @@ private String fromemail; - public ChannelEmail() { + public ChannelEmail() + { } - public void init(String name, CoreManager coreManager) { + public void init(String name, CoreManager coreManager) + { this.name = name; this.description = "EMail"; this.coreManager = coreManager; @@ -62,16 +64,22 @@ this.fromemail = coreManager.getProperty("message.email.defaultfrom"); } - public String getName() { + public String getName() + { return name; } - public String getDescription() { + public String getDescription() + { return description; } - public boolean sendMessage(Message message, int recipientId) { + /** + * + */ + public boolean sendMessage(Message message, int recipientId) + { if (smtphost == null) return false; try { UserManager userManager = (UserManager) @@ -106,8 +114,7 @@ } catch (Exception e) { logger.error("failed sending email: "+e.toString()); } - return true; - + return true; } } Index: Subscription.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/message/Subscription.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Subscription.java 7 Dec 2005 14:01:11 -0000 1.2 +++ Subscription.java 16 Feb 2006 15:21:08 -0000 1.3 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004 Cobricks Group. All rights reserved. + * Copyright (c) 2004-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software Index: ChannelMailbox.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/message/ChannelMailbox.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ChannelMailbox.java 23 Feb 2004 08:20:59 -0000 1.2 +++ ChannelMailbox.java 16 Feb 2006 15:21:08 -0000 1.3 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -15,7 +15,7 @@ import java.io.*; import java.util.*; -import org.apache.log4j.*; +import org.apache.log4j.Logger; import org.cobricks.core.CoreManager; import org.cobricks.core.util.LogUtil; @@ -27,7 +27,7 @@ * Message channel using the internal mailbox. * * @author mic...@ac... - * @version $ $ + * @version $Date$ */ public class ChannelMailbox Index: properties.txt =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/message/properties.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- properties.txt 26 Jul 2005 10:56:45 -0000 1.3 +++ properties.txt 16 Feb 2006 15:21:08 -0000 1.4 @@ -20,10 +20,18 @@ # # message delivery channels -message.channels=email,mailbox,event +message.channels=email,mailbox,event,newsletterd,newsletterw message.channel.email.class=org.cobricks.message.ChannelEmail message.channel.mailbox.class=org.cobricks.message.ChannelMailbox message.channel.event.class=org.cobricks.message.ChannelEvent +message.channel.newsletterd.class=org.cobricks.message.ChannelNewsletter +message.channel.newsletterw.class=org.cobricks.message.ChannelNewsletter +scheduler.task.newsletterd.time=cron:30,0,*,*,* +scheduler.task.newsletterd.class=org.cobricks.message.ChannelNewsletter +scheduler.task.newsletterd.args=nlname=newsletterd +scheduler.task.newsletterw.time=cron:40,0,*,*,0 +scheduler.task.newsletterw.class=org.cobricks.message.ChannelNewsletter +scheduler.task.newsletterw.args=nlname=newsletterw # # email channel Index: MessageManager.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/message/MessageManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- MessageManager.java 7 Dec 2005 14:01:11 -0000 1.6 +++ MessageManager.java 16 Feb 2006 15:21:08 -0000 1.7 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -36,6 +36,12 @@ public List getMailboxMessages(int userid); public void addMessageToMailbox(int userid, Message message); public void deleteMessageFromMailbox(int userid, int msgid); + public void addMessageToNewsletter(int userid, String nlname, + Message message); + public List getNewsletterMessages(String nlname); + public List getNewsletterMessages(int userid, String nlname); + public void removeNewsletterMessages(String nlname); + public void removeNewsletterMessages(int userid, String nlname); public List getSubscriptions(int userid); public Set getSubscriptions(String domain, String action, int userid, Index: MessageManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/message/MessageManagerImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- MessageManagerImpl.java 20 Dec 2005 18:09:24 -0000 1.8 +++ MessageManagerImpl.java 16 Feb 2006 15:21:08 -0000 1.9 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -12,6 +12,15 @@ package org.cobricks.message; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; +import java.net.URL; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -24,6 +33,8 @@ import java.util.Set; import org.apache.log4j.Logger; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; import org.cobricks.core.ComponentDirectory; import org.cobricks.core.ComponentEvent; @@ -33,6 +44,8 @@ import org.cobricks.core.db.DBAccess; import org.cobricks.core.db.DBAccessImpl; import org.cobricks.core.util.LogUtil; +import org.cobricks.core.util.ResourceUtil; +import org.cobricks.portal.PortalManager; import org.cobricks.user.User; import org.cobricks.user.UserManager; @@ -50,7 +63,7 @@ static Logger logger = Logger.getLogger(MessageManagerImpl.class); static String COMP_NAME = "Cobricks-2 Message Manager"; - static String COMP_VERSION = "V0.2 (Feb. 2004)"; + static String COMP_VERSION = "V0.3 (Feb. 2006)"; ChannelDirectory channelDirectory; MessageQueue messageQueue; @@ -307,6 +320,73 @@ /** + * + */ + public void addMessageToNewsletter(int userid, String nlname, + Message message) + { + // insert message in database + Map attrs = new HashMap(); + attrs.put("userid", new Integer(userid)); + attrs.put("subject", message.getSubject()); + attrs.put("nlname", nlname); + attrs.put("content", message.getContent()); + attrs.put("senderid", new Integer(message.getSenderId())); + attrs.put("sender", message.getSenderDescription()); + attrs.put("senddate", message.getSendDate()); + if (message.getExpirationDate()!=null) + attrs.put("expirationdate", message.getExpirationDate()); + int msgid = dbAccess.sqlInsert("msg_newsletter", attrs); + } + + + /** + * Return the newsletter messages for a particular newsletter + */ + public List getNewsletterMessages(String nlname) + { + String sql = "select * from msg_newsletter where nlname='" + +nlname+"' order by userid, senddate"; + return dbAccess.sqlQuery(sql); + } + + /** + * Return the newsletter messages for a particular user + * and a particular newsletter + */ + public List getNewsletterMessages(int userid, String nlname) + { + String sql = "select * from msg_newsletter where userid = " + +Integer.toString(userid)+" and nlname='" + +nlname+"' order by senddate"; + return dbAccess.sqlQuery(sql); + } + + + /** + * Remove the newsletter messages for a particular newsletter + */ + public void removeNewsletterMessages(String nlname) + { + String sql = "delete from msg_newsletter where nlname='" + +nlname+"'"; + dbAccess.sqlExecute(sql); + } + + /** + * Remove the newsletter messages for a particular user + * and a particular newsletter + */ + public void removeNewsletterMessages(int userid, String nlname) + { + String sql = "delete from msg_newsletter where userid = " + +Integer.toString(userid)+" and nlname='" + +nlname+"'"; + dbAccess.sqlExecute(sql); + } + + + /** * Return the subscriptions of a particular user. */ public List getSubscriptions(int userid) @@ -432,6 +512,64 @@ } + /** + * Return the template content for a given template name (as + * used in subscriptions). + */ + public String getTemplate(String tname) + { + /* the template name is either an URL, then check there, + or a relative path to the template directory in + the jar file (static) or in the WEB-INF/conf/templates + directory */ + try { + InputStream is = null; + + // check if it is an URL + if (tname.indexOf(":")>0) { + URL url = new URL(tname); + is = url.openStream(); + } + else { + // check in config dir + String configdir = coreManager.getProperty("configdir"); + File file = new File(configdir+File.separator + +"org.cobricks.message"+File.separator + +"templates"+File.separator+tname); + if (file.exists()) + is = new FileInputStream(file); + if (is == null) { + // check if the file is in the component resources + is = ResourceUtil. + getComponentResourceAsStream("org.cobricks.message", + "templates/"+tname); + } + } + + if (is == null) { + logger.info("failed loading message template "+tname); + return null; + } + + StringBuffer sb = new StringBuffer(""); + BufferedReader in = + new BufferedReader(new InputStreamReader(is)); + while (true) { + String tmps = in.readLine(); + if (tmps == null) break; + sb.append(tmps); + sb.append("\n"); + } + return (sb.toString()); + + } catch (Exception e) { + logger.warn(LogUtil.ex("Failed loading template "+tname, e)); + } + + return null; + } + + /* ************************************************************ */ /** @@ -455,8 +593,12 @@ class ComponentEventThread extends Thread { ComponentEvent event; + VelocityContext velocityContext; ComponentEventThread(ComponentEvent event) { this.event = event; + PortalManager portalManager = (PortalManager)coreManager. + getComponentDirectory().getManager("portalManager"); + velocityContext = portalManager.getVelocityRootContext(); } public void run() { Set subscriptions = @@ -479,22 +621,42 @@ new ConditionProcessor(coreManager); cond = conditionProcessor. check(scondition, userid, event.getUserId(), - event.getObjectId(), event.getObjectType()); + event.getObjectId(), event.getObjectType(), + event.getContent()); } catch (Exception e) { logger.warn(LogUtil.ex("Failed processing condition: " +scondition, e)); } if (!cond) continue; + logger.debug("condition "+scondition+" is true ..."); // otherwise the condition is true and we can continue - } + } // now create a message and deliver it to the user Message message = new Message(); message.setSenderId(event.getUserId()); message.setSendDate(new Date()); message.setSubject("notification "+event.getDomain() +"/"+event.getAction()); - // tbd: format event with template ... - message.setContent(event.toString()); + + String templateName = subscr.getTemplateName(); + String templ = getTemplate(templateName); + if (templ == null) continue; + + // parse template as Velocity template + Writer sw = new StringWriter(); + try { + Object o = event.getContent(); + if (o!=null) + velocityContext.put("obj", o); + Velocity.evaluate(velocityContext, sw, + "message template", templ); + } catch (Exception e) { + logger.warn(LogUtil.ex("failed parsing template", e)); + } + templ = sw.toString(); + + message.setContent(templ); + // deliver message to channel String channelname = subscr.getChannelName(); if (channelname.startsWith("PRIORITY=")) { |
|
From: Michael K. <ko...@us...> - 2006-02-16 15:21:17
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8500/org/cobricks/item Modified Files: Item.java ItemManagerImpl.java ItemPresenter.java ItemServlet.java Log Message: Index: ItemManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemManagerImpl.java,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- ItemManagerImpl.java 2 Feb 2006 11:39:12 -0000 1.65 +++ ItemManagerImpl.java 16 Feb 2006 15:21:07 -0000 1.66 @@ -1003,7 +1003,7 @@ // and finally send a component event ComponentEvent event = new ComponentEventImpl("org.cobricks.item", "item", "create"); - event.setObjectId(itemid); + event.setObject(it); User creator = (User)it.getAttributeQualified("creator", coreManager); if (creator != null) event.setUserId(creator.getId()); @@ -1639,7 +1639,7 @@ // send a component event ComponentEvent event = new ComponentEventImpl("org.cobricks.item", "item", "delete"); - event.setObjectId(localid); + event.setObject(item); event.setUserId(userid); this.publishEvent(event); } @@ -1827,10 +1827,8 @@ public void updateItem(Item item) throws CobricksException { - java.util.Calendar cal = java.util.Calendar.getInstance(); - java.util.Date start = cal.getTime(); - - String newContentVersion = item.getAttributeAsString("newContentVersion"); + String newContentVersion = + item.getAttributeAsString("newContentVersion"); item.removeAttribute("newContentVersion"); newContentVersion = (newContentVersion == null) ? "" : @@ -1981,15 +1979,11 @@ // send a component event ComponentEvent event = new ComponentEventImpl("org.cobricks.item", "item", "update"); - event.setObjectId(item.getLocalId()); + event.setObject(item); User updater = (User)item.getAttributeQualified("updater", coreManager); if (updater != null) event.setUserId(updater.getId()); this.publishEvent(event); - - cal = java.util.Calendar.getInstance(); - long elapsed = cal.getTime().getTime() - start.getTime(); - logger.info("elapsed:" + elapsed); } Index: Item.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/Item.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- Item.java 13 Feb 2006 21:07:42 -0000 1.50 +++ Item.java 16 Feb 2006 15:21:07 -0000 1.51 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2004-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software Index: ItemPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemPresenter.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- ItemPresenter.java 16 Jan 2006 20:43:24 -0000 1.44 +++ ItemPresenter.java 16 Feb 2006 15:21:07 -0000 1.45 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2004-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -498,6 +498,8 @@ private String printAttribute(Object attribute, OntologyDataType datatype, String lang) { + if (attribute == null) return ""; + // Get a String representation of the corresponding datatype String type = datatype.getTypeName(); @@ -523,7 +525,6 @@ } return result.toString(); } else { - if (attribute == null) return null; return attribute.toString(); } } else if (type.equals("int")) { @@ -542,7 +543,6 @@ } return result.toString(); } else { - if (attribute == null) return null; return attribute.toString(); } } else if (type.equals("user")) { Index: ItemServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemServlet.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- ItemServlet.java 2 Feb 2006 11:39:12 -0000 1.41 +++ ItemServlet.java 16 Feb 2006 15:21:07 -0000 1.42 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2004-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -227,7 +227,6 @@ // are there any attachments to add? if ((upload != null) && upload instanceof FileItem) { - logger.info("adding attachment"); String title = prequest.getRequestParameter("_fileTitle"); String comment = prequest.getRequestParameter("_fileComment"); if (title==null || title.equalsIgnoreCase("")) @@ -237,13 +236,16 @@ FileItem uploadFile = (FileItem)upload; String contentType = uploadFile.getContentType(); int size = (int)uploadFile.getSize(); - ItemAttachment ia = - itemManager. - createItemAttachment(it.getId(), title, comment, - contentType, size, null, - portalUser.getUserId(), null); - byte[] data = uploadFile.get(); - itemManager.storeItemAttachment(ia, data); + if (size > 0) { + logger.info("adding attachment"); + ItemAttachment ia = + itemManager. + createItemAttachment(it.getId(), title, comment, + contentType, size, null, + portalUser.getUserId(), null); + byte[] data = uploadFile.get(); + itemManager.storeItemAttachment(ia, data); + } } // and what about annotations? |
|
From: Michael K. <ko...@us...> - 2006-02-16 15:21:16
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8500/org/cobricks/user Modified Files: UserManagerImpl.java Log Message: Index: UserManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/UserManagerImpl.java,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- UserManagerImpl.java 12 Feb 2006 19:43:39 -0000 1.57 +++ UserManagerImpl.java 16 Feb 2006 15:21:08 -0000 1.58 @@ -1166,18 +1166,14 @@ newUser.setAttributesLocally(attrs); //and sending of an event - ComponentEvent event = new ComponentEventImpl("user", "user", - "create"); - event.setObjectId(userId); - if (newUser != null) { + ComponentEvent event = + new ComponentEventImpl("user", "user", "create"); + event.setObject(newUser); event.setUserId(userId); - } else { - event.setUserId(0); + this.publishEvent(event); } - this.publishEvent(event); - return newUser; } } @@ -1217,6 +1213,8 @@ public void deleteUser(int userid) throws Exception { + User user = getUser(userid); + Map conditions = new HashMap(); conditions.put(User.USERID, new Integer(userid)); @@ -1236,8 +1234,9 @@ removeUserObjectFromCache(userid); //event sending - ComponentEvent event = new ComponentEventImpl("user", "user", "delete"); - event.setObjectId(0); + ComponentEvent event = + new ComponentEventImpl("user", "user", "delete"); + event.setObject(user); this.publishEvent(event); } @@ -1601,14 +1600,13 @@ } // and finally send an event - ComponentEvent event = new ComponentEventImpl("user", "user", "update"); - event.setObjectId(userid); if (updateUser != null) { + ComponentEvent event = + new ComponentEventImpl("user", "user", "update"); + event.setObject(updateUser); event.setUserId(userid); - } else { - event.setUserId(0); + this.publishEvent(event); } - this.publishEvent(event); } |