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: Michael K. <ko...@us...> - 2006-05-31 16:39:48
|
Update of /cvsroot/cobricks/cobricks2/web/ADMIN In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31476 Modified Files: index.html Log Message: Index: index.html =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/ADMIN/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- index.html 29 Nov 2005 07:14:46 -0000 1.3 +++ index.html 31 May 2006 16:39:24 -0000 1.4 @@ -1,5 +1,5 @@ -#parse ( "$!pagePath/pageheader.html" ) +$portalPresenter.parse("$!contextPath/ADMIN/pageheader.html.en",$portalRequest) <p> <em><a href="$contextPath/ADMIN/index.html">Admin</a></em> @@ -52,5 +52,4 @@ <input type="submit" value="Clear All Caches"/> </form> - -#parse ( "$!pagePath/pagefooter.html" ) +$portalPresenter.parse("$!contextPath/ADMIN/pagefooter.html.en",$portalRequest) |
|
From: Michael K. <ko...@us...> - 2006-05-31 16:39:48
|
Update of /cvsroot/cobricks/cobricks2/web/ADMIN/org.cobricks.user In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31476/org.cobricks.user Modified Files: index.html Log Message: Index: index.html =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/ADMIN/org.cobricks.user/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- index.html 11 Feb 2004 14:39:29 -0000 1.1 +++ index.html 31 May 2006 16:39:24 -0000 1.2 @@ -4,25 +4,18 @@ <em><a href="/ADMIN/index.html">Admin</a> - <a href="/ADMIN/org.cobricks.user/index.html">User Component</a></em> - <h1>User Component</h1> The following actions can be performed in the user component: <p> <ul> -<li><a href="search.html">Search for registered users</a> +<li><a href="search.html">Search for registered users</a> (and edit or + delete the accounts) <p> <li><a href="create.html">Directly (without email notification) create a -new user</a> + new user</a> <p> <li><a href="ontology.html">Show user ontology</a> </ul> #parse ( "/ADMIN/pagefooter.html" ) - - - - - - - |
|
From: Michael K. <ko...@us...> - 2006-05-31 06:04:22
|
Update of /cvsroot/cobricks/cobricks2/web/ADMIN/org.cobricks.user In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29264/web/ADMIN/org.cobricks.user Modified Files: search.html Log Message: Index: search.html =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/ADMIN/org.cobricks.user/search.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- search.html 27 Aug 2004 06:41:16 -0000 1.4 +++ search.html 31 May 2006 06:04:18 -0000 1.5 @@ -5,36 +5,17 @@ <a href="/ADMIN/org.cobricks.user/index.html">User Component</a> - <a href="/ADMIN/org.cobricks.user/search.html">Search User</a></em> - <h1>Search User</h1> -<!--<p>Currently we just display a list of all registered users ...<p> - -<ul>--> - -##foreach( $i in $coreManager.getDBAccess().sqlQuery("select userid,firstname,lastname,userlogin from user_main order by userlogin") ) -##<!--<li>$i.get("userlogin"): $i --> -##end -##<!--</ul> - -##<ul>--> -##foreach( $i in $userManager.getUserIdList() ) -##set ( $user = $userManager.getUser($i) ) -##<!--<li>$user.getUserLogin() ($user.getId() - $user.getGlobalId())--> -##end -##</ul> - <form action="search.html" method="get"> - <INPUT TYPE="hidden" NAME="cmd" VALUE="search" /> -<input type="hidden" name="more_attrs" value="basic_university_status, email, basic_title" /> -<input type="hidden" name="cmd.success" value="/user/search.html" /> -<input type="hidden" name="cmd.error" value="/user/search.html" /> +<input type="hidden" name="more_attrs" value="email" /> +<input type="hidden" name="cmd.success" value="/ADMIN/org.cobricks.user/search.html" /> +<input type="hidden" name="cmd.error" value="/ADMIN/org.cobricks.user/search.html" /> <input type="hidden" name="path" value="$portalRequest.getPagePath()" /> - -#set ( $tmp = "$!auserlogin$!firstname$!lastname$!basic_university_status$!email$!basic_title" ) +#set ( $tmp = "$!auserlogin$!firstname$!lastname$!email" ) #if ( $tmp.length() > 0 ) #set ($attrsInit = true) Search for users with search criteria @@ -78,17 +59,6 @@ #end </td> #end - - #set ( $tmp = "$!basic_university_status" ) - #if ($tmp.length() > 0) - <td>Status: - #if ($compare_func_basic_university_status == "2") - like '$!basic_university_status' - #else - is equal '$!basic_university_status' - #end - </td> - #end </tr> <tr> #set ( $tmp = "$!email" ) @@ -101,18 +71,6 @@ #end </td> #end - - #set ( $tmp = "$!basic_title" ) - #if ($tmp.length() > 0) - <td>title: - #if ($compare_func_basic_title == "2") - like '$!basic_title' - #else - is equal '$!basic_title' - #end - </td> - #end - </tr> </table> @@ -121,20 +79,16 @@ #set ( $login = "$!auserlogin" ) #set ( $fname = "$!firstname" ) #set ( $lname = "$!lastname" ) -#set ( $status = "$!basic_university_status" ) #set ( $mail = "$!email" ) -#set ( $title = "$!basic_title" ) #set ( $loginCond = "$!compare_func_auserlogin" ) #set ( $fnameCond = "$!compare_func_firstname" ) #set ( $lnameCond = "$!compare_func_lastname" ) -#set ( $statusCond = "$!compare_func_basic_university_status" ) #set ( $mailCond = "$!compare_func_email" ) -#set ( $titleCond = "$!compare_func_basic_title" ) -#set ( $listNames = ["auserlogin", "firstname", "lastname", "basic.university.status", "email", "basic.title"] ) -#set ( $listConditions = [$loginCond, $fnameCond, $lnameCond, $statusCond, $mailCond, $titleCond] ) -#set ( $listValues = [$login, $fname, $lname, $status, $mail, $title] ) +#set ( $listNames = ["auserlogin", "firstname", "lastname", "email"] ) +#set ( $listConditions = [$loginCond, $fnameCond, $lnameCond, $mailCond] ) +#set ( $listValues = [$login, $fname, $lname, $mail] ) #set ($orFlag = false) #if ("$!SearchLogik" == "or") @@ -153,14 +107,13 @@ #end #else <p> - <div class="info">The search for users has no results</div> - Please, try to change one or more search criteria. + <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></td> <td> <b>User Id</b> </td> @@ -179,13 +132,13 @@ #set ($uId = $i.getUserId()) <tr bgcolor = "#dfdfdf"> <td> - #set( $number = $number + 1 ) - $number - </td> - <td> $uId </td> <td> +#set ($imageuri = $i.getAttribute("basic.personal.imageuri")) +#if ("$!imageuri"!="") +<img src="$imageuri" width="16"> +#end <a href="/user/user.html?auserlogin=$i.getUserLogin()"> $i.getUserLogin()</a> </td> <td> @@ -198,22 +151,19 @@ $!i.getAttribute("basic.contact-priv.online.email") #end </td> + <td> +<a href="/ADMIN/org.cobricks.user/user.html?auserlogin=$i.getUserLogin()">edit</a> - +<a href="/user/user.html?auserlogin=$i.getUserLogin()">edit app</a> + </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> -<p>NOTE: Valid values for a <i>Status</i> field are : - #foreach( $i in $userPresenter.getValuesForAttribute("basic.university.status", "universityuser") ) - $i - #end - <br> -</p> -##<input type="hidden" name="first" value="$!first" /> +<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> + <table border="0"> <tr> <TD>Login Name:</TD> @@ -243,16 +193,7 @@ </tr> <tr> - <TD>Status:</TD><TD><input name="basic_university_status" size=20 value="$!basic_university_status"></td> - <td> - <select width="15" name="compare_func_basic_university_status" > - <option value="1">is equal - <option value="2">like - </select> - </td> - </tr> - <tr> - <TD>E-Mail:</TD><TD><input name="email" size=20 value="$!email"></td> + <TD>Email:</TD><TD><input name="email" size=20 value="$!email"></td> <td> <select width="15" name="compare_func_email" > <option value="1">is equal <option value="2">like @@ -260,14 +201,6 @@ </td> </tr> <tr> - <TD>Title:</TD><TD><input name="basic_title" size=20 value="$!basic_title"></td> - <td> <select width="15" name="compare_func_basic_title" > - <option value="1">is equal - <option value="2">like - </select> - </td> - </tr> - <tr> <td> order by: </td> @@ -276,9 +209,7 @@ <option value="1">Login name <option value="2">Lastname <option value="3">Firstname - <option value="4">Status <option value="5">E-Mail - <option value="6>Title </select> </td> <td width="100"></td> @@ -297,8 +228,6 @@ </tr> </table> - - <p><input type="submit" value="Search"></p> </form> |
|
From: Michael K. <ko...@us...> - 2006-05-31 06:04:22
|
Update of /cvsroot/cobricks/cobricks2/web In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29264/web Modified Files: pageheader.html.en style.css Log Message: Index: pageheader.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/pageheader.html.en,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pageheader.html.en 30 May 2006 14:18:29 -0000 1.1 +++ pageheader.html.en 31 May 2006 06:04:18 -0000 1.2 @@ -1,8 +1,8 @@ <html> <head> -<meta http-equiv="Content-Type" content="text/html"> -<meta name="Author" content="mic...@co..."> -$portalPresenter.printHeader($portalRequest) +<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>Cobricks-2</title> +<base href="$portalRequest.getBaseUrl()"> <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> <meta http-equiv="expires" content="0"> Index: style.css =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/style.css,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- style.css 5 Jul 2005 05:35:34 -0000 1.9 +++ style.css 31 May 2006 06:04:18 -0000 1.10 @@ -1,4 +1,5 @@ /* Default font for all pages: */ +@charset "utf-8"; body,td,textarea,input,select,submit,option { font-size: 11px; |
|
From: Michael K. <ko...@us...> - 2006-05-31 06:04:21
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29264/src/org/cobricks/portal Modified Files: PortalManagerImpl.java PortalPresenter.java Log Message: Index: PortalPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPresenter.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- PortalPresenter.java 29 May 2006 15:57:29 -0000 1.40 +++ PortalPresenter.java 31 May 2006 06:04:18 -0000 1.41 @@ -376,32 +376,6 @@ /** - * Print some header information for html pages. This function - * will be called in the Velocity header files. - */ - public String printHeader(PortalRequest portalRequest, String title) - { - StringBuffer sb = new StringBuffer(""); - sb.append("<title>"); - sb.append(title); - sb.append("</title>\n"); - // and now a base tag - this is needed if templates are loaded - // from servlet actions - in this case the browser does not - // know the correct base - String useragent = portalRequest. - getHttpServletRequest().getHeader("user-agent"); - if (!useragent.startsWith("Mozilla/4")) - sb.append("<base href=\""+portalRequest.getBaseUrl()+"\">"); - return sb.toString(); - } - - public String printHeader(PortalRequest portalRequest) - { - return printHeader(portalRequest, "Cobricks-2"); - } - - - /** * Print icons for the other possible language versions * of this page. */ Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- PortalManagerImpl.java 30 May 2006 06:54:40 -0000 1.82 +++ PortalManagerImpl.java 31 May 2006 06:04:18 -0000 1.83 @@ -98,7 +98,7 @@ static Logger logger = Logger.getLogger(PortalManagerImpl.class); static String COMP_NAME = "Cobricks-2 Portal Component"; - static String COMP_VERSION = "V0.4 (Feb. 2006)"; + static String COMP_VERSION = "V0.4 (Jun. 2006)"; static String ROOTPORTALFOLDER = "ROOT"; |
|
From: Michael K. <ko...@us...> - 2006-05-31 06:04:21
|
Update of /cvsroot/cobricks/cobricks2/tomcat/5.0/conf In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29264/tomcat/5.0/conf Modified Files: server.xml Log Message: Index: server.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/tomcat/5.0/conf/server.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- server.xml 22 Nov 2005 12:42:25 -0000 1.1 +++ server.xml 31 May 2006 06:04:18 -0000 1.2 @@ -3,6 +3,7 @@ <Service name="Catalina" debug="0"> <Connector className="org.apache.coyote.tomcat5.CoyoteConnector" + URIEncoding="UTF-8" port="@@@HTTPPORT@@@" minProcessors="5" maxProcessors="100" enableLookups="true" redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000" @@ -11,6 +12,7 @@ <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 --> <!-- <Connector className="org.apache.coyote.tomcat5.CoyoteConnector" + URIEncoding="UTF-8" port="@@@HTTPSPORT@@@" minProcessors="5" maxProcessors="75" enableLookups="true" disableUploadTimeout="true" acceptCount="100" debug="0" scheme="https" secure="true"> |
|
From: Michael K. <ko...@us...> - 2006-05-31 06:04:21
|
Update of /cvsroot/cobricks/cobricks2/web/user In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29264/web/user Modified Files: search.html.en Log Message: Index: search.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/user/search.html.en,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- search.html.en 30 May 2006 14:18:30 -0000 1.10 +++ search.html.en 31 May 2006 06:04:19 -0000 1.11 @@ -89,7 +89,7 @@ <b>Name</b> </td> <td> - <b>E-Mail</b> + <b>Email</b> </td> </tr> #set( $number = 0 ) |
|
From: Michael K. <ko...@us...> - 2006-05-31 06:04:21
|
Update of /cvsroot/cobricks/cobricks2/tomcat/5.5/conf In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29264/tomcat/5.5/conf Modified Files: server.xml Log Message: Index: server.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/tomcat/5.5/conf/server.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- server.xml 22 Nov 2005 14:31:38 -0000 1.1 +++ server.xml 31 May 2006 06:04:18 -0000 1.2 @@ -11,6 +11,7 @@ <Service name="Catalina" debug="0"> <Connector port="@@@HTTPPORT@@@" maxHttpHeaderSize="8192" + URIEncoding="UTF-8" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="@@@HTTPSPORT@@@" acceptCount="100" @@ -21,6 +22,7 @@ <!-- Define a SSL HTTP/1.1 Connector on port 8443 --> <!-- <Connector port="@@@HTTPSPORT@@@" maxHttpHeaderSize="8192" + URIEncoding="UTF-8" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" |
|
From: Michael K. <ko...@us...> - 2006-05-31 06:04:21
|
Update of /cvsroot/cobricks/cobricks2 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29264 Modified Files: changelog.txt Log Message: Index: changelog.txt =================================================================== RCS file: /cvsroot/cobricks/cobricks2/changelog.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- changelog.txt 30 May 2006 14:20:49 -0000 1.9 +++ changelog.txt 31 May 2006 06:04:18 -0000 1.10 @@ -1,5 +1,11 @@ Cobricks2 v0.37 +- Module course reworked completely (to fit needs of course + management at TUM) + +- item attachment handling debugged - it works now ... + +- charset changed consistently to UTF-8 Cobricks2 v0.36 |
|
From: Michael K. <ko...@us...> - 2006-05-31 05:59:49
|
Update of /cvsroot/cobricks/cobricks2/web/user In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv25949 Added Files: index.html.en login-success.html.en login.html.en role-create.html.en role-edit.html.en role-editperm.html.en role-editperm2.html.en roles.html.en user-roles.html.en Removed Files: index.html login-success.html.de login.html.de role-create.html role-edit.html role-editperm.html role-editperm2.html roles.html user-roles.html Log Message: --- NEW FILE: login-success.html.en --- $portalPresenter.parse("$contextPath/pageheader.html.en",$portalRequest) <h1>Hallo <b>$luserlogin</b>,</h1> <p>Your login to the platform was successful.</p> <p>As registered user you can access the following functionality:</P> <p> <ul> <li><a href="/user/user.html.de">Edit user profile</a> <li><a href="/user/user-search.html.de">Search users</a> <p></p> <li><a href="/servlet/Item_Pflege?cmd=createitem&typeid=1"> Publish announcement</a> </ul> $portalPresenter.parse("$contextPath/pagefooter.html.en",$portalRequest) --- NEW FILE: role-create.html.en --- #parse ( "pageheader.html" ) <em><a href="index.html">User Component</a> - <a href="roles.html">Access Roles</a> - <a href="role-create.html">Create Access Role</a></em> <h1>Create Access Role</h1> <!-- tbd: check for permission userrole/create - if not, then print warning --> <form action="/USER" method="post"> <input type="hidden" name="cmd" value="createrole"/> <input type="hidden" name="cmd.noaccess" value="/noaccess.html"/> <input type="hidden" name="cmd.success" value="/user/roles.html"/> <b>Role Name:</b><br> <input type="string" size="30" name="rolename"/> <p> <b>Role Description:</b><br> <textarea name="roledescription" cols="80" rows="3"> </textarea> <p> <b>Role Type:</b><br> <input type="radio" select name="roletype" value="0" checked="checked"/> standard (for explicitely assigned users)<br> <input type="radio" select name="roletype" value="10"/> login (for all authenticated users)<br> <input type="radio" select name="roletype" value="20"/> all (for all users - inclusive anonymous) <p> <input type="submit" value="Create Role"/> </form> #parse ( "pagefooter.html" ) --- NEW FILE: login.html.en --- $portalPresenter.parse("$contextPath/pageheader.html.en",$portalRequest) <h1>Login</h1> #if ($returnCode > 2000) <div class="error"> #if ($returnCode == 2001) The login name "$luserlogin" is not defined. #end #if ($returnCode == 2002) The password is not correct for login "$luserlogin". #end #if ($returnCode > 2002) Failed during login. #end #if ($returnCode == 1006) Email is an obligatory field. #end </div> #end <p class="standard">Please specify your user name and the password for this user name to log in. If you do not have an account on this platform you can <a href="/user/register.html.de">register</a>.</p> <quote> <form name="loginForm" action="/PORTAL" method="post"> <INPUT TYPE="hidden" NAME="cmd" VALUE="login"> <INPUT TYPE="hidden" NAME="cmd.success" VALUE="/user/login-success.html.en"> <INPUT TYPE="hidden" NAME="cmd.error" VALUE="/user/login.html.en"> <INPUT TYPE="hidden" NAME="redirect" VALUE="$!redirect"> Login<br> <input title="User name" size="20" name="luserlogin" type="text" value="$!luserlogin"><br> Password<br> <input title="Password" size="16" name="luserpw" type="password"> <input class="submit" title="Login" value="Log in" type="submit"><br> <input type=checkbox name="autologin" value="auto"> store login (in session cookie) </form> </quote> <p>  <p>If you have forgotten your password, that you can reset it and send the new password to you email address using this form. If you have not specified an email address in your user profile, than you have to contact the administrator of the platform..</p> <p><INPUT TYPE=hidden NAME=cmd VALUE=forgotPassword /> <input type="hidden" name="userclass" value="universityuser" /> <input type="hidden" name="cmd.success" value="/user/login.html.de" /> <input type="hidden" name="cmd.error" value="/user/login.html.de" /> <table border="0"> <tr><td>Login name*:</td><td><input name="auserlogin" size=20 value="$!auserlogin"></td></tr> <tr><td>Email*:</TD><TD><input name="email" size=20 value="$!email"></td></tr> </table> </p> #set ($login = "$!auserlogin") <p><input type=submit value="Request new password"/></p> <input type="hidden" name="email_subject" value="Cobricks Password" /> <input type=hidden name="email_textsource" value="/user/forgot_password.txt.en" /> </form> </td> $portalPresenter.parse("$contextPath/pagefooter.html.en",$portalRequest) --- login-success.html.de DELETED --- --- NEW FILE: role-editperm2.html.en --- #parse ( "pageheader.html" ) <em><a href="index.html">User Component</a> - <a href="roles.html">Access Roles</a> - <a href="role-edit.html?roleid=$roleid">Edit Access Role</a></em> <h1>Edit Access Role</h1> #set ( $auth = $userPresenter.checkPermission($userId, "userrole", "update", "") ) #if ( $auth != "true") <font color="red">You do not have the access permission to update access role information.</font> <p> Please log in as user with the specified permission or ask the platform administrator to assign the permission to your account. #else <h3>Add Permission - Step 2: Specify Access Permission Attributes</h3> <form action="/USER" method="post"> <input type="hidden" name="cmd" value="addperm"/> <input type="hidden" name="roleid" value="$roleid"/> <input type="hidden" name="cmd.noaccess" value="/noaccess.html"/> <input type="hidden" name="cmd.success" value="/user/role-edit.html"/> <input type="hidden" name="permdomain" value="$permdomain"/> <input type="hidden" name="permaction" value="$permaction"/> Domain: <b>"$permdomain"</b> <p> Action: <b>"$permaction"</b> <p> Permission Attributes:<br> <select name="permaname1" size="1"> <option value="">- #foreach( $i in $userManager.getAccessControl().getAccessHandler($permdomain).getDomainActionAttributes($permaction) ) <option value="$i">$i #end </select> <input name="permavalue1" size="30"><br> <select name="permaname2" size="1"> <option value="">- #foreach( $i in $userManager.getAccessControl().getAccessHandler($permdomain).getDomainActionAttributes($permaction) ) <option value="$i">$i #end </select> <input name="permavalue2" size="30"><br> <select name="permaname3" size="1"> <option value="">- #foreach( $i in $userManager.getAccessControl().getAccessHandler($permdomain).getDomainActionAttributes($permaction) ) <option value="$i">$i #end </select> <input name="permavalue3" size="30"><br> <select name="permaname4" size="1"> <option value="">- #foreach( $i in $userManager.getAccessControl().getAccessHandler($permdomain).getDomainActionAttributes($permaction) ) <option value="$i">$i #end </select> <input name="permavalue4" size="30"><br> <select name="permaname5" size="1"> <option value="">- #foreach( $i in $userManager.getAccessControl().getAccessHandler($permdomain).getDomainActionAttributes($permaction) ) <option value="$i">$i #end </select> <input name="permavalue5" size="30"><p> The attribute names provided for restricting the permission are a subset of the attributes defined in the basic ontology for the domain. The subset is specified in the AccessHandler component for the given domain. <p> Values can either be string or integer values. Additionally, you can use the keywords "ownuserid", "ownuserlogin" and "ownuserclass". <p> <input type="submit" value="Add Permission"/> </form> #end #parse ( "pagefooter.html" ) --- roles.html DELETED --- --- NEW FILE: index.html.en --- $portalPresenter.parse("$contextPath/pageheader.html.en",$portalRequest) <h1>User Component</h1> The User Component is responsible for managing user data objects. <h3><a href="register.html">Register New User</a></h3> <ul> <li><a href="register.html">Register with E-Mail check</a> <li><a href="register-direct.html">Register directly</a> </ul> <h3><a href="user.html">User Information</a></h3> Self-service functions for managing information of a logged in user. <ul> <li><a href="user.html?auserlogin=$userLogin">Show own User Profile</a> <ul> <li><a href="user-roles.html?auserlogin=$userLogin">User Roles</a> <li><a href="user-buddylist.html?auserlogin=$userLogin">User BuddyList</a> <li><a href="user-interests.html?auserlogin=$userLogin">User Interests</a> </ul> <p> <li>Show Profile of User <form action="card.html"> <input name="auserlogin" value="$userLogin"> <input type="submit" class="submit" value="Show"> </form> <p> <li><a href="forgot_password.html">Forgot Password</a> </ul> <h3><a href="search.html">Search Users</a></h3> Search for users and show user business cards - for any user (see business card) and for admins (edit user data). <ul> <li><a href="search.html">Search Users</a> </ul> <h3><a href="roles.html">User Access Roles</a></h3> Manage user access roles and access rights (usually for admins with special permissions only). <ul> <li><a href="roles.html">Show User Access Roles</a> <li><a href="role-create.html">Create User Access Role</a> </ul> $portalPresenter.parse("$contextPath/pagefooter.html.en",$portalRequest) --- NEW FILE: roles.html.en --- #parse ( "pageheader.html" ) <em><a href="index.html">User Component</a> - <a href="roles.html">Access Roles</a></em> <h1>Access Roles</h1> #set ( $auth = $userPresenter.checkPermission($userId, "userrole", "read", "") ) #if ( $auth != "true") <font color="red">You do not have the access permission to read access role information.</font> <p> Please log in as user with the specified permission or ask the platform administrator to assign the permission to your account. #else <table> <tr><td><b>Role Name</b></td><td> </td><td> </td></tr> #foreach( $i in $userManager.getAccessControl().getAccessRoles() ) <tr><td>$i.getName()</td><td></td><td><a href="/user/role-edit.html?roleid=$i.getId()">edit</a> - <a href="/USER?cmd=deleterole&cmd.success=/user/roles.html&cmd.noaccess=/user/roles.html&roleid=$i.getId()">delete</a></td></tr> #end </table> <p> <h3>Role Management Activities</h3> <ul> <li><a href="role-create.html">Create New Access Role</a> <li><form action="/user/user-roles.html"> Show Access Roles for User <input name="auserlogin" value="$userLogin"> <input type="submit" value="Show"></form> </ul> #end #parse ( "pagefooter.html" ) --- index.html DELETED --- --- login.html.de DELETED --- --- role-edit.html DELETED --- --- user-roles.html DELETED --- --- role-create.html DELETED --- --- NEW FILE: user-roles.html.en --- $portalPresenter.parse("$contextPath/pageheader.html.de",$portalRequest) #set ( $auserlogin = "$!auserlogin" ) #if ( $auserlogin == "" ) #set ( $auserlogin = $userLogin ) #end #set ( $auserid = $userManager.getUserIdForUserLogin($auserlogin) ) #set ($auser = $userManager.getUser($auserid)) #set ($auserclass = $auser.getUserClass() ) <h1>Benutzerprofil - Zugriffsrechte</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">Sie haben keine ausreichenden Zugriffsrechte um das Benutzerprofil von "$auserlogin" zu lesen.</div> <p>Bitte melden Sie sich als Benutzer mit den entsprechenden Rechten an oder kontaktieren Sie den Plattformadministrator um die notwendigen Rechte zugewiesen zu bekommen.</p> #else #if ($auserid == 0) <p><div class="error">Loginname <b>$auserlogin</b> existiert nicht!</div></p> #else #if ( "$!cmd" == "addrole" ) #if ( "$!roleid" != "" ) $userPresenter.addRole($auserid, $roleid) <p><div class="success">Rolle erfolgreich hinzugefügt.</div></p> #end #end #if ( "$!cmd" == "removerole" ) #if ( "$!roleid" != "" ) $userPresenter.removeRole($auserid, $roleid) <p><div class="success">Rolle erfolgreich entfernt.</div></p> #end #end <p>Loginname: $auserlogin</p> <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">Basisdaten</a> - <a href="user-interests.html?auserlogin=$auserlogin">Interessen</a> - <a href="user-buddylist.html?auserlogin=$auserlogin">Freundesliste</a> - <a href="user-roles.html?auserlogin=$auserlogin">Zugriffsrechte</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">Passwort ändern</a></em> </td></tr></table> </td></tr> <tr><td colspan="2"> <table border="0" cellpadding="8pt"> <tr><td> <b>Zugriffsrollen und -rechte des Benutzers</b> <ul> #foreach( $i in $userManager.getAccessControl().getAccessRolesByUser($auserid) ) <li>$i.getName() - <a href="user-roles.html?cmd=removerole&auserlogin=$auserlogin&roleid=$i.getId()">entfernen</a> #end </ul> <h3>Rolle hinzufügen</h3> <form action="user-roles.html" method="post"> <input type="hidden" name="cmd" value="addrole"/> <input type="hidden" name="auserid" value="$auserid"/> <input type="hidden" name="auserlogin" value="$auserlogin"/> <select name="roleid"> #foreach( $i in $userManager.getAccessControl().getAccessRoles() ) <option value="$i.getId()">$i.getName() #end </select> <input type="submit" name="submit" value="Hinzufügen"/> </form> </p> </td></tr></table> </td></tr></table> #end #end #parse ( "pagefooter.html" ) --- NEW FILE: role-edit.html.en --- #parse ( "pageheader.html" ) <em><a href="index.html">User Component</a> - <a href="roles.html">Access Roles</a> - <a href="role-edit.html?roleid=$roleid">Edit Access Role</a></em> <h1>Edit Access Role</h1> #set ( $auth = $userPresenter.checkPermission($userId, "userrole", "read", "") ) #if ( $auth != "true") <font color="red">You do not have the access permission to read access role information.</font> <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 > 999 ) <p> #if ( $returnCode == 1000 ) <div class="success">Access role updated.</div> #end #if ( $returnCode == 1001 ) <div class="success">Parent access roles updated.</div> #end #if ( $returnCode == 1002 ) <div class="success">Permissions deleted from access role.</div> #end #if ( $returnCode == 1003 ) <div class="success">Permission added to access role.</div> #end #if ( $returnCode == 1004 ) <div class="success">Users deleted from access role.</div> #end #if ( $returnCode == 1005 ) <div class="success">User added to access role.</div> #end #if ( $returnCode == 2000 ) <div class="error">Failed updating access role.</div> #end #if ( $returnCode == 2005 ) <div class="error">Illegal user login $userlogin.</div> #end </p> #end #set ( $role = $userPresenter.getAccessRole($roleid) ) #set ( $authupdate = $userPresenter.checkPermission($userId, "userrole", "update", "roleid=$roleid") ) #set ( $authadduser = $userPresenter.checkPermission($userId, "userrole", "adduser", "roleid=$roleid") ) #set ( $authremoveuser = $userPresenter.checkPermission($userId, "userrole", "removeuser", "roleid=$roleid") ) <p> #if ("$!authupdate" != "true") <div class="error">You do not have the permission to update this user role!</div> <p> #end <form action="/USER" method="post"> <input type="hidden" name="cmd" value="updaterole"/> <input type="hidden" name="roleid" value="$roleid"/> <input type="hidden" name="cmd.noaccess" value="/noaccess.html"/> <input type="hidden" name="cmd.success" value="/user/role-edit.html"/> <input type="hidden" name="cmd.editperm" value="/user/role-editperm.html"/> <table border="0" width="100%"> <tr><td width="50%" valign="top"> <b>Role Name:</b><br> <input type="string" size="30" name="rolename" value="$!role.getName()"/> <p> <b>Role Description:</b><br> <textarea name="roledescription" rows="3" width="100%"> $!role.getDescription() </textarea> <p> <b>Role Type:</b><br> <input type="radio" select name="roletype" value="0" #if ($role.getType()==0) checked="checked" #end /> standard (for explicitely assigned users)<br> <input type="radio" select name="roletype" value="10" #if ($role.getType()==10) checked="checked" #end /> login (for all authenticated users)<br> <input type="radio" select name="roletype" value="20" #if ($role.getType()==20) checked="checked" #end /> all (for all users - inclusive anonymous) <p> #if ( $authupdate == "true" ) <input type="submit" name="subcmd" class="submit" value="Update Role"/> #end <p> <h3>Parent Access Roles</h3> <select name="parentroles" multiple="true" size="5"> #foreach( $i in $userManager.getAccessControl().getAccessRoles() ) <option value="$i.getId()" $userPresenter.checkSubRole($role,$i)>$i.getName() #end </select> #if ( $authupdate == "true" ) <br>Select or deselect roles to change the parent roles of this role.<br> <input type="submit" class="submit" name="subcmd" value="Update Parent Roles"/> #end </td><td> </td> <td width="50%" valign="top"> <h3>Access Role Permissions</h3> <select name="perms" multiple="true" size="5"> #foreach( $i in $userPresenter.getAccessPermissions($roleid) ) <option value="$i.getId()">$i.getDomain() - $i.getAction() $i.getAttrsAsString() #end </select> #if ( $authupdate == "true" ) <br>Deselect permissions for deleting the permission.<br> <input type="submit" class="submit" name="subcmd" value="Delete selected Permissions"/> <p> Domain <select name="permdomain" size="1"> #foreach( $i in $userManager.getAccessControl().getDomains() ) <option value="$i">$i #end </select> <input type="submit" class="submit" name="subcmd" value="Add Permission"/> #end <p> <h3>Users Assigned to Role</h3> <select name="roleusers" multiple="true" size="5"> #foreach( $i in $userPresenter.getAccessRoleUsers($roleid) ) #set ($user = $userManager.getUser($i) ) <option value="$i"> #if ($role.isUserDelegate($i)) + #end $user.getName() ($user.getUserLogin()) #end </select> #if ( $authremoveuser == "true" ) <br>Deselect users for unassigning them from the role.<br> <input type="submit" class="submit" name="subcmd" value="Delete selected Users"/> #end #if ( $authadduser == "true" ) <p> User Login <input name="userlogin" size="30"><br> <input type="checkbox" name="delegate" value="true"> delegate<br> <input type="submit" class="submit" name="subcmd" value="Add User"/> #end </td> </tr> </table> </form> #end #parse ( "pagefooter.html" ) --- NEW FILE: role-editperm.html.en --- #parse ( "pageheader.html" ) <em><a href="index.html">User Component</a> - <a href="roles.html">Access Roles</a> - <a href="role-edit.html?roleid=$roleid">Edit Access Role</a></em> <h1>Edit Access Role</h1> #set ( $auth = $userPresenter.checkPermission($userId, "userrole", "update", "") ) #if ( $auth != "true") <font color="red">You do not have the access permission to update access role information.</font> <p> Please log in as user with the specified permission or ask the platform administrator to assign the permission to your account. #else <h3>Add Permission - Step 1: Specify Access Permission Action</h3> <form action="role-editperm2.html" method="post"> <input type="hidden" name="roleid" value="$roleid"/> <input type="hidden" name="permdomain" value="$permdomain"/> Domain: <b>"$permdomain"</b> <p> Action <select name="permaction" size="1"> #foreach( $i in $userManager.getAccessControl().getAccessHandler($permdomain).getDomainActions() ) <option value="$i">$i #end </select> <p> <input type="submit" value="Add Permission"/> </form> #end #parse ( "pagefooter.html" ) --- role-editperm.html DELETED --- --- role-editperm2.html DELETED --- |
|
From: Michael K. <ko...@us...> - 2006-05-31 05:32:46
|
Update of /cvsroot/cobricks/drehscheibe-in/web In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17351/web Modified Files: index.html.de pageheader.html.de style.css Log Message: Index: index.html.de =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/web/index.html.de,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- index.html.de 30 May 2006 14:14:30 -0000 1.15 +++ index.html.de 31 May 2006 05:32:42 -0000 1.16 @@ -115,7 +115,6 @@ #end </tbody></table></td></tr></tbody></table></td></tr></tbody></table> - </td> </tr> </table> Index: pageheader.html.de =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/web/pageheader.html.de,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pageheader.html.de 29 May 2006 07:37:16 -0000 1.2 +++ pageheader.html.de 31 May 2006 05:32:42 -0000 1.3 @@ -1,8 +1,13 @@ <html> <head> -<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"> -<title>TU - München</title> -$portalPresenter.printHeader($portalRequest) +<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>Cobricks-2</title> +<base href="$portalRequest.getBaseUrl()"> +<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> +<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> +<meta http-equiv="expires" content="0"> +<META NAME="GOOGLEBOT" CONTENT="NOARCHIVE"> +<META NAME="ROBOTS" CONTENT="NONE"> <link rel="stylesheet" type="text/css" href="$contextPath/style.css"> </head> Index: style.css =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/web/style.css,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- style.css 29 May 2006 07:37:16 -0000 1.4 +++ style.css 31 May 2006 05:32:42 -0000 1.5 @@ -1,3 +1,5 @@ +@charset "utf-8"; + BODY { FONT-STYLE: normal; FONT-FAMILY: Arial,Helvetica,Sans-Serif; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: left } |
|
From: Michael K. <ko...@us...> - 2006-05-31 05:32:46
|
Update of /cvsroot/cobricks/drehscheibe-in/tomcat/5.5/conf In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17351/tomcat/5.5/conf Modified Files: server.xml Log Message: Index: server.xml =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/tomcat/5.5/conf/server.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- server.xml 30 May 2006 14:14:30 -0000 1.1 +++ server.xml 31 May 2006 05:32:42 -0000 1.2 @@ -11,6 +11,7 @@ <Service name="Catalina" debug="0"> <Connector port="@@@HTTPPORT@@@" maxHttpHeaderSize="8192" + URIencoding="UTF-8" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="@@@HTTPSPORT@@@" acceptCount="100" @@ -21,6 +22,7 @@ <!-- Define a SSL HTTP/1.1 Connector on port 8443 --> <!-- <Connector port="@@@HTTPSPORT@@@" maxHttpHeaderSize="8192" + URIencoding="UTF-8" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" |
|
From: Michael K. <ko...@us...> - 2006-05-31 05:32:46
|
Update of /cvsroot/cobricks/drehscheibe-in/tomcat/5.0/conf In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17351/tomcat/5.0/conf Modified Files: server.xml Log Message: Index: server.xml =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/tomcat/5.0/conf/server.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- server.xml 30 May 2006 14:14:30 -0000 1.1 +++ server.xml 31 May 2006 05:32:42 -0000 1.2 @@ -3,6 +3,7 @@ <Service name="Catalina" debug="0"> <Connector className="org.apache.coyote.tomcat5.CoyoteConnector" + URIEncoding="UTF-8" port="@@@HTTPPORT@@@" minProcessors="5" maxProcessors="100" enableLookups="true" redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000" @@ -11,6 +12,7 @@ <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 --> <!-- <Connector className="org.apache.coyote.tomcat5.CoyoteConnector" + URIEncoding="UTF-8" port="@@@HTTPSPORT@@@" minProcessors="5" maxProcessors="75" enableLookups="true" disableUploadTimeout="true" acceptCount="100" debug="0" scheme="https" secure="true"> |
|
From: Philipp H. <p-...@us...> - 2006-05-30 14:48:22
|
Update of /cvsroot/cobricks/cobricks2/web/discussion In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26797/web/discussion Modified Files: index.html Added Files: tree.html category.html forum.html topic.html Log Message: discussion modul without input forms --- NEW FILE: topic.html --- ## redirect if catId or forumId is missing #if(!$topicId) <head> <meta http-equiv="refresh" content="0; URL=$contextPath/discussion/index.html"> <link rel="stylesheet" type="text/css" href="$contextPath/style.css"> <link rel="shortcut icon" href="http://www.cobricks.de/c2.png" type="image/png"> </head> <body bgcolor="#ffffff" topmargin="1" leftmargin="3" marginwidth="3" marginheight="1"> Redirekt to Main Diskussion Page because topicId is missing. </body> #end #if (!$count) #set ( $count = $coreManager.getProperty("org.cobricks.discussion.settings.display_count") ) #end #if (!$postingId) #set ($postingId = "-1") #end #if (!$view) #set ($view = $discussionPresenter.getViewFromRequest($portalRequest) ) #end #if (!$index) #set ($index = "-1") #end #set ( $topic = $itemPresenter.getItem($topicId)) #set ( $forumId = $topic.getAttribute("parent_cat")) #set ( $forum = $categoryPresenter.getCategory($forumId)) #set ( $cat = $categoryPresenter.getCategory("$forum.getParentId()")) #set ( $forum_type = $forum.getAttribute("forumtype")) #if ( $forum_type == "Forum" && $view == "tree" ) #set ( $count = 1 ) #end #set ( $posting_list = $discussionPresenter.getPostings("$topicId", "$forum_type", "$view", "$postingId", "$index","$count", true)) #parse ( "pageheader.html" ) <em><a href="index.html">$coreManager.getProperty("org.cobricks.discussion.settings.forum_headline")</a> - <a href="category.html?catId=$cat.getLocalId()">$cat.getTitle()</a> - <a href="forum.html?forumId=$forum.getLocalId()">$forum.getTitle()</a> - $topic.getTitle()</em> <!-- [debug] forumtype=$forum.getAttribute("forumtype") --> #if($returnCode == 1010) <div class="success">New view is set.</div><br/> #elseif($returnCode == 2010) <div class="error">Failed setting new view.</div> #end #if ( $forum_type == "Forum" && $view != "list") <iframe src="tree.html?topicId=$topicId" width="100%" height="150"> </iframe> #end <h1>$topic.getTitle()</h1> #foreach ( $posting in $posting_list) #set ( $creator = $userManager.getUser($posting.getAttribute("creator"))) <!-- $posting.getIndent() --> #set ($indent = $posting.getIndent()*20) <table style="text-align: left; width: 627px; margin-left: ${indent}px;" border="0" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="background-color: rgb(115, 185, 207);"> $posting.getTitle() </td> </tr> <tr> <td style="width: 613px;"> $posting.getContent() <div style="text-align:right;"> ($posting.getAttribute("creationtime")) <a href="$contextPath/user/card.html?auserlogin=$creator.getUserLogin()">$creator.getUserLogin()</a> </div> </td> </tr> </tbody> </table> #end <!-- userId=$userId portalUser=$portalUser userLogin=$userLogin user_change_view=$coreManager.getProperty("org.cobricks.discussion.settings.user_change_view") view=$view --> #if ( $forum_type == "Forum" && $coreManager.getProperty("org.cobricks.discussion.settings.user_change_view") == "true" ) <form action="/DISCUSSION" method="post"> <input type="hidden" name="cmd" value="saveView"/> <input type="hidden" name="cmd.success" value="$contextPath/discussion/topic.html"/> <input type="hidden" name="cmd.error" value="$contextPath/discussion/topic.html"/> <input type="hidden" name="topicId" value="$topic.getLocalId()"/> Change view: <select name="view" size="1"> <option value="list"#if($view=="list") selected="selected"#end>Chronological view</option> <option value="tree"#if($view=="tree") selected="selected"#end>Tree view</option> <option value="hybrid"#if($view=="hybrid") selected="selected"#end>Hybrid view</option> </select> <input type="submit" value=" Change "> </form> #end #parse ( "pagefooter.html" ) --- NEW FILE: category.html --- #parse ( "pageheader.html" ) #set ( $cat = $categoryPresenter.getCategory("$catId")) <em><a href="index.html">$coreManager.getProperty("org.cobricks.discussion.settings.forum_headline")</a> - $cat.getTitle()</em> <h1>$cat.getTitle()</h1> #if($cat.getAttribute("description_$portalRequest.getLang()") != "") <p>$cat.getAttribute("description_$portalRequest.getLang()")</p> #end #set($sub_cat_list = $discussionPresenter.getCategories("$cat.getLocalId()")) #foreach($sub_cat in $sub_cat_list) <a href="category.html?catId=$sub_cat.getLocalId()">$sub_cat.getTitle()</a> #end #if ($coreManager.getProperty("org.cobricks.discussion.settings.start_with_forums") == "true") <table style="text-align: left; width: 627px;" border="0" cellpadding="2" cellspacing="2"> <tbody> #foreach ( $forum in $discussionPresenter.getForums("$cat.getLocalId()")) <tr> <td style="background-color: rgb(115, 185, 207); width: 613px;"><a href="forum.html?forumId=$forum.getLocalId()">$forum.getTitle()</a></td> </tr> <tr> <td style="width: 613px;">$!forum.getAttribute("description_$portalRequest.getLang()")</td> </tr> #end </tbody> </table> #end #parse ( "pagefooter.html" ) --- NEW FILE: forum.html --- ## redirect if forumId is missing #if(!$forumId) <head> <meta http-equiv="refresh" content="0; URL=$contextPath/discussion/index.html"> <link rel="stylesheet" type="text/css" href="$contextPath/style.css"> <link rel="shortcut icon" href="http://www.cobricks.de/c2.png" type="image/png"> </head> <body bgcolor="#ffffff" topmargin="1" leftmargin="3" marginwidth="3" marginheight="1"> Redirekt to Main Diskussion Page because forumId is missing. </body> #end #set ( $forum = $categoryPresenter.getCategory("$forumId")) ## redirect if forumtype equals Weblog or Guestbook #if($forum.getAttribute("forumtype") == "Weblog" || $forum.getAttribute("forumtype") == "Guestbook") #set ($topic = $discussionPresenter.getSingleTopic("$forum.getLocalId()")) #if($topic) <head> <meta http-equiv="refresh" content="0; URL=$contextPath/discussion/topic.html?topicId=$topic.getLocalId()"> <link rel="stylesheet" type="text/css" href="$contextPath/style.css"> <link rel="shortcut icon" href="http://www.cobricks.de/c2.png" type="image/png"> </head> <body bgcolor="#ffffff" topmargin="1" leftmargin="3" marginwidth="3" marginheight="1"> Redirekt to Topic Page because Type is Weblog or Guestbook. </body> #end #end #set ( $cat = $categoryPresenter.getCategory("$forum.getParentId()")) #parse ( "pageheader.html" ) <em><a href="index.html">$coreManager.getProperty("org.cobricks.discussion.settings.forum_headline")</a> - <a href="category.html?catId=$cat.getLocalId()">$cat.getTitle()</a> - $forum.getTitle()</em> <!-- [debug] forumtype=$forum.getAttribute("forumtype") --> <h1>$forum.getTitle()</h1> <table style="text-align: left; width: 627px;" border="0" cellpadding="2" cellspacing="2"> <tbody> #foreach ( $topic in $itemManager.searchItems("/item/parent_cat[category=$forum.getLocalId()]")) ## <li>$topic.getTitle("de")<br/></li> #set ( $creator = $userManager.getUser($topic.getAttribute("creator"))) <tr> <td style="background-color: rgb(115, 185, 207); width: 613px;"><a href="topic.html?topicId=$topic.getLocalId()">$topic.getTitle()</a></td> </tr> <tr> <td style="width: 613px;"> ($topic.getAttribute("creationtime")) <a href="$contextPath/user/card.html?auserlogin=$creator.getUserLogin()">$creator.getUserLogin()</a> </td> </tr> #end </tbody> </table> #parse ( "pagefooter.html" ) Index: index.html =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/discussion/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.html 2 May 2006 12:09:49 -0000 1.2 +++ index.html 30 May 2006 14:48:06 -0000 1.3 @@ -1,8 +1,12 @@ #parse ( "pageheader.html" ) -<em><a href="index.html.en">Discussion Component</a></em> +<em>$coreManager.getProperty("org.cobricks.discussion.settings.forum_headline")</em> -<h1>Cobricks2 - Discussion Component (Under development)</h1> +<h1>$coreManager.getProperty("org.cobricks.discussion.settings.forum_headline")</h1> +#if($coreManager.getProperty("org.cobricks.discussion.settings.forum_descr") != "") +$coreManager.getProperty("org.cobricks.discussion.settings.forum_descr") +#end +#set( $hasAccess = true ) ## tbd #if (!$discussionManager) <h2>Couldn't find Discussion Component</h2> @@ -16,16 +20,39 @@ Please make sure, that every part of the component has been loaded without errors. </p> +#elseif ($coreManager.getProperty("org.cobricks.discussion.settings.offline") == "true") + You have to be logged in to view the discussion component. +#elseif (!$hasAccess) + You have to be logged in to view the discussion component. #else + #set($cat_list = $discussionPresenter.getCategories("")) + #foreach( $cat in $cat_list ) + + +<h3><a href="category.html?catId=$cat.getLocalId()">$cat.getTitle()</a></h3> + <p>$!cat.getAttribute("description_$portalRequest.getLang()")</p> + #set($sub_cat_list = $discussionPresenter.getCategories("$cat.getLocalId()")) + #foreach($sub_cat in $sub_cat_list) + <a href="category.html?catId=$sub_cat.getLocalId()">$sub_cat.getTitle()</a> + #end - <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 - +#if ($coreManager.getProperty("org.cobricks.discussion.settings.start_with_forums") == "true") +<table style="text-align: left; width: 627px;" border="0" + cellpadding="2" cellspacing="2"> + <tbody> + #foreach ( $forum in $discussionPresenter.getForums("$cat.getLocalId()")) + <tr> + <td style="background-color: rgb(115, 185, 207); width: 613px;"><a + href="forum.html?forumId=$forum.getLocalId()">$forum.getTitle()</a></td> + </tr> + <tr> + <td style="width: 613px;">$!forum.getAttribute("description_$portalRequest.getLang()")</td> + </tr> + #end + </tbody> +</table> +#end +#end #end #parse ( "pagefooter.html" ) --- NEW FILE: tree.html --- <html> <head> <meta http-equiv="Content-Type" content="text/html"> <meta name="Author" content="mic...@co..."> $portalPresenter.printHeader($portalRequest) <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> <meta http-equiv="expires" content="0"> <META NAME="GOOGLEBOT" CONTENT="NOARCHIVE"> <META NAME="ROBOTS" CONTENT="NONE"> <link rel="stylesheet" type="text/css" href="$contextPath/style.css"> <link rel="shortcut icon" href="http://www.cobricks.de/c2.png" type="image/png"> </head> <body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"> #if (!$count) #set ( $count = $coreManager.getProperty("org.cobricks.discussion.settings.display_count") ) #end #if (!$view) #set ($view = $discussionPresenter.getViewFromRequest($portalRequest) ) #end #if (!$index) #set ($index = "-1") #end #set ( $topic = $itemPresenter.getItem($topicId)) ##set ( $forumId = $topic.getAttribute("parent_cat")) ##set ( $forum = $categoryPresenter.getCategory($forumId)) ##set ( $cat = $categoryPresenter.getCategory("$forum.getParentId()")) #set ( $posting_list = $discussionPresenter.getPostings("$topicId", "Forum", "$view", "-1", "-1","-1", false)) #foreach ( $posting in $posting_list) #set ( $creator = $userManager.getUser($posting.getAttribute("creator"))) <!-- $posting.getIndent() --> #set ($indent = $posting.getIndent()*20) <table style="text-align: left; width: 627px; margin-left: ${indent}px;" border="0" cellpadding="2" cellspacing="2"> <tbody> <tr> <td#if ($posting.isMarked()) style="font-weight:bold"#end> <a href="topic.html?topicId=$topicId&postingId=$posting.getLocalId()" target="_top">$posting.getTitle(), $creator.getUserLogin() ($posting.getAttribute("creationtime"))</a> </td> </tr> </tbody> </table> #end </body> </html> |
|
From: Philipp H. <p-...@us...> - 2006-05-30 14:48:16
|
Update of /cvsroot/cobricks/cobricks2/web/ADMIN/org.cobricks.discussion In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26797/web/ADMIN/org.cobricks.discussion Modified Files: index.html Log Message: discussion modul without input forms Index: index.html =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/ADMIN/org.cobricks.discussion/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- index.html 2 Mar 2006 21:24:43 -0000 1.1 +++ index.html 30 May 2006 14:48:06 -0000 1.2 @@ -1,14 +1,34 @@ +#parse ( "adminpageheader.html" ) -#parse ( "/ADMIN/pageheader.html" ) +#if ($returnCode == 1005) + <p><div class="success">Item annotation added.</div></p> +#elseif ($returnCode == 1006) + <p><div class="success">Item annotation removed.</div></p> +#elseif ($returnCode == 1007) + <p><div class="success">Item attachment added.</div></p> -<em><a href="/ADMIN/index.html">Admin</a> - -<a href="/ADMIN/org.cobricks.discussion/index.html">Discussion Component</a></em> +#end + +<em><a href="$contextPath/ADMIN/index.html">Admin</a> - +<a href="$contextPath/ADMIN/org.cobricks.discussion/index.html">Discussion Component</a></em> <h1>Discussion Component</h1> <h3>Version: $discussionManager.getComponentVersion()</h3> +<h3>Properties</h3> +<form action="/DISCUSSION" method="post"> +<input type="hidden" name="cmd" value="saveProperties"/> +<input type="hidden" name="cmd.success" value="/ADMIN/discussion/index.html"/> +<input type="hidden" name="cmd.error" value="/ADMIN/discussion/index.html"/> +<input type="hidden" name="cmd.noaccess" value="/noaccess.html"/> +<table> +#foreach ($table_line in $discussionPresenter.getAdminPropertiesForm()) + $table_line +#end +</table> +</form> -#parse ( "/ADMIN/pagefooter.html" ) +#parse ( "adminpagefooter.html" ) |
|
From: Philipp H. <p-...@us...> - 2006-05-30 14:48:15
|
Update of /cvsroot/cobricks/cobricks2/web/WEB-INF In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26797/web/WEB-INF Modified Files: web.xml Log Message: discussion modul without input forms Index: web.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/WEB-INF/web.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- web.xml 10 Feb 2006 11:33:21 -0000 1.13 +++ web.xml 30 May 2006 14:48:06 -0000 1.14 @@ -63,7 +63,11 @@ <servlet-name>VotingServlet</servlet-name> <servlet-class>org.cobricks.voting.VotingServlet</servlet-class> </servlet> - + + <servlet> + <servlet-name>DiscussionServlet</servlet-name> + <servlet-class>org.cobricks.discussion.DiscussionServlet</servlet-class> + </servlet> <servlet-mapping> <servlet-name>PortalServlet</servlet-name> @@ -151,6 +155,11 @@ <servlet-name>VotingServlet</servlet-name> <url-pattern>/VOTING</url-pattern> </servlet-mapping> + + <servlet-mapping> + <servlet-name>DiscussionServlet</servlet-name> + <url-pattern>/DISCUSSION</url-pattern> + </servlet-mapping> <session-config> |
|
From: Philipp H. <p-...@us...> - 2006-05-30 14:48:15
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26797/src/org/cobricks/discussion Modified Files: DiscussionManager.java DiscussionServlet.java itemontology.xml properties.txt DiscussionPresenter.java DiscussionManagerImpl.java Added Files: ChronologicalPostingComparator.java Posting.java TreePostingComparator.java DiscussionCategory.java OrderComparator.java Log Message: discussion modul without input forms --- NEW FILE: DiscussionCategory.java --- package org.cobricks.discussion; import org.cobricks.category.Category; public class DiscussionCategory extends Category { public DiscussionCategory() { super(); // TODO Auto-generated constructor stub } } Index: itemontology.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/itemontology.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- itemontology.xml 2 May 2006 11:56:31 -0000 1.3 +++ itemontology.xml 30 May 2006 14:48:06 -0000 1.4 @@ -1,30 +1,17 @@ <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="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" /> +<attr name="parent_cat" type="category(discussion_forum)" /> </class> <class name="discussion_posting" parent="item"> <description lang="de">Beitrag</description> <description lang="en">Posting</description> -<attr name="topicid" type="item" /> -<attr name="children" type="posting[]" /> -<attr name="parent" type="posting" /> - - - +<attr name="topicId" type="item(discussion_topic)" /> +<attr name="parent" type="item(discussion_posting)" /> +<attr name="ip" type="string" /> +<attr name="email" type="string" /> </class> </itemontology> --- NEW FILE: TreePostingComparator.java --- package org.cobricks.discussion; import java.sql.Timestamp; import java.util.Comparator; /** * Used to sort Lists of Postings. * @author Philipp Hemmer * */ public class TreePostingComparator implements Comparator { private boolean news_on_top = false; public TreePostingComparator() { super(); } public TreePostingComparator(boolean news_on_top) { super(); this.news_on_top = news_on_top; } public int compare(Object o1, Object o2) { int return_val = 0; if (o1 instanceof Posting && o2 instanceof Posting) { Posting p1 = (Posting) o1; Posting p2 = (Posting) o2; if(news_on_top){ Timestamp[] time_arr1 = p1.getNews_on_top_sorting_array(); Timestamp[] time_arr2 = p2.getNews_on_top_sorting_array(); int result = 0; for (int i = 0; i < time_arr1.length; i++) { if(i == time_arr2.length){ return 1; // first Array is longer } result = time_arr1[i].compareTo(time_arr2[i]); if(result != 0){ return result; } } return -1; // second Array is longer }else{ Timestamp[] time_arr1 = p1.getSorting_array(); Timestamp[] time_arr2 = p2.getSorting_array(); int result = 0; for (int i = 0; i < time_arr1.length; i++) { if(i == time_arr2.length){ return 1; // first Array is longer } result = time_arr1[i].compareTo(time_arr2[i]); if(result != 0){ return result * -1; } } return -1; // second Array is longer } } return return_val; } } --- NEW FILE: ChronologicalPostingComparator.java --- package org.cobricks.discussion; import java.sql.Date; import java.sql.Timestamp; import java.util.Comparator; import org.apache.log4j.Logger; import org.cobricks.item.Item; public class ChronologicalPostingComparator implements Comparator { private static Logger logger = Logger.getLogger(ChronologicalPostingComparator.class); private boolean reverse = false; public ChronologicalPostingComparator() { super(); } public ChronologicalPostingComparator(boolean reverse) { super(); this.reverse = reverse; } public int compare(Object o1, Object o2) { int return_val = 0; if (o1 instanceof Item && o2 instanceof Item) { Item i1 = (Item) o1; Item i2 = (Item) o2; Object dateObj1 = i1.getAttribute("creationtime"); Object dateObj2 = i2.getAttribute("creationtime"); if(dateObj1 instanceof Timestamp && dateObj2 instanceof Timestamp && dateObj1 != null && dateObj2 != null){ return_val = ((Timestamp)dateObj1).compareTo((Timestamp)dateObj2); } } if(reverse){ return_val *= -1; } return return_val; } } --- NEW FILE: OrderComparator.java --- package org.cobricks.discussion; import java.util.Comparator; import org.apache.log4j.Logger; import org.cobricks.category.Category; public class OrderComparator implements Comparator { private static Logger logger = Logger.getLogger(OrderComparator.class); public int compare(Object o1, Object o2) { // the not null value comes first than the null value if (o1 == null) { if (o2 == null) { return 0; } else { return 1; } } else if (o2 == null) { return -1; } // the object from type Category come first than the other objects if (o1 instanceof Category) { if (o2 instanceof Category) { int i1 = 0; int i2 = 0; Object order1 =((Category) o1).getAttribute("order"); Object order2 =((Category) o2).getAttribute("order"); // if one of the Categories has no order it comes last if (order1 == null) { if (order2 == null) { return 0; } else { return 1; } } else if (order2 == null) { return -1; } if (order1 instanceof String) { i1 = Integer.parseInt((String) order1); }else if(order1 instanceof Integer){ i1 = ((Integer)order1).intValue(); } if (order2 instanceof String) { i2 = Integer.parseInt((String) order2); }else if(order2 instanceof Integer){ i2 = ((Integer)order2).intValue(); } return i1 - i2; }else { return -1; } }else if (o2 instanceof Category) { return 1; } return 0; } } Index: properties.txt =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/properties.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- properties.txt 6 Apr 2006 16:25:53 -0000 1.2 +++ properties.txt 30 May 2006 14:48:06 -0000 1.3 @@ -20,14 +20,68 @@ discussion.presenter.timestyle=short discussion.languages=en,de -#item.display.template.details.posting=/discussion/itemtemplate-posting.html +#item.display.template.details.discussion_topic=/discussion/itemtemplate-topic.html +#item.display.template.details.discussion_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.forum_headline=Discussion Component +org.cobricks.discussion.settings.forum_headline.descr=the headline shown on the webpage -# org.cobricks.discussion.settings.test=value -# (description) \ No newline at end of file +org.cobricks.discussion.settings.forum_descr=Support of Discussion, FAQ, Weblog and Guestbook functionality +org.cobricks.discussion.settings.forum_descr.descr=the headline shown on the webpage + +org.cobricks.discussion.settings.offline=false +org.cobricks.discussion.settings.offline.descr=true: nobody can enter the discussion component<br/>false: the component is online +org.cobricks.discussion.settings.offline.choice1=true +org.cobricks.discussion.settings.offline.choice2=false + +org.cobricks.discussion.settings.start_with_forums=true +org.cobricks.discussion.settings.start_with_forums.descr=true: startpage shows categories with its forums and subcategories<br/>false: startpage shows only list of categories +org.cobricks.discussion.settings.start_with_forums.choice1=true +org.cobricks.discussion.settings.start_with_forums.choice2=false + +org.cobricks.discussion.settings.display_count=15 +org.cobricks.discussion.settings.display_count.descr=how much forums and topics on one page + +org.cobricks.discussion.settings.guestbook_with_form=true +org.cobricks.discussion.settings.guestbook_with_form.descr=if entry form ist displayed in the guestbook view or on new page +org.cobricks.discussion.settings.guestbook_with_form.choice1=true +org.cobricks.discussion.settings.guestbook_with_forme.choice2=false + +org.cobricks.discussion.settings.weblog_with_form=true +org.cobricks.discussion.settings.weblog_with_form.descr=if entry form ist displayed in the weblog view or on new page<br/>only for users who can create entry +org.cobricks.discussion.settings.weblog_with_form.choice1=true +org.cobricks.discussion.settings.weblog_with_form.choice2=false + +org.cobricks.discussion.settings.forum_view=list +org.cobricks.discussion.settings.forum_view.descr=how the forum is initialy displayed +org.cobricks.discussion.settings.forum_view.choice1=tree +org.cobricks.discussion.settings.forum_view.choice2=list +org.cobricks.discussion.settings.forum_view.choice3=hybrid + +org.cobricks.discussion.settings.tree_sorting=chronologic +org.cobricks.discussion.settings.tree_sorting.descr=how the tree view is sorted<br/>chronologic: first the old then the new topics<br/>news_on_top: in every level of the tree the newes topic is on top +org.cobricks.discussion.settings.tree_sorting.choice1=chronologic +org.cobricks.discussion.settings.tree_sorting.choice2=news_on_top + +org.cobricks.discussion.settings.user_change_view=true +org.cobricks.discussion.settings.user_change_view.descr=if user can change the view +org.cobricks.discussion.settings.user_change_view.choice1=true +org.cobricks.discussion.settings.user_change_view.choice2=false + +org.cobricks.discussion.settings.text_input=text +org.cobricks.discussion.settings.text_input.descr=how the user can enter the entries (bbcode not supportet yet) +org.cobricks.discussion.settings.text_input.choice1=text +org.cobricks.discussion.settings.text_input.choice2=html +#org.cobricks.discussion.settings.text_input.choice3=bbcode(not yet) + +org.cobricks.discussion.settings.faq_show_incomplete=marked +org.cobricks.discussion.settings.faq_show_incomplete.descr=if incomplete FAQ entries are marked as such or hidden +org.cobricks.discussion.settings.faq_show_incomplete.choice1=marked +org.cobricks.discussion.settings.faq_show_incomplete.choice2=hidden + +org.cobricks.discussion.settings.hybrid_indent=20 +org.cobricks.discussion.settings.hybrid_indent.descr=the number of pixels the postings are indented in hybrid view --- NEW FILE: Posting.java --- package org.cobricks.discussion; import java.sql.Timestamp; import org.cobricks.item.Item; public class Posting { private Item item = null; private int indent = 0; private boolean marked = false; /** * used for sorting the tree chronological */ private Timestamp[] sorting_array = null; /** * used for sorting the tree news on top */ private Timestamp[] news_on_top_sorting_array = null; public Posting(Item item) { this.item = item; } public Posting(Item item, int indent) { this(item); this.indent = indent; } public String getTitle() { return item.getTitle(); } public Object getAttribute(String aname) { return item.getAttribute(aname); } public String getContent() { return item.getContent(); } public String getContent(String lang) { return item.getContent(lang); } public int getIndent() { return indent; } public void setIndent(int indent) { this.indent = indent; } public Timestamp[] getSorting_array() { return sorting_array; } public void setSorting_array(Timestamp[] sorting_array) { this.sorting_array = sorting_array; } public Timestamp[] getNews_on_top_sorting_array() { return news_on_top_sorting_array; } public void setNews_on_top_sorting_array(Timestamp[] news_on_top_sorting_array) { this.news_on_top_sorting_array = news_on_top_sorting_array; } public int getLocalId() { return item.getLocalId(); } public boolean isMarked() { return marked; } public void setMarked(boolean marked) { this.marked = marked; } } Index: DiscussionManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/DiscussionManagerImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DiscussionManagerImpl.java 6 Apr 2006 16:25:53 -0000 1.2 +++ DiscussionManagerImpl.java 30 May 2006 14:48:06 -0000 1.3 @@ -1,5 +1,10 @@ package org.cobricks.discussion; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -8,6 +13,7 @@ import org.apache.log4j.Logger; import org.cobricks.category.Category; import org.cobricks.category.CategoryManager; +import org.cobricks.core.CobricksException; import org.cobricks.core.ComponentManagerAdaptor; import org.cobricks.core.CoreManager; import org.cobricks.core.Ontology; @@ -15,6 +21,11 @@ import org.cobricks.core.db.DBAccess; import org.cobricks.item.Item; import org.cobricks.item.ItemManager; +import org.cobricks.user.AccessControl; +import org.cobricks.user.AccessHandler; +import org.cobricks.user.User; +import org.cobricks.user.UserAccessHandler; +import org.cobricks.user.UserManager; public class DiscussionManagerImpl extends ComponentManagerAdaptor implements DiscussionManager @@ -45,6 +56,10 @@ private Ontology itemOntology; + private AccessControl accessControl; + + private UserManager userManager; + // public DiscussionManagerImpl(String componentId, // String managerId, // Properties p, @@ -77,12 +92,13 @@ 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"); + this.userManager = (UserManager) componentDirectory + .getManager("userManager"); categoryOntology = coreManager.getOntology("category"); itemOntology = coreManager.getOntology("item"); @@ -97,96 +113,725 @@ managerList += ", "; } } - logger.info("PAH_ " + managerList); - logger.info("PAH_ " + "init(...) end"); - // + + // and finally initialize all other modules of the user manager + accessControl = new AccessControl((UserManager) componentDirectory + .getManager("userManager"), dbAccess); + AccessHandler accesshandler = null; + accesshandler = new UserAccessHandler(); + accesshandler.init(coreManager, dbAccess); + accessControl.registerAccessHandler(accesshandler); + + //if no discussion data is present create default discussion_categorie, forum, topic and postings + Map attrs = new HashMap(); + attrs.put("categoryclass", "discussion_category"); + List cats = categoryManager.searchCategories(attrs); + //everything in the component is unter the categories, if there are no categories + //there are no valid other data from the discussion component + if(cats.size() == 0){ + logger.debug("no discussion data is present, fill will default data"); + insertDefaultData(); + } + logger.info("discussionManager initialized"); } - public Category createCategory(Map attrs) + private void insertDefaultData() { + GregorianCalendar cal = new GregorianCalendar(1979, 4, 12, 12, 00); + // default category + Map attrs = new HashMap(); + User admin = userManager.getUser(userManager.getUserIdForUserLogin("admin")); + logger.debug("admin for inserting default data ="+admin); + + attrs.put("categoryclass", "discussion_category"); + attrs.put("title_de", "Beispielkategorie"); + attrs.put("title_en", "Example category"); + attrs.put("visible", new Boolean(true)); - // 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", ""); + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("open", new Boolean(true)); +// attrs.put("members", ); +// attrs.put("managers", ); + attrs.put("description_de", ""); + attrs.put("description_en", ""); + attrs.put("type", new Integer(0)); + attrs.put("order", new Integer(10)); + + Category category = categoryManager.createCategory(attrs, admin); + + + //first forum of type "Forum" + attrs = new HashMap(); + + attrs.put("categoryclass", "discussion_forum"); + attrs.put("title_de", "Das erste Forum"); + attrs.put("title_en", "The first forum"); + attrs.put("visible", new Boolean(true)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("parent", new Integer(category.getLocalId())); + attrs.put("open", new Boolean(true)); +// attrs.put("members", ); +// attrs.put("managers", ); + attrs.put("description_de", "Beispielforum mit Beispieleinträgen"); + attrs.put("description_en", "Example forum with example postings"); + attrs.put("type", new Integer(0)); + attrs.put("order", new Integer(10)); + attrs.put("forumtype", "Forum"); + + Category forum = categoryManager.createCategory(attrs, admin); + + //first forum of type "FAQ" + attrs = new HashMap(); + + attrs.put("categoryclass", "discussion_forum"); + attrs.put("title_de", "Häufig gestellte Fragen (FAQ)"); + attrs.put("title_en", "Frequently Asked Questions (FAQ)"); + attrs.put("visible", new Boolean(true)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("parent", new Integer(category.getLocalId())); + attrs.put("open", new Boolean(true)); +// attrs.put("members", ); +// attrs.put("managers", ); + attrs.put("description_de", "Zuerst hier schauen!"); + attrs.put("description_en", "First look here!"); + attrs.put("type", new Integer(0)); + attrs.put("order", new Integer(10)); + attrs.put("forumtype", "FAQ"); + + Category faq = categoryManager.createCategory(attrs, admin); + + //first forum of type "Weblog" + attrs = new HashMap(); + + attrs.put("categoryclass", "discussion_forum"); + attrs.put("title_de", "Informationen als Weblog"); + attrs.put("title_en", "Information weblog"); + attrs.put("visible", new Boolean(true)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("parent", new Integer(category.getLocalId())); + attrs.put("open", new Boolean(true)); +// attrs.put("members", ); +// attrs.put("managers", ); + attrs.put("description_de", "Offizielles Weblog"); + attrs.put("description_en", "Official Weblog"); + attrs.put("type", new Integer(0)); + attrs.put("order", new Integer(10)); + attrs.put("forumtype", "Weblog"); + + Category weblog = categoryManager.createCategory(attrs, admin); + + //first forum of type "Guestbook" + attrs = new HashMap(); + + attrs.put("categoryclass", "discussion_forum"); + attrs.put("title_de", "Gästebuch"); + attrs.put("title_en", "Guestbook"); + attrs.put("visible", new Boolean(true)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("parent", new Integer(category.getLocalId())); + attrs.put("open", new Boolean(true)); +// attrs.put("members", ); +// attrs.put("managers", ); + attrs.put("description_de", "Meinungen zur Homepage"); + attrs.put("description_en", "Opinions from visitors"); + attrs.put("type", new Integer(0)); + attrs.put("order", new Integer(10)); + attrs.put("forumtype", "Guestbook"); + + Category guestbook = categoryManager.createCategory(attrs, admin); + + + //topic for "Forum" + Item topic = null; + if(forum != null){ + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_topic"); + attrs.put("title_de", "Ein schönes Thema"); + attrs.put("title_en", "A nice topic"); + attrs.put("content_de", "Beispielforum mit Beispieleinträgen"); + attrs.put("content_en", "Example forum with example postings"); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("parent_cat", new Integer(forum.getLocalId())); + + try + { + topic = itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default topic for forum"); + } } - if (attrs.get("title") == null) - { - attrs.put("title", ((String) attrs.get("long_title")).substring( - 0, 10)); + //postings for "Forum" topic + Item first_posting = null; + Item second_posting = null; + Item third_posting = null; + if(topic != null){ + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Erste Antwort"); + attrs.put("title_en", "First answer"); + attrs.put("content_de", "Lorem ipsum quo ut inani feugait scaevola, vis possim inermis definitionem te. Te per regione persius. Inani summo democritum usu ex, at vocent periculis vis, nam eu nihil delectus. Cu porro alterum facilisis pro, no vim tibique voluptaria."); + attrs.put("content_en", "Lorem ipsum quo ut inani feugait scaevola, vis possim inermis definitionem te. Te per regione persius. Inani summo democritum usu ex, at vocent periculis vis, nam eu nihil delectus. Cu porro alterum facilisis pro, no vim tibique voluptaria."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(topic.getLocalId())); +// attrs.put("parent", new Integer(forum.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); + + try + { + first_posting = itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default first answer for forum"); + } + + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Zweite Antwort"); + attrs.put("title_en", "Second answer"); + attrs.put("content_de", "Lorem ipsum tota lobortis ut quo, duo rebum modus quidam cu. Sea eu apeirian evertitur. Vim melius audiam detraxit ex, ut debet noluisse vulputate vix, natum paulo tibique usu te. Te augue vivendo mel. Eu mel reque solet sapientem, ne natum facer assum sit."); + attrs.put("content_en", "Lorem ipsum tota lobortis ut quo, duo rebum modus quidam cu. Sea eu apeirian evertitur. Vim melius audiam detraxit ex, ut debet noluisse vulputate vix, natum paulo tibique usu te. Te augue vivendo mel. Eu mel reque solet sapientem, ne natum facer assum sit."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(topic.getLocalId())); +// attrs.put("parent", new Integer(forum.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); + + try + { + second_posting = itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default second answer for forum"); + } + + + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Dritte Antwort"); + attrs.put("title_en", "Third answer"); + attrs.put("content_de", "Lorem ipsum ex nec utinam ornatus copiosae, elitr definitiones vis eu. Ut animal fabellas inciderint cum. Ea facer doming scribentur vis. Unum nostro vocibus duo ne, id usu verterem splendide, quo ex dicta deleniti."); + attrs.put("content_en", "Lorem ipsum ex nec utinam ornatus copiosae, elitr definitiones vis eu. Ut animal fabellas inciderint cum. Ea facer doming scribentur vis. Unum nostro vocibus duo ne, id usu verterem splendide, quo ex dicta deleniti."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(topic.getLocalId())); +// attrs.put("parent", new Integer(forum.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); + + try + { + third_posting = itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } } - // 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"); + + if(first_posting != null){ + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Antwort auf erste Antwort"); + attrs.put("title_en", "Answer to first answer"); + attrs.put("content_de", "Lorem ipsum per quidam laboramus tincidunt id, in nec quod probo aperiam. Malorum sensibus duo ei, harum nihil necessitatibus mei et. Quando epicurei et mea, eam probo incorrupte eu. Est mutat erroribus appellantur ut, zzril iuvaret voluptatum in vel, ut duis mutat mel. Id clita decore maiestatis eam, vix bonorum mentitum voluptatibus id, eu quo populo imperdiet adversarium."); + attrs.put("content_en", "Lorem ipsum per quidam laboramus tincidunt id, in nec quod probo aperiam. Malorum sensibus duo ei, harum nihil necessitatibus mei et. Quando epicurei et mea, eam probo incorrupte eu. Est mutat erroribus appellantur ut, zzril iuvaret voluptatum in vel, ut duis mutat mel. Id clita decore maiestatis eam, vix bonorum mentitum voluptatibus id, eu quo populo imperdiet adversarium."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(topic.getLocalId())); + attrs.put("parent", new Integer(first_posting.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); + + try + { + itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); } } - //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; + Item first_of_second_answer = null; + if(second_posting != null){ + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Antwort auf zweite Antwort"); + attrs.put("title_en", "Answer to second answer"); + attrs.put("content_de", "Lorem ipsum tollit platonem usu ei, ne sit nisl splendide ullamcorper. Vim et nisl inani apeirian, mea ne aeterno equidem comprehensam, ea sea mollis facilis quaerendum. Te vel nonumy blandit, no dolores referrentur quo. Pri putant labitur singulis at, ei mea nullam doming, vidisse virtute accommodare quo in. Mel id omnes quaeque petentium."); + attrs.put("content_en", "Lorem ipsum tollit platonem usu ei, ne sit nisl splendide ullamcorper. Vim et nisl inani apeirian, mea ne aeterno equidem comprehensam, ea sea mollis facilis quaerendum. Te vel nonumy blandit, no dolores referrentur quo. Pri putant labitur singulis at, ei mea nullam doming, vidisse virtute accommodare quo in. Mel id omnes quaeque petentium."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(topic.getLocalId())); + attrs.put("parent", new Integer(second_posting.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); + + try + { + first_of_second_answer = itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } + + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Zweite Antwort auf zweite Antwort"); + attrs.put("title_en", "Second answer to second answer"); + attrs.put("content_de", "Lorem ipsum labores minimum et mei. Ad disputationi vituperatoribus iudicabit usu. Qui cu quod fastidii delicata, in ubique iriure fastidii pro, his mucius audire conceptam cu. Eos quot illum paulo cu. Pri tibique neglegentur te. Et delectus probatus eos."); + attrs.put("content_en", "Lorem ipsum labores minimum et mei. Ad disputationi vituperatoribus iudicabit usu. Qui cu quod fastidii delicata, in ubique iriure fastidii pro, his mucius audire conceptam cu. Eos quot illum paulo cu. Pri tibique neglegentur te. Et delectus probatus eos."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(topic.getLocalId())); + attrs.put("parent", new Integer(second_posting.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); + + try + { + itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } } - return categoryManager.createCategory(attrs); - } + if(third_posting != null){ - public Category createForum(Map attrs) - { - // TODO Auto-generated method stub - return null; - } + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Antwort auf dritte Antwort"); + attrs.put("title_en", "Answer to third answer"); + attrs.put("content_de", "Lorem ipsum ex nec mollis nominati petentium, eu copiosae convenire sea. Vix no exerci mucius repudiare. Ex falli voluptua eum, vivendo tibique recteque in sit, ei mel admodum splendide intellegam. Eum labitur democritum ad, in has minimum facilisi. Ius eius laoreet tibique eu. Ludus sapientem adipiscing ut pri, nec qualisque theophrastus ut."); + attrs.put("content_en", "Lorem ipsum ex nec mollis nominati petentium, eu copiosae convenire sea. Vix no exerci mucius repudiare. Ex falli voluptua eum, vivendo tibique recteque in sit, ei mel admodum splendide intellegam. Eum labitur democritum ad, in has minimum facilisi. Ius eius laoreet tibique eu. Ludus sapientem adipiscing ut pri, nec qualisque theophrastus ut."); + attrs.put("state", new Integer(1)); - public Category createTopic(Map attrs) - { - // TODO Auto-generated method stub - return null; + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); - } + attrs.put("topicId", new Integer(topic.getLocalId())); + attrs.put("parent", new Integer(third_posting.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); - public Item createPosting(Map attrs) - { - // TODO Auto-generated method stub - return null; + try + { + itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } + } + + if(first_of_second_answer != null){ - } + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Antwort auf zweite Antwort der zweiten Antwort"); + attrs.put("title_en", "Answer to second answer from second answer"); + attrs.put("content_de", "Lorem ipsum vix te mundi tation consulatu, ipsum mucius quaestio est ex. Numquam tibique denique vel at, an wisi elitr putant vel, id qui vidisse eripuit. Id placerat vivendum detraxit sea. Ea solum utinam dolores pro, quis adipiscing ne vis, quas dolores persecuti duo ea. No eos ullum iuvaret platonem, affert imperdiet ne duo."); + attrs.put("content_en", "Lorem ipsum vix te mundi tation consulatu, ipsum mucius quaestio est ex. Numquam tibique denique vel at, an wisi elitr putant vel, id qui vidisse eripuit. Id placerat vivendum detraxit sea. Ea solum utinam dolores pro, quis adipiscing ne vis, quas dolores persecuti duo ea. No eos ullum iuvaret platonem, affert imperdiet ne duo."); + attrs.put("state", new Integer(1)); - public List getCategories() - { - // TODO Auto-generated method stub - return null; - } + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); - public List getForums() - { - // TODO Auto-generated method stub - return null; - } + attrs.put("topicId", new Integer(topic.getLocalId())); + attrs.put("parent", new Integer(first_of_second_answer.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); - public List getForums(int catid) - { - // TODO Auto-generated method stub - return null; - } + try + { + itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } + } + +// topics for "FAQ" + Item question1 = null; + Item question2 = null; + if(faq != null){ + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_topic"); + attrs.put("title_de", "Die erste Frage"); + attrs.put("title_en", "The first question"); + attrs.put("content_de", "Lorem ipsum in sint hendrerit philosophia eos. Vim utinam noster fabulas ad, vis illud instructior ex, pro ne verterem gubergren incorrupte. Mel adhuc dicat at. Exerci dolorum est cu, eum no corrumpit necessitatibus, fabellas facilisi sententiae mea ut. Sale fugit nobis ut his."); + attrs.put("content_en", "Lorem ipsum in sint hendrerit philosophia eos. Vim utinam noster fabulas ad, vis illud instructior ex, pro ne verterem gubergren incorrupte. Mel adhuc dicat at. Exerci dolorum est cu, eum no corrumpit necessitatibus, fabellas facilisi sententiae mea ut. Sale fugit nobis ut his."); + attrs.put("state", new Integer(1)); - public List getTopics(int catid) - { - // TODO Auto-generated method stub - return null; - } + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); - public List getPostings(int forumid) - { - // TODO Auto-generated method stub - return null; - } + attrs.put("parent_cat", new Integer(faq.getLocalId())); + + try + { + question1 = itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default topic for forum"); + } + + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_topic"); + attrs.put("title_de", "Die zweite Frage"); + attrs.put("title_en", "The second question"); + attrs.put("content_de", "Lorem ipsum te primis indoctum ullamcorper quo. Id voluptatum constituam quo. Nostrum maluisset mnesarchum per ne, aeterno mnesarchum necessitatibus ut duo. Homero partem sit at, cum ad labore tractatos, mazim pericula ex cum. Pro oratio apeirian splendide ex, facer aperiam fuisset cu mel. Sit nisl quaeque atomorum ne, eum decore tincidunt in, iudico deleniti sed cu."); + attrs.put("content_en", "Lorem ipsum te primis indoctum ullamcorper quo. Id voluptatum constituam quo. Nostrum maluisset mnesarchum per ne, aeterno mnesarchum necessitatibus ut duo. Homero partem sit at, cum ad labore tractatos, mazim pericula ex cum. Pro oratio apeirian splendide ex, facer aperiam fuisset cu mel. Sit nisl quaeque atomorum ne, eum decore tincidunt in, iudico deleniti sed cu."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("parent_cat", new Integer(faq.getLocalId())); + + try + { + question2 = itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default topic for forum"); + } + } + + if(question1 != null){ + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Antwort zur ersten Frage"); + attrs.put("title_en", "Answer to first question"); + attrs.put("content_de", "Lorem ipsum eu verterem postulant sea. Est verterem reformidans et. Ad duo utinam aliquip, vis eros perfecto at. Vis perfecto dissentiet ne, ut nam reque postea. Per aperiri posidonium te."); + attrs.put("content_en", "Lorem ipsum eu verterem postulant sea. Est verterem reformidans et. Ad duo utinam aliquip, vis eros perfecto at. Vis perfecto dissentiet ne, ut nam reque postea. Per aperiri posidonium te."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(question1.getLocalId())); +// attrs.put("parent", new Integer(question1.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); + + try + { + itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } + } + + if(question2 != null){ + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Antwort zur zweiten Frage"); + attrs.put("title_en", "Answer to second question"); + attrs.put("content_de", "Lorem ipsum id partem populo sea, iisque oblique ut per. No habeo comprehensam ius. Duo ut omnes atomorum, ea zzril recteque eam. Albucius moderatius ut vel, minimum suavitate eos ne, equidem meliore atomorum id qui. Constituto posidonium te est, sed dicunt sententiae at."); + attrs.put("content_en", "Lorem ipsum id partem populo sea, iisque oblique ut per. No habeo comprehensam ius. Duo ut omnes atomorum, ea zzril recteque eam. Albucius moderatius ut vel, minimum suavitate eos ne, equidem meliore atomorum id qui. Constituto posidonium te est, sed dicunt sententiae at."); + attrs.put("state", new Integer(1)); + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(question2.getLocalId())); +// attrs.put("parent", new Integer(question2.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); + + try + { + itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } + } + + Item weblog_topic = null; + if(weblog != null){ + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_topic"); + attrs.put("title_de", weblog.getAttribute("title_de")); + attrs.put("title_en", weblog.getAttribute("title_en")); + attrs.put("content_de", ""); + attrs.put("content_en", ""); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("parent_cat", new Integer(weblog.getLocalId())); + + try + { + weblog_topic = itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default topic for forum"); + } + } + + if(weblog_topic != null){ + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Weblogeintrag 1"); + attrs.put("title_en", "Weblog entry 1"); + attrs.put("content_de", "Lorem ipsum per ei minimum commune salutatus, offendit prodesset pro te. Erat tollit definiebas qui ad. Sanctus vivendo oporteat an vel. Sit ei iudico atomorum euripidis, ei his volumus scaevola. Saepe moderatius per ei, nusquam consulatu sea ne."); + attrs.put("content_en", "Lorem ipsum per ei minimum commune salutatus, offendit prodesset pro te. Erat tollit definiebas qui ad. Sanctus vivendo oporteat an vel. Sit ei iudico atomorum euripidis, ei his volumus scaevola. Saepe moderatius per ei, nusquam consulatu sea ne."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(weblog_topic.getLocalId())); +// attrs.put("parent", new Integer(question2.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); + + try + { + itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } + + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Weblogeintrag 2"); + attrs.put("title_en", "Weblog entry 2"); + attrs.put("content_de", "Lorem ipsum vix ad alii clita insolens, ei brute incorrupte deterruisset mei. Id sea adhuc fierent. Putent evertitur inciderint quo ea. At persius accusata electram sea, eum ad dicam detraxit disputando. Ad vim movet ceteros deterruisset."); + attrs.put("content_en", "Lorem ipsum vix ad alii clita insolens, ei brute incorrupte deterruisset mei. Id sea adhuc fierent. Putent evertitur inciderint quo ea. At persius accusata electram sea, eum ad dicam detraxit disputando. Ad vim movet ceteros deterruisset."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(weblog_topic.getLocalId())); +// attrs.put("parent", new Integer(question2.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); + + try + { + itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } + + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Weblogeintrag 3"); + attrs.put("title_en", "Weblog entry 3"); + attrs.put("content_de", "Lorem ipsum an vim meis nominati, solet semper convenire et eos. Reque maiorum complectitur pri et, cum prima dissentias disputationi eu, sit ut novum intellegam. Cu mea sint hinc saepe. Et soluta efficiendi his, sea id nostro vivendo periculis. Debitis praesent cu vis, sale clita quando nam ad."); + attrs.put("content_en", "Lorem ipsum an vim meis nominati, solet semper convenire et eos. Reque maiorum complectitur pri et, cum prima dissentias disputationi eu, sit ut novum intellegam. Cu mea sint hinc saepe. Et soluta efficiendi his, sea id nostro vivendo periculis. Debitis praesent cu vis, sale clita quando nam ad."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(weblog_topic.getLocalId())); +// attrs.put("parent", new Integer(question2.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); + + try + { + itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } + } + // guestbook entries + + + Item guestbook_topic = null; + if(guestbook != null){ + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_topic"); + attrs.put("title_de", guestbook.getAttribute("title_de")); + attrs.put("title_en", guestbook.getAttribute("title_en")); + attrs.put("content_de", ""); + attrs.put("content_en", ""); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("parent_cat", new Integer(guestbook.getLocalId())); + + try + { + guestbook_topic = itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default topic for forum"); + } + } + + if(guestbook_topic != null){ + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Gästebucheintrag 1"); + attrs.put("title_en", "Guestbook entry 1"); + attrs.put("content_de", "Lorem ipsum verterem voluptatibus id vim, fugit democritum eu duo. Te his unum ferri labitur. Qui id omnis omnium. Ut pro aliquip voluptatum temporibus."); + attrs.put("content_en", "Lorem ipsum verterem voluptatibus id vim, fugit democritum eu duo. Te his unum ferri labitur. Qui id omnis omnium. Ut pro aliquip voluptatum temporibus."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(guestbook_topic.getLocalId())); +// attrs.put("parent", new Integer(question2.getLocalId())); +// attrs.put("ip", new Integer(forum.getLocalId())); +// attrs.put("email", new Integer(forum.getLocalId())); + + try + { + itemManager.createItem(attrs, admin); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } + + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Gästebucheintrag 2"); + attrs.put("title_en", "Guestbook entry 2"); + attrs.put("content_de", "Lorem ipsum vis te paulo vidisse dolorem, per id virtute officiis deserunt. Ea sea efficiendi assueverit. Quod volutpat in sit, hinc nominavi at eam, ex mel volutpat mediocritatem. Ei vim malis debitis posidonium, dolor scripta tritani at per."); + attrs.put("content_en", "Lorem ipsum vis te paulo vidisse dolorem, per id virtute officiis deserunt. Ea sea efficiendi assueverit. Quod volutpat in sit, hinc nominavi at eam, ex mel volutpat mediocritatem. Ei vim malis debitis posidonium, dolor scripta tritani at per."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(guestbook_topic.getLocalId())); +// attrs.put("parent", new Integer(question2.getLocalId())); + attrs.put("ip", "127.0.0.1"); + attrs.put("email", "name_(at)_host.de"); + + try + { + itemManager.createItem(attrs, null); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } + + attrs = new HashMap(); + + attrs.put("itemclass", "discussion_posting"); + attrs.put("title_de", "Gästebucheintrag 3"); + attrs.put("title_en", "Guestbook entry 3"); + attrs.put("content_de", "Lorem ipsum mei modus summo voluptua in, ne sit affert consul, no sea nostrud eruditi graecis. An pri hinc dicunt salutandi. Ea congue noluisse duo, ad pri aperiri eruditi percipit, ad aeque persecuti moderatius sea. An mazim quaeque meliore sit, vel quodsi perfecto omittantur ea, stet menandri antiopam est ea. Quis probo torquatos nec cu, eu nec dicta iusto denique."); + attrs.put("content_en", "Lorem ipsum mei modus summo voluptua in, ne sit affert consul, no sea nostrud eruditi graecis. An pri hinc dicunt salutandi. Ea congue noluisse duo, ad pri aperiri eruditi percipit, ad aeque persecuti moderatius sea. An mazim quaeque meliore sit, vel quodsi perfecto omittantur ea, stet menandri antiopam est ea. Quis probo torquatos nec cu, eu nec dicta iusto denique."); + attrs.put("state", new Integer(1)); + + attrs.put("creationtime", cal.getTime()); + attrs.put("updatetime", cal.getTime()); + cal.add(Calendar.MINUTE, 1); + + attrs.put("topicId", new Integer(guestbook_topic.getLocalId())); +// attrs.put("parent", new Integer(question2.getLocalId())); + attrs.put("ip", "127.0.0.1"); + attrs.put("email", "name_(at)_host.de"); + + try + { + itemManager.createItem(attrs, null); + } catch (CobricksException e) + { + logger.warn("fail to create default item for forum"); + } + } + logger.info("default data for discussion module created"); + } } Index: DiscussionServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/discussion/DiscussionServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DiscussionServlet.java 6 Apr 2006 16:25:53 -0000 1.2 +++ DiscussionServlet.java 30 May 2006 14:48:06 -0000 1.3 @@ -4,10 +4,12 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import java.util.Properties; import java.util.Set; import javax.servlet.ServletConfig; import javax.servlet.ServletException; +import javax.servlet.http.Cookie; import org.apache.log4j.Logger; import org.cobricks.category.Category; @@ -22,7 +24,8 @@ import org.cobricks.portal.PortalServletAdaptor; import org.cobricks.portal.PortalUser; -public class DiscussionServlet extends PortalServletAdaptor { +public class DiscussionServlet extends PortalServletAdaptor +{ private static Logger logger = Logger.getLogger(DiscussionServlet.class); /** @@ -35,125 +38,136 @@ /** * */ - public void init(ServletConfig config) - throws ServletException + public void init(ServletConfig config) throws ServletException { - super.init(config); + 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); + // this.addTarget("createCat", "performCreateCat", "", true); + + this.addTarget("saveProperties", "performSaveProps", "", true); + this.addTarget("saveView", "performSaveView", "", false); + // 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) { - logge... [truncated message content] |
|
From: Michael K. <ko...@us...> - 2006-05-30 14:32:21
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/context In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19207/src/org/cobricks/context Modified Files: ContextManagerImpl.java Log Message: Index: ContextManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/context/ContextManagerImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ContextManagerImpl.java 23 Jan 2006 16:06:33 -0000 1.5 +++ ContextManagerImpl.java 30 May 2006 14:32:00 -0000 1.6 @@ -97,6 +97,7 @@ int res = dbAccess.checkTable(tablename); if (res == -1) dbAccess.createTable(tablename); else if (res == -2) { + logger.info("Found need to update table "+tablename); if (!dbAccess.updateTable(tablename)) logger.error("Updating table "+tablename+" failed."); } |
|
From: Michael K. <ko...@us...> - 2006-05-30 14:32:19
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item/sqlsearch In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19207/src/org/cobricks/item/sqlsearch Modified Files: Lexer.java scanner.flex Log Message: Index: scanner.flex =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/sqlsearch/scanner.flex,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- scanner.flex 16 Jan 2006 20:43:24 -0000 1.2 +++ scanner.flex 30 May 2006 14:32:00 -0000 1.3 @@ -122,35 +122,35 @@ return it. */ /* path expression */ - "/" { System.out.print(" / "); return symbol(sym.PATHDELIM); } + "/" { return symbol(sym.PATHDELIM); } /* return path as value */ /* boolean expressions */ - "and" { System.out.print(" AND "); return symbol(sym.AND); } - "or" { System.out.print(" OR "); return symbol(sym.OR); } - "AND" { System.out.print(" AND "); return symbol(sym.AND); } - "OR" { System.out.print(" OR "); return symbol(sym.OR); } + "and" { return symbol(sym.AND); } + "or" { return symbol(sym.OR); } + "AND" { return symbol(sym.AND); } + "OR" { return symbol(sym.OR); } /* sets */ - "in" { System.out.print(" IN "); return symbol(sym.IN); } - "IN" { System.out.print(" IN "); return symbol(sym.IN); } - "," { System.out.print(" , "); return symbol(sym.COMMA); } + "in" { return symbol(sym.IN); } + "IN" { return symbol(sym.IN); } + "," { return symbol(sym.COMMA); } /* comparisons */ - "=" { System.out.print(" = "); return symbol(sym.EQUAL); } - "!=" { System.out.print(" != "); return symbol(sym.NOTEQUAL); } - ">" { System.out.print(" > "); return symbol(sym.GREATER); } - "<" { System.out.print(" < "); return symbol(sym.LESS); } - ">=" { System.out.print(" >= "); return symbol(sym.GREATEREQ); } - "<=" { System.out.print(" <= "); return symbol(sym.LESSEQ); } + "=" { return symbol(sym.EQUAL); } + "!=" { return symbol(sym.NOTEQUAL); } + ">" { return symbol(sym.GREATER); } + "<" { return symbol(sym.LESS); } + ">=" { return symbol(sym.GREATEREQ); } + "<=" { return symbol(sym.LESSEQ); } /* date */ - "today" { System.out.print(" TODAY "); return symbol(sym.TODAY); } - "TODAY" { System.out.print(" TODAY "); return symbol(sym.TODAY); } - "+" { yybegin(YYINITIAL); System.out.print(" + "); return symbol(sym.PLUS); } - "-" { yybegin(YYINITIAL); System.out.print(" - "); return symbol(sym.MINUS); } - {datetime} { System.out.print(" DATETIME "); + "today" { return symbol(sym.TODAY); } + "TODAY" { return symbol(sym.TODAY); } + "+" { yybegin(YYINITIAL); return symbol(sym.PLUS); } + "-" { yybegin(YYINITIAL); return symbol(sym.MINUS); } + {datetime} { try { Date d = new SimpleDateFormat(Item.INTERNAL_DATE_FORMAT + " " + Item.INTERNAL_TIME_FORMAT).parse(yytext()); @@ -162,12 +162,12 @@ } /* contracted expressions */ - "(" { System.out.print(" ( "); return symbol(sym.LPAREN); } - ")" { System.out.print(" ) "); return symbol(sym.RPAREN); } - "[" { System.out.print(" [ "); return symbol(sym.LBRACK); } - "]" { System.out.print(" ] "); return symbol(sym.RBRACK); } - "{" { System.out.print(" { "); return symbol(sym.LCBRACK); } - "}" { System.out.print(" } "); return symbol(sym.RCBRACK); } + "(" { return symbol(sym.LPAREN); } + ")" { return symbol(sym.RPAREN); } + "[" { return symbol(sym.LBRACK); } + "]" { return symbol(sym.RBRACK); } + "{" { return symbol(sym.LCBRACK); } + "}" { return symbol(sym.RCBRACK); } /* string expressions */ \" { string.setLength(0); yybegin(STRING1); } @@ -177,14 +177,12 @@ that represents an integer and the value of the integer that is held in the string yytext which will get turned into an integer before returning */ - {dec_int_lit} { System.out.print(yytext()); - return symbol(sym.NUMBER, new Integer(yytext())); } + {dec_int_lit} { return symbol(sym.NUMBER, new Integer(yytext())); } /* If an identifier is found print it out, return the token ID that represents an identifier and the default value one that is given to all identifiers. */ - {dec_int_pathid} { System.out.print(yytext()); - return symbol(sym.PATHID, new String(yytext()));} + {dec_int_pathid} { return symbol(sym.PATHID, new String(yytext()));} /* Don't do anything if whitespace is found */ {WhiteSpace} { /* just skip what was found, do nothing */ } @@ -192,7 +190,7 @@ /* String1 state */ <STRING1> { - \" { System.out.print(" String=\"" + string + "\" "); + \" { yybegin(YYINITIAL); return symbol(sym.STRING, string.toString()); } [^\n\r\"\\]+ { string.append( yytext() ); } @@ -205,7 +203,7 @@ /* String2 state */ <STRING2> { - \' { System.out.print(" String=\"" + string + "\" "); + \' { yybegin(YYINITIAL); return symbol(sym.STRING, string.toString()); } [^\n\r\"\'\\]+ { string.append( yytext() ); } Index: Lexer.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/sqlsearch/Lexer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Lexer.java 17 May 2006 11:19:25 -0000 1.3 +++ Lexer.java 30 May 2006 14:32:00 -0000 1.4 @@ -688,8 +688,7 @@ switch ((zzAction < 0) ? zzAction : ZZ_ACTION[zzAction]) { case 25: { - System.out.print(" != "); - + //System.out.print(" != "); return symbol(sym.NOTEQUAL); } @@ -697,8 +696,7 @@ break; case 7: { - System.out.print(" = "); - + //System.out.print(" = "); return symbol(sym.EQUAL); } @@ -706,8 +704,7 @@ break; case 8: { - System.out.print(" > "); - + // System.out.print(" > "); return symbol(sym.GREATER); } @@ -716,8 +713,7 @@ case 11: { yybegin(YYINITIAL); - System.out.print(" - "); - + //System.out.print(" - "); return symbol(sym.MINUS); } @@ -730,8 +726,7 @@ break; case 33: { - System.out.print(" TODAY "); - + //System.out.print(" TODAY "); return symbol(sym.TODAY); } @@ -739,8 +734,7 @@ break; case 17: { - System.out.print(" } "); - + //System.out.print(" } "); return symbol(sym.RCBRACK); } @@ -756,9 +750,8 @@ break; case 21: { - System.out.print(" String=\"" + string + "\" "); + //System.out.print(" String=\"" + string + "\" "); yybegin(YYINITIAL); - return symbol(sym.STRING, string.toString()); } @@ -771,8 +764,7 @@ break; case 16: { - System.out.print(" { "); - + //System.out.print(" { "); return symbol(sym.LCBRACK); } @@ -780,8 +772,7 @@ break; case 5: { - System.out.print(" / "); - + //System.out.print(" / "); return symbol(sym.PATHDELIM); } @@ -789,8 +780,7 @@ break; case 24: { - System.out.print(" IN "); - + //System.out.print(" IN "); return symbol(sym.IN); } @@ -798,8 +788,7 @@ break; case 32: { - System.out.print(" AND "); - + //System.out.print(" AND "); return symbol(sym.AND); } @@ -812,8 +801,7 @@ break; case 6: { - System.out.print(" , "); - + //System.out.print(" , "); return symbol(sym.COMMA); } @@ -821,8 +809,7 @@ break; case 14: { - System.out.print(" [ "); - + //System.out.print(" [ "); return symbol(sym.LBRACK); } @@ -830,8 +817,7 @@ break; case 9: { - System.out.print(" < "); - + //System.out.print(" < "); return symbol(sym.LESS); } @@ -845,8 +831,7 @@ break; case 3: { - System.out.print(yytext()); - + //System.out.print(yytext()); return symbol(sym.NUMBER, new Integer(yytext())); } @@ -854,8 +839,7 @@ break; case 4: { - System.out.print(yytext()); - + //System.out.print(yytext()); return symbol(sym.PATHID, new String(yytext())); } @@ -871,8 +855,7 @@ break; case 23: { - System.out.print(" OR "); - + //System.out.print(" OR "); return symbol(sym.OR); } @@ -880,8 +863,7 @@ break; case 27: { - System.out.print(" <= "); - + //System.out.print(" <= "); return symbol(sym.LESSEQ); } @@ -889,8 +871,7 @@ break; case 34: { - System.out.print(" DATETIME "); - + //System.out.print(" DATETIME "); try { Date d = new SimpleDateFormat(Item.INTERNAL_DATE_FORMAT + " " + Item.INTERNAL_TIME_FORMAT).parse(yytext()); @@ -913,8 +894,7 @@ case 10: { yybegin(YYINITIAL); - System.out.print(" + "); - + //System.out.print(" + "); return symbol(sym.PLUS); } @@ -922,8 +902,7 @@ break; case 15: { - System.out.print(" ] "); - + //System.out.print(" ] "); return symbol(sym.RBRACK); } @@ -936,8 +915,7 @@ break; case 13: { - System.out.print(" ) "); - + //System.out.print(" ) "); return symbol(sym.RPAREN); } @@ -945,8 +923,7 @@ break; case 26: { - System.out.print(" >= "); - + //System.out.print(" >= "); return symbol(sym.GREATEREQ); } @@ -959,8 +936,7 @@ break; case 12: { - System.out.print(" ( "); - + //System.out.print(" ( "); return symbol(sym.LPAREN); } |
|
From: Michael K. <ko...@us...> - 2006-05-30 14:32:18
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/util/migration In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19207/src/org/cobricks/util/migration Modified Files: ItemMigration.java Log Message: Index: ItemMigration.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/util/migration/ItemMigration.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ItemMigration.java 8 May 2006 07:48:00 -0000 1.7 +++ ItemMigration.java 30 May 2006 14:32:01 -0000 1.8 @@ -309,14 +309,14 @@ .get("publisheddate")); } - ItemAttachment newAttach = - itemManager.createItemAttachment( + ItemAttachment newAttach = + itemManager.createItemAttachment( tmpItem.getId(), title, comment, mimetype, size, - url2, + url2, "", creatorid, creationtime ); @@ -440,7 +440,7 @@ comment, mimetype, size, - url, + url, "", creatorid, creationtime ); |
|
From: Michael K. <ko...@us...> - 2006-05-30 14:32:12
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/user/attribute In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19207/src/org/cobricks/user/attribute Modified Files: UserJoin.java Log Message: Index: UserJoin.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/attribute/UserJoin.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- UserJoin.java 11 Aug 2004 15:11:12 -0000 1.11 +++ UserJoin.java 30 May 2006 14:32:01 -0000 1.12 @@ -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 @@ -42,6 +42,7 @@ * ua2.avalue desc; * * @author Irina Zhitomirskaja + * @author Michael Koch */ public class UserJoin @@ -247,16 +248,14 @@ switch (aname.charAt(aname.length() - 1)) { case '~': { if (dbAccess.getDBType() == DBAccessImpl.DBTYPE_POSTGRES) { - // handling case intensitive search using the Postgres ILIKE - // operator + // handling case intensitive search using the + // Postgres ILIKE operator newTail = " ilike ?"; tailCutSize = 1; - // like 'a%' - adding of '%' for right query. avalue = "%"+avalue.toString()+"%"; } else { newTail = " like ?"; tailCutSize = 1; - // like 'a%' - adding of '%' for right query. avalue = "%"+avalue.toString()+"%"; } break; |
|
From: Michael K. <ko...@us...> - 2006-05-30 14:32:12
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/core In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19207/src/org/cobricks/core Modified Files: ComponentDirectory.java ComponentManagerAdaptor.java Log Message: Index: ComponentManagerAdaptor.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/ComponentManagerAdaptor.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ComponentManagerAdaptor.java 29 Nov 2005 07:18:38 -0000 1.9 +++ ComponentManagerAdaptor.java 30 May 2006 14:32:00 -0000 1.10 @@ -12,6 +12,7 @@ package org.cobricks.core; +import java.io.IOException; import java.util.*; import org.apache.log4j.*; @@ -32,7 +33,8 @@ */ public abstract class ComponentManagerAdaptor - implements ComponentManagerInterface, ComponentEventListener + implements ComponentManagerInterface, ComponentEventListener, + java.io.Serializable { static Logger logger = Logger.getLogger(ComponentManagerAdaptor.class); @@ -307,4 +309,17 @@ return "manager("+managerId+")"; } + /** + * + */ + private void writeObject(java.io.ObjectOutputStream out) + throws IOException + { + } + + private void readObject(java.io.ObjectInputStream in) + throws IOException, ClassNotFoundException + { + } + } Index: ComponentDirectory.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/ComponentDirectory.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ComponentDirectory.java 6 Dec 2004 20:38:40 -0000 1.10 +++ ComponentDirectory.java 30 May 2006 14:32:00 -0000 1.11 @@ -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 @@ -12,18 +12,14 @@ package org.cobricks.core; - import java.net.*; import java.util.*; - -import org.apache.log4j.*; +import org.apache.log4j.Logger; import org.cobricks.core.db.DBAccess; import org.cobricks.core.util.LogUtil; - - /** * Class for holding a list of manager objects. * @@ -46,7 +42,6 @@ boolean alreadyInitialized = false; - /** * */ @@ -187,8 +182,9 @@ /** * */ - public void doInitComponents(Properties properties, CoreManager coreManager, - DBAccess dbAccess) + public void doInitComponents(Properties properties, + CoreManager coreManager, + DBAccess dbAccess) { if (alreadyInitialized) return; logger.info("Initializing components"); @@ -218,11 +214,10 @@ Class c = Class.forName(classname); ComponentManagerInterface m = (ComponentManagerInterface)c.newInstance(); - m.init(componentId, cmanagerId, properties, coreManager, - dbAccess); - // if object did not register itself ... if (lookupManager(cmanagerId) == null) registerManager(cmanagerId, m); + m.init(componentId, cmanagerId, properties, coreManager, + dbAccess); } catch (Exception e) { logger.error(LogUtil. exception("Failed initializing component " |
|
From: Michael K. <ko...@us...> - 2006-05-30 14:32:12
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/core/ws In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19207/src/org/cobricks/core/ws Modified Files: clientWS.java Log Message: Index: clientWS.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/ws/clientWS.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- clientWS.java 3 May 2005 21:57:56 -0000 1.10 +++ clientWS.java 30 May 2006 14:32:00 -0000 1.11 @@ -51,7 +51,7 @@ public static void main(String[] args) { try { - String endpoint = "http://localhost:8080/services/cobricksUser"; + String endpoint = "http://localhost:9080/services/cobricksUser"; Service service = new Service(); QName qnUser = new QName("urn://cobricks.org/user", "User"); @@ -77,7 +77,7 @@ Call call = null; - endpoint = "http://localhost:8080/services/cobricksUser"; + endpoint = "http://localhost:9080/services/cobricksUser"; try { call = (Call)service.createCall(); call.setTargetEndpointAddress(new java.net.URL(endpoint)); @@ -93,12 +93,12 @@ call.setReturnClass(List.class); - call.setProperty(Call.USERNAME_PROPERTY, "kochm"); - call.setProperty(Call.PASSWORD_PROPERTY, "devpac"); + call.setProperty(Call.USERNAME_PROPERTY, "cadmin"); + call.setProperty(Call.PASSWORD_PROPERTY, "joshua"); logger.info("do invoke"); - List ret = (List) call.invoke(new Object[] { "/item/itemid=2", null } ); + List ret = (List) call.invoke(new Object[] { "", null } ); logger.info("return: " + ret); logger.info("return: " + ret.size()); |
|
From: Michael K. <ko...@us...> - 2006-05-30 14:32:12
|
Update of /cvsroot/cobricks/cobricks2/conf In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19207/conf Modified Files: localproperties.txt.orig Added Files: userontology.xml Log Message: Index: localproperties.txt.orig =================================================================== RCS file: /cvsroot/cobricks/cobricks2/conf/localproperties.txt.orig,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- localproperties.txt.orig 26 Jul 2005 10:13:17 -0000 1.7 +++ localproperties.txt.orig 30 May 2006 14:31:59 -0000 1.8 @@ -42,7 +42,7 @@ # XML database # For using the XML database activate the following properties # and deactivate the two above -#item.xmldb=true +#item.xmldb=false #org.cobricks.item.comp.manager.class=org.cobricks.item.xmldb.ItemManagerImpl #item.xmldb.hostname=localhost #item.xmldb.dbname=cobricks --- NEW FILE: userontology.xml --- <userontology> <class name="universityuser" parent="user"> <attr name="basic.university.status" type="string(10)"> <description lang="de">Universitaet Status</description> <description lang="en">University Status</description> <value>professor</value> <value>staff</value> <value>student</value> <value>alumni</value> <value>other</value> </attr> <attr name="basic.university.graduation" type="int"> <description lang="en">Graduation</description> </attr> <attr name="basic.university.subject" type="string(30)"> <description lang="de">Hauptfach</description> <description lang="en">Major subject</description> </attr> <attr name="basic.university.faculties" type="string(15)"/> <attr name="basic.personal.card" type="string(10000)" /> </class> </userontology> |
|
From: Michael K. <ko...@us...> - 2006-05-30 14:32:08
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19207/src/org/cobricks/course Modified Files: Course.java CourseLecturer.java CourseManager.java CourseManagerImpl.java CourseManagerWS.java CourseModule.java CourseModuleAccessHandler.java CourseModuleProgramRel.java CoursePresenter.java CourseProgram.java CourseServlet.java Log Message: Index: CoursePresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CoursePresenter.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- CoursePresenter.java 22 Aug 2005 13:52:06 -0000 1.20 +++ CoursePresenter.java 30 May 2006 14:32:00 -0000 1.21 @@ -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 @@ -12,16 +12,25 @@ package org.cobricks.course; +import java.io.Reader; +import java.io.StringReader; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import org.xml.sax.InputSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; import org.apache.log4j.Logger; @@ -134,12 +143,6 @@ return null; } - public List getCourseGroups() { - Map attrs = new HashMap(); - attrs.put("categoryclass", "coursegroup"); - return categoryManager.searchCategories(attrs); - } - public List getSemesters() { ArrayList al = new ArrayList(); al.add(new String[] {"2000s","SS 2000"}); @@ -160,69 +163,85 @@ return al; } - public List searchCourses(String query) + public List searchCourses(String query, String sortby) { - logger.debug("Search Courses : "+query); + logger.debug("Search Courses "+query); try { - return courseManager.searchCourses(parseQuery(query)); + return courseManager.searchCourses(parseQuery(query), sortby); } catch (Exception e) { logger.error(LogUtil.ex("Failed searching courses.", e)); } return null; } - public CourseModule getCourseModule(String ctplid) { -// logger.debug("Presenter: getCourseModule"); + public CourseModule getCourseModule(String cmid) + { + if (cmid == null) return null; try { - return courseManager.getCourseModule(Integer.parseInt(ctplid.trim())); + return courseManager. + getCourseModule(Integer.parseInt(cmid.trim())); } catch(Exception e ){ logger.error(LogUtil.ex("Failed getting course module.", e)); } return null; } - public List getCourseModules(String ctplid, String ctname) + public CourseModule getCourseModuleBySId(String cmsid) + { + try { + Map attrs = new HashMap(); + attrs.put("cmsid", cmsid); + List result = courseManager.searchCourseModules(attrs, "cmname"); + if (result!=null && result.size()>0) + return (CourseModule)(result.iterator().next()); + } catch (Exception e) { + logger.error(LogUtil.ex("Failed getting courselecturers.", e)); + } + return null; + } + + public List getCourseModules(String cmid, String cmname) { List result = new ArrayList(); - if (ctplid!=null && ctplid.trim().length()>0) { + if (cmid!=null && cmid.trim().length()>0) { try { - int i = Integer.parseInt(ctplid); - CourseModule ct = courseManager.getCourseModule(i); - if (ct != null) - result.add(ct); + int i = Integer.parseInt(cmid); + CourseModule cm = courseManager.getCourseModule(i); + if (cm != null) + result.add(cm); } catch (Exception e) { - logger.error(LogUtil.ex("Failed getting coursemodule.", e)); + logger.error(LogUtil.ex("Failed getting course module.", e)); } } else { try { Map attrs = new HashMap(); - attrs.put("ctname", ctname); - result = courseManager.searchCourseModules(attrs); + attrs.put("cmname", cmname); + result = courseManager.searchCourseModules(attrs,"cmname"); } catch (Exception e) { - logger.error(LogUtil.ex("Failed getting courselecturers.", e)); + logger.error(LogUtil.ex("Failed getting course modules.", e)); } } return result; } - public List getCourseModulesByName(String ctname) + public List getCourseModulesByName(String cmname) { List result = new ArrayList(); try { Map attrs = new HashMap(); - attrs.put("ctname", ctname); - result = courseManager.searchCourseModules(attrs); + attrs.put("ctname", cmname); + result = courseManager.searchCourseModules(attrs,"cmname"); } catch (Exception e) { logger.error(LogUtil.ex("Failed getting courselecturers.", e)); } return result; } - public List searchCourseModules(String query) + public List searchCourseModules(String query, String sortby) { - logger.debug("Search Course Module : "+query); + logger.debug("Search Course Modules: "+query); try { - return courseManager.searchCourseModules(parseQuery(query)); + return courseManager.searchCourseModules(parseQuery(query), sortby); } catch (Exception e) { logger.error(LogUtil.ex("Failed searching course modules.", e)); } @@ -320,21 +339,23 @@ } - public static String getTerms(String selectedTerm){ + public static String getTerms(String selectedTerm) + { int year = Calendar.getInstance().get(Calendar.YEAR); StringBuffer sb = new StringBuffer(); String tmpTerm = null; - if (selectedTerm == null){ + if (selectedTerm == null || selectedTerm.length()<1) { selectedTerm = CalendarPresenter.getTerm(new GregorianCalendar()); } - for(int i = year-6;i<=year+1;i++){ + for (int i = year-6;i<=year+4;i++) { tmpTerm = i+"s"; sb.append("<option value=\""+tmpTerm+"\" "); if(tmpTerm.equalsIgnoreCase(selectedTerm)) sb.append("selected=\"1\" "); sb.append(">SS "+i+"</option>\n"); tmpTerm = i+"w"; sb.append("<option value=\""+tmpTerm+"\" "); - if(tmpTerm.equalsIgnoreCase(selectedTerm)) sb.append("selected=\"1\" "); + if (tmpTerm.equalsIgnoreCase(selectedTerm)) + sb.append("selected=\"1\" "); sb.append(">WS "+i+"/"+(i+1)+"</option>\n"); } return sb.toString(); @@ -451,5 +472,129 @@ } } return attrs; - } + } + + + public String printSWS(CourseModule cm) + { + StringBuffer sb = new StringBuffer(""); + int tmpi = cm.getHoursLecture(); + if (tmpi > 0) + sb.append(Integer.toString(tmpi)).append("V"); + tmpi = cm.getHoursLab(); + if (tmpi > 0) { + if (sb.length()>0) sb.append(" + "); + sb.append(Integer.toString(tmpi)).append("P"); + } + tmpi = cm.getHoursSeminar(); + if (tmpi > 0) { + if (sb.length()>0) sb.append(" + "); + sb.append(Integer.toString(tmpi)).append("S"); + } + tmpi = cm.getHoursExercises(); + if (tmpi > 0) { + if (sb.length()>0) sb.append(" + "); + sb.append(Integer.toString(tmpi)).append("Ü"); + } + return sb.toString(); + } + + public String printSWS(Course c) + { + StringBuffer sb = new StringBuffer(""); + int tmpi = c.getHoursLecture(); + if (tmpi > 0) + sb.append(Integer.toString(tmpi)).append("V"); + tmpi = c.getHoursLab(); + if (tmpi > 0) { + if (sb.length()>0) sb.append(" + "); + sb.append(Integer.toString(tmpi)).append("P"); + } + tmpi = c.getHoursSeminar(); + if (tmpi > 0) { + if (sb.length()>0) sb.append(" + "); + sb.append(Integer.toString(tmpi)).append("S"); + } + tmpi = c.getHoursExercises(); + if (tmpi > 0) { + if (sb.length()>0) sb.append(" + "); + sb.append(Integer.toString(tmpi)).append("Ü"); + } + return sb.toString(); + } + + public String printProg(CourseModule cm) + { + StringBuffer sb = new StringBuffer(""); + List prlist = cm.getProgramRel(); + Iterator i = prlist.iterator(); + while (i.hasNext()) { + if (sb.length()>0) sb.append("<br>\n"); + CourseModuleProgramRel pr = (CourseModuleProgramRel)i.next(); + sb.append(pr.getProgram().getLabel()); + sb.append(": "); + sb.append(pr.getType().toUpperCase()); + String tmps = pr.getComment(); + if (tmps!=null && tmps.length()>0) + sb.append(" (").append(tmps).append(")"); + } + return sb.toString(); + } + + public String printPrerequ(CourseModule cm) + { + StringBuffer sb = new StringBuffer(""); + // parse prerequ as XML document + String tmps = cm.getPrerequ(); + try { + DocumentBuilderFactory factory = + DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + Reader reader = new StringReader(tmps); + InputSource in = new InputSource(reader); + Document doc = builder.parse(in); + Node node = doc.getFirstChild(); + if (node instanceof Element) { + String tagName = ((Element)node).getTagName(); + if (tagName.equals("Vorkenntnisse")) { + node = ((Element)node).getFirstChild(); + while (node != null) { + if (node instanceof Element) { + tagName = ((Element)node).getTagName(); + if (tagName.equals("Vorkenntnis")) { + if (sb.length()>0) + sb.append("<br>\n"); + String art = ((Element)node).getAttribute("art"); + if (art.equals("Modul")) { + String idref = ((Element)node).getAttribute("idref"); + String tmps2 = ((Element)node).getAttribute("kommentar"); + sb.append("<a href=\"cm.html?id=").append(idref).append("\">").append("Modul ").append(idref).append("</a>"); + if (tmps2!=null && tmps2.length()>0) + sb.append(" (").append(tmps2).append(")"); + } else { + String tmps2 = ((Element)node).getAttribute("kommentar"); + if (tmps2!=null && tmps2.length()>0) + sb.append(tmps2); + } + } + } + node = node.getNextSibling(); + } + } + } + } catch (Exception e) { + logger.error(LogUtil.ex("Failed parsing prerequ", e)); + } + return sb.toString(); + } + + public String printCert(CourseModule cm) + { + StringBuffer sb = new StringBuffer(""); + // parse prerequ as XML document + String tmps = cm.getPrerequ(); + sb.append(tmps); + return sb.toString(); + } + } Index: CourseServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseServlet.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- CourseServlet.java 22 Aug 2005 13:52:06 -0000 1.19 +++ CourseServlet.java 30 May 2006 14:32:00 -0000 1.20 @@ -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 @@ -121,24 +121,25 @@ attrs.put("ccomment", prequest.getRequestParameter("ccomment")); attrs.put("clang", prequest.getRequestParameter("clang")); attrs.put("curl", prequest.getRequestParameter("curl")); - tmps = prequest.getRequestParameter("cgroup"); + tmps = prequest.getRequestParameter("ccapacity"); if (tmps != null) { try { int tmpi = Integer.parseInt(tmps); - attrs.put("cgroup", new Integer(tmpi)); + attrs.put("ccapacity", new Integer(tmpi)); } catch (Exception e) { } - } - tmps = prequest.getRequestParameter("cparticipants"); + } + tmps = prequest.getRequestParameter("cectscredits"); if (tmps != null) { try { - int tmpi = Integer.parseInt(tmps); - attrs.put("cparticipants", new Integer(tmpi)); + attrs.put("cectscredits", new BigDecimal(tmps)); } catch (Exception e) { } } - tmps = prequest.getRequestParameter("cectscredits"); + attrs.put("cexaminername", prequest.getRequestParameter("cexaminername")); + tmps = prequest.getRequestParameter("cexaminerid"); if (tmps != null) { try { - attrs.put("cectscredits", new BigDecimal(tmps)); + int tmpi = Integer.parseInt(tmps); + attrs.put("cexaminerid", new Integer(tmpi)); } catch (Exception e) { } } tmps = prequest.getRequestParameter("chours_lec"); @@ -171,12 +172,14 @@ } attrs.put("ccontent", prequest.getRequestParameter("ccontent")); attrs.put("ccontent_en", prequest.getRequestParameter("ccontent_en")); + attrs.put("ctarget", prequest.getRequestParameter("ctarget")); + attrs.put("ctarget_en", prequest.getRequestParameter("ctarget_en")); attrs.put("cprerequ", prequest.getRequestParameter("cprerequ")); attrs.put("cprerequ_en", prequest.getRequestParameter("cprerequ_en")); - attrs.put("cprerequcert", prequest. - getRequestParameter("cprerequcert")); - attrs.put("cprerequcert_en", prequest. - getRequestParameter("cprerequcert_en")); + attrs.put("ccert", prequest.getRequestParameter("ccert")); + attrs.put("ccert_en", prequest.getRequestParameter("ccert_en")); + attrs.put("cdidactics", prequest.getRequestParameter("cdidactics")); + attrs.put("cdidactics_en", prequest.getRequestParameter("cdidactics_en")); int maxcnt = 4; tmps = prequest.getRequestParameter("cdatescnt"); @@ -268,27 +271,28 @@ attrs.put("newlecturerid", tmps); } catch (Exception e) { } } + tmps = prequest.getRequestParameter("lecturername"); + if (tmps != null) { + try { + attrs.put("newlecturername", tmps); + } catch (Exception e) { } + } // Used only by updateCourse if(cid > 0){ List lecturers = courseManager.getLecturersForCourse(cid); List lecturersNew = new ArrayList(); - // logger.debug("lecturers size : "+lecturers.size()); Iterator iter = lecturers.iterator(); while (iter.hasNext()) { CourseLecturer element = (CourseLecturer) iter.next(); tmps = prequest.getRequestParameter("lecturer"+element.getId()); logger.debug("lecturer : "+tmps+" : "+element.getId()); if (tmps != null && tmps.equalsIgnoreCase("true")) { - // logger.debug("adding: "+element.getId()); lecturersNew.add(new Integer(element.getId())); } } if(lecturersNew.size() > 0) attrs.put("lecturers", lecturersNew); } - return attrs; - -// attrs.put("ccontent", prequest.getRequestParameter("ccontent")); - + return attrs; } @@ -314,6 +318,12 @@ } */ Map attrs = getCourseRequestParameters(prequest); + String tmps = (String)attrs.remove("cexaminername"); + if (tmps != null) { + int lid = courseManager.getLecturerIdByName(tmps); + if (lid > 0) + attrs.put("cexaminerid", new Integer(lid)); + } try { int cid = courseManager.createCourse(attrs, portalUser.getUser()); @@ -349,11 +359,17 @@ return "noaccess"; } */ Map attrs = getCourseRequestParameters(prequest); + String tmps = (String)attrs.remove("cexaminername"); + if (tmps != null) { + int lid = courseManager.getLecturerIdByName(tmps); + if (lid > 0) + attrs.put("cexaminerid", new Integer(lid)); + } try { int cid = Integer.parseInt(prequest.getRequestParameter("cid")); courseManager.updateCourse(cid, attrs, portalUser.getUser()); - prequest.setReturnCode(1001); + prequest.setReturnCode(1002); return "success"; } catch (Exception e) { logger.error("Failed updating course",e); @@ -389,7 +405,7 @@ try { int cid = Integer.parseInt(prequest.getRequestParameter("cid")); courseManager.deleteCourse(cid, portalUser.getUser()); - prequest.setReturnCode(1001); + prequest.setReturnCode(1003); return "success"; } catch (Exception e) { logger.error("Failed deleting course",e); @@ -415,84 +431,96 @@ attrs.put("cmid", new Integer(tmpi)); } catch (Exception e) { } } - attrs.put("ctname", prequest.getRequestParameter("ctname")); - attrs.put("ctname_en", prequest.getRequestParameter("ctname_en")); - attrs.put("ctshortname", prequest.getRequestParameter("ctshortname")); - attrs.put("cttype", prequest.getRequestParameter("cttype")); - tmps = prequest.getRequestParameter("ctectscredits"); + attrs.put("cmsid", prequest.getRequestParameter("cmsid")); + attrs.put("cmname", prequest.getRequestParameter("cmname")); + attrs.put("cmname_en", prequest.getRequestParameter("cmname_en")); + attrs.put("cmshortname", prequest.getRequestParameter("cmshortname")); + attrs.put("cmtype", prequest.getRequestParameter("cmtype")); + tmps = prequest.getRequestParameter("cmectscredits"); if (tmps != null) { try { - attrs.put("ctectscredits", new BigDecimal(tmps)); + attrs.put("cmectscredits", new BigDecimal(tmps)); } catch (Exception e) { } } - attrs.put("ctcontent", - prequest.getRequestParameter("ctcontent")); - attrs.put("ctcontent_en", - prequest.getRequestParameter("ctcontent_en")); - attrs.put("ctprerequ", - prequest.getRequestParameter("ctprerequ")); - attrs.put("ctprerequ_en", - prequest.getRequestParameter("ctprerequ_en")); - attrs.put("ctprerequcert", prequest. - getRequestParameter("ctprerequcert")); - attrs.put("ctprerequcert_en", prequest. - getRequestParameter("ctprerequcert_en")); - tmps = prequest.getRequestParameter("ctcycle"); + attrs.put("cmcontent", + prequest.getRequestParameter("cmcontent")); + attrs.put("cmcontent_en", + prequest.getRequestParameter("cmcontent_en")); + attrs.put("cmtarget", + prequest.getRequestParameter("cmtarget")); + attrs.put("cmtarget_en", + prequest.getRequestParameter("cmtarget_en")); + attrs.put("cmprerequ", + prequest.getRequestParameter("cmprerequ")); + attrs.put("cmprerequ_en", + prequest.getRequestParameter("cmprerequ_en")); + attrs.put("cmcert", prequest. + getRequestParameter("cmcert")); + attrs.put("cmcert_en", prequest. + getRequestParameter("cmcert_en")); + attrs.put("cmdidactics", prequest. + getRequestParameter("cmdidactics")); + attrs.put("cmdidactics_en", prequest. + getRequestParameter("cmdidactics_en")); + attrs.put("cmaddxml", prequest. + getRequestParameter("cmaddxml")); + attrs.put("cmcycle", prequest.getRequestParameter("cmcycle")); + tmps = prequest.getRequestParameter("cmhidden"); if (tmps != null) { try { int tmpi = Integer.parseInt(tmps); - attrs.put("ctcycle", new Integer(tmpi)); + attrs.put("cmhidden", new Integer(tmpi)); } catch (Exception e) { } - } - tmps = prequest.getRequestParameter("cthidden"); + } + tmps = prequest.getRequestParameter("cmhours_lec"); if (tmps != null) { try { int tmpi = Integer.parseInt(tmps); - attrs.put("cthidden", new Integer(tmpi)); + attrs.put("cmhours_lec", new Integer(tmpi)); } catch (Exception e) { } - } - tmps = prequest.getRequestParameter("cthours_lec"); + } + tmps = prequest.getRequestParameter("cmhours_ex"); if (tmps != null) { try { int tmpi = Integer.parseInt(tmps); - attrs.put("cthours_lec", new Integer(tmpi)); + attrs.put("cmhours_ex", new Integer(tmpi)); } catch (Exception e) { } } - tmps = prequest.getRequestParameter("cthours_ex"); + tmps = prequest.getRequestParameter("cmhours_sem"); if (tmps != null) { try { int tmpi = Integer.parseInt(tmps); - attrs.put("cthours_ex", new Integer(tmpi)); + attrs.put("cmhours_sem", new Integer(tmpi)); } catch (Exception e) { } } - tmps = prequest.getRequestParameter("cthours_sem"); + tmps = prequest.getRequestParameter("cmhours_lab"); if (tmps != null) { try { int tmpi = Integer.parseInt(tmps); - attrs.put("cthours_sem", new Integer(tmpi)); + attrs.put("cmhours_lab", new Integer(tmpi)); } catch (Exception e) { } } - tmps = prequest.getRequestParameter("cthours_lab"); + tmps = prequest.getRequestParameter("cmresponsible"); if (tmps != null) { try { int tmpi = Integer.parseInt(tmps); - attrs.put("cthours_lab", new Integer(tmpi)); + attrs.put("cmresponsible", new Integer(tmpi)); } catch (Exception e) { } } - attrs.put("ctapplicant", prequest. - getRequestParameter("ctapplicant")); - attrs.put("ctexaminer", prequest. - getRequestParameter("ctexaminer")); + attrs.put("cmresponsiblename", prequest. + getRequestParameter("cmresponsiblename")); + attrs.put("cmcomment", prequest. + getRequestParameter("cmcomment")); int maxcnt = 6; - tmps = prequest.getRequestParameter("ctprogcnt"); + tmps = prequest.getRequestParameter("cmprogcnt"); if (tmps != null) { try { int tmpi = Integer.parseInt(tmps); - attrs.put("ctprogcnt", new Integer(tmpi)); + attrs.put("cmprogcnt", new Integer(tmpi)); maxcnt = tmpi; } catch (Exception e) { - attrs.put("ctprogcnt", new Integer(maxcnt)); + attrs.put("cmprogcnt", new Integer(maxcnt)); } } @@ -504,7 +532,7 @@ attrs.put("cpid"+i, new Integer(tmpi)); } catch (Exception e) { } } - attrs.put("type"+i, prequest.getRequestParameter("type"+i)); + attrs.put("type"+i, prequest.getRequestParameter("type"+i)); tmps = prequest.getRequestParameter("startsem"+i); if (tmps != null) { try { @@ -547,10 +575,17 @@ } */ Map attrs = getCourseModuleRequestParameters(prequest); - + String tmps = (String)attrs.remove("cmresponsiblename"); + if (tmps != null) { + int lid = courseManager.getLecturerIdByName(tmps); + if (lid > 0) + attrs.put("cmresponsible", new Integer(lid)); + } + try { - int cid = courseManager.createCourseModule(attrs, portalUser.getUser()); - prequest.setReturnCode(1001); + int cid = courseManager. + createCourseModule(attrs, portalUser.getUser()); + prequest.setReturnCode(1011); return "success"; } catch (Exception e) { logger.error("Failed creating coursemodule",e); @@ -562,19 +597,19 @@ } - /** - * Updates the specified course module - * @param prequest Portal request to gather the data for updating a - * specified course module - * @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. - */ + /** + * Updates the specified course module + * @param prequest Portal request to gather the data for updating a + * specified course module + * @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. + */ public String performUpdateCourseModule(PortalRequest prequest, - PrintWriter out) + PrintWriter out) { logger.info("performUpdateCourseModule"); - + // check access rights PortalUser portalUser = prequest.getPortalUser(); /** TODO @@ -585,11 +620,17 @@ return "noaccess"; } */ Map attrs = getCourseModuleRequestParameters(prequest); + String tmps = (String)attrs.remove("cmresponsiblename"); + if (tmps != null) { + int lid = courseManager.getLecturerIdByName(tmps); + if (lid > 0) + attrs.put("cmresponsible", new Integer(lid)); + } try { int cmid = Integer.parseInt(prequest.getRequestParameter("cmid")); courseManager.updateCourseModule(cmid, attrs, portalUser.getUser()); - prequest.setReturnCode(1001); + prequest.setReturnCode(1012); return "success"; } catch (Exception e) { logger.error("Failed updating course",e); @@ -626,7 +667,7 @@ try { int cmid = Integer.parseInt(prequest.getRequestParameter("cmid")); courseManager.deleteCourseModule(cmid, portalUser.getUser()); - prequest.setReturnCode(1001); + prequest.setReturnCode(1013); return "success"; } catch (Exception e) { logger.error("Failed deleting course",e); @@ -651,11 +692,11 @@ attrs.put("lid", new Integer(tmpi)); } catch (Exception e) { } } - tmps = prequest.getRequestParameter("uid"); + tmps = prequest.getRequestParameter("luserid"); if (tmps != null) { try { int tmpi = Integer.parseInt(tmps); - attrs.put("uid", new Integer(tmpi)); + attrs.put("luserid", new Integer(tmpi)); } catch (Exception e) { } } tmps = prequest.getRequestParameter("lhidden"); @@ -665,14 +706,6 @@ attrs.put("lhidden", new Integer(tmpi)); } catch (Exception e) { } } - tmps = prequest.getRequestParameter("lgroup"); - if (tmps != null) { - try { - int tmpi = Integer.parseInt(tmps); - attrs.put("lgroup", new Integer(tmpi)); - } catch (Exception e) { } - } - attrs.put("ltyp", prequest.getRequestParameter("ltyp")); attrs.put("lfirstname", prequest.getRequestParameter("lfirstname")); attrs.put("llastname", prequest.getRequestParameter("llastname")); @@ -715,9 +748,9 @@ Map attrs = getCourseLecturerRequestParameters(prequest); try { - int clid = courseManager.createLecturer(attrs, - portalUser.getUser()); - prequest.setReturnCode(1001); + int clid = courseManager. + createLecturer(attrs, portalUser.getUser()); + prequest.setReturnCode(1031); return "success"; } catch (Exception e) { logger.error("Failed creating courselecturer",e); @@ -754,7 +787,7 @@ try { int clid = Integer.parseInt(prequest.getRequestParameter("lid")); courseManager.updateLecturer(clid, attrs, portalUser.getUser()); - prequest.setReturnCode(1001); + prequest.setReturnCode(1032); return "success"; } catch (Exception e) { logger.error("Failed updating courselecturer",e); @@ -791,7 +824,7 @@ try { int clid = Integer.parseInt(prequest.getRequestParameter("lid")); courseManager.deleteLecturer(clid, portalUser.getUser()); - prequest.setReturnCode(1001); + prequest.setReturnCode(1033); return "success"; } catch (Exception e) { logger.error("Failed deleting courselecturer",e); @@ -865,7 +898,7 @@ try { int crid = courseManager.createRoom(attrs, portalUser.getUser()); - prequest.setReturnCode(1001); + prequest.setReturnCode(1021); return "success"; } catch (Exception e) { logger.error("Failed creating courseroom",e); @@ -902,7 +935,7 @@ try { int crid = Integer.parseInt(prequest.getRequestParameter("crid")); courseManager.updateRoom(crid, attrs, portalUser.getUser()); - prequest.setReturnCode(1001); + prequest.setReturnCode(1022); return "success"; } catch (Exception e) { logger.error("Failed updating courseroom",e); @@ -939,7 +972,7 @@ try { int crid = Integer.parseInt(prequest.getRequestParameter("crid")); courseManager.deleteRoom(crid, portalUser.getUser()); - prequest.setReturnCode(1001); + prequest.setReturnCode(1023); return "success"; } catch (Exception e) { logger.error("Failed deleting courseroom",e); @@ -966,7 +999,6 @@ attrs.put("cpname", prequest.getRequestParameter("cpname")); attrs.put("cpname_en", prequest.getRequestParameter("cpname_en")); attrs.put("cplabel", prequest.getRequestParameter("cplabel")); - attrs.put("cpsubproglabel", prequest.getRequestParameter("cpsubproglabel")); attrs.put("cpcomment", prequest.getRequestParameter("cpcomment")); return attrs; @@ -999,7 +1031,7 @@ try { int cpid = courseManager.createProgram(attrs, portalUser.getUser()); - prequest.setReturnCode(1001); + prequest.setReturnCode(1041); return "success"; } catch (Exception e) { logger.error("Failed creating courseprogram",e); @@ -1036,7 +1068,7 @@ try { int cpid = Integer.parseInt(prequest.getRequestParameter("cpid")); courseManager.updateProgram(cpid, attrs, portalUser.getUser()); - prequest.setReturnCode(1001); + prequest.setReturnCode(1042); return "success"; } catch (Exception e) { logger.error("Failed updating courseprogram",e); @@ -1073,7 +1105,7 @@ try { int cpid = Integer.parseInt(prequest.getRequestParameter("cpid")); courseManager.deleteProgram(cpid, portalUser.getUser()); - prequest.setReturnCode(1001); + prequest.setReturnCode(1043); return "success"; } catch (Exception e) { logger.error("Failed deleting courseprogram",e); @@ -1118,7 +1150,7 @@ try { String comment = prequest.getRequestParameter("comment"); courseManager.addToTimetable(uid, cid, comment); - prequest.setReturnCode(1001); + prequest.setReturnCode(1051); return "success"; } catch (Exception e) { logger.error(LogUtil.ex("Failed adding course to timetable",e)); @@ -1160,7 +1192,7 @@ try { courseManager.removeFromTimetable(cttid); - prequest.setReturnCode(1001); + prequest.setReturnCode(1052); return "success"; } catch (Exception e) { logger.error(LogUtil.ex("Failed removing course from timetable",e)); Index: CourseModuleProgramRel.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseModuleProgramRel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CourseModuleProgramRel.java 22 Aug 2005 13:52:06 -0000 1.1 +++ CourseModuleProgramRel.java 30 May 2006 14:32:00 -0000 1.2 @@ -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 @@ -9,6 +9,7 @@ * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. */ + package org.cobricks.course; import java.util.Map; @@ -32,6 +33,10 @@ String cptype; int cpstartsem; int cpendsem; + String cpcomment; + + CourseModule cm; + CourseProgram cp; /** @@ -56,6 +61,10 @@ return cptype; } + public String getComment() + { + return cpcomment; + } public int getStartSem() { @@ -67,6 +76,16 @@ return cpendsem; } + public CourseModule getModule() + { + return cm; + } + + public CourseProgram getProgram() + { + return cp; + } + /** * Load course attributes from a Map object - e.g. one retrieved @@ -74,9 +93,22 @@ */ public void loadFromMap(Map map, CourseManager courseManager) { + loadFromMap(map, courseManager, null); + } + + public void loadFromMap(Map map, CourseManager courseManager, + CourseModule cm) + { Integer tmpi = (Integer)map.get("cmid"); if (tmpi!=null) cmid = tmpi.intValue(); + if (cm == null) { + try { + this.cm = courseManager.getCourseModule(cmid); + } catch (Exception e) { } + } else { + this.cm = cm; + } tmpi = (Integer)map.get("cpstartsem"); if (tmpi!=null) cpstartsem = tmpi.intValue(); @@ -85,8 +117,12 @@ cpendsem = tmpi.intValue(); tmpi = (Integer)map.get("cpid"); if (tmpi!=null) - cpid = tmpi.intValue(); + cpid = tmpi.intValue(); + try { + cp = courseManager.getProgram(cpid); + } catch (Exception e) { } cptype = (String)map.get("cptype"); + cpcomment = (String)map.get("cpcomment"); } } Index: CourseManager.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseManager.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- CourseManager.java 22 Aug 2005 13:52:06 -0000 1.29 +++ CourseManager.java 30 May 2006 14:32:00 -0000 1.30 @@ -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 @@ -86,7 +86,7 @@ * @return * @throws CobricksException */ - public List searchCourses(Map attrs) + public List searchCourses(Map attrs, String sortby) throws CobricksException; /** @@ -152,17 +152,17 @@ * otherwise. * @throws CobricksException */ - public CourseModule getCourseModule(int ctid) + public CourseModule getCourseModule(int cmid) throws CobricksException; - public CourseModule getCourseModuleForName(String ctname); + public CourseModule getCourseModuleForName(String cmname); /** * @param attrs * @return * @throws CobricksException */ - public List searchCourseModules(Map attrs) + public List searchCourseModules(Map attrs, String sortby) throws CobricksException; /** @@ -212,7 +212,9 @@ public void deleteCourseModule(int ctid, User user) throws CobricksException; - public List getCourseModuleProgramRel(int ctid) + public List getCourseModuleProgramRel(int cmid) + throws CobricksException; + public List getCourseModuleProgramRel(CourseModule cm) throws CobricksException; /** @@ -487,19 +489,19 @@ public CourseProgram getProgramForLabel(String cplabel); - public void addProgramToCourse(Map attrs); + public void addProgramToModule(Map attrs); - public List getProgramsForCourse(int ctplid); + public List getProgramsForModule(int cmid); - public int getStartSemForCourse(int cpid, int ctplid); + public int getStartSemForModule(int cpid, int cmid); - public int getEndSemForCourse(int cpid, int ctplid); + public int getEndSemForModule(int cpid, int cmid); - public String getProgramType(int cpid, int ctplid); + public String getProgramType(int cpid, int cmid); public CourseDate getCourseDates(int cid, char dtype); - public void deleteCoursePrograms(int ctplid); + public void deleteCourseProgramsForModule(int cmid); public void updateCourseAttrs(int cid, Map attrs); @@ -515,6 +517,8 @@ String label) throws CobricksException; + public int getLecturerIdByName(String lname); + } Index: CourseManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseManagerImpl.java,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- CourseManagerImpl.java 3 Jan 2006 09:36:56 -0000 1.54 +++ CourseManagerImpl.java 30 May 2006 14:32:00 -0000 1.55 @@ -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 @@ -136,51 +136,8 @@ if (res == -1) dbAccess.createTable(tablename); else if (res == -2) { logger.info("Found need to update table "+tablename); - if (tablename.equals("course")) { - // non-versioned schema change Dec 2005: - // this should be removed soon ... - try { - if (dbAccess.getDBType()==DBAccessImpl.DBTYPE_MYSQL) { - String sql = "ALTER TABLE course CHANGE `ctplid` cmid int"; - dbAccess.sqlExecute(sql, true); - } - if (dbAccess.getDBType()==DBAccessImpl.DBTYPE_POSTGRES) { - String sql = "ALTER TABLE course RENAME COLUMN ctplid TO cmid"; - dbAccess.sqlExecute(sql, true); - } - } catch (Exception e) { } - } - else if (tablename.equals("course_progrel")) { - // non-versioned schema change Dec 2005: - // this should be removed soon ... - try { - if (dbAccess.getDBType()==DBAccessImpl.DBTYPE_MYSQL) { - String sql = "ALTER TABLE course_progrel CHANGE `ctplid` cmid int"; - dbAccess.sqlExecute(sql, true); - } - if (dbAccess.getDBType()==DBAccessImpl.DBTYPE_POSTGRES) { - String sql = "ALTER TABLE course_progrel RENAME COLUMN ctplid TO cmid"; - dbAccess.sqlExecute(sql, true); - } - } catch (Exception e) { } - } - else if (tablename.equals("course_lecturer")) { - // non-versioned schema change Dec 2005: - // this should be removed soon ... - // renamed columns size, url, creatoriontime - try { - if (dbAccess.getDBType()==DBAccessImpl.DBTYPE_MYSQL) { - String sql = "ALTER TABLE course_lecturer CHANGE `uid` globalid varchar(64)"; - dbAccess.sqlExecute(sql, true); - } - if (dbAccess.getDBType()==DBAccessImpl.DBTYPE_POSTGRES) { - String sql = "ALTER TABLE course_lecturer RENAME COLUMN uid TO globalid"; - dbAccess.sqlExecute(sql, true); - } - } catch (Exception e) { } - } else if (!dbAccess.updateTable(tablename)) - logger.error("Updating table "+tablename+" failed."); + logger.error("Updating table "+tablename+" failed."); } } @@ -229,9 +186,9 @@ copyAttr("cname_en", attrs, sqlAttrs); copyAttr("ccomment", attrs, sqlAttrs); copyAttr("clang", attrs, sqlAttrs); - copyAttr("cgroup", attrs, sqlAttrs); copyAttr("curl", attrs, sqlAttrs); - copyAttr("cparticipants", attrs, sqlAttrs); + copyAttr("cexaminerid", attrs, sqlAttrs); + copyAttr("ccapacity", attrs, sqlAttrs); copyAttr("cectscredits", attrs, sqlAttrs); copyAttr("chours_lec", attrs, sqlAttrs); copyAttr("chours_ex", attrs, sqlAttrs); @@ -239,11 +196,15 @@ copyAttr("chours_lab", attrs, sqlAttrs); copyAttr("ccontent", attrs, sqlAttrs); copyAttr("ccontent_en", attrs, sqlAttrs); + copyAttr("ctarget", attrs, sqlAttrs); + copyAttr("ctarget_en", attrs, sqlAttrs); copyAttr("cprerequ", attrs, sqlAttrs); copyAttr("cprerequ_en", attrs, sqlAttrs); - copyAttr("cprerequcert", attrs, sqlAttrs); - copyAttr("cprerequcert_en", attrs, sqlAttrs); - copyAttr("ccategoryid", attrs, sqlAttrs); + copyAttr("ccert", attrs, sqlAttrs); + copyAttr("ccert_en", attrs, sqlAttrs); + copyAttr("cdidactics", attrs, sqlAttrs); + copyAttr("cdidactics_en", attrs, sqlAttrs); + copyAttr("cexaminerid", attrs, sqlAttrs); copyAttr("cextid", attrs, sqlAttrs); copyAttr("cextlastrep", attrs, sqlAttrs); //TODO add new attributes @@ -319,21 +280,17 @@ // Adding new lecturers to course try { if(attrs.containsKey("newlecturerid")){ - String lid = (String) attrs.get("newlecturerid"); - if(lid != null){ - String sql = - "SELECT * FROM course_lecturer WHERE lid = '" - +lid+"'"; - List sqlList = dbAccess.sqlQuery(sql); - if(sqlList.size()==1){ - addLecturerToCourse(Integer.parseInt(lid), - cid,user); - } else { - logger.debug("Adding course to lecturer " - +"relation failed!" - +" There is no lecturer with id : " - +lid+" "); - } + String tmps = (String) attrs.get("newlecturerid"); + try { + int lid = Integer.parseInt(tmps); + addLecturerToCourse(lid, cid, user); + } catch (Exception e) { } + } + if(attrs.containsKey("newlecturername")) { + String lname = (String) attrs.get("newlecturername"); + int lid = getLecturerIdByName(lname); + if (lid > 0) { + addLecturerToCourse(lid, cid, user); } } } catch(Exception ex) { @@ -378,9 +335,9 @@ copyAttr("ccontent_en", attrs, sqlAttrs); copyAttr("cprerequ", attrs, sqlAttrs); copyAttr("cprerequ_en", attrs, sqlAttrs); - copyAttr("cprerequcert", attrs, sqlAttrs); - copyAttr("cprerequcert_en", attrs, sqlAttrs); - copyAttr("ccategoryid", attrs, sqlAttrs); + copyAttr("ccert", attrs, sqlAttrs); + copyAttr("ccert_en", attrs, sqlAttrs); + copyAttr("cexaminerid", attrs, sqlAttrs); copyAttr("cextid", attrs, sqlAttrs); copyAttr("cimport", attrs, sqlAttrs); copyAttr("chidden", attrs, sqlAttrs); @@ -462,16 +419,17 @@ // Adding new lecturer to course try { if(attrs.containsKey("newlecturerid")){ - String lid = (String) attrs.get("newlecturerid"); - if(lid != null){ - String sql = "SELECT * FROM course_lecturer WHERE lid = '"+lid+"'"; - List sqlList = dbAccess.sqlQuery(sql); - if(sqlList.size()==1){ - addLecturerToCourse(Integer.parseInt(lid),cid,user); - } else { - logger.debug("Adding course to lecturer relation failed!" + - " There is no lecturer with id : "+lid+" "); - } + String tmps = (String) attrs.get("newlecturerid"); + try { + int lid = Integer.parseInt(tmps); + addLecturerToCourse(lid, cid, user); + } catch (Exception e) { } + } + if(attrs.containsKey("newlecturername")){ + String lname = (String) attrs.get("newlecturername"); + int lid = getLecturerIdByName(lname); + if (lid > 0) { + addLecturerToCourse(lid, cid, user); } } } catch(Exception ex) { @@ -560,14 +518,13 @@ } /** - * @see org.cobricks.course.CourseManager#searchCourses(java.util.Map) + * @see org.cobricks.course.CourseManager#searchCourses(java.util.Map,java.lang.String) */ - public List searchCourses(Map attrs) throws CobricksException + public List searchCourses(Map attrs, String sortby) throws CobricksException { - logger.debug("Search Course"); + logger.debug("Search course"); List result = new ArrayList(); - // display the last 30 courses by default - String sql = "SELECT * FROM course ORDER BY cid LIMIT 30"; + String sql = "SELECT * FROM course ORDER BY cname"; if(attrs.size()>0){ String where = "where course.cmid = course_module.cmid "; String from = "course, course_module "; @@ -642,9 +599,11 @@ where += "AND course_date.dendhour <= '"+attrs.get("endhour")+"' "; } - sql = "SELECT DISTINCT course.cid, course.* FROM "+from+" "+where+" ORDER BY course.cid"; + sql = "SELECT DISTINCT course.cid, course.*," + +"course_module.cmname FROM " + +from+" "+where+" ORDER BY course_module.cmname"; } - logger.debug("Search Course : ("+sql+")"); + logger.debug("Search Course ("+sql+")"); try{ List sqlList = dbAccess.sqlQuery(sql); @@ -778,26 +737,31 @@ Map sqlAttrs = new HashMap(); copyAttr("cmname", attrs, sqlAttrs); copyAttr("cmname_en", attrs, sqlAttrs); - copyAttr("cmparentid", attrs, sqlAttrs); + copyAttr("cmsid", attrs, sqlAttrs); copyAttr("cmshortname", attrs, sqlAttrs); copyAttr("cmtype", attrs, sqlAttrs); copyAttr("cmectscredits", attrs, sqlAttrs); copyAttr("cmcontent", attrs, sqlAttrs); copyAttr("cmcontent_en", attrs, sqlAttrs); + copyAttr("cmtarget", attrs, sqlAttrs); + copyAttr("cmtarget_en", attrs, sqlAttrs); copyAttr("cmprerequ", attrs, sqlAttrs); copyAttr("cmprerequ_en", attrs, sqlAttrs); - copyAttr("cmprerequcert", attrs, sqlAttrs); - copyAttr("cmprerequcert_en", attrs, sqlAttrs); + copyAttr("cmcert", attrs, sqlAttrs); + copyAttr("cmcert_en", attrs, sqlAttrs); + copyAttr("cmdidactics", attrs, sqlAttrs); + copyAttr("cmdidactics_en", attrs, sqlAttrs); copyAttr("cmcycle", attrs, sqlAttrs); - copyAttr("cmapplicant", attrs, sqlAttrs); - copyAttr("cmexaminer", attrs, sqlAttrs); copyAttr("cmhidden", attrs, sqlAttrs); + copyAttr("cmaddxml", attrs, sqlAttrs); copyAttr("cmhours_lec", attrs, sqlAttrs); copyAttr("cmhours_ex", attrs, sqlAttrs); copyAttr("cmhours_sem", attrs, sqlAttrs); copyAttr("cmhours_lab", attrs, sqlAttrs); + copyAttr("cmcapacity", attrs, sqlAttrs); + copyAttr("cmresponsible", attrs, sqlAttrs); + copyAttr("cmcomment", attrs, sqlAttrs); // add new attributes - sqlAttrs.put("cmappdate", new Date()); sqlAttrs.put("cmimport", new Integer(0)); int maxcnt = 6; @@ -823,7 +787,6 @@ if (o != null) sqlAttrs2.put("cpendsem", o); o = attrs.get("type"+i); if (o != null) sqlAttrs2.put("cptype", o); -// logger.debug("Progrel : "+sqlAttrs2.toString()+" "+i); dbAccess.sqlInsert("course_progrel", sqlAttrs2); } } @@ -848,20 +811,26 @@ Map sqlAttrs = new HashMap(); copyAttr("cmname", attrs, sqlAttrs); copyAttr("cmname_en", attrs, sqlAttrs); + copyAttr("cmsid", attrs, sqlAttrs); copyAttr("cmshortname", attrs, sqlAttrs); copyAttr("cmtype", attrs, sqlAttrs); copyAttr("cmectscredits", attrs, sqlAttrs); copyAttr("cmcontent", attrs, sqlAttrs); copyAttr("cmcontent_en", attrs, sqlAttrs); + copyAttr("cmtarget", attrs, sqlAttrs); + copyAttr("cmtarget_en", attrs, sqlAttrs); copyAttr("cmprerequ", attrs, sqlAttrs); copyAttr("cmprerequ_en", attrs, sqlAttrs); - copyAttr("cmprerequcert", attrs, sqlAttrs); - copyAttr("cmprerequcert_en", attrs, sqlAttrs); + copyAttr("cmcert", attrs, sqlAttrs); + copyAttr("cmcert_en", attrs, sqlAttrs); + copyAttr("cmdidactics", attrs, sqlAttrs); + copyAttr("cmdidactics_en", attrs, sqlAttrs); + copyAttr("cmaddxml", attrs, sqlAttrs); copyAttr("cmcycle", attrs, sqlAttrs); - copyAttr("cmappdate", attrs, sqlAttrs); copyAttr("cmhidden", attrs, sqlAttrs); - copyAttr("cmapplicant", attrs, sqlAttrs); - copyAttr("cmexaminer", attrs, sqlAttrs); + copyAttr("cmcapacity", attrs, sqlAttrs); + copyAttr("cmresponsible", attrs, sqlAttrs); + copyAttr("cmcomment", attrs, sqlAttrs); copyAttr("cmhours_lec", attrs, sqlAttrs); copyAttr("cmhours_ex", attrs, sqlAttrs); copyAttr("cmhours_sem", attrs, sqlAttrs); @@ -949,9 +918,8 @@ // load from database Map dbres = dbAccess. sqlQuerySingleRow("select * from course_module where cmid = " - +Integer.toString(cmid)); - - if(!(dbres.isEmpty())){ + +Integer.toString(cmid)); + if(!(dbres.isEmpty())) { result = new CourseModule(); result.loadFromMap(dbres, this); courseModuleCache.put(new Integer(cmid), result); @@ -977,7 +945,27 @@ result.add(cmpr); } return result; - + } + + /** + * @see org.cobricks.course.CourseManager#getCourseModuleProgramRel(CourseModule) + */ + public List getCourseModuleProgramRel(CourseModule cm) + throws CobricksException + { + int cmid = cm.getId(); + List result = new ArrayList(); + String sql = "select * from course_progrel where cmid = "+cmid+";"; + List sqlList = dbAccess.sqlQuery(sql); + ListIterator i = sqlList.listIterator(); + logger.info("Returns CourseModuleProgramRelation"); + while (i.hasNext()) { + Map m = (Map)i.next(); + CourseModuleProgramRel cmpr = new CourseModuleProgramRel(); + cmpr.loadFromMap(m, this, cm); + result.add(cmpr); + } + return result; } public CourseModule getCourseModuleForName(String cmname) @@ -997,42 +985,61 @@ } /** - * @see org.cobricks.course.CourseManager#searchCourseModules(java.util.Map) + * @see org.cobricks.course.CourseManager#searchCourseModules(java.util.Map,java.lang.String) */ - public List searchCourseModules(Map attrs) throws CobricksException + public List searchCourseModules(Map attrs, String sortby) + throws CobricksException { - // display the last 30 course_modules by default - logger.debug("Search Coursemodule"); + logger.debug("Search course modules"); List result = new ArrayList(); - String sql = "SELECT * FROM course_module ORDER BY cmid LIMIT 30"; - if(attrs.size()>0){ - String where = "where cmid = cmid "; - if(attrs.get("cmname")!=null) + String sql = "SELECT * FROM course_module"; + String where = ""; + if (attrs.size()>0) { + if (attrs.get("cmid")!=null) + where += "AND cmid = "+attrs.get("cmid")+" "; + if (attrs.get("cmname")!=null) where += "AND cmname like '%"+attrs.get("cmname")+"%' "; - if(attrs.get("cmname_en")!=null) + if (attrs.get("cmname_en")!=null) where += "AND cmname_en like '%"+attrs.get("cmname_en")+"%' "; - if(attrs.get("cmcontent")!=null) + if (attrs.get("cmcontent")!=null) where += "AND cmcontent like '%"+attrs.get("cmcontent")+"%' "; - if(attrs.get("cmcontent_en")!=null) + if (attrs.get("cmcontent_en")!=null) where += "AND cmcontent_en like '%" +attrs.get("cmcontent_en")+"%' "; - if(attrs.get("cmshortname")!=null) + if (attrs.get("cmsid")!=null) + where += "AND cmsid like '%"+attrs.get("cmsid")+"%' "; + if (attrs.get("cmshortname")!=null) where += "AND cmshortname like '%"+attrs.get("cmshortname")+"%' "; - if(attrs.get("cmtype")!=null) + if (attrs.get("cmtype")!=null) where += "AND cmtype = '"+attrs.get("cmtype")+"' "; - if(attrs.get("cmhidden")!=null) + if (attrs.get("cmhidden")!=null) where += "AND cmhidden = '"+attrs.get("cmhidden")+"' "; - if(attrs.get("cmectscredits")!=null) + if (attrs.get("cmectscredits")!=null) where += "AND cmectscredits = '"+attrs.get("cmectscredits")+"' "; - if(attrs.get("cmhours_lec")!=null) + if (attrs.get("cmhours_lec")!=null) where += "AND cmhours_lec = '"+attrs.get("cmhours_lec")+"' "; - if(attrs.get("cmhours_ex")!=null) + if (attrs.get("cmhours_ex")!=null) where += "AND cmhours_ex = '"+attrs.get("cmhours_ex")+"' "; - if(attrs.get("cmhours_sem")!=null) + if (attrs.get("cmhours_sem")!=null) where += "AND cmhours_sem = '"+attrs.get("cmhours_sem")+"' "; - if(attrs.get("cmhours_lab")!=null) + if (attrs.get("cmhours_lab")!=null) where += "AND cmhours_lab = '"+attrs.get("cmhours_lab")+"' "; - sql = "SELECT * FROM course_module "+where+" ORDER BY cmid"; + if (attrs.get("cpid")!=null) { + sql += ",course_progrel"; + where += "AND course_progrel.cmid = course_module.cmid AND course_progrel.cpid = "+attrs.get("cpid")+" "; + } + if (where.startsWith("AND ")) + where = where.substring(4); + if (where.length()>0) + sql = sql + " where "+where; + } + if (sortby.equals("cmtype")) { + sql = sql + " ORDER BY cmtype, cmname"; + } + else { + if (sortby == null || sortby.length()<1) + sortby = "cmname"; + sql = sql + " ORDER BY "+sortby; } List sqlList = dbAccess.sqlQuery(sql); @@ -1197,16 +1204,9 @@ copyAttr("llastname", attrs, sqlAttrs); copyAttr("lurl", attrs, sqlAttrs); copyAttr("limageurl", attrs, sqlAttrs); - copyAttr("lgroup", attrs, sqlAttrs); copyAttr("lextid", attrs, sqlAttrs); copyAttr("lhidden", attrs, sqlAttrs); - - // Default policy: This is a create method, so there must not be a given - // id - it has to be created by the system, --> no interference with - // other course lecuters! - UUID uuid = new UUID(); - String uniqueid = uuid.getNewUuidAsString(); - sqlAttrs.put("globalid", uniqueid); + copyAttr("luserid", attrs, sq... [truncated message content] |