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: Wolfgang W. <wo...@us...> - 2007-11-14 14:03:55
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28814/src/org/cobricks/portal Modified Files: PortalPresenter.java Log Message: Index: PortalPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPresenter.java,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- PortalPresenter.java 18 Oct 2007 10:49:14 -0000 1.62 +++ PortalPresenter.java 14 Nov 2007 14:03:49 -0000 1.63 @@ -64,7 +64,7 @@ import org.apache.nutch.searcher.Summary; import org.apache.hadoop.fs.*; -import org.apache.hadoop.io.Closeable; +import org.apache.hadoop.io.*; import org.apache.hadoop.conf.*; import org.apache.nutch.parse.*; import org.apache.nutch.indexer.*; @@ -638,7 +638,6 @@ return sb.toString(); } - /** * Print a clickable path of the current page - if "printPageName" * is not null, then the page name will be printed as last @@ -705,6 +704,63 @@ return result.toString(); } + /** + * Print the path of the current page (but no link) - if "printPageName" + * is not null, then the page name will be printed as last + * element of the page + */ + public String printNavigationPathNoLink(PortalRequest portalRequest) + { + return printNavigationPathNoLink(portalRequest, null); + } + + public String printNavigationPathNoLink(PortalRequest portalRequest, + String printPageName) + { + StringBuffer result = new StringBuffer(""); + + HttpServletRequest request = portalRequest.getHttpServletRequest(); + String uri = request.getRequestURI(); + uri = portalRequest.getPagePath()+portalRequest.getPageName(); + int poslast = uri.lastIndexOf("/"); + String pagename = ""; + String fullpagename = ""; + try { + pagename = uri.substring(poslast+1); + fullpagename = pagename; + int pos = pagename.indexOf("."); + if (pos > -1) + pagename = pagename.substring(0, pos); + } catch (Exception e) { } + int posfirst = uri.indexOf("/"); + if (poslast > posfirst) { + String tmpurl = "/"; + uri = uri.substring(posfirst+1, poslast); + StringTokenizer st = new StringTokenizer(uri, "/"); + while (st.hasMoreTokens()) { + String tmps = st.nextToken(); + tmpurl = tmpurl + tmps + "/"; + PortalFolder pf = portalManager.getPortalFolder(tmpurl); + String tmpname = tmps; + if (pf != null) { + tmpname = pf.getTitle(portalRequest.getLang()); + if (tmpname.startsWith("/")) + tmpname = tmps; + } + result.append(" - "); + result.append(tmpname); + } + if (printPageName!=null && + pagename!=null && pagename.length()>0 && + (!(pagename.equals("index")))) { + result.append(" - "); + result.append(pagename); + } + } + + return result.toString(); + } + /** * Return a list of PortalPage objects for a given folder. @@ -1344,29 +1400,32 @@ try { - Configuration conf = NutchConfiguration.create(); - logger.info("conf = " + conf.toString()); - // Test String classpath = System.getProperties().getProperty("java.class.path"); logger.info("CLASSPATH = " + classpath); - + // result = "CLASSPATH = " + classpath + "<p>"; + + Configuration conf = NutchConfiguration.create(); + logger.info("conf = " + conf.toString()); + String pathtonutch = coreManager.getProperty("search.nutch.crawl"); NutchBean bean = new NutchBean(conf, new Path(pathtonutch)); + // result = result + "search.nutch.crawl = " + pathtonutch + "<p>"; // NutchBean bean = new NutchBean(conf, new Path("/usr/wiss/woerndl/drehscheibe/nutch/crawl")); logger.info("querystring = " + querystring); + // result = result + "querystring = " + querystring + "<p>"; Query query = Query.parse(querystring, conf); - logger.info("query = " + query.toString()); + // result = result + "query = " + query + "<p>"; - // Hits hits = bean.search(query, maxhits); - Hits hits = bean.search(query, 10); + Hits hits = bean.search(query, maxhits); - logger.info("Total hits: " + hits.getTotal()); + // logger.info("Total hits: " + hits.getTotal()); + // result = result + "Total hits: " + hits.getTotal() + "<p>"; if (hits.getLength() > 0) { - result = "<div id=\"suchergebnis\">\n<ul>"; + result = result + "<div id=\"suchergebnis\">\n<ul>"; } for (int i = 0; i < hits.getLength(); i++) @@ -1376,6 +1435,9 @@ String title = details.getValue("title"); String hiturl = details.getValue("url"); + + if ((title == null) || (title.equals(""))) + title = hiturl; Summary summary = bean.getSummary(details, query); result = result + "<li><a href=\"" + hiturl + "\">" + title + "</a><p>" + summary + "</p></li>\n"; @@ -1385,6 +1447,7 @@ { result = result + "</ul></div>"; } + } catch (Exception e) { |
|
From: Wolfgang W. <wo...@us...> - 2007-10-18 10:49:20
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19415/src/org/cobricks/portal Modified Files: PortalPresenter.java Log Message: Index: PortalPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPresenter.java,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- PortalPresenter.java 20 Mar 2007 17:26:21 -0000 1.61 +++ PortalPresenter.java 18 Oct 2007 10:49:14 -0000 1.62 @@ -35,6 +35,10 @@ import javax.servlet.*; import javax.servlet.http.*; +// Für Nutch Suche +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.apache.log4j.Logger; import org.apache.velocity.VelocityContext; import org.apache.velocity.Template; @@ -52,6 +56,31 @@ import org.cobricks.category.CategoryPresenter; import org.cobricks.user.User; +import org.apache.nutch.searcher.Hit; +import org.apache.nutch.searcher.HitDetails; +import org.apache.nutch.searcher.Hits; +import org.apache.nutch.searcher.NutchBean; +import org.apache.nutch.searcher.Query; +import org.apache.nutch.searcher.Summary; + +import org.apache.hadoop.fs.*; +import org.apache.hadoop.io.Closeable; +import org.apache.hadoop.conf.*; +import org.apache.nutch.parse.*; +import org.apache.nutch.indexer.*; +import org.apache.nutch.crawl.Inlinks; +import org.apache.nutch.util.NutchConfiguration; + +// Für Lucene Suche +/* +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.de.GermanAnalyzer; +import org.apache.lucene.document.Document; +import org.apache.lucene.search.*; +import org.apache.lucene.queryParser.QueryParser; +*/ + + /** * Collection of methods for the Portal Component user interface. * @@ -1305,5 +1334,97 @@ } + /** + * Search a Lucene/Nutch full text index with Nutch + **/ + public String fulltextSearch (String querystring, int maxhits) + + { + String result = ""; + + try + { + Configuration conf = NutchConfiguration.create(); + logger.info("conf = " + conf.toString()); + + // Test + String classpath = System.getProperties().getProperty("java.class.path"); + logger.info("CLASSPATH = " + classpath); + + String pathtonutch = coreManager.getProperty("search.nutch.crawl"); + NutchBean bean = new NutchBean(conf, new Path(pathtonutch)); + // NutchBean bean = new NutchBean(conf, new Path("/usr/wiss/woerndl/drehscheibe/nutch/crawl")); + + logger.info("querystring = " + querystring); + Query query = Query.parse(querystring, conf); + logger.info("query = " + query.toString()); + + // Hits hits = bean.search(query, maxhits); + Hits hits = bean.search(query, 10); + + logger.info("Total hits: " + hits.getTotal()); + + if (hits.getLength() > 0) + { + result = "<div id=\"suchergebnis\">\n<ul>"; + } + + for (int i = 0; i < hits.getLength(); i++) + { + Hit hit = hits.getHit(i); + HitDetails details = bean.getDetails(hit); + + String title = details.getValue("title"); + String hiturl = details.getValue("url"); + Summary summary = bean.getSummary(details, query); + + result = result + "<li><a href=\"" + hiturl + "\">" + title + "</a><p>" + summary + "</p></li>\n"; + } + + if (hits.getLength() > 0) + { + result = result + "</ul></div>"; + } + } + catch (Exception e) + { + logger.error(LogUtil.ex("Exception in Nutch fulltext search.", e)); + } + + return result; + } + + /** + * Search a Lucene/Nutch full text index with Lucene + **/ + + /* + public String fulltextSearch (String querystring, int maxhits) + { + String result = ""; + + try + { + Searcher searcher = new IndexSearcher("/usr/wiss/woerndl/drehscheibe/nutch/crawl"); + Analyzer analyzer = new GermanAnalyzer(); + Query query = QueryParser.parse(querystring, Const.DEF_FIELD, analyzer); + Hits hits = searcher.search(query); + int end = hits.length(); + for (int i=0; i<end; i++) + { + Document doc = hits.doc(i); + String path = doc.get(Const.PATH_FIELD); + result = result + path; + } + } + catch (Exception e) + { + e.printStackTrace(); + } + + return result; + } + */ } + |
|
From: Michael K. <ko...@us...> - 2007-08-23 05:39:15
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18686 Modified Files: generateListDeputate.java Log Message: Index: generateListDeputate.java =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course/generateListDeputate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- generateListDeputate.java 4 May 2007 10:34:16 -0000 1.1 +++ generateListDeputate.java 23 Aug 2007 05:39:11 -0000 1.2 @@ -191,13 +191,18 @@ +c.getHours()+" ; "); List ll = courseManager.getLecturersForCourse(cid.intValue()); Iterator ii = ll.iterator(); + String clgroup = null; while (ii.hasNext()) { CourseLecturer cl = (CourseLecturer)ii.next(); out.print(cl.getName()); if (ii.hasNext()) out.print(", "); + if (clgroup == null) + clgroup = cl.getGroup(); } - out.println(""); + out.print(" ; "); + if (clgroup == null) clgroup = ""; + out.println(clgroup); } catch (Exception e) { } } |
|
From: Wolfgang W. <wo...@us...> - 2007-07-17 12:45:04
|
Update of /cvsroot/cobricks/drehscheibe-in In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20860 Modified Files: build.xml Log Message: Index: build.xml =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/build.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- build.xml 4 May 2007 10:35:06 -0000 1.12 +++ build.xml 17 Jul 2007 12:44:57 -0000 1.13 @@ -403,7 +403,7 @@ classname="de.tum.cobricks.course.generateHTMLOverviews" maxmemory="512M" classpathref="exec.classpath"> <jvmarg value="-Dfile.encoding=utf-8"/> - <arg line="build/webapps/ROOT/WEB-INF/conf SS 2007 test"/> + <arg line="build/webapps/ROOT/WEB-INF/conf WS 2007 test"/> </java> </target> @@ -412,7 +412,16 @@ classname="de.tum.cobricks.course.generateListDeputate" maxmemory="512M" classpathref="exec.classpath"> <jvmarg value="-Dfile.encoding=utf-8"/> - <arg line="build/webapps/ROOT/WEB-INF/conf SS 2007"/> + <arg line="build/webapps/ROOT/WEB-INF/conf WS 2007"/> + </java> +</target> + +<target name="list2" depends="compile"> + <java fork="yes" + classname="de.tum.cobricks.course.generateListExams" maxmemory="512M" + classpathref="exec.classpath"> + <jvmarg value="-Dfile.encoding=utf-8"/> + <arg line="build/webapps/ROOT/WEB-INF/conf WS 2007"/> </java> </target> |
|
From: Wolfgang W. <wo...@us...> - 2007-07-17 12:45:02
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20860/src/de/tum/cobricks/course Added Files: generateListExams.java Log Message: --- NEW FILE: generateListExams.java --- /* * Copyright (c) 2002-2007 Michael Koch, mic...@ac... * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * */ package de.tum.cobricks.course; import java.io.*; import java.net.*; import java.sql.*; import java.text.*; import java.util.Date; import java.util.*; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import org.cobricks.core.CobricksException; import org.cobricks.core.ComponentDirectory; import org.cobricks.core.CoreManager; import org.cobricks.core.db.DBAccess; import org.cobricks.core.util.DateUtil; import org.cobricks.core.util.LogUtil; import org.cobricks.core.util.PropertiesUtil; import org.cobricks.course.Course; import org.cobricks.course.CourseDate; import org.cobricks.course.CourseLecturer; import org.cobricks.course.CourseManager; import org.cobricks.course.CourseModule; import org.cobricks.course.CourseProgram; import org.cobricks.course.CourseRoom; import org.cobricks.user.UserManager; /** * Generate a list of lecture courses for the exam plannung process (Hr. Meixner) * * * @author Michael Koch, Wolfgang Woerndl, TUM * @version $Date: 2007/07/17 12:44:58 $ */ public class generateListExams { static Logger logger = Logger.getLogger(generateListExams.class); static private CoreManager coreManager = null; static private DBAccess dbAccess; static String querysem; static int queryjahr; static String cterm; static CourseManager courseManager; static UserManager userManager; public static void main(String args[]) { String confdir = "WEB-INF/conf"; querysem = "WS"; queryjahr = 2007; if (args.length > 0) confdir = args[0]; if (args.length > 1) querysem = args[1]; if (args.length > 2) queryjahr = Integer.parseInt(args[2]); cterm = Integer.toString(queryjahr); if (querysem.equals("WS")) { cterm += "w"; } else { cterm += "s"; } generateListExams o = new generateListExams(confdir); try { o.doIt(); } catch (Exception e) { System.err.println(e.toString()); } } /** * */ public generateListExams(String confdir) { try { PropertyConfigurator. configure(confdir+File.separator+"log.properties"); } catch (Throwable e) { } // Instantiate CoreManager coreManager = new CoreManager(); // load Cobricks configuration (properties) Properties properties = new Properties(); properties.put("configdir", confdir); PropertiesUtil.loadProperties(confdir, properties, coreManager); // initialize CoreManager object ... try { coreManager.init(properties); } catch (CobricksException e) { System.err.println(e.toString()); System.exit(-1); } // initialize all the other components // this call instantiates all manager and presenter objects try { coreManager.initComponents(properties); } catch (Throwable e) { logger.error(LogUtil.ex("Failed initializing components.", e)); } this.dbAccess = coreManager.getDBAccess(); ComponentDirectory componentDirectory = coreManager.getComponentDirectory(); userManager = (UserManager) componentDirectory.getManager("userManager"); courseManager = (CourseManager) componentDirectory.getManager("courseManager"); } /** * */ public void doIt() throws Exception { String filename = "list"+querysem+Integer.toString(queryjahr)+".txt"; File file = new File(filename); PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new java.io.FileOutputStream(file),"UTF8"))); String query = "SELECT cid, cname, cmname, chours_lec, " +"chours_ex, chours_sem, chours_lab, " +"course_module.cmid, cmtype, cmsid, " +"cimport, chidden " +"FROM course, course_module " +"WHERE course.cmid = course_module.cmid AND " +"(cimport = 0 or cimport is null) and " +"cterm = '"+cterm+"' "; query = query + " order by cmtype, cmname, cname"; List l = dbAccess.sqlQuery(query); out.println("Veranstaltungen im "+ querysem+" "+queryjahr+"\n"); Iterator i = l.iterator(); while (i.hasNext()) { Map h = (Map)i.next(); Integer cid = (Integer)h.get("cid"); try { Course c = courseManager.getCourse(cid.intValue()); CourseModule cm = c.getCourseModule(); out.print(cm.getSId()+" ; "+cid.toString()+" ; " +c.getFullName()); out.print(" ; "+cm.getType()+" ; " +c.getHours()+" ; "); List ll = courseManager.getLecturersForCourse(cid.intValue()); Iterator ii = ll.iterator(); while (ii.hasNext()) { CourseLecturer cl = (CourseLecturer)ii.next(); out.print(cl.getName()); if (ii.hasNext()) out.print(", "); } // New, for exam planning out.print("; cexamform=" + c.getExamform()); out.print("; cexamrepeat=" + c.getExamrepeat()); out.print("; cexamweek=" + c.getExamweek()); out.print("; cexamrepeatweek=" + c.getExamrepeatweek()); out.println(""); } catch (Exception e) { } } out.close(); } } |
|
From: Wolfgang W. <wo...@us...> - 2007-06-20 15:11:50
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21017/src/org/cobricks/course Modified Files: Course.java CourseManagerImpl.java CourseServlet.java Log Message: Index: Course.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/Course.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- Course.java 21 Mar 2007 08:25:38 -0000 1.28 +++ Course.java 20 Jun 2007 15:11:42 -0000 1.29 @@ -225,6 +225,38 @@ return null; } + /** Returns the course examform + * @return String representing the type of exam of the course (e.g. muendl) + */ + public String getExamform() + { + return (String)attrs.get("cexamform"); + } + + /** Returns the course examrepeat + * @return String representing whether Wiederholungsklausur or not + */ + public String getExamrepeat() + { + return (String)attrs.get("cexamrepeat"); + } + + /** Returns the course examweek + * @return String representing the week of the exam (e.g. ersteFreieWoche) + */ + public String getExamweek() + { + return (String)attrs.get("cexamweek"); + } + + /** Returns the course examrepeatweek + * @return String representing the week of the Wiederholungsklausur (e.g. ersteWocheNeuSem) + */ + public String getExamrepeatweek() + { + return (String)attrs.get("cexamrepeatweek"); + } + public int getHours() { int res = getHoursLecture(); Index: CourseServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseServlet.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- CourseServlet.java 4 Mar 2007 12:49:47 -0000 1.30 +++ CourseServlet.java 20 Jun 2007 15:11:42 -0000 1.31 @@ -141,6 +141,12 @@ attrs.put("ccomment", prequest.getRequestParameter("ccomment")); attrs.put("clang", prequest.getRequestParameter("clang")); attrs.put("curl", prequest.getRequestParameter("curl")); + + attrs.put("cexamform", prequest.getRequestParameter("cexamform")); + attrs.put("cexamrepeat", prequest.getRequestParameter("cexamrepeat")); + attrs.put("cexamweek", prequest.getRequestParameter("cexamweek")); + attrs.put("cexamrepeatweek", prequest.getRequestParameter("cexamrepeatweek")); + tmps = prequest.getRequestParameter("ccapacity"); if (tmps != null) { try { Index: CourseManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseManagerImpl.java,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- CourseManagerImpl.java 1 Jun 2007 13:45:24 -0000 1.70 +++ CourseManagerImpl.java 20 Jun 2007 15:11:42 -0000 1.71 @@ -208,6 +208,11 @@ copyAttr("cextlastrep", attrs, sqlAttrs); copyAttr("cimport", attrs, sqlAttrs); + copyAttr("cexamform", attrs, sqlAttrs); + copyAttr("cexamrepeat", attrs, sqlAttrs); + copyAttr("cexamweek", attrs, sqlAttrs); + copyAttr("cexamrepeatweek", attrs, sqlAttrs); + try { if (user != null) sqlAttrs.put("clastupdateuserid", new Integer(user.getId())); @@ -366,6 +371,13 @@ copyAttr("chidden", attrs, sqlAttrs); copyAttr("cextlastrep", attrs, sqlAttrs); copyAttr("ccapacity", attrs, sqlAttrs); + + copyAttr("cexamform", attrs, sqlAttrs); + copyAttr("cexamrepeat", attrs, sqlAttrs); + copyAttr("cexamweek", attrs, sqlAttrs); + copyAttr("cexamrepeatweek", attrs, sqlAttrs); + + try { sqlAttrs.put("clastupdateuserid", new Integer(user.getId())); } catch(Exception exp){ @@ -2643,3 +2655,4 @@ } } + |
|
From: Wolfgang W. <wo...@us...> - 2007-06-20 15:11:46
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course/db In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21017/src/org/cobricks/course/db Modified Files: course.xml Log Message: Index: course.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/db/course.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- course.xml 11 Jul 2006 10:27:03 -0000 1.6 +++ course.xml 20 Jun 2007 15:11:42 -0000 1.7 @@ -46,6 +46,11 @@ <column name="cextid" type="varchar(70)"/> <column name="cextlastrep" type="timestamp"/> + <column name="cexamform" type="varchar(25)"/> + <column name="cexamrepeat" type="varchar(25)"/> + <column name="cexamweek" type="varchar(25)"/> + <column name="cexamrepeatweek" type="varchar(25)"/> + <index name="course_cid" unique="unique"> <colname>cid</colname> </index> |
|
From: Wolfgang W. <wo...@us...> - 2007-06-01 13:45:28
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv5616/src/org/cobricks/course Modified Files: CourseManagerImpl.java Log Message: Index: CourseManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseManagerImpl.java,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- CourseManagerImpl.java 18 Jan 2007 13:05:21 -0000 1.69 +++ CourseManagerImpl.java 1 Jun 2007 13:45:24 -0000 1.70 @@ -365,6 +365,7 @@ copyAttr("cimport", attrs, sqlAttrs); copyAttr("chidden", attrs, sqlAttrs); copyAttr("cextlastrep", attrs, sqlAttrs); + copyAttr("ccapacity", attrs, sqlAttrs); try { sqlAttrs.put("clastupdateuserid", new Integer(user.getId())); } catch(Exception exp){ |
|
From: Michael K. <ko...@us...> - 2007-05-10 22:03:01
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/user In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17613/org/cobricks/user Modified Files: AccessPermission.java Log Message: Index: AccessPermission.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/AccessPermission.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- AccessPermission.java 16 Dec 2006 15:29:10 -0000 1.9 +++ AccessPermission.java 10 May 2007 22:02:58 -0000 1.10 @@ -18,6 +18,8 @@ import org.apache.log4j.Logger; +import org.cobricks.core.DataObject; + /** * * @author mic...@ac... @@ -212,6 +214,9 @@ Object o = objattrs.get(aname); if (o != null) { String avalueaccess = (String)o.toString(); + if (o instanceof DataObject) { + avalueaccess = Integer.toString(((DataObject)o).getId()); + } // TBD compare sets, wildcards if (!avalueaccess.equalsIgnoreCase(avalue)) return false; |
|
From: Michael K. <ko...@us...> - 2007-05-10 22:03:01
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17613/org/cobricks/item Modified Files: ItemAccessHandler.java ItemManagerImpl.java Log Message: Index: ItemAccessHandler.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemAccessHandler.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ItemAccessHandler.java 6 Dec 2006 09:41:29 -0000 1.7 +++ ItemAccessHandler.java 10 May 2007 22:02:57 -0000 1.8 @@ -146,7 +146,7 @@ } } - // special handling of roleread and roleupdatae attributes + // special handling of roleread and roleupdate attributes if (attrs!=null && action.equals("read")) { String tmps = (String)attrs.get("roleread"); if (tmps!=null && tmps.length()>0) { Index: ItemManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemManagerImpl.java,v retrieving revision 1.87 retrieving revision 1.88 diff -u -d -r1.87 -r1.88 --- ItemManagerImpl.java 19 Apr 2007 06:37:37 -0000 1.87 +++ ItemManagerImpl.java 10 May 2007 22:02:57 -0000 1.88 @@ -3129,8 +3129,7 @@ UserManager userManager = (UserManager) coreManager. getComponentDirectory().getManager("userManager"); // check permission - Map attrs = new HashMap(); - attrs.put("itemid", new Integer(item.getId())); + Map attrs = item.getAttributes(); boolean b = userManager. checkPermission(user.getId(), "item", "update", attrs); return b; |
|
From: Michael K. <ko...@us...> - 2007-05-04 10:35:10
|
Update of /cvsroot/cobricks/drehscheibe-in In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21840 Modified Files: build.xml Log Message: Index: build.xml =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/build.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- build.xml 15 Dec 2006 12:06:50 -0000 1.11 +++ build.xml 4 May 2007 10:35:06 -0000 1.12 @@ -361,6 +361,13 @@ <!-- =================== Client Applications ========================== --> +<target name="doit" depends="compile"> + <java fork="yes" classname="org.cobricks.util.doIt" + classpathref="exec.classpath"> + <arg line="-c ${web.home}/WEB-INF/conf"/> + </java> +</target> + <target name="cwall" depends="compile"> <java fork="yes" classname="org.cobricks.cwall.CWall" classpathref="exec.classpath"> @@ -400,4 +407,22 @@ </java> </target> +<target name="list" depends="compile"> + <java fork="yes" + classname="de.tum.cobricks.course.generateListDeputate" maxmemory="512M" + classpathref="exec.classpath"> + <jvmarg value="-Dfile.encoding=utf-8"/> + <arg line="build/webapps/ROOT/WEB-INF/conf SS 2007"/> + </java> +</target> + +<target name="delunivis" depends="compile"> + <java fork="yes" + classname="de.tum.cobricks.univis.deleteUnivIS" maxmemory="512M" + classpathref="exec.classpath"> + <jvmarg value="-Dfile.encoding=utf-8"/> + <arg line="-c ${web.home}/WEB-INF/conf -s 2007s"/> + </java> +</target> + </project> |
|
From: Michael K. <ko...@us...> - 2007-05-04 10:34:20
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21800 Added Files: generateListDeputate.java Log Message: --- NEW FILE: generateListDeputate.java --- /* * Copyright (c) 2002-2007 Michael Koch, mic...@ac... * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * */ package de.tum.cobricks.course; import java.io.*; import java.net.*; import java.sql.*; import java.text.*; import java.util.Date; import java.util.*; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import org.cobricks.core.CobricksException; import org.cobricks.core.ComponentDirectory; import org.cobricks.core.CoreManager; import org.cobricks.core.db.DBAccess; import org.cobricks.core.util.DateUtil; import org.cobricks.core.util.LogUtil; import org.cobricks.core.util.PropertiesUtil; import org.cobricks.course.Course; import org.cobricks.course.CourseDate; import org.cobricks.course.CourseLecturer; import org.cobricks.course.CourseManager; import org.cobricks.course.CourseModule; import org.cobricks.course.CourseProgram; import org.cobricks.course.CourseRoom; import org.cobricks.user.UserManager; /** * Generate a list for the deputat process (Hr. Schrott) * * @author Michael Koch, TUM * @version $Date: 2007/05/04 10:34:16 $ */ public class generateListDeputate { static Logger logger = Logger.getLogger(generateListDeputate.class); static private CoreManager coreManager = null; static private DBAccess dbAccess; static String querysem; static int queryjahr; static String cterm; static CourseManager courseManager; static UserManager userManager; public static void main(String args[]) { String confdir = "WEB-INF/conf"; querysem = "SS"; queryjahr = 2007; if (args.length > 0) confdir = args[0]; if (args.length > 1) querysem = args[1]; if (args.length > 2) queryjahr = Integer.parseInt(args[2]); cterm = Integer.toString(queryjahr); if (querysem.equals("WS")) { cterm += "w"; } else { cterm += "s"; } generateListDeputate o = new generateListDeputate(confdir); try { o.doIt(); } catch (Exception e) { System.err.println(e.toString()); } } /** * */ public generateListDeputate(String confdir) { try { PropertyConfigurator. configure(confdir+File.separator+"log.properties"); } catch (Throwable e) { } // Instantiate CoreManager coreManager = new CoreManager(); // load Cobricks configuration (properties) Properties properties = new Properties(); properties.put("configdir", confdir); PropertiesUtil.loadProperties(confdir, properties, coreManager); // initialize CoreManager object ... try { coreManager.init(properties); } catch (CobricksException e) { System.err.println(e.toString()); System.exit(-1); } // initialize all the other components // this call instantiates all manager and presenter objects try { coreManager.initComponents(properties); } catch (Throwable e) { logger.error(LogUtil.ex("Failed initializing components.", e)); } this.dbAccess = coreManager.getDBAccess(); ComponentDirectory componentDirectory = coreManager.getComponentDirectory(); userManager = (UserManager) componentDirectory.getManager("userManager"); courseManager = (CourseManager) componentDirectory.getManager("courseManager"); } /** * */ public void doIt() throws Exception { String filename = "list"+querysem+Integer.toString(queryjahr)+".txt"; File file = new File(filename); PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new java.io.FileOutputStream(file),"UTF8"))); String query = "SELECT cid, cname, cmname, chours_lec, " +"chours_ex, chours_sem, chours_lab, " +"course_module.cmid, cmtype, cmsid, " +"cimport, chidden " +"FROM course, course_module " +"WHERE course.cmid = course_module.cmid AND " +"(cimport = 0 or cimport is null) and " +"cterm = '"+cterm+"' "; query = query + " order by cmtype, cmname, cname"; List l = dbAccess.sqlQuery(query); out.println("Veranstaltungen im "+ querysem+" "+queryjahr+"\n"); Iterator i = l.iterator(); while (i.hasNext()) { Map h = (Map)i.next(); Integer cid = (Integer)h.get("cid"); try { Course c = courseManager.getCourse(cid.intValue()); CourseModule cm = c.getCourseModule(); out.print(cm.getSId()+" ; "+cid.toString()+" ; " +c.getFullName()); out.print(" ; "+cm.getType()+" ; " +c.getHours()+" ; "); List ll = courseManager.getLecturersForCourse(cid.intValue()); Iterator ii = ll.iterator(); while (ii.hasNext()) { CourseLecturer cl = (CourseLecturer)ii.next(); out.print(cl.getName()); if (ii.hasNext()) out.print(", "); } out.println(""); } catch (Exception e) { } } out.close(); } } |
|
From: Michael K. <ko...@us...> - 2007-04-19 06:37:40
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15173/org/cobricks/item Modified Files: ItemManagerImpl.java Log Message: Index: ItemManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemManagerImpl.java,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- ItemManagerImpl.java 21 Mar 2007 15:16:56 -0000 1.86 +++ ItemManagerImpl.java 19 Apr 2007 06:37:37 -0000 1.87 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2006 Cobricks Group. All rights reserved. + * Copyright (c) 2004-2007 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 @@ -2474,10 +2474,10 @@ // result caching for some seconds to boost performance if (itemclasses == null) itemclasses = new ArrayList(); if (categories == null) categories = new ArrayList(); - String cachekey = aname - +Long.toString(avaluelow)+Long.toString(avaluehigh) + String cachekey = aname+"," + +Long.toString(avaluelow)+","+Long.toString(avaluehigh)+"," +sortasc+itemclasses.toString() - +categories.toString()+creatorid+","+maxrows; + +categories.toString()+","+creatorid+","+maxrows; Date tmpd = (Date)searchItemsByTimestampCacheTime.get(cachekey); if (tmpd!=null) { long now = (new Date()).getTime(); |
|
From: Michael K. <ko...@us...> - 2007-03-27 11:27:52
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv32324/org/cobricks/portal Modified Files: PortalObject.java PortalRequest.java Log Message: Index: PortalObject.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalObject.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- PortalObject.java 21 Mar 2007 08:25:38 -0000 1.8 +++ PortalObject.java 27 Mar 2007 11:27:40 -0000 1.9 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2007 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 @@ -139,8 +139,14 @@ public String getPagePath() { if (pagePath == null) { - if (pagePaths != null) - pagePath = (String)(pagePaths.iterator().next()); + if (pagePaths != null) { + if (pagePaths instanceof Set) { + Iterator i = pagePaths.iterator(); + if (i.hasNext()) { + pagePath = (String)(i.next()); + } + } + } } return pagePath; } Index: PortalRequest.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalRequest.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- PortalRequest.java 30 Nov 2006 14:02:00 -0000 1.24 +++ PortalRequest.java 27 Mar 2007 11:27:40 -0000 1.25 @@ -308,6 +308,17 @@ return pagePath; } + public int getPagePathLength() + { + int count = -1; + int pos = pagePath.indexOf("/"); + while (pos > -1) { + count++; + pos = pagePath.indexOf("/", pos+1); + } + return count; + } + // requested language public String getLang() { |
|
From: Michael K. <ko...@us...> - 2007-03-27 11:27:52
|
Update of /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv32324/de/tum/cobricks/univis Modified Files: UnivIS.java Log Message: Index: UnivIS.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis/UnivIS.java,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- UnivIS.java 21 Mar 2007 08:25:38 -0000 1.64 +++ UnivIS.java 27 Mar 2007 11:27:39 -0000 1.65 @@ -1593,35 +1593,37 @@ String label = cp.getLabel(); int cpid = cp.getId(); int startsem = courseManager.getStartSemForModule(cpid, cmid); - if(label == null || label.length()<1){ + if (startsem == 0) startsem = 1; + if (label == null || label.length()<1){ continue; - }else if(!(label.startsWith("INF")) || !(label.endsWith("INF"))){ + } else if(!(label.startsWith("INF")) || + !(label.endsWith("INF"))) { title = "in/_lehrv"; - }else if(label.equalsIgnoreCase("INF")){ - if(startsem < 5){ + } else if(label.equalsIgnoreCase("INF")) { + if( startsem < 5) { title = "in/_lehrv_1"; - }else if(startsem > 4){ + } else if(startsem > 4) { title = "in/_lehrv_2"; } - } } } - if(ctype.equalsIgnoreCase("Praktikum")) { + if (ctype.equalsIgnoreCase("Praktikum")) { title = "in/_prakt/prakti"; - }else if(ctype.equalsIgnoreCase("Kolloquium")){ + } else if (ctype.equalsIgnoreCase("Kolloquium")){ title = "in/_prakt/kolloq"; - }else if(ctype.equalsIgnoreCase("Seminar") && + } else if (ctype.equalsIgnoreCase("Seminar") && cname.equalsIgnoreCase("Oberseminar")){ title = "in/_prakt/oberse"; - }else if(ctype.equalsIgnoreCase("Seminar") && + } else if (ctype.equalsIgnoreCase("Seminar") && cname.equalsIgnoreCase("Doktorandenseminar")){ title = "in/_prakt/doktor"; - }else if(ctype.equalsIgnoreCase("Seminar")){ + } else if (ctype.equalsIgnoreCase("Seminar")){ title = "in/_prakt/semina"; } return title; } + /** * Add the course parameters to the formular, which will be send to univIS * @param Course course |
|
From: Michael K. <ko...@us...> - 2007-03-21 15:17:00
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11283/org/cobricks/item Modified Files: ItemManagerImpl.java Log Message: Index: ItemManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemManagerImpl.java,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- ItemManagerImpl.java 11 Jan 2007 14:04:58 -0000 1.85 +++ ItemManagerImpl.java 21 Mar 2007 15:16:56 -0000 1.86 @@ -2474,7 +2474,9 @@ // result caching for some seconds to boost performance if (itemclasses == null) itemclasses = new ArrayList(); if (categories == null) categories = new ArrayList(); - String cachekey = aname+sortasc+itemclasses.toString() + String cachekey = aname + +Long.toString(avaluelow)+Long.toString(avaluehigh) + +sortasc+itemclasses.toString() +categories.toString()+creatorid+","+maxrows; Date tmpd = (Date)searchItemsByTimestampCacheTime.get(cachekey); if (tmpd!=null) { |
|
From: Michael K. <ko...@us...> - 2007-03-21 08:25:43
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/category In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10220/org/cobricks/category Modified Files: categoryontology.xml Log Message: Index: categoryontology.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/categoryontology.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- categoryontology.xml 4 Mar 2007 12:49:46 -0000 1.9 +++ categoryontology.xml 21 Mar 2007 08:25:38 -0000 1.10 @@ -47,5 +47,5 @@ </attr> <attr name="password" type="string(25)"/> </class> -</categoryontology> +</categoryontology> |
|
From: Michael K. <ko...@us...> - 2007-03-21 08:25:43
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10220/org/cobricks/portal Modified Files: PortalObject.java categoryontology.xml itemontology.xml Log Message: Index: PortalObject.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalObject.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- PortalObject.java 19 Dec 2006 14:12:49 -0000 1.7 +++ PortalObject.java 21 Mar 2007 08:25:38 -0000 1.8 @@ -113,10 +113,12 @@ getComponentDirectory().getManager("portalManager"); o = portalManager.getPortalFolder(((Integer)o).intValue()); } - PortalFolder pf = (PortalFolder)o; - String path = pf.getPath(); - pagePaths.add(path); - pagePath = path; + if (o != null) { + PortalFolder pf = (PortalFolder)o; + String path = pf.getPath(); + pagePaths.add(path); + pagePath = path; + } } } Index: categoryontology.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/categoryontology.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- categoryontology.xml 11 Sep 2004 00:11:37 -0000 1.2 +++ categoryontology.xml 21 Mar 2007 08:25:38 -0000 1.3 @@ -2,7 +2,7 @@ <class name="portalfolder" parent="category" javaclassname="org.cobricks.portal.PortalFolder"> <description lang="en">Portal Folder (for Page items)</description> -<attr name="path" type="string(50)"/> +<attr name="path" type="string(250)"/> </class> <class name="pagecategory" parent="category" /> Index: itemontology.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/itemontology.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- itemontology.xml 8 May 2006 07:47:59 -0000 1.20 +++ itemontology.xml 21 Mar 2007 08:25:39 -0000 1.21 @@ -29,6 +29,7 @@ <class name="wikipage" parent="portalpage"> <description lang="de">Wikiseite</description> <attr name="content" type="text" multilanguage="true" versioned="true" /> +<attr name="content" type="text" multilanguage="true" versioned="true" /> </class> </itemontology> |
|
From: Michael K. <ko...@us...> - 2007-03-21 08:25:43
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10220/org/cobricks/item Modified Files: ItemServlet.java Log Message: Index: ItemServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemServlet.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- ItemServlet.java 4 Mar 2007 12:49:47 -0000 1.50 +++ ItemServlet.java 21 Mar 2007 08:25:38 -0000 1.51 @@ -811,7 +811,7 @@ String anames = prequest.getRequestParameter("anames"); parameterNames.remove("anames"); if (anames != null) { - StringTokenizer st = new StringTokenizer(anames, ","); + StringTokenizer st = new StringTokenizer(anames, ", "); while (st.hasMoreTokens()) { String tmps = st.nextToken(); result.put(tmps, ""); |
|
From: Michael K. <ko...@us...> - 2007-03-21 08:25:43
|
Update of /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10220/de/tum/cobricks/univis Modified Files: UnivIS.java Log Message: Index: UnivIS.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis/UnivIS.java,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- UnivIS.java 4 Mar 2007 12:49:44 -0000 1.63 +++ UnivIS.java 21 Mar 2007 08:25:38 -0000 1.64 @@ -619,6 +619,11 @@ if (pos > -1) { int pos2 = s.indexOf("</td></tr>", pos); String tmps = s.substring(pos+21, pos2); + tmps = tmps.trim(); + if (tmps.startsWith("<li>")) { + tmps = tmps.substring(4); + } + tmps = tmps.trim(); return tmps; } pos = s.indexOf("<h3>Fehler:</h3>"); @@ -626,6 +631,11 @@ int pos2 = s.indexOf("<ul>", pos); int pos3 = s.indexOf("</ul>", pos); String tmps = s.substring(pos2+4, pos3); + tmps = tmps.trim(); + if (tmps.startsWith("<li>")) { + tmps = tmps.substring(4); + } + tmps = tmps.trim(); return tmps; } return ""; @@ -718,45 +728,45 @@ attrs.put("cname_en", ul.getEctsName()); if(ul.getComment() != null) attrs.put("ccomment", ul.getComment()); - if(ul.getURL() != null) + if (ul.getURL() != null) attrs.put("curl", ul.getURL()); // get the integer value form the teilno String - if(ul.getParticipants() != null){ + if (ul.getParticipants() != null){ int ccapacity = Integer.parseInt(ul.getParticipants()); attrs.put("ccapacity", new Integer(ccapacity)); } // get the big decimal value from the ects string - if(ul.getEctsCred() != null){ + if (ul.getEctsCred() != null){ logger.info("cectscredits = "+ul.getEctsCred()); Float cectscredits = Float.valueOf(ul.getEctsCred()); attrs.put("cectscredits", cectscredits); } - if(ul.getSWS() != null){ + if (ul.getSWS() != null){ if(ul.getTyp().equalsIgnoreCase("Vorlesung")){ int chours_lec = Integer.parseInt( ul.getSWS()); attrs.put("chours_lec", new Integer(chours_lec)); - }else if(ul.getTyp().equalsIgnoreCase("Praktikum")){ + } else if(ul.getTyp().equalsIgnoreCase("Praktikum")){ int chours_lab = Integer.parseInt( ul.getSWS()); attrs.put("chours_lab", new Integer(chours_lab)); - }else if(ul.getTyp().equalsIgnoreCase("Seminar") + } else if(ul.getTyp().equalsIgnoreCase("Seminar") || ul.getTyp().equalsIgnoreCase("Hauptseminar") || ul.getTyp().equalsIgnoreCase("Proseminar")){ int chours_sem = Integer.parseInt( ul.getSWS()); attrs.put("chours_sem", new Integer(chours_sem)); - }else if(ul.getTyp().equalsIgnoreCase("Ãbung")){ + } else if(ul.getTyp().equalsIgnoreCase("Ãbung")){ int chours_ex = Integer.parseInt(ul.getSWS()); attrs.put("chours_ex", new Integer(chours_ex)); } } - if(ul.getSummary()!=null) + if (ul.getSummary()!=null) attrs.put("ccontent", ul.getSummary()); - if(ul.getEctsSummary()!=null) + if (ul.getEctsSummary()!=null) attrs.put("ccontent_en", ul.getEctsSummary()); - if(ul.getUnivISId()!=null) + if (ul.getUnivISId()!=null) attrs.put("cextid", ul.getUnivISId()); - if(ul.getOrganizational()!= null) + if (ul.getOrganizational()!= null) attrs.put("cprerequ", ul.getOrganizational()); - if(ul.getEctsOrganizational() != null) + if (ul.getEctsOrganizational() != null) attrs.put("cprerequ_en", ul.getEctsOrganizational()); attrs.put("cextlastrep", new Date()); @@ -1231,16 +1241,16 @@ logger.info("update course ..."); Map map = new HashMap(); String cterm = univISSync.getTerm(); - if(cterm != null) + if (cterm != null) map.put("cterm", cterm); map.put("cimport", new Integer(1)); - if(ul.getName()!= null) + if (ul.getName()!= null) map.put("cname", ul.getName()); - if(ul.getEctsName()!= null) + if (ul.getEctsName()!= null) map.put("cname_en", ul.getEctsName()); - if(ul.getComment()!= null) + if (ul.getComment()!= null) map.put("ccomment", ul.getComment()); - if(ul.getURL()!= null) + if (ul.getURL()!= null) map.put("curl", ul.getURL()); // get the integer value form the teilno String if(ul.getParticipants()!= null){ @@ -1248,22 +1258,22 @@ map.put("ccapacity", new Integer(ccapacity)); } // get the big decimal value from the ects string - if(ul.getEctsCred()!= null){ + if (ul.getEctsCred()!= null){ logger.info("cectscredits = "+ul.getEctsCred()); Float cectscredits = Float.valueOf(ul.getEctsCred()); map.put("cectscredits", cectscredits); } - if(ul.getSummary()!= null) + if (ul.getSummary()!= null) map.put("ccontent", ul.getSummary()); - if(ul.getEctsSummary()!= null) + if (ul.getEctsSummary()!= null) map.put("ccontent_en", ul.getEctsSummary()); - if(ul.getUnivISId()!= null) + if (ul.getUnivISId()!= null) map.put("cextid", ul.getUnivISId()); - if(ul.getOrganizational()!= null) + if (ul.getOrganizational()!= null) map.put("cprerequ", ul.getOrganizational()); - if(ul.getEctsOrganizational() != null) + if (ul.getEctsOrganizational() != null) map.put("cprerequ_en", ul.getEctsOrganizational()); - if(ul.getSWS() != null){ + if (ul.getSWS() != null){ if(ul.getTyp().equalsIgnoreCase("Vorlesung")){ int chours_lec = Integer.parseInt( ul.getSWS()); map.put("chours_lec", new Integer(chours_lec)); @@ -1767,7 +1777,7 @@ post.addParameter("url_description", ""); if (tmps2.indexOf(":")>-1) { if (tmps2.indexOf("/")>-1) { - post.addParameter("url_description", tmps); + post.addParameter("url_description", tmps2); } } } else { @@ -2135,7 +2145,7 @@ { logger.info("updating UnivIS ..."); String responsemsg = null; - //Prepare HTTP Post + // prepare HTTP Post PostMethod post1 = new PostMethod(univISUrl+"/form"); //insert the params post1.addParameter("__s", "1"); @@ -2144,7 +2154,7 @@ post1.addParameter("classification", getUnivISEinordnung(course)); post1.addParameter("parent-lv", ""); post1.addParameter("origin", ""); - //add the course parameters + // add the course parameters addCourseParameters(course, post1, univISSync); String cextid = course.getExtId(); String lv = cextid.substring(8); @@ -2157,21 +2167,28 @@ int evalue = (int)((time - 1007506796106L)/86400000L)+661-2000; post1.addParameter("__e", Integer.toString(evalue)); post1.addParameter("done-save", " Nur speichern "); - try{ + try { httpClient.executeMethod(hc,post1); - //read the response - BufferedReader bf = new BufferedReader(new InputStreamReader( - post1.getResponseBodyAsStream())); - + // read the response + BufferedReader bf = + new BufferedReader(new InputStreamReader( + post1.getResponseBodyAsStream())); responsemsg = readResponse(bf); bf.close(); post1.releaseConnection(); - //logger.info("response : "+responsemsg); - - //Warnung - int index = responsemsg.indexOf("name=\"done-lecture/edit:ignore\""); - if(index > -1) { - + + // check for error message + if (responsemsg.indexOf("<h3>Fehler:</h3>")>0) { + String err = getErrorFromUnivISResponse(responsemsg); + logger.error("UnivIS request failed: "+err); + univISSync.log("UnivIS request failed: "+err); + return null; + } + + // ignore warning + int index = + responsemsg.indexOf("name=\"done-lecture/edit:ignore\""); + if (index > -1) { PostMethod post2 = new PostMethod(univISUrl+"/form"); //insert the params post2.addParameter("__s", "1"); @@ -2195,18 +2212,26 @@ httpClient.executeMethod(hc,post2); - //read the response - bf = - new BufferedReader(new InputStreamReader(post2.getResponseBodyAsStream())); + // read the response + bf = new BufferedReader(new InputStreamReader(post2. + getResponseBodyAsStream())); responsemsg = readResponse(bf); bf.close(); post2.releaseConnection(); + // check for error message + if (responsemsg.indexOf("<h3>Fehler:</h3>")>0) { + String err = getErrorFromUnivISResponse(responsemsg); + logger.error("UnivIS request failed: "+err); + univISSync.log("UnivIS request failed: "+err); + return null; + } + } - }catch(Exception e){ + } catch(Exception e) { logger.error(LogUtil.ex("Failed connect to UnivIS.",e)); - if(univISSync.shouldLog("error")){ + if (univISSync.shouldLog("error")){ univISSync.log("Failed connect to UnivIS : "+e.getMessage()); } } |
|
From: Michael K. <ko...@us...> - 2007-03-21 08:25:43
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10220/org/cobricks/course Modified Files: Course.java CourseModule.java Log Message: Index: Course.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/Course.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Course.java 10 Jan 2007 06:54:35 -0000 1.27 +++ Course.java 21 Mar 2007 08:25:38 -0000 1.28 @@ -225,6 +225,15 @@ return null; } + public int getHours() + { + int res = getHoursLecture(); + res += getHoursExercises(); + res += getHoursSeminar(); + res += getHoursLab(); + return res; + } + /** Returns the weekly count of lecture hours * @return int corresponding to the hour count */ Index: CourseModule.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseModule.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- CourseModule.java 18 Dec 2006 16:39:04 -0000 1.6 +++ CourseModule.java 21 Mar 2007 08:25:38 -0000 1.7 @@ -222,6 +222,15 @@ return i.intValue(); } + public int getHours() + { + int res = getHoursLecture(); + res += getHoursExercises(); + res += getHoursSeminar(); + res += getHoursLab(); + return res; + } + public int getHoursLecture() { Integer i = (Integer)attrs.get("cmhours_lec"); |
|
From: Wolfgang W. <wo...@us...> - 2007-03-20 17:26:39
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv1110/src/org/cobricks/portal Modified Files: PortalPresenter.java Log Message: Index: PortalPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPresenter.java,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- PortalPresenter.java 4 Mar 2007 12:49:48 -0000 1.60 +++ PortalPresenter.java 20 Mar 2007 17:26:21 -0000 1.61 @@ -1240,6 +1240,14 @@ return str; } + /** + * Interprets the string as integer + */ + public final int toInteger (String str) + { + int i = Integer.parseInt(str); + return i; + } /** * Prepare a text for being displayed in a textbox for editing |
|
From: Wolfgang W. <wo...@us...> - 2007-03-20 09:59:35
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/user In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28426/src/de/tum/cobricks/user Modified Files: LdapUserHandlerMyTUM.java Log Message: Index: LdapUserHandlerMyTUM.java =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/user/LdapUserHandlerMyTUM.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- LdapUserHandlerMyTUM.java 23 Feb 2007 09:52:32 -0000 1.7 +++ LdapUserHandlerMyTUM.java 20 Mar 2007 09:35:13 -0000 1.8 @@ -109,17 +109,10 @@ env.put(Context.SECURITY_PRINCIPAL, securityprincipal); env.put(Context.SECURITY_CREDENTIALS, securitycredentials); env.put(Context.SECURITY_PROTOCOL, "ssl"); + + // specify the timeout to be 5 seconds + env.put("com.sun.jndi.ldap.connect.timeout", "5000"); - try { - // specify the timeout to be 5 seconds - env.put("com.sun.jndi.ldap.connect.timeout", "5000"); - dirContext = new InitialDirContext(env); - } catch (Exception e) { - logger.error(LogUtil. - ex("Failed initializing directory context.", e)); - throw e; - } - logger.debug("finished initializing LdapUserHandlerMyTUM"); } @@ -182,7 +175,7 @@ /** * */ - public boolean handleCheckCredentials(User user, Object credentials) + public boolean handleCheckCredentials(User user, Object credentials) { logger.debug("begin handleCheckCredentials"); String userlogin = user.getUserLogin(); @@ -217,7 +210,17 @@ SearchControls ctls = new SearchControls(); ctls.setReturningAttributes(returnAttribut); // Return attrs ctls.setSearchScope(SearchControls.SUBTREE_SCOPE); // - + + // Init. dirContext + try { + dirContext = new InitialDirContext(env); + } catch (Exception e) { + logger.error(LogUtil. + ex("Failed initializing directory context.", e)); + return false; + } + + // Invoke search method to retrieve CN try { @@ -247,6 +250,16 @@ return false; } + // Close dirContext + try + { + dirContext.close(); + } + catch (Exception u) + { + logger.error("MyTUM: exception when closing dirContext "+u.getMessage()); + } + return true; } @@ -267,7 +280,16 @@ SearchControls ctls = new SearchControls(); ctls.setReturningAttributes(returnAttribut); // Return attrs ctls.setSearchScope(SearchControls.SUBTREE_SCOPE); // - + + // Init. dirContext + try { + dirContext = new InitialDirContext(env); + } catch (Exception e) { + logger.error(LogUtil. + ex("Failed initializing directory context.", e)); + throw e; + } + // Invoke search method to retrieve CN (needed for authentication) try { @@ -322,6 +344,16 @@ return false; } + // Close dirContext + try + { + dirContext.close(); + } + catch (Exception u) + { + logger.error("MyTUM: exception when closing dirContext "+u.getMessage()); + } + return true; } } |
|
From: Michael K. <ko...@us...> - 2007-03-04 12:50:40
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/core/util In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28633/org/cobricks/core/util Modified Files: HTMLUtil.java Log Message: Index: HTMLUtil.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/util/HTMLUtil.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- HTMLUtil.java 10 Jan 2007 06:54:35 -0000 1.3 +++ HTMLUtil.java 4 Mar 2007 12:49:46 -0000 1.4 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006 Cobricks Group. All rights reserved. + * Copyright (c) 2006-2007 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 @@ -67,12 +67,17 @@ appendString(task, html.substring(pold, p), "-"); else if (b == '&') { int pend = html.indexOf(";", p); - if (pend<0 || pend > p+6) pend = p+4; - String htmlchar = getHTMLCharacter(html.substring(p+1,pend)); - appendString(task, html.substring(pold, p), htmlchar); - p = pend; - } else + if (pend>0) { + String htmlchar = + getHTMLCharacter(html.substring(p+1,pend)); + appendString(task, html.substring(pold, p), htmlchar); + p = pend; + } else { + appendString(task, html.substring(pold, p), "&"); + } + } else { appendString(task, html.substring(pold, p), " "); + } // handle break p++; @@ -224,18 +229,48 @@ static String getHTMLCharacter(String name) { - if (name.equals("amp")) return "&"; - if (name.equals("nbsp")) return " "; - if (name.equals("auml")) return "ä"; - if (name.equals("ouml")) return "ö"; - if (name.equals("uuml")) return "ü"; - if (name.equals("Auml")) return "Ã"; - if (name.equals("Ouml")) return "Ã"; - if (name.equals("Uuml")) return "Ã"; + if (name.equals("amp")) return "&"; + if (name.equals("ndash")) return "-"; + if (name.equals("nbsp")) return " "; + if (name.equals("auml")) return "ä"; + if (name.equals("ouml")) return "ö"; + if (name.equals("uuml")) return "ü"; + if (name.equals("Auml")) return "Ã"; + if (name.equals("Ouml")) return "Ã"; + if (name.equals("Uuml")) return "Ã"; if (name.equals("szlig")) return "Ã"; + if (name.equals("gt")) return ">"; + if (name.equals("lt")) return "<"; return "?"; } + + /** + * Convert HTML/XML characters in string to utf8 + * characters + */ + static String convertHTMLCharacters(String s) + { + int pos = s.indexOf("&"); + while (pos>-1) { + int pos2 = s.indexOf(";", pos); + if (pos2>-1) { + if (pos+10 > pos2) { + String tmps = s.substring(pos+1, pos2); + tmps = getHTMLCharacter(tmps); + s = s.substring(0, pos) + tmps + s.substring(pos2+1); + pos = s.indexOf("&", pos+1); + } else { + pos = s.indexOf("&", pos+1); + } + } else { + pos = -1; + } + } + return s; + } + + static public void main(String[] args) { StringBuffer content = new StringBuffer(""); |
|
From: Michael K. <ko...@us...> - 2007-03-04 12:50:40
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28633/org/cobricks/course Modified Files: CourseServlet.java Log Message: Index: CourseServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseServlet.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- CourseServlet.java 18 Dec 2006 16:39:04 -0000 1.29 +++ CourseServlet.java 4 Mar 2007 12:49:47 -0000 1.30 @@ -367,6 +367,7 @@ c.getCourseModule().getSId()+")", hostname, new Date()); + prequest.setContextObject("cid", new Integer(cid)); prequest.setReturnCode(1001); return "success"; } @@ -742,6 +743,7 @@ cm.getName()+" ("+cm.getSId()+")", hostname, new Date()); + prequest.setContextObject("cmid", new Integer(cmid)); prequest.setReturnCode(1011); return "success"; } catch (Exception e) { |