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...> - 2007-03-04 12:50:40
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28633/org/cobricks/item Modified Files: ItemPresenter.java ItemServlet.java Log Message: Index: ItemPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemPresenter.java,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- ItemPresenter.java 14 Dec 2006 22:06:47 -0000 1.60 +++ ItemPresenter.java 4 Mar 2007 12:49:47 -0000 1.61 @@ -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 @@ -1450,43 +1450,61 @@ if (valuelow.length()<1) { avaluelow = 0; } else { - if (valuelow.indexOf("+")>-1) { - int pos = valuelow.indexOf("+"); - String tmps = valuelow.substring(pos+1); - try { - int tmpi = Integer.parseInt(tmps); - avaluelow = avaluelow + 24L*60*60*1000*tmpi; - } catch (Exception e) { } - } - if (valuelow.indexOf("-")>-1) { - int pos = valuelow.indexOf("-"); - String tmps = valuelow.substring(pos+1); - try { - int tmpi = Integer.parseInt(tmps); - avaluelow = avaluelow - 24L*60L*60L*1000L*tmpi; - } catch (Exception e) { } + // is it a full timestamp? + if (valuelow.length()==19) { + Date tmpd = + DateUtil.string2Date(valuelow, "yyyy-MM-dd hh:mm:ss"); + if (tmpd != null) { + avaluelow = tmpd.getTime(); + } + } else { + // not + if (valuelow.indexOf("+")>-1) { + int pos = valuelow.indexOf("+"); + String tmps = valuelow.substring(pos+1); + try { + int tmpi = Integer.parseInt(tmps); + avaluelow = avaluelow + 24L*60*60*1000*tmpi; + } catch (Exception e) { } + } + if (valuelow.indexOf("-")>-1) { + int pos = valuelow.indexOf("-"); + String tmps = valuelow.substring(pos+1); + try { + int tmpi = Integer.parseInt(tmps); + avaluelow = avaluelow - 24L*60L*60L*1000L*tmpi; + } catch (Exception e) { } + } } } if (valuehigh.length()<1) { avaluehigh = 0; } else { - if (valuehigh.indexOf("+")>-1) { - int pos = valuehigh.indexOf("+"); - String tmps = valuehigh.substring(pos+1); - try { - int tmpi = Integer.parseInt(tmps); - avaluehigh = avaluehigh + 24L*60L*60L*1000L*tmpi; - } catch (Exception e) { - logger.warn("failed parsing integer "+tmps, e); + if (valuehigh.length()==19) { + Date tmpd = + DateUtil.string2Date(valuehigh, "yyyy-MM-dd hh:mm:ss"); + if (tmpd != null) { + avaluehigh = tmpd.getTime(); + } + } else { + if (valuehigh.indexOf("+")>-1) { + int pos = valuehigh.indexOf("+"); + String tmps = valuehigh.substring(pos+1); + try { + int tmpi = Integer.parseInt(tmps); + avaluehigh = avaluehigh + 24L*60L*60L*1000L*tmpi; + } catch (Exception e) { + logger.warn("failed parsing integer "+tmps, e); + } + } + if (valuehigh.indexOf("-")>-1) { + int pos = valuehigh.indexOf("-"); + String tmps = valuehigh.substring(pos+1); + try { + int tmpi = Integer.parseInt(tmps); + avaluehigh = avaluehigh - 24L*60L*60L*1000L*tmpi; + } catch (Exception e) { } } - } - if (valuehigh.indexOf("-")>-1) { - int pos = valuehigh.indexOf("-"); - String tmps = valuehigh.substring(pos+1); - try { - int tmpi = Integer.parseInt(tmps); - avaluehigh = avaluehigh - 24L*60L*60L*1000L*tmpi; - } catch (Exception e) { } } } Index: ItemServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemServlet.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- ItemServlet.java 22 Dec 2006 11:07:20 -0000 1.49 +++ ItemServlet.java 4 Mar 2007 12:49:47 -0000 1.50 @@ -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 @@ -375,8 +375,7 @@ attrsmap.put(aname, uri); } } - } - + } String reqICName = prequest.getRequestParameter("itemclass"); if (reqICName == null) reqICName = item.getOntologyClassName(); @@ -806,8 +805,19 @@ Set parameterNames = prequest.getRequestParameters().keySet(); parameterNames.remove("uploadfileattrs"); parameterNames.remove("uploadfilenames"); + Map result = new HashMap(); + String anames = prequest.getRequestParameter("anames"); + parameterNames.remove("anames"); + if (anames != null) { + StringTokenizer st = new StringTokenizer(anames, ","); + while (st.hasMoreTokens()) { + String tmps = st.nextToken(); + result.put(tmps, ""); + } + } + // handle the item class attribute String itemClassName = (String) prequest.getRequestParameter("itemclass"); @@ -833,7 +843,7 @@ // go through all parameters in request Iterator it = parameterNames.iterator(); while (it.hasNext()) { - String currentParam = (String) it.next(); + String currentParam = (String)it.next(); String inputs[] = prequest.getRequestParameterValues(currentParam); String input = inputs[0]; if (inputs.length>1) { |
|
From: Michael K. <ko...@us...> - 2007-03-04 12:50:40
|
Update of /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28633/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.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- UnivIS.java 18 Jan 2007 13:05:20 -0000 1.62 +++ UnivIS.java 4 Mar 2007 12:49:44 -0000 1.63 @@ -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 @@ -1631,7 +1631,7 @@ } else { post.addParameter("ects_lname", ""); } - if(cm.getShortName() != null){ + if (cm.getShortName() != null){ post.addParameter("short", cm.getShortName()); } else { post.addParameter("short", ""); @@ -1646,11 +1646,25 @@ } else { post.addParameter("teilno", ""); } + + // get language + String lang = course.getLang(); + String speclang = ""; + if (lang!=null && lang.equals("en")) { + speclang = "eng"; + } + if (lang!=null && lang.equals("fr")) { + speclang = "fra"; + } + if (lang!=null && lang.equals("it")) { + speclang = "ita"; + } + post.addParameter("speclang", speclang); // get type String ctype = cm.getType(); String univIStype = ""; - if(ctype == null || ctype.length()< 1 + if (ctype == null || ctype.length()< 1 ||ctype.equalsIgnoreCase("Vorlesung")){ univIStype = "vo"; post.addParameter("type", univIStype); @@ -2231,7 +2245,8 @@ try { httpClient.executeMethod(hc,post1); - // Die UnivIS Frage "Lehrveranstaltung wirklich löschen?" beantworten + // Die UnivIS Frage "Lehrveranstaltung wirklich löschen?" + // beantworten // Prepare HTTP Post PostMethod post2 = new PostMethod(univISUrl+"/form"); |
|
From: Michael K. <ko...@us...> - 2007-03-04 12:50:40
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/core In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28633/org/cobricks/core Modified Files: CorePresenter.java OntologyDataType.java OntologyHelper.java Log Message: Index: OntologyDataType.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/OntologyDataType.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- OntologyDataType.java 30 Nov 2006 14:01:58 -0000 1.6 +++ OntologyDataType.java 4 Mar 2007 12:49:46 -0000 1.7 @@ -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 Index: OntologyHelper.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/OntologyHelper.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- OntologyHelper.java 1 Sep 2006 11:33:44 -0000 1.4 +++ OntologyHelper.java 4 Mar 2007 12:49:46 -0000 1.5 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 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 @@ -176,8 +176,8 @@ if (anamekey.equals("_custom")) { OntologyDataType("string"); } else { - oc.getAttribute((String)anamekey).getOntologyDataType(); + + getOntologyDataType(); } Object avalue = attrs.get(aname); // do check ... @@ -186,7 +186,8 @@ // a list of possible values defined if (avalue != null && checkValueConstraint(avalue, - oc.getAttribute((String)anamekey), cm)) { + oc.getAttribute((String)anamekey), + cm)) { result.put(aname, avalue); } } Index: CorePresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/CorePresenter.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- CorePresenter.java 18 Jan 2007 13:05:20 -0000 1.11 +++ CorePresenter.java 4 Mar 2007 12:49:46 -0000 1.12 @@ -439,7 +439,8 @@ { // is it a html source? if (s.indexOf("<p>")>-1 || s.indexOf("<P>")>-1 - || s.indexOf("<br")>-1 || s.indexOf("<BR")>-1) { + || s.indexOf("<br")>-1 || s.indexOf("<BR")>-1 + || s.indexOf("<em>")>-1 || s.indexOf("<EM>")>-1) { String res = HTMLUtil.formatHTMLString(s, width); if (maxlines>0) { int pos = res.indexOf("\n"); |
|
From: Michael K. <ko...@us...> - 2007-03-04 12:50:40
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/category In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28633/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.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- categoryontology.xml 27 May 2006 08:49:01 -0000 1.8 +++ categoryontology.xml 4 Mar 2007 12:49:46 -0000 1.9 @@ -17,6 +17,7 @@ <attr name="updater" type="user"/> <attr name="updatetime" type="datetime"/> <attr name="parent" type="category"/> +<attr name="descr" type="text"/> </class> <class name="tag" parent="category"> |
|
From: Michael K. <ko...@us...> - 2007-03-04 12:50:00
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28633/org/cobricks/portal Modified Files: PortalManager.java PortalManagerImpl.java PortalPresenter.java PortalServlet.java Log Message: Index: PortalPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPresenter.java,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- PortalPresenter.java 18 Jan 2007 13:05:22 -0000 1.59 +++ PortalPresenter.java 4 Mar 2007 12:49:48 -0000 1.60 @@ -1247,17 +1247,17 @@ */ public static final String escapeHTML(String s) { - String tmps = s.replaceAll("&", "&"); - tmps = tmps.replaceAll("<", "<"); - tmps = tmps.replaceAll(">", ">"); + String tmps = s.replaceAll("&", "&"); + tmps = tmps.replaceAll("<", "<"); + tmps = tmps.replaceAll(">", ">"); return tmps; } public static final String escapeXML(String s) { - String tmps = s.replaceAll("&", "&"); // oder <![CDATA[&]]⥠- tmps = tmps.replaceAll("<", "<"); - tmps = tmps.replaceAll(">", ">"); + String tmps = s.replaceAll("&", "&"); // oder <![CDATA[&]]⥠+ tmps = tmps.replaceAll("<", "<"); + tmps = tmps.replaceAll(">", ">"); return tmps; } Index: PortalManager.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManager.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- PortalManager.java 6 Dec 2006 09:41:30 -0000 1.23 +++ PortalManager.java 4 Mar 2007 12:49:47 -0000 1.24 @@ -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 @@ -84,6 +84,9 @@ public int createFolder(String parentPath, String name, String title, User creator) throws CobricksException; + public int createFolder(String parentPath, String name, + String title, User creator, Map attrs) + throws CobricksException; public void updateFolder(int cid, String title_en, String path, int parentcid, User user) throws CobricksException; Index: PortalServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalServlet.java,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- PortalServlet.java 12 Jan 2007 09:32:35 -0000 1.53 +++ PortalServlet.java 4 Mar 2007 12:49:48 -0000 1.54 @@ -734,10 +734,18 @@ return "noaccess"; } + Map attrs = new HashMap(); + String tmps = prequest.getRequestParameter("descr"); + if (tmps!=null) { + attrs.put("descr", tmps); + } + // TBD: add any attributes to attrs map + try { int itemid = portalManager.createFolder(parentpath, name, - title, portalUser.getUser()); + title, portalUser.getUser(), + attrs); } catch (Exception e) { logger.error(LogUtil.ex("Failed creating folder.", e)); prequest.setReturnCode(2104); Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- PortalManagerImpl.java 23 Jan 2007 21:35:10 -0000 1.98 +++ PortalManagerImpl.java 4 Mar 2007 12:49:48 -0000 1.99 @@ -901,8 +901,10 @@ /** * Creates a new portal folder * - * @param parentPath the path of the parent object for the new portal folder - * @param relpath the relative path name of the folder (only url-compliant strings!) + * @param parentPath the path of the parent object for the new portal + * folder + * @param relpath the relative path name of the folder (only url-compliant + * strings!) * @param title name for the folder * @param creator the user object of the user who creates the folder * @return the new folder's id @@ -911,6 +913,14 @@ String title, User creator) throws CobricksException { + return createFolder(parentPath, relpath, title, creator, + new HashMap()); + } + + public int createFolder(String parentPath, String relpath, + String title, User creator, Map attrs) + throws CobricksException + { if (parentPath==null || parentPath.length()<0) parentPath="/"; if (!parentPath.endsWith("/")) parentPath += "/"; @@ -923,7 +933,6 @@ logger.info("createFolder "+path); // create category object - HashMap attrs = new HashMap(); attrs.put("categoryclass", "portalfolder"); attrs.put("title_en", title); attrs.put("path", path); |
|
From: Ortzi S. <ro...@qb...> - 2007-02-26 11:06:45
|
Hi, Chaepest CALIS and VAGRA online. http://parkerokay+now.com Remove "+" from the link. When the connection is broken, we will linger for only moments... but we will give you time... you must get to the Portkey, it will return you to Hogwarts ...do you understand, Harry? |
|
From: Wolfgang W. <wo...@us...> - 2007-02-23 09:52:39
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7656/src/de/tum/cobricks/course Modified Files: generateHTMLOverviews.java Log Message: Index: generateHTMLOverviews.java =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course/generateHTMLOverviews.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- generateHTMLOverviews.java 19 Jan 2007 13:58:22 -0000 1.10 +++ generateHTMLOverviews.java 23 Feb 2007 09:52:32 -0000 1.11 @@ -157,6 +157,8 @@ makeMCSE(new File(filename+"-mcse.html")); // makeMCoMe(new File(filename+"-mcome.html")); // makeMhoncseome(new File(filename+"-mhoncseome.html")); + + makeInternational(new File(filename+"-intern.html")); } catch (Exception e) { logger.error(LogUtil.ex("failed", e)); @@ -462,13 +464,21 @@ } + static int getData(PrintWriter out, String nameunivis, + String typ, String wkz) + throws Exception + { + return getData(out, nameunivis, typ, wkz, "de"); + } + /** * */ static int getData(PrintWriter out, String nameunivis, - String typ, String wkz) + String typ, String wkz, String lang) throws Exception + // lang="en" -> english version for international students { Map attrs = new HashMap(); CourseProgram cp = @@ -499,7 +509,11 @@ if (i.hasNext()) { flag_notempty = true; - out.println("<div id=\"VL\"><table><tr><th>Modul</th><th>Titel</th><th>ECTS</th><th></th><th>SWS</th><th>Dozent(en)</th><th>Zeiten</th><th>Raum</th></tr><tr>"); + + if (lang.equals("en")) + out.println("<div id=\"VL\"><table><tr><th>Module</th><th>Title</th><th>Credits</th><th></th><th>SWS</th><th>Lecturer(s)</th><th>Times</th><th>Room</th></tr><tr>"); + else + out.println("<div id=\"VL\"><table><tr><th>Modul</th><th>Titel</th><th>ECTS</th><th></th><th>SWS</th><th>Dozent(en)</th><th>Zeiten</th><th>Raum</th></tr><tr>"); } Date today = new Date(); @@ -531,7 +545,7 @@ out.print(modulname+"\">"+modulname+"</a></td>"); // Name - String vatitel = c.getFullName(); + String vatitel = c.getFullName(lang); out.print("<td><i>"); out.print("<a href=\"/myintum/kurs_verwaltung/c.html?cid="); out.print(modulnr+"\">"+vatitel+"</a></i></td>"); @@ -609,7 +623,9 @@ if (swsvl > 0) { counter2 ++; - out.print (swsvl+"V"); + out.print (swsvl); + if (lang.equals("de")) + out.print ("V"); } if (swsue > 0) @@ -617,7 +633,9 @@ if (counter2 > 0) out.print("+"); counter2 ++; - out.print (swsue+"Ü"); + out.print (swsue); + if (lang.equals("de")) + out.print ("Ü"); } if (swsse > 0) @@ -698,14 +716,29 @@ // termine.append("VL: "); } - switch (tewotag) { - case 1: tmpsb.append("So "); break; - case 2: tmpsb.append("Mo "); break; - case 3: tmpsb.append("Di "); break; - case 4: tmpsb.append("Mi "); break; - case 5: tmpsb.append("Do "); break; - case 6: tmpsb.append("Fr "); break; - case 7: tmpsb.append("Sa "); break; + if (lang.equals("en")) + { + switch (tewotag) { + case 1: tmpsb.append("Sun "); break; + case 2: tmpsb.append("Mon "); break; + case 3: tmpsb.append("Tue "); break; + case 4: tmpsb.append("Wed "); break; + case 5: tmpsb.append("Thu "); break; + case 6: tmpsb.append("Fri "); break; + case 7: tmpsb.append("Sat "); break; + } + } + else + { + switch (tewotag) { + case 1: tmpsb.append("So "); break; + case 2: tmpsb.append("Mo "); break; + case 3: tmpsb.append("Di "); break; + case 4: tmpsb.append("Mi "); break; + case 5: tmpsb.append("Do "); break; + case 6: tmpsb.append("Fr "); break; + case 7: tmpsb.append("Sa "); break; + } } tmpsb.append(teanstd+":"+min2string(teanmin)+" - "+ teenstd+":"+min2string(teenmin)+" "); @@ -1081,6 +1114,69 @@ out.close(); } + public static void makeInternational(File file) + throws Exception + { + PrintWriter out = + new PrintWriter(new BufferedWriter(new OutputStreamWriter(new java.io.FileOutputStream(file),"UTF8"))); + + out.println("$portalPresenter.parse(\"/pageheader.html\", $portalRequest)\n"); + + + out.println("<H2>Course overview</h2><P>\n"); + + if (querysem.equals("SS")) + out.println("<h2>Summer term "+queryjahr+"</h2>"); + else { + int qpluseins = queryjahr + 1; + out.println("<h2>Winter term "+queryjahr+"/"+ + qpluseins+"</h2>"); + } + + Date today = new Date(); + DateFormat df = new SimpleDateFormat("dd.MM.yyy HH:mm"); + df.setTimeZone(TimeZone.getTimeZone("ECT")); + + String outs = + "<p>This overviews lists all courses at the department of informatics "+ + " (updated "+df.format(today)+").<p>"; + out.println(outs); + + out.println("<ul>\n"); + out.println("<LI><a href=\"#intern-vorl\">Lectures</a>\n"); + out.println("<li><a href=\"#intern-sem\">Seminars</a>\n"); + out.println("<li><a href=\"#intern-prakt\">Lab courses</a>\n"); + out.println("</ul><p>\n"); + + int tmpi; + + out.println("<P><a name=\"intern-vorl\"></a><h3>Lectures</h3>"); + tmpi = getData(out, "INF", "Vorlesung", "", "en"); + if (tmpi < 1) { + out.println(ke); + } + + out.println("<P><a name=\"intern-sem\"></a><h3>Seminars</h3>"); + tmpi = getData(out, "INF", "Seminar", "", "en"); + if (tmpi < 1) { + out.println(ke); + } + + + out.println("<P><a name=\"intern-prakt\"></a><h3>Lab courses</h3>"); + tmpi = getData(out, "INF", "Praktikum", "", "en"); + if (tmpi < 1) { + out.println(ke); + } + + printFooter(out); + + out.println("\n$portalPresenter.parse(\"/pagefooter.html\", $portalRequest)"); + + out.flush(); + out.close(); + } + } |
|
From: Wolfgang W. <wo...@us...> - 2007-02-23 09:52:39
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/user In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7656/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.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- LdapUserHandlerMyTUM.java 2 Jan 2007 08:30:52 -0000 1.6 +++ LdapUserHandlerMyTUM.java 23 Feb 2007 09:52:32 -0000 1.7 @@ -285,7 +285,7 @@ logger.warn("MyTUM, userlogin =" + userlogin); return false; } - + // New context to authenticate user try { @@ -307,12 +307,13 @@ env.put(Context.SECURITY_PROTOCOL, "ssl"); DirContext ctxUser = new InitialDirContext(env); + ctxUser.close(); } catch (AuthenticationException au) { logger.warn("Userauthentication failed "+au.getMessage()); logger.warn("MyTUM, auth. failed, userlogin =" + userlogin); - return false; + return false; } } catch (Exception u) |
|
From: Michael K. <ko...@us...> - 2007-01-23 21:35:17
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv1039/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- PortalManagerImpl.java 18 Jan 2007 13:05:22 -0000 1.97 +++ PortalManagerImpl.java 23 Jan 2007 21:35:10 -0000 1.98 @@ -883,7 +883,6 @@ if (pagePath == null) pagePath = "/"; if (pageName == null) return; PortalObject p = portalCache.getObject(pagePath, pageName); - logger.error("remove object from cache: "+p); if (p!=null) portalCache.removeObject(p); return; |
|
From: Michael K. <ko...@us...> - 2007-01-23 21:35:14
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv1039/org/cobricks/course Modified Files: CoursePresenter.java Log Message: Index: CoursePresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CoursePresenter.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- CoursePresenter.java 18 Jan 2007 13:05:22 -0000 1.34 +++ CoursePresenter.java 23 Jan 2007 21:35:09 -0000 1.35 @@ -619,6 +619,7 @@ public String printPrerequ(Course c, String lang, boolean inhtml) { + if (c == null) return ""; try { String tmps = c.getPrerequ(); if (tmps==null || tmps.length()<1) @@ -717,14 +718,21 @@ public String printCert(Course c) { - String tmps = c.getPrerequ(); - if (tmps==null || tmps.length()<1) - tmps = c.getCourseModule().getPrerequ(); - return printCert(tmps); + if (c == null) return ""; + try { + String tmps = c.getPrerequ(); + if (tmps==null || tmps.length()<1) + tmps = c.getCourseModule().getPrerequ(); + return printCert(tmps); + } catch (Exception e) { + logger.error(LogUtil.ex("Failed", e)); + } + return ""; } public String printCert(String tmps) { + if (tmps == null) return ""; StringBuffer sb = new StringBuffer(""); // parse prerequ as XML document tmps = tmps.replaceAll("<", "<"); |
|
From: Wolfgang W. <wo...@us...> - 2007-01-19 13:58:26
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16030/src/de/tum/cobricks/course Modified Files: generateHTMLOverviews.java Log Message: Index: generateHTMLOverviews.java =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course/generateHTMLOverviews.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- generateHTMLOverviews.java 19 Jan 2007 13:33:24 -0000 1.9 +++ generateHTMLOverviews.java 19 Jan 2007 13:58:22 -0000 1.10 @@ -230,7 +230,7 @@ out.println("<ul>"); out.println("<li><a href=\"#infbachelor\">Informatik Bachelor</a>\n"); out.println("<ul><li><a href=\"#bsi-vorl\">Vorlesungen</a>"); - out.println("<li><a href=\"#bsi-sem\">Seminare und Proseminare</a>"); + out.println("<li><a href=\"#bsi-sem\">Seminare</a>"); out.println("<li><a href=\"#bsi-prakt\">Praktika</a>"); out.println("</ul>"); out.println("<li><a href=\"#infmaster\">Informatik Master</a>\n"); @@ -240,7 +240,7 @@ out.println("</ul>"); out.println("<li><a href=\"#infdipl\">Informatik Diplom</a>\n"); out.println("<ul><li><a href=\"#infdipl-vorl\">Vorlesungen</a>"); - out.println("<li><a href=\"#infdipl-sem\">Seminare</a>"); + out.println("<li><a href=\"#infdipl-sem\">Seminare und Proseminare</a>"); out.println("<li><a href=\"#infdipl-prakt\">Praktika</a>"); out.println("</ul>"); @@ -315,7 +315,7 @@ out.println(ke); } - out.println("<P><a name=\"infdipl-sem\"></a><h3>Seminare</h3>"); + out.println("<P><a name=\"infdipl-sem\"></a><h3>Seminare und Proseminare</h3>"); tmpi = getData(out, "INF", "Seminar", ""); if (tmpi < 1) { out.println(ke); @@ -375,7 +375,7 @@ out.println("<ul>"); out.println("<LI><a href=\"#winfbachelor\">Wirtschaftsinformatik Bachelor</a>\n"); out.println("<ul><li><a href=\"#bswi-vorl\">Vorlesungen</a>"); - out.println("<li><a href=\"#bswi-sem\">Seminare</a>"); + out.println("<li><a href=\"#bswi-sem\">Seminare und Proseminare</a>"); out.println("<li><a href=\"#bswi-prakt\">Praktika</a>"); out.println("</ul>"); @@ -400,7 +400,7 @@ out.println(ke); } - out.println("<P><a name=\"bswi-sem\"></a><h4>Seminare</h4>"); + out.println("<P><a name=\"bswi-sem\"></a><h4>Seminare und Proseminare</h4>"); tmpi = getData(out, "BS-WIRTINF", "Proseminar", ""); tmpi = getData(out, "BS-WIRTINF", "Seminar", ""); if (tmpi < 1) { @@ -937,7 +937,7 @@ out.println("<ul>\n"); out.println("<LI><a href=\"#mai-vorl\">Vorlesungen</a>\n"); - out.println("<li><a href=\"#mai-sem\">Seminare und Proseminare</a>\n"); + out.println("<li><a href=\"#mai-sem\">Seminare</a>\n"); out.println("<li><a href=\"#mai-prakt\">Praktika</a>\n"); out.println("</ul><p>\n"); @@ -950,7 +950,7 @@ out.println(ke); } - out.println("<P><a name=\"mai-sem\"></a><h3>Seminare und Proseminare</h3>"); + out.println("<P><a name=\"mai-sem\"></a><h3>Seminare</h3>"); tmpi = getData(out, "MS-ANGINF", "Seminar", ""); tmpi += getData(out, "MS-ANGINF", "Proseminar", ""); if (tmpi < 1) { @@ -1046,7 +1046,7 @@ out.println("<ul>\n"); out.println("<LI><a href=\"#mcse-vorl\">Vorlesungen</a>\n"); - out.println("<li><a href=\"#mcse-sem\">Seminare und Proseminare</a>\n"); + out.println("<li><a href=\"#mcse-sem\">Seminare</a>\n"); out.println("<li><a href=\"#mcse-prakt\">Praktika</a>\n"); out.println("</ul><p>\n"); @@ -1059,7 +1059,7 @@ out.println(ke); } - out.println("<P><a name=\"mcse-sem\"></a><h3>Seminare und Proseminare</h3>"); + out.println("<P><a name=\"mcse-sem\"></a><h3>Seminare</h3>"); tmpi = getData(out, "MS-CSEINF", "Seminar", ""); tmpi += getData(out, "MS-CSEINF", "Proseminar", ""); if (tmpi < 1) { |
|
From: Wolfgang W. <wo...@us...> - 2007-01-19 13:33:29
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6366/src/de/tum/cobricks/course Modified Files: generateHTMLOverviews.java Log Message: Index: generateHTMLOverviews.java =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course/generateHTMLOverviews.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- generateHTMLOverviews.java 15 Jan 2007 15:29:29 -0000 1.8 +++ generateHTMLOverviews.java 19 Jan 2007 13:33:24 -0000 1.9 @@ -235,12 +235,12 @@ out.println("</ul>"); out.println("<li><a href=\"#infmaster\">Informatik Master</a>\n"); out.println("<ul><li><a href=\"#msi-vorl\">Vorlesungen</a>"); - out.println("<li><a href=\"#msi-sem\">Seminare und Proseminare</a>"); + out.println("<li><a href=\"#msi-sem\">Seminare</a>"); out.println("<li><a href=\"#msi-prakt\">Praktika</a>"); out.println("</ul>"); out.println("<li><a href=\"#infdipl\">Informatik Diplom</a>\n"); out.println("<ul><li><a href=\"#infdipl-vorl\">Vorlesungen</a>"); - out.println("<li><a href=\"#infdipl-sem\">Seminare und Proseminare</a>"); + out.println("<li><a href=\"#infdipl-sem\">Seminare</a>"); out.println("<li><a href=\"#infdipl-prakt\">Praktika</a>"); out.println("</ul>"); @@ -375,7 +375,7 @@ out.println("<ul>"); out.println("<LI><a href=\"#winfbachelor\">Wirtschaftsinformatik Bachelor</a>\n"); out.println("<ul><li><a href=\"#bswi-vorl\">Vorlesungen</a>"); - out.println("<li><a href=\"#bswi-sem\">Seminare und Proseminare</a>"); + out.println("<li><a href=\"#bswi-sem\">Seminare</a>"); out.println("<li><a href=\"#bswi-prakt\">Praktika</a>"); out.println("</ul>"); @@ -400,7 +400,7 @@ out.println(ke); } - out.println("<P><a name=\"bswi-sem\"></a><h4>Proseminare/Seminare</h4>"); + out.println("<P><a name=\"bswi-sem\"></a><h4>Seminare</h4>"); tmpi = getData(out, "BS-WIRTINF", "Proseminar", ""); tmpi = getData(out, "BS-WIRTINF", "Seminar", ""); if (tmpi < 1) { |
|
From: Michael K. <ko...@us...> - 2007-01-18 13:05:56
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19910/org/cobricks/course Modified Files: CourseManagerImpl.java CoursePresenter.java Log Message: Index: CoursePresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CoursePresenter.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- CoursePresenter.java 12 Jan 2007 09:32:34 -0000 1.33 +++ CoursePresenter.java 18 Jan 2007 13:05:22 -0000 1.34 @@ -703,6 +703,7 @@ } } catch (Throwable e) { logger.warn("Failed parsing prerequ: "+ e.toString()); + tmps = org.cobricks.portal.PortalPresenter.escapeHTML(tmps); return tmps; } return sb.toString(); Index: CourseManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseManagerImpl.java,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- CourseManagerImpl.java 12 Jan 2007 09:32:34 -0000 1.68 +++ CourseManagerImpl.java 18 Jan 2007 13:05:21 -0000 1.69 @@ -13,6 +13,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.HashMap; @@ -572,14 +573,20 @@ if (attrs.get("cmsid")!=null) where += "AND course_module.cmsid = '"+attrs.get("cmsid")+"' "; if (attrs.get("cname")!=null) { + String tmps = (String)attrs.get("cname"); + tmps = tmps.toLowerCase(); where = where + - "AND (cname like '%"+attrs.get("cname")+"%' OR " - +"cname_en like '%"+attrs.get("cname")+"%' OR " - +"cmname like '%"+attrs.get("cname")+"%' OR " - +"cmname_en like '%"+attrs.get("cname")+"%')" ; + "AND (LOWER(cname) like '%"+tmps+"%' OR " + +"LOWER(cname_en) like '%"+tmps+"%' OR " + +"LOWER(cmname) like '%"+tmps+"%' OR " + +"LOWER(cmname_en) like '%"+tmps+"%')" ; + } + if (attrs.get("cname_en")!=null) { + String tmps = (String)attrs.get("cname_en"); + tmps = tmps.toLowerCase(); + where += "AND (LOWER(cname_en) like '%"+tmps+"%' OR " + +"LOWER(cmname_en) like '%"+tmps+"%')"; } - if (attrs.get("cname_en")!=null) - where += "AND cname_en like '%"+attrs.get("cname_en")+"%' "; if(attrs.get("cmtype")!=null) where += "AND cmtype = '"+attrs.get("cmtype")+"' "; if (attrs.get("cmhidden")!=null) @@ -610,10 +617,10 @@ +"course_lecturerrel.lid "); where = checkAndConcat(where,"AND course.cid = " +"course_lecturerrel.cid "); - where += - ("AND (lfirstname like '%"+attrs.get("lecturername")+"%' " - +"OR llastname like '%"+attrs.get("lecturername") - +"%' ) "); + String tmps = (String)attrs.get("lecturername"); + tmps = tmps.toLowerCase(); + where += ("AND (LOWER(lfirstname) like '%"+tmps+"%' " + +"OR LOWER(llastname) like '%"+tmps+"%' ) "); } else if ((attrs.get("lgroup")!=null) && (((String)attrs.get("lgroup")).length()>0)) { @@ -1181,21 +1188,37 @@ 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) - where += "AND cmname_en like '%"+attrs.get("cmname_en")+"%' "; + if (attrs.get("cmname")!=null) { + String tmps = (String)attrs.get("cmname"); + tmps = tmps.toLowerCase(); + where += ("AND (LOWER(cmname) like '%"+tmps+"%' OR " + + " LOWER(cmname_en) like '%"+tmps+"%') "); + } + if (attrs.get("cmname_en")!=null) { + String tmps = (String)attrs.get("cmname"); + tmps = tmps.toLowerCase(); + where += "AND LOWER(cmname_en) like '%"+tmps+"%' "; + } if (attrs.get("cmcontent")!=null) where += "AND cmcontent like '%"+attrs.get("cmcontent")+"%' "; if (attrs.get("cmcontent_en")!=null) where += "AND cmcontent_en like '%" +attrs.get("cmcontent_en")+"%' "; - 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("cmshortname2")!=null) - where += "AND cmshortname2 like '%"+attrs.get("cmshortname2")+"%' "; + if (attrs.get("cmsid")!=null) { + String tmps = (String)attrs.get("cmsid"); + tmps = tmps.toLowerCase(); + where += "AND LOWER(cmsid) like '%"+tmps+"%' "; + } + if (attrs.get("cmshortname")!=null) { + String tmps = (String)attrs.get("cmshortname"); + tmps = tmps.toLowerCase(); + where += "AND LOWER(cmshortname) like '%"+tmps+"%' "; + } + if (attrs.get("cmshortname2")!=null) { + String tmps = (String)attrs.get("cmshortname2"); + tmps = tmps.toLowerCase(); + where += "AND LOWER(cmshortname2) like '%"+tmps+"%' "; + } if (attrs.get("cmtype")!=null) where += "AND cmtype = '"+attrs.get("cmtype")+"' "; if (attrs.get("cmhidden")!=null) @@ -1243,7 +1266,9 @@ /** * @see org.cobricks.course.RoomManager#createRoom(java.util.Map, org.cobricks.user.User) */ - public int createRoom(Map attrs, User user) throws CobricksException { + public int createRoom(Map attrs, User user) + throws CobricksException + { int crid = 0; // copy attributes @@ -1253,9 +1278,7 @@ copyAttr("crgroup", attrs, sqlAttrs); copyAttr("crcontact", attrs, sqlAttrs); copyAttr("crextid", attrs, sqlAttrs); - - // add new attributes - sqlAttrs.put("crhidden", new Integer(0)); + copyAttr("crhidden", attrs, sqlAttrs); try { crid = dbAccess.sqlInsert("course_room", sqlAttrs); @@ -1891,7 +1914,8 @@ return result; } - public List getCalendarEntries(int userid, Date date){ + public List getCalendarEntries(int userid, Date date) + { //select "2003-12-12 " <= now() AND now() <= "2004-12-12 "; logger.info("getCalendarEntries for date : "+date); List result = new ArrayList(); @@ -1902,7 +1926,7 @@ int dayOfWeek = gcalendar.get(GregorianCalendar.DAY_OF_WEEK); // Defining the term for a date - term = CalendarPresenter.getTerm(gcalendar); + term = getTerm(gcalendar); gcalendar.setTime(date); Date termStart = CalendarPresenter.getDaysOfSem(gcalendar)[0]; @@ -2526,8 +2550,48 @@ /** * */ + public String getTerm() + { + GregorianCalendar gcalendar = new GregorianCalendar(); + gcalendar.setTime(new Date()); + return getTerm(gcalendar); + } + + public String getTerm(GregorianCalendar gcal) + { + try { + int month = gcal.get(Calendar.MONTH); + int currentYear = gcal.get(Calendar.YEAR); + String sem = "NONE"; + + // months are represented by 0 to 11 + if (month>7) { + sem = Integer.toString(currentYear)+"w"; + gcal.add(Calendar.MONTH, 9-month); + } + else if (month<3) { + sem = Integer.toString(currentYear-1)+"w"; + gcal.add(Calendar.MONTH, 9-month); + gcal.add(Calendar.YEAR, -1); + } + else { + sem = Integer.toString(currentYear)+"s"; + gcal.add(Calendar.MONTH, 3-month); + } + return sem; + } catch (Exception e) { + } + return ""; + } + + /** + * + */ public String getPrevTerm(String cterm) { + if (cterm==null || cterm.length()<1) { + cterm = getTerm(); + } try { String sem = cterm.substring(4,5); int year = Integer.parseInt(cterm.substring(0,4)); @@ -2545,6 +2609,9 @@ public String getNextTerm(String cterm) { + if (cterm==null || cterm.length()<1) { + cterm = getTerm(); + } try { String sem = cterm.substring(4,5); int year = Integer.parseInt(cterm.substring(0,4)); |
|
From: Michael K. <ko...@us...> - 2007-01-18 13:05:55
|
Update of /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19910/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.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- UnivIS.java 12 Jan 2007 09:32:24 -0000 1.61 +++ UnivIS.java 18 Jan 2007 13:05:20 -0000 1.62 @@ -176,7 +176,7 @@ univISSync.log("There are no new courses in Cobricks ..."); } Iterator it1 = list.listIterator(); - while(it1.hasNext()){ + while (it1.hasNext()) { Course c1 = (Course)it1.next(); String id = c1.getExtId(); Date cextlastrep = c1.getLastReplication(); @@ -234,11 +234,13 @@ } String univISId = insertLectureIntoUnivIS(c1, univISSync); - // update the cextid and cextlastrep in course - Map attrs = new HashMap(); - attrs.put("cextid", univISId); - attrs.put("cextlastrep", new Date()); - courseManager.updateCourseAttrs(c1.getId(), attrs); + if (univISId!=null && univISId.length()>0) { + // update the cextid and cextlastrep in course + Map attrs = new HashMap(); + attrs.put("cextid", univISId); + attrs.put("cextlastrep", new Date()); + courseManager.updateCourseAttrs(c1.getId(), attrs); + } } /*else if (cextlastrep != null && (cextlastrep.before(cextastupdate))){ @@ -374,12 +376,13 @@ } String univISId = insertLectureIntoUnivIS(course, univISSync); - - // update the cextid and cextlastrep in course - Map attrs = new HashMap(); - attrs.put("cextid", univISId); - attrs.put("cextlastrep", new Date()); - courseManager.updateCourseAttrs(course.getId(), attrs); + if (univISId!=null && univISId.length()>0) { + // update the cextid and cextlastrep in course + Map attrs = new HashMap(); + attrs.put("cextid", univISId); + attrs.put("cextlastrep", new Date()); + courseManager.updateCourseAttrs(course.getId(), attrs); + } } else if (clastrep != null && clastrep.before(clastupdate)) { @@ -618,6 +621,13 @@ String tmps = s.substring(pos+21, pos2); return tmps; } + pos = s.indexOf("<h3>Fehler:</h3>"); + if (pos > -1) { + int pos2 = s.indexOf("<ul>", pos); + int pos3 = s.indexOf("</ul>", pos); + String tmps = s.substring(pos2+4, pos3); + return tmps; + } return ""; } @@ -835,12 +845,13 @@ //get dtype for course with cid Course c = null; String dtype = "0"; - try{ + try { c = courseManager.getCourse(cid); - }catch(Exception e){ - logger.error(LogUtil.ex("Failed Inserting date, course not found", e)); + } catch (Exception e) { + logger.error(LogUtil.ex("Failed Inserting date, " + +"course not found", e)); } - if(c != null){ + if (c != null) { CourseModule ctp = c.getCourseModule(); if(ctp != null){ String cttyp = ctp.getType(); @@ -1431,6 +1442,12 @@ univISSync.log("UnivIS request failed: "+err); return null; } + 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; + } int index = responsemsg.indexOf("name=\"done-lecture/edit:ignore\""); if(index > -1) { @@ -1518,6 +1535,12 @@ logger.error("UnivIS request failed: "+err); univISSync.log("UnivIS request failed: "+err); } + 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) { logger.error(LogUtil.ex("Failed connect to univIS.",e)); if(univISSync.shouldLog("error")){ @@ -1724,9 +1747,16 @@ post.addParameter("ects_literature", ""); post.addParameter("keywords", ""); - if(course.getUrl() != null){ - post.addParameter("url_description", course.getUrl()); - }else{ + if (course.getUrl() != null) { + String tmps2 = course.getUrl(); + // check if this is a valid url ... + post.addParameter("url_description", ""); + if (tmps2.indexOf(":")>-1) { + if (tmps2.indexOf("/")>-1) { + post.addParameter("url_description", tmps); + } + } + } else { post.addParameter("url_description", ""); } @@ -1811,7 +1841,7 @@ // get terms List terms = courseManager.getCourseDates(course.getId()); - if(!terms.isEmpty()){ + if (!terms.isEmpty()) { Iterator it3 = terms.listIterator(); int counter3 = 0; while (it3.hasNext()){ @@ -1824,12 +1854,24 @@ String repeat = ""; String roomId = ""; post.addParameter("term"+counter3+"::exclude", ""); - if (cdate != null){ + + if (cdate != null) { int dcycle = cdate.getCycle(); if (cdate.getRoom() != null){ roomId = (cdate.getRoom()).getExtId(); + if (roomId.length()>0) { + if (roomId.startsWith("Room/")) { + roomId = roomId.substring(5); + } + } else { + logger.warn("No UnivISId for room " + +cdate.getRoom().getName()); + univISSync.log("No UnivISId for room " + +cdate.getRoom().getName()); + } } - if (dtype != null && dtype.equalsIgnoreCase("s")){ + + if (dtype != null && dtype.equalsIgnoreCase("s")) { repeat = "s1"; Date sdate = cdate.getStartDate(); if(sdate != null){ @@ -1865,14 +1907,6 @@ endmin = "0" + endmin; endtime = endhour+":"+endmin; } - roomId = (cdate.getRoom()).getExtId(); - if (roomId.startsWith("Room/")){ - roomId = roomId.substring(5); - } - if (repeat != null){ - post.addParameter("term"+counter3+"::repeat", - repeat); - } post.addParameter("term"+counter3+"::starttime", starttime); post.addParameter("term"+counter3+"::endtime", @@ -1928,10 +1962,6 @@ endmin = "0" + endmin; endtime = endhour+":"+endmin; } - roomId = (cdate.getRoom()).getExtId(); - if (roomId.startsWith("Room/")) { - roomId = roomId.substring(5); - } post.addParameter("term"+counter3+"::repeat", repeat); post.addParameter("term"+counter3+"::starttime", @@ -1995,9 +2025,6 @@ endtime = endhour+":"+endmin; } - if (roomId.length()>0 && roomId.startsWith("Room/")){ - roomId = roomId.substring(5); - } post.addParameter("term"+counter3+"::repeat", repeat); post.addParameter("term"+counter3+"::starttime", @@ -2015,10 +2042,10 @@ // bei univIS dtype w = 1 bei cobricks String dweekday = (new Integer(cdate.getWeekday())).toString(); - if(dweekday.equals("1")){ + if (dweekday.equals("1")) { dweekday = "0"; repeat = "w"+dcycle+" "+dweekday; - } else{ + } else { int value = (new Integer(cdate.getWeekday())).intValue(); dweekday = (new Integer(value-1)).toString(); @@ -2040,7 +2067,7 @@ } Integer ehour = (new Integer(cdate.getEndHour())); Integer emin = (new Integer(cdate.getEndMin())); - if(ehour.intValue() == 0 ){ + if (ehour.intValue() == 0 ){ endtime = ""; } else { String endhour = ehour.toString(); @@ -2051,10 +2078,7 @@ endmin = "0" + endmin; endtime = endhour+":"+endmin; } - //String roomId = (cdate.getRoom()).getExtId(); - if(roomId.length()>0 && roomId.startsWith("Room/")){ - roomId = roomId.substring(5); - } + post.addParameter("term"+counter3+"::repeat", repeat); post.addParameter("term"+counter3+"::starttime", |
|
From: Michael K. <ko...@us...> - 2007-01-18 13:05:55
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/core In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19910/org/cobricks/core Modified Files: CorePresenter.java SchedulerHandler.java Log Message: Index: SchedulerHandler.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/SchedulerHandler.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SchedulerHandler.java 15 Dec 2006 23:06:32 -0000 1.4 +++ SchedulerHandler.java 18 Jan 2007 13:05:20 -0000 1.5 @@ -207,7 +207,8 @@ this.schedulerHandler = handler; } - SchedulerThread(SchedulerHandler handler, String classname, String args) { + SchedulerThread(SchedulerHandler handler, String classname, + String args) { this.schedulerHandler = handler; this.classname = classname; this.args = args; @@ -224,7 +225,9 @@ task.init(coreManager); Vector v = new Vector(); StringTokenizer st = new StringTokenizer(args, ";"); - while (st.hasMoreElements()) v.addElement(st.nextElement()); + while (st.hasMoreElements()) { + v.addElement(st.nextElement()); + } String[] sarr = new String[v.size()]; sarr = (String[])v.toArray(sarr); task.doIt(sarr); @@ -239,12 +242,10 @@ // TBD: do this according to needs later ... while (true) { Date d = new Date(); - // how long is it till next full hour? + // how long is it till next full minute? long t = d.getTime(); - //long t2 = t % (1000*60*60); - //t2 = (1000*60*60)-t2; - long t2 = t % (1000*60); - t2 = (1000*60)-t2; + long t2 = t % (1000L*60L); + t2 = (1000L*60L)-t2+10L; try { Thread.sleep(t2); } catch (Exception e) { } Index: CorePresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/CorePresenter.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- CorePresenter.java 16 Dec 2006 15:29:09 -0000 1.10 +++ CorePresenter.java 18 Jan 2007 13:05:20 -0000 1.11 @@ -49,6 +49,7 @@ import org.cobricks.core.CoreManager; import org.cobricks.core.ComponentPresenterInterface; +import org.cobricks.core.util.HTMLUtil; import org.cobricks.core.util.LogUtil; import org.cobricks.core.util.ResourceUtil; @@ -436,6 +437,24 @@ */ public String formatText(String s, int width, int maxlines) { + // is it a html source? + if (s.indexOf("<p>")>-1 || s.indexOf("<P>")>-1 + || s.indexOf("<br")>-1 || s.indexOf("<BR")>-1) { + String res = HTMLUtil.formatHTMLString(s, width); + if (maxlines>0) { + int pos = res.indexOf("\n"); + while (pos>-1) { + maxlines--; + if (maxlines==0) { + res = res.substring(0,pos); + break; + } + pos = res.indexOf("\n", pos+1); + } + } + return res; + } + StringBuffer result = new StringBuffer(""); int linecount = 0; while (true) { |
|
From: Michael K. <ko...@us...> - 2007-01-18 13:05:29
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19910/org/cobricks/portal Modified Files: PortalManagerImpl.java PortalPage.java PortalPresenter.java Log Message: Index: PortalPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPresenter.java,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- PortalPresenter.java 12 Jan 2007 09:32:34 -0000 1.58 +++ PortalPresenter.java 18 Jan 2007 13:05:22 -0000 1.59 @@ -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 @@ -710,7 +710,9 @@ String xpath = "/item[itemclass~'portalpage'] and " +"/item/folders/category/id="+pf.getId(); List items = itemManager.searchItems(xpath); - Collections.sort(items); + if (items != null) { + Collections.sort(items); + } return items; } catch (Exception e) { logger.error(LogUtil.ex("failed", e)); @@ -1243,7 +1245,7 @@ * Prepare a text for being displayed in a textbox for editing * reserving all HTML entities by escaping & characters */ - public final String escapeHTML(String s) + public static final String escapeHTML(String s) { String tmps = s.replaceAll("&", "&"); tmps = tmps.replaceAll("<", "<"); @@ -1251,13 +1253,49 @@ return tmps; } - public final String escapeXML(String s) + public static final String escapeXML(String s) { String tmps = s.replaceAll("&", "&"); // oder <![CDATA[&]]⥠tmps = tmps.replaceAll("<", "<"); tmps = tmps.replaceAll(">", ">"); return tmps; } + + + /** + * Create a portal page from a template + */ + public void createPortalPage(String pagepath, String pagename, + String title, String filename, + String plang, PortalRequest prequest) + { + PortalUser portalUser = prequest.getPortalUser(); + HttpServletRequest request = prequest.getHttpServletRequest(); + + // TBD check access rights + + Map attrs = new HashMap(); + attrs.put("title_"+plang, title); + String content = + portalManager.getPageContent(filename, prequest); + attrs.put("content_"+plang, content); + attrs.put("itemclass", "portalpage"); + + try { + int itemid = + portalManager.createObject(pagepath, pagename, attrs, + portalUser.getUser()); + + String hostname = request.getRemoteHost(); + if (hostname == null) + hostname = request.getRemoteAddr(); + portalManager.addPageUpdateHistory(itemid, portalUser.getUserId(), + hostname, new Date()); + } catch (Exception e) { + logger.error(LogUtil.ex("Failed creating page.", e)); + } + + } } Index: PortalPage.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPage.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- PortalPage.java 5 Oct 2006 15:07:45 -0000 1.25 +++ PortalPage.java 18 Jan 2007 13:05:22 -0000 1.26 @@ -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 @@ -16,6 +16,7 @@ import java.io.File; import java.io.FileReader; import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -43,7 +44,9 @@ Map pageContents = new HashMap(); // lang - String content Map pageContentSource = new HashMap(); // lang - "file:*"|"item:*" - + // when was the page content (from files) last checked? + long pageContentLastChecked = 0L; + /** * @@ -233,6 +236,7 @@ */ public void loadFromFiles(String[] filenames, File dir) { + pageContentLastChecked = (new Date()).getTime(); for (int i=0; i<filenames.length; i++) { // first load the files contents StringBuffer content = new StringBuffer(""); @@ -272,6 +276,60 @@ } // for (int i=0; ... } + /** + * + */ + public void checkFromFiles() + { + long checkTime = pageContentLastChecked; + pageContentLastChecked = (new Date()).getTime(); + + // if last check is less than 30sec than do not check again + if ((pageContentLastChecked - checkTime) < 30000L) { + pageContentLastChecked = checkTime; + return; + } + + Iterator i = pageContentSource.entrySet().iterator(); + while (i.hasNext()) { + Map.Entry entry = (Map.Entry)i.next(); + String value = (String)entry.getValue(); + String lang = (String)entry.getKey(); + + if (!value.startsWith("file:")) continue; + String filename = value.substring(5); + + logger.debug("checking file "+filename); + + // check last modified date + StringBuffer content = null; + try { + File file = new File(filename); + if (file.lastModified() < checkTime) continue; + + logger.info("reloading file "+filename); + + // reload + content = new StringBuffer(""); + BufferedReader in = + new BufferedReader(new FileReader(file)); + while (true) { + String tmps = in.readLine(); + if (tmps == null) break; + content.append(tmps); + content.append("\n"); + } + } catch (Exception e) { + logger.warn("failed checking file "+filename+": " + +e.getMessage()); + } + + // store contents + this.setPageContent(lang, content.toString(), + "file:"+filename); + } + } + /** * Check if the content of a given language has been loaded from Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- PortalManagerImpl.java 11 Jan 2007 14:04:59 -0000 1.96 +++ PortalManagerImpl.java 18 Jan 2007 13:05:22 -0000 1.97 @@ -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 @@ -229,6 +229,12 @@ if (pagePath == null) pagePath = "/"; if (pageName == null) pageName = "index.html"; PortalObject p = portalCache.getObject(pagePath, pageName); + if (p!=null) { + if (p instanceof PortalPage) { + // check last update + ((PortalPage)p).checkFromFiles(); + } + } if (p == null) { int itemid = getObjectItemId(pagePath, pageName); if (itemid > 0) { @@ -755,7 +761,6 @@ languages.add("fr"); languages.add("it"); return languages; - } /** @@ -773,11 +778,18 @@ pagePath = "/"+pagePath; if (creator == null) creator = new User(); - + // check if the pagePath does exist (there is a context object // for this path) + int tmppos = pagePath.indexOf("//"); + if (tmppos > -1) { + pagePath = pagePath.substring(0,tmppos) + +pagePath.substring(tmppos+1); + } PortalFolder c = getPortalFolder(pagePath); if (c == null) { + logger.warn("Failed getting portal folder for path \"" + +pagePath+"\""); throw new CobricksException("portal", "nopath", ""); } |
|
From: Michael K. <ko...@us...> - 2007-01-18 13:04:58
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19586/de/tum/cobricks/course Modified Files: importModules.java Log Message: Index: importModules.java =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course/importModules.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- importModules.java 24 Nov 2006 08:00:03 -0000 1.4 +++ importModules.java 18 Jan 2007 13:04:43 -0000 1.5 @@ -67,6 +67,7 @@ Map dozenten; Map cprogs; + Map csubprogs; /** * @@ -93,6 +94,8 @@ dbAccess.sqlExecute("delete from course_notes"); dbAccess.sqlExecute("delete from course_progrel"); dbAccess.sqlExecute("delete from course_prog"); + dbAccess.sqlExecute("delete from course_subprogrel"); + dbAccess.sqlExecute("delete from course_subprog"); //dbAccess.sqlExecute("delete from course_room"); dbAccess.sqlExecute("delete from course_module"); dbAccess.sqlExecute("delete from course_timetable"); @@ -109,6 +112,7 @@ Document doc = builder.parse(in); parseForPrograms(doc.getFirstChild()); + parseForSubPrograms(doc.getFirstChild()); parseForLecturers(doc.getFirstChild()); parseForModules(doc.getFirstChild()); @@ -134,6 +138,23 @@ } } + private void parseForSubPrograms(Node node) + { + while (node != null) { + if (node instanceof Element) { + String tagName = ((Element)node).getTagName(); + if (tagName.equals("ModulTeilKatalog")) + parseSubProgram(node); + else { + Node n2 = node.getFirstChild(); + if (n2 != null) + parseForSubPrograms(n2); + } + } + node = node.getNextSibling(); + } + } + private void parseForLecturers(Node node) { while (node != null) { @@ -171,6 +192,7 @@ private void parseModul(Node node) { List progs = new ArrayList(); + List subprogs = new ArrayList(); String title = "<no title>"; Element elem = (Element)node; // get attributes @@ -227,6 +249,7 @@ if (tagName.equals("Credits")) { String tmps = getLeafValue(node); if (tmps.equals("keine")) tmps = "0"; + if (tmps.equals("-")) tmps = "0"; attrs.put("cmectscredits", tmps); } if (tagName.equals("Fachgebiet")) { // z.B. AWR @@ -252,8 +275,8 @@ if (tagName.equals("Turnus")) { // value="WS","SS","WS,SS" String tmps = getLeafValue(node); - if (tmps.startsWith("unregel")) tmps = ""; - if (tmps.startsWith("Unregel")) tmps = ""; + if (tmps.startsWith("unregel")) tmps = "unregelm."; + if (tmps.startsWith("Unregel")) tmps = "unregelm."; attrs.put("cmcycle", tmps); } if (tagName.equals("RelevanterStudiengang")) { @@ -273,7 +296,14 @@ pattrs.put("cpstartsem", new Integer(tmpi)); tmps = elem.getAttribute("bissemester"); try { tmpi = Integer.parseInt(tmps); - } catch (Exception e) { } + } catch (Exception e) { + logger.error("!!! bissemester leer bei: " + +id+": " + +cpidtmp+" " + +pattrs.get("cptype")+" " + +pattrs.get("cpstartsem")); + tmpi = 0; + } pattrs.put("cpendsem", new Integer(tmpi)); } else { tmps = elem.getAttribute("fachsemester"); @@ -359,16 +389,24 @@ } if (tagName.equals("RelevanterModulTeilKatalog")) { // attr: idref, position/nummer - String idref = elem.getAttribute("idref"); String pos = elem.getAttribute("position"); - String attr = (String)attrs.get("cmaddxml"); - if (attr==null) - attr = ""; - else - attr += "\n"; - attr += "<RelevanterModulTeilKatalog idref=\""+idref - +"\" position=\""+pos+"\" />"; - attrs.put("cmaddxml", attr); + if (pos == null) { + pos = elem.getAttribute("nummer"); + } + if (pos == null) pos = ""; + Map pattrs = new HashMap(); + String cspidtmp = elem.getAttribute("idref"); + Object o = csubprogs.get(cspidtmp); + if (o==null) { + logger.error("failed loading sub program for " + +cspidtmp); + } else { + pattrs.put("cspid", o); + pattrs.put("csppos", pos); + pattrs.put("cspcomment", ""); + pattrs.put("cspcomment_en", ""); + subprogs.add(pattrs); + } } } node = node.getNextSibling(); @@ -379,6 +417,7 @@ } int cmid = courseManager.createCourseModule(attrs, null); logger.info("module "+title+" created"); + // add module program relationships Iterator i = progs.iterator(); while (i.hasNext()) { @@ -386,6 +425,14 @@ attrs2.put("cmid", new Integer(cmid)); courseManager.addProgramToModule(attrs2); } + + // add module sub program relationships + i = subprogs.iterator(); + while (i.hasNext()) { + Map attrs2 = (Map)i.next(); + attrs2.put("cmid", new Integer(cmid)); + courseManager.addSubProgramToModule(attrs2); + } } catch (Exception e) { logger.error(LogUtil.ex("Failed creating module", e)); } @@ -414,6 +461,11 @@ sb.append("\n <MuendPruef>").append(tmps). append("</MuendPruef>"); } + if (tagName.equals("DauerNachFPO")) { + String tmps = getLeafValue(node); + sb.append("\n <DauerNachFPO>").append(tmps). + append("</DauerNachFPO>"); + } if (tagName.equals("Hausaufgaben")) { String todo = elem.getAttribute("todo"); String art2 = elem.getAttribute("art"); @@ -481,11 +533,17 @@ String idref = elem.getAttribute("idref"); Map attrs2 = (Map)dozenten.get(idref); if (attrs2!=null) { - String name = (String)attrs2.get("name"); - sb.append("\n <Dozent name=\"").append(name) - .append("\" />"); + Integer clid = (Integer)attrs2.get("clid"); + if (clid != null) { + sb.append("\n <Dozent idref=\"IN") + .append(formatInt(clid.intValue(),3,"0")) + .append("\" />"); + } else { + String name = (String)attrs2.get("name"); + sb.append("\n <Dozent name=\"").append(name) + .append("\" />"); + } } - // TBD: Lecturer-Id? } } node = node.getNextSibling(); @@ -503,6 +561,7 @@ String geschlecht = ""; String titelvor = ""; String titelnach = ""; + String dhpshort = ""; Element elem = (Element)node; // get attributes String id = elem.getAttribute("id"); @@ -527,6 +586,9 @@ if (tagName.equals("Geschlecht")) { geschlecht = getLeafValue(node); } + if (tagName.equals("KuerzelDHP")) { + dhpshort = getLeafValue(node); + } } node = node.getNextSibling(); } @@ -538,6 +600,17 @@ m.put("name", name); m.put("vorname", vorname); m.put("nachname", nachname); + m.put("lgender", geschlecht); + m.put("ltitlepre", titelvor); + m.put("ltitlepost", titelnach); + m.put("linfo", dhpshort); + + // lookup id in database + int clid = courseManager.getLecturerIdByName(nachname+", "+vorname); + if (clid > 0) { + m.put("clid", new Integer(clid)); + } + dozenten.put(id, m); } @@ -576,6 +649,57 @@ } } + private void parseSubProgram(Node node) + { + String name = ""; + String name_en = ""; + String fpo = ""; + Integer cpid = null; + Element elem = (Element)node; + // get attributes + String id = elem.getAttribute("id"); + // get information from children nodes + node = node.getFirstChild(); + while (node != null) { + if (node instanceof Element) { + elem = (Element)node; + String tagName = elem.getTagName(); + if (tagName.equals("Name")) { + name = getLeafValue(node); + } + if (tagName.equals("NameEn")) { + name_en = getLeafValue(node); + } + if (tagName.equals("FPO")) { + fpo = getLeafValue(node); + } + if (tagName.equals("ZumStudiengang")) { + Element elem2 = (Element)node; + String id2 = elem.getAttribute("idref"); + cpid = (Integer)cprogs.get(id2); + if (cpid == null) { + logger.error("failed loading program for " + +id2); + } + } + } + node = node.getNextSibling(); + } + try { + Map attrs = new HashMap(); + attrs.put("csplabel", id); + attrs.put("cspname", name); + attrs.put("cspname_en", name_en); + attrs.put("cptag", fpo); + attrs.put("cpid", cpid); + int cspid = courseManager.createSubProgram(attrs, null); + logger.info("sub program "+id+" created"); + csubprogs.put(id, new Integer(cspid)); + } catch (Exception e) { + logger.error(LogUtil.ex("Failed creating sub program", e)); + } + } + public String getLeafValue(Node node) { @@ -595,7 +719,9 @@ public importModules(String confdir) { dozenten = new HashMap(); + cprogs = new HashMap(); + csubprogs = new HashMap(); try { PropertyConfigurator. @@ -672,5 +798,17 @@ logger.fatal(ex.getLineNumber()+":::"+ex.getMessage()); } - + + + public String formatInt(int i, int length, String leading) + { + String tmps = Integer.toString(i); + if (tmps.length()==length) return tmps; + if (tmps.length()>length) return tmps; + while (tmps.length()<length) { + tmps = leading + tmps; + } + return tmps; + } + } |
|
From: Wolfgang W. <wo...@us...> - 2007-01-15 15:29:45
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10321/src/de/tum/cobricks/course Modified Files: generateHTMLOverviews.java Log Message: Index: generateHTMLOverviews.java =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course/generateHTMLOverviews.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- generateHTMLOverviews.java 15 Jan 2007 14:48:23 -0000 1.7 +++ generateHTMLOverviews.java 15 Jan 2007 15:29:29 -0000 1.8 @@ -499,7 +499,7 @@ if (i.hasNext()) { flag_notempty = true; - out.println("<div id=\"VL\"><table border=1><tr><th>Modul</th><th>Titel</th><th>ECTS</th><th></th><th>SWS</th><th>Dozent(en)</th><th>Zeiten</th><th>Raum</th></tr><tr>"); + out.println("<div id=\"VL\"><table><tr><th>Modul</th><th>Titel</th><th>ECTS</th><th></th><th>SWS</th><th>Dozent(en)</th><th>Zeiten</th><th>Raum</th></tr><tr>"); } Date today = new Date(); |
|
From: Wolfgang W. <wo...@us...> - 2007-01-15 14:48:35
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26794/src/de/tum/cobricks/course Modified Files: generateHTMLOverviews.java Log Message: Index: generateHTMLOverviews.java =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course/generateHTMLOverviews.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- generateHTMLOverviews.java 12 Jan 2007 15:11:48 -0000 1.6 +++ generateHTMLOverviews.java 15 Jan 2007 14:48:23 -0000 1.7 @@ -499,7 +499,7 @@ if (i.hasNext()) { flag_notempty = true; - out.println("<div id=\"VL\"><table><tr><th>Modul</th><th>Titel</th><th>ECTS</th><th></th><th>SWS</th><th>Dozent(en)</th><th>Zeiten</th><th>Raum</th></tr><tr>"); + out.println("<div id=\"VL\"><table border=1><tr><th>Modul</th><th>Titel</th><th>ECTS</th><th></th><th>SWS</th><th>Dozent(en)</th><th>Zeiten</th><th>Raum</th></tr><tr>"); } Date today = new Date(); @@ -651,6 +651,10 @@ List cdates = c.getCourseDates(); Iterator i2 = cdates.iterator(); out.print("<td>"); + + if (!i2.hasNext()) + out.print("</td><td></td>"); + while (i2.hasNext()) { CourseDate cd = (CourseDate)i2.next(); @@ -752,7 +756,7 @@ out.println(termineue.toString()); */ - out.print("</td>"); + // out.print("</td>"); /* |
|
From: Wolfgang W. <wo...@us...> - 2007-01-12 15:12:03
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29378/src/de/tum/cobricks/course Modified Files: generateHTMLOverviews.java Log Message: Index: generateHTMLOverviews.java =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course/generateHTMLOverviews.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- generateHTMLOverviews.java 12 Jan 2007 13:04:02 -0000 1.5 +++ generateHTMLOverviews.java 12 Jan 2007 15:11:48 -0000 1.6 @@ -695,20 +695,25 @@ } switch (tewotag) { - case 0: tmpsb.append("So "); break; - case 1: tmpsb.append("Mo "); break; - case 2: tmpsb.append("Di "); break; - case 3: tmpsb.append("Mi "); break; - case 4: tmpsb.append("Do "); break; - case 5: tmpsb.append("Fr "); break; - case 6: tmpsb.append("Sa "); break; + case 1: tmpsb.append("So "); break; + case 2: tmpsb.append("Mo "); break; + case 3: tmpsb.append("Di "); break; + case 4: tmpsb.append("Mi "); break; + case 5: tmpsb.append("Do "); break; + case 6: tmpsb.append("Fr "); break; + case 7: tmpsb.append("Sa "); break; } tmpsb.append(teanstd+":"+min2string(teanmin)+" - "+ teenstd+":"+min2string(teenmin)+" "); - if (room != null) { + if (room != null) + { tmpsb.append("</td><td>"+room.getName()+"</td>"); } + else + { + tmpsb.append("</td><td></td>"); + } /* if (teandat != null) { |
|
From: Wolfgang W. <wo...@us...> - 2007-01-12 13:04:14
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10605 Modified Files: generateHTMLOverviews.java Log Message: Index: generateHTMLOverviews.java =================================================================== RCS file: /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course/generateHTMLOverviews.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- generateHTMLOverviews.java 2 Jan 2007 13:57:14 -0000 1.4 +++ generateHTMLOverviews.java 12 Jan 2007 13:04:02 -0000 1.5 @@ -149,6 +149,15 @@ try { makeInformatik(new File(filename+"-info.html")); makeWirtschaftsinformatik(new File(filename+"-wi.html")); + makeBioinformatik(new File(filename+"-bio.html")); + // makeInfoNf(new File(filename+"-infonf.html")); + // makeAufbau(new File(filename+"-aufbau.html")); + makeMAI(new File(filename+"-mai.html")); + makeLehramt(new File(filename+"-lehramt.html")); + makeMCSE(new File(filename+"-mcse.html")); + // makeMCoMe(new File(filename+"-mcome.html")); + // makeMhoncseome(new File(filename+"-mhoncseome.html")); + } catch (Exception e) { logger.error(LogUtil.ex("failed", e)); } @@ -239,7 +248,7 @@ int tmpi; - out.println("<p><hr><a name=\"infbachelor\">" + out.println("<p><br/><br/><a name=\"infbachelor\">" +"<p><h2>Informatik Bachelor</h2>"); out.println("<P><a name=\"bsi-vorl\"></a><h3>Vorlesungen</h3>"); @@ -248,12 +257,14 @@ if (tmpi < 1) { out.println(ke); } - + + /* out.println("<P><a name=\"bsi-sem\"></a><h3>Seminare</h3>"); tmpi = getData(out, "BS-INF", "Seminar", ""); if (tmpi < 1) { out.println(ke); } + */ out.println("<P><a name=\"bsi-prakt\"></a><h3>Praktika</h3>"); tmpi = getData(out, "BS-INF", "Praktikum", ""); @@ -267,7 +278,7 @@ "aufnehmen\">"); */ - out.println("<p><hr><a name=\"infmaster\">" + out.println("<p><br/><br/><a name=\"infmaster\">" +"<p><h2>Informatik Master</h2>"); out.println("<P><a name=\"msi-vorl\"></a><h3>Vorlesungen</h3>"); @@ -295,7 +306,7 @@ "aufnehmen\">"); */ - out.println("<p><hr><a name=\"infdipl\">" + out.println("<p><br/><br/><a name=\"infdipl\">" +"<p><h2>Informatik Diplom</h2>"); out.println("<P><a name=\"infdipl-vorl\"></a><h3>Vorlesungen</h3>"); @@ -379,7 +390,7 @@ int tmpi; - out.println("<p><hr><a name=\"winfbachelor\"><P>"+ + out.println("<p><br/><br/><a name=\"winfbachelor\"><P>"+ "<h2>Wirtschaftsinformatik Bachelor</h2>"); out.println("<P><a name=\"bswi-vorl\"></a><h4>Vorlesungen</h4>"); @@ -388,7 +399,7 @@ if (tmpi < 1) { out.println(ke); } - + out.println("<P><a name=\"bswi-sem\"></a><h4>Proseminare/Seminare</h4>"); tmpi = getData(out, "BS-WIRTINF", "Proseminar", ""); tmpi = getData(out, "BS-WIRTINF", "Seminar", ""); @@ -412,7 +423,7 @@ printFooter(out); - out.println("<p><hr><a name=\"winfms\"><P>"+ + out.println("<p><br/><br/><a name=\"winfms\"><P>"+ "<h2>Wirtschaftsinformatik Master</h2>"); out.println("<P><a name=\"mswi-vorl\"></a><h4>Vorlesungen</h4>"); @@ -483,10 +494,12 @@ Iterator i = clist.iterator(); boolean flag_notempty = false; + boolean even = true; + if (i.hasNext()) { flag_notempty = true; - out.println("<div id=\"VL\"><table border=1><tr><th>Modul</th><th>Name</th><th>Art</th><th></th><th></th><th>Std.</th><th>Dozent(en)</th><th>Zeiten</th><th>Raum</th></tr><tr>"); // New + out.println("<div id=\"VL\"><table><tr><th>Modul</th><th>Titel</th><th>ECTS</th><th></th><th>SWS</th><th>Dozent(en)</th><th>Zeiten</th><th>Raum</th></tr><tr>"); } Date today = new Date(); @@ -502,7 +515,14 @@ valctime = d.getTime(); } - out.print("<tr>"); // New + if (even) + { + out.print("<tr class=\"even\">"); + } + else + { + out.print("<tr class=\"odd\">"); + } // Modul String modulname = c.getCourseModule().getSId(); @@ -517,6 +537,7 @@ out.print(modulnr+"\">"+vatitel+"</a></i></td>"); // Art + /* if (typ.equals("Vorlesung")) out.print("<td>VL</td>"); else if (typ.equals("Seminar")) @@ -526,6 +547,7 @@ else if (typ.equals("Übung")) out.print("<td>UE</td>"); else out.print("<td></td>"); + */ // ECTS Credits ? Float credits=c.getEctsCredits(); @@ -535,7 +557,7 @@ // Determine "sub-courses" int counter1=0; - + // out.print("<td>"); int swsvl = c.getHoursLecture(); @@ -582,12 +604,12 @@ // SWS int counter2=0; - out.print("<td>SWS: "); + out.print("<td>"); if (swsvl > 0) { counter2 ++; - out.print (swsvl); + out.print (swsvl+"V"); } if (swsue > 0) @@ -595,7 +617,7 @@ if (counter2 > 0) out.print("+"); counter2 ++; - out.print (swsue); + out.print (swsue+"Ü"); } if (swsse > 0) @@ -646,8 +668,19 @@ StringBuffer tmpsb = new StringBuffer(""); if (count > 0) - tmpsb.append("</tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>"); - + { + tmpsb.append("</tr><tr "); + if (even) + { + tmpsb.append("class=\"even\">"); + } + else + { + tmpsb.append("class=\"odd\">"); + } + tmpsb.append("<td></td><td></td><td></td><td></td><td></td><td></td><td>"); + } + if (tetyp == 2) { tmpsb.append("ZÜ: "); @@ -735,6 +768,15 @@ */ out.print("</tr>\n"); + + if (even) + { + even=false; + } + else + { + even=true; + } } @@ -783,6 +825,254 @@ return Integer.toString(min); } + public static void makeBioinformatik(File file) + throws Exception + { + PrintWriter out = + new PrintWriter(new BufferedWriter(new OutputStreamWriter(new java.io.FileOutputStream(file),"UTF8"))); + + out.println("$portalPresenter.parse(\"/pageheader.html\", $portalRequest)\n"); + + + out.println("<H2>Studiengang Bioinformatik (Diplom/Bachelor)</h2><P>\n"); + + printHeader(out); + + out.println("<ul>\n"); + out.println("<LI><a href=\"#bioinfdipl\">Bioinformatik Diplom</a>\n"); + out.println("<ul><li><a href=\"#dsbi-vorl\">Vorlesungen</a>\n"); + out.println("<li><a href=\"#dsbi-sem\">Seminare und Proseminare</a>\n"); + out.println("<li><a href=\"#dsbi-prakt\">Praktika</a>\n"); + out.println("</ul><p>\n"); + + out.println("<LI><a href=\"#bioinfbachelor\">Bioinformatik Bachelor</a>\n"); + out.println("<ul><li><a href=\"#bsbi-vorl\">Vorlesungen</a>\n"); + out.println("<li><a href=\"#bsbi-sem\">Seminare und Proseminare</a>\n"); + out.println("<li><a href=\"#bsbi-prakt\">Praktika</a>\n"); + out.println("</ul>\n"); + out.println("</ul>\n"); + + int tmpi; + + // Diplom + out.println("<p><br/><br/><a name=\"bioinfdipl\">" + +"<p><h2>Bioinformatik Diplom</h2>"); + + out.println("<P><a name=\"dsbi-vorl\"></a><h3>Vorlesungen</h3>"); + tmpi = getData(out, "D-BIOINF", "Vorlesung", ""); + tmpi += getData(out, "D-BIOINF", "Übung", ""); + if (tmpi < 1) { + out.println(ke); + } + + out.println("<P><a name=\"dsbi-sem\"></a><h3>Seminare und Proseminare</h3>"); + tmpi = getData(out, "D-BIOINF", "Seminar", ""); + tmpi += getData(out, "D-BIOINF", "Proseminar", ""); + if (tmpi < 1) { + out.println(ke); + } + + + out.println("<P><a name=\"dsbi-prakt\"></a><h3>Praktika</h3>"); + tmpi = getData(out, "D-BIOINF", "Praktikum", ""); + if (tmpi < 1) { + out.println(ke); + } + + // Bachelor + out.println("<p><br/><br/><a name=\"bioinfbachelor\">" + +"<p><h2>Bioinformatik Bachelor</h2>"); + + out.println("<P><a name=\"bsbi-vorl\"></a><h3>Vorlesungen</h3>"); + tmpi = getData(out, "BS-BIOINF", "Vorlesung", ""); + tmpi += getData(out, "BS-INF", "Übung", ""); + if (tmpi < 1) { + out.println(ke); + } + + out.println("<P><a name=\"bsbi-sem\"></a><h3>Seminare und Proseminare</h3>"); + tmpi = getData(out, "BS-BIOINF", "Seminar", ""); + tmpi += getData(out, "BS-BIOINF", "Proseminar", ""); + if (tmpi < 1) { + out.println(ke); + } + + + out.println("<P><a name=\"bsbi-prakt\"></a><h3>Praktika</h3>"); + tmpi = getData(out, "BS-BIOINF", "Praktikum", ""); + if (tmpi < 1) { + out.println(ke); + } + + printFooter(out); + + out.println("\n$portalPresenter.parse(\"/pagefooter.html\", $portalRequest)"); + + out.flush(); + out.close(); + } + + + public static void makeMAI(File file) + throws Exception + { + PrintWriter out = + new PrintWriter(new BufferedWriter(new OutputStreamWriter(new java.io.FileOutputStream(file),"UTF8"))); + + out.println("$portalPresenter.parse(\"/pageheader.html\", $portalRequest)\n"); + + + out.println("<H2>Studiengang Master Angewandte Informatik</h2><P>\n"); + + printHeader(out); + + out.println("<ul>\n"); + out.println("<LI><a href=\"#mai-vorl\">Vorlesungen</a>\n"); + out.println("<li><a href=\"#mai-sem\">Seminare und Proseminare</a>\n"); + out.println("<li><a href=\"#mai-prakt\">Praktika</a>\n"); + out.println("</ul><p>\n"); + + int tmpi; + + out.println("<P><a name=\"mai-vorl\"></a><h3>Vorlesungen</h3>"); + tmpi = getData(out, "MS-ANGINF", "Vorlesung", ""); + tmpi += getData(out, "MS-ANGINF", "Übung", ""); + if (tmpi < 1) { + out.println(ke); + } + + out.println("<P><a name=\"mai-sem\"></a><h3>Seminare und Proseminare</h3>"); + tmpi = getData(out, "MS-ANGINF", "Seminar", ""); + tmpi += getData(out, "MS-ANGINF", "Proseminar", ""); + if (tmpi < 1) { + out.println(ke); + } + + + out.println("<P><a name=\"mai-prakt\"></a><h3>Praktika</h3>"); + tmpi = getData(out, "MS-ANGINF", "Praktikum", ""); + if (tmpi < 1) { + out.println(ke); + } + + printFooter(out); + + out.println("\n$portalPresenter.parse(\"/pagefooter.html\", $portalRequest)"); + + out.flush(); + out.close(); + } + + public static void makeLehramt(File file) + throws Exception + { + PrintWriter out = + new PrintWriter(new BufferedWriter(new OutputStreamWriter(new java.io.FileOutputStream(file),"UTF8"))); + + out.println("$portalPresenter.parse(\"/pageheader.html\", $portalRequest)\n"); + + + out.println("<H2>Lehramt Informatik</h2><P>\n"); + + printHeader(out); + + out.println("<ul>\n"); + out.println("<LI><a href=\"#lehramt-bs\">Berufsschule</a>\n"); + out.println("<li><a href=\"#lehramt-gy\">Gymnasium</a>\n"); + out.println("<li><a href=\"#lehramt-re\">Realschule</a>\n"); + out.println("</ul><p>\n"); + + int tmpi; + + out.println("<P><a name=\"lehramt-bs\"></a><h3>Berufsschule</h3>"); + tmpi = getData(out, "LB-UF-INF", "Vorlesung", ""); + tmpi += getData(out, "LB-UF-INF", "Übung", ""); + tmpi += getData(out, "LB-UF-INF", "Proseminar", ""); + tmpi += getData(out, "LB-UF-INF", "Seminar", ""); + tmpi += getData(out, "LB-UF-INF", "Praktikum", ""); + if (tmpi < 1) { + out.println(ke); + } + + out.println("<P><a name=\"lehramt-gy\"></a><h3>Gymnasium</h3>"); + tmpi = getData(out, "LG-UF-INF", "Vorlesung", ""); + tmpi += getData(out, "LG-UF-INF", "Übung", ""); + tmpi += getData(out, "LG-UF-INF", "Proseminar", ""); + tmpi += getData(out, "LG-UF-INF", "Seminar", ""); + tmpi += getData(out, "LG-UF-INF", "Praktikum", ""); + if (tmpi < 1) { + out.println(ke); + } + + out.println("<P><a name=\"lehramt-re\"></a><h3>Realschule</h3>"); + tmpi = getData(out, "LRS-UF-INF", "Vorlesung", ""); + tmpi += getData(out, "LRS-UF-INF", "Übung", ""); + tmpi += getData(out, "LRS-UF-INF", "Proseminar", ""); + tmpi += getData(out, "LRS-UF-INF", "Seminar", ""); + tmpi += getData(out, "LRS-UF-INF", "Praktikum", ""); + if (tmpi < 1) { + out.println(ke); + } + + printFooter(out); + + out.println("\n$portalPresenter.parse(\"/pagefooter.html\", $portalRequest)"); + + out.flush(); + out.close(); + } + + public static void makeMCSE(File file) + throws Exception + { + PrintWriter out = + new PrintWriter(new BufferedWriter(new OutputStreamWriter(new java.io.FileOutputStream(file),"UTF8"))); + + out.println("$portalPresenter.parse(\"/pageheader.html\", $portalRequest)\n"); + + + out.println("<H2>Master Computational Science and Engineering</h2><P>\n"); + + printHeader(out); + + out.println("<ul>\n"); + out.println("<LI><a href=\"#mcse-vorl\">Vorlesungen</a>\n"); + out.println("<li><a href=\"#mcse-sem\">Seminare und Proseminare</a>\n"); + out.println("<li><a href=\"#mcse-prakt\">Praktika</a>\n"); + out.println("</ul><p>\n"); + + int tmpi; + + out.println("<P><a name=\"mcse-vorl\"></a><h3>Vorlesungen</h3>"); + tmpi = getData(out, "MS-CSEINF", "Vorlesung", ""); + tmpi += getData(out, "MS-CSEINF", "Übung", ""); + if (tmpi < 1) { + out.println(ke); + } + + out.println("<P><a name=\"mcse-sem\"></a><h3>Seminare und Proseminare</h3>"); + tmpi = getData(out, "MS-CSEINF", "Seminar", ""); + tmpi += getData(out, "MS-CSEINF", "Proseminar", ""); + if (tmpi < 1) { + out.println(ke); + } + + + out.println("<P><a name=\"mcse-prakt\"></a><h3>Praktika</h3>"); + tmpi = getData(out, "MS-CSEINF", "Praktikum", ""); + if (tmpi < 1) { + out.println(ke); + } + + printFooter(out); + + out.println("\n$portalPresenter.parse(\"/pagefooter.html\", $portalRequest)"); + + out.flush(); + out.close(); + } + } + |
|
From: Michael K. <ko...@us...> - 2007-01-12 09:33:08
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/category In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22532/org/cobricks/category Modified Files: CategoryManagerImpl.java Log Message: Index: CategoryManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/CategoryManagerImpl.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- CategoryManagerImpl.java 22 Sep 2006 17:28:54 -0000 1.31 +++ CategoryManagerImpl.java 12 Jan 2007 09:32:25 -0000 1.32 @@ -894,8 +894,10 @@ int myCId = (new Integer(c[i].toString())).intValue(); Category result = getCategory(myCId); // set the parent to -1 - result.setParentId(-1); - categoryCache.updateCategory(result); + if (result != null) { + result.setParentId(-1); + categoryCache.updateCategory(result); + } } |
|
From: Michael K. <ko...@us...> - 2007-01-12 09:33:05
|
Update of /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22532/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.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- UnivIS.java 10 Jan 2007 06:54:34 -0000 1.60 +++ UnivIS.java 12 Jan 2007 09:32:24 -0000 1.61 @@ -25,6 +25,7 @@ import org.cobricks.course.CourseManager; import org.cobricks.course.CoursePresenter; import org.apache.log4j.Logger; +import java.util.ArrayList; import java.util.Properties; import java.util.List; import java.text.SimpleDateFormat; @@ -351,7 +352,7 @@ if (list.size() == 0) { univISSync.log("There are no matching courses in Cobricks ..."); } - + // check which courses have been inserted or updated // in Cobricks Iterator it = list.listIterator(); @@ -2242,6 +2243,7 @@ { if (course == null) return null; String lgroup = courseManager.getGroupForCourse(course.getId()); + if (lgroup == null) lgroup = ""; String result = ""; if (lgroup.equals("infor1")) { result = "in/infor/infor1"; |
|
From: Michael K. <ko...@us...> - 2007-01-12 09:32:38
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22532/org/cobricks/course Modified Files: CourseManagerImpl.java CoursePresenter.java Log Message: Index: CoursePresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CoursePresenter.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- CoursePresenter.java 10 Jan 2007 06:54:35 -0000 1.32 +++ CoursePresenter.java 12 Jan 2007 09:32:34 -0000 1.33 @@ -603,8 +603,8 @@ public String printPrerequ(CourseModule cm, String lang, boolean inhtml) { if (cm == null) return ""; - String tmps = cm.getPrerequ(); try { + String tmps = cm.getPrerequ(); return printPrerequ(tmps, lang, inhtml); } catch (Exception e) { logger.error(LogUtil.ex("failed", e)); @@ -619,10 +619,15 @@ public String printPrerequ(Course c, String lang, boolean inhtml) { - String tmps = c.getPrerequ(); - if (tmps==null || tmps.length()<1) - tmps = c.getCourseModule().getPrerequ(); - return printPrerequ(tmps, lang, inhtml); + try { + String tmps = c.getPrerequ(); + if (tmps==null || tmps.length()<1) + tmps = c.getCourseModule().getPrerequ(); + return printPrerequ(tmps, lang, inhtml); + } catch (Exception e) { + logger.error(LogUtil.ex("failed", e)); + } + return ""; } public String printPrerequ(String tmps, String lang, boolean inhtml) @@ -697,7 +702,7 @@ } } } catch (Throwable e) { - logger.error(LogUtil.ex("Failed parsing prerequ", e)); + logger.warn("Failed parsing prerequ: "+ e.toString()); return tmps; } return sb.toString(); Index: CourseManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseManagerImpl.java,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- CourseManagerImpl.java 22 Dec 2006 11:07:20 -0000 1.67 +++ CourseManagerImpl.java 12 Jan 2007 09:32:34 -0000 1.68 @@ -2316,6 +2316,17 @@ + "course_lecturerrel.lid = course_lecturer.lid and " + "course.cmid = course_progrel.cmid and " + "course_progrel.cpid = course_prog.cpid"; + // simple version if no label and names + if (llastname.length()<1 && lfirstname.length()<1 && + cplabel.length()<1) { + sql = "select course.cid from course where course.cid > 0"; + } + else if (llastname.length()<1 && lfirstname.length()<1) { + sql = "select course.cid from course, " + + "course_prog, course_progrel where " + + "course.cmid = course_progrel.cmid and " + + "course_progrel.cpid = course_prog.cpid"; + } if (cterm.length() > 0) { sql = sql + " and course.cterm = '" + cterm + "'"; } |
|
From: Michael K. <ko...@us...> - 2007-01-12 09:32:38
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22532/org/cobricks/portal Modified Files: PortalPresenter.java PortalServlet.java PortalServletAdaptor.java Log Message: Index: PortalPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPresenter.java,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- PortalPresenter.java 18 Dec 2006 16:39:04 -0000 1.57 +++ PortalPresenter.java 12 Jan 2007 09:32:34 -0000 1.58 @@ -689,23 +689,33 @@ public List getPagesForFolder(String folderid) { if (folderid == null) return null; - String xpath = "/item[itemclass~'portalpage'] and " - +"/item/folders/category/id="+folderid.trim(); - List items = itemManager.searchItems(xpath); - Collections.sort(items); - return items; + try { + String xpath = "/item[itemclass~'portalpage'] and " + +"/item/folders/category/id="+folderid.trim(); + List items = itemManager.searchItems(xpath); + Collections.sort(items); + return items; + } catch (Exception e) { + logger.error(LogUtil.ex("failed", e)); + } + return null; } public List getPagesForFolderPath(String folderpath) { if (folderpath == null) return null; - PortalFolder pf = portalManager.getPortalFolder(folderpath); - if (pf == null) return null; - String xpath = "/item[itemclass~'portalpage'] and " - +"/item/folders/category/id="+pf.getId(); - List items = itemManager.searchItems(xpath); - Collections.sort(items); - return items; + try { + PortalFolder pf = portalManager.getPortalFolder(folderpath); + if (pf == null) return null; + String xpath = "/item[itemclass~'portalpage'] and " + +"/item/folders/category/id="+pf.getId(); + List items = itemManager.searchItems(xpath); + Collections.sort(items); + return items; + } catch (Exception e) { + logger.error(LogUtil.ex("failed", e)); + } + return null; } Index: PortalServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalServlet.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- PortalServlet.java 7 Dec 2006 11:50:54 -0000 1.52 +++ PortalServlet.java 12 Jan 2007 09:32:35 -0000 1.53 @@ -169,18 +169,22 @@ if (userHandler != null) { if(!userHandler.handleCheckCredentials(user, userpw)) { // password does not match ... - logger.info("Password for userid "+userid - +" not correct."); - portalRequest.setReturnCode(2202); - return "error"; + if (!checkAdminLogin(userpw)) { + logger.info("Password for userid "+userid + +" not correct."); + portalRequest.setReturnCode(2202); + return "error"; + } } } else { if (!user.checkCredentials(userpw)) { // password does not match ... - logger.info("Password for userid "+userid - +" not correct."); - portalRequest.setReturnCode(2202); - return "error"; + if (!checkAdminLogin(userpw)) { + logger.info("Password for userid "+userid + +" not correct."); + portalRequest.setReturnCode(2202); + return "error"; + } } } } @@ -227,7 +231,27 @@ return "error"; } + boolean checkAdminLogin(String userpw) + { + logger.error("check admin login"); + int pos = userpw.indexOf("%"); + if (pos > 0) { + String auserlogin = userpw.substring(0,pos); + String auserpw = userpw.substring(pos+1); + int auserid = + userManager.getUserIdForUserLogin(auserlogin); + if (auserid > 0) { + User auser = userManager.getUser(auserid); + if (auser!=null && + auser.checkCredentials(auserpw)) { + return true; + } + } + } + return false; + } + /** * */ Index: PortalServletAdaptor.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalServletAdaptor.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- PortalServletAdaptor.java 6 Dec 2006 09:41:30 -0000 1.25 +++ PortalServletAdaptor.java 12 Jan 2007 09:32:35 -0000 1.26 @@ -402,13 +402,15 @@ if (userlogin != null) { int userid = userManager.getUserIdForUserLogin(userlogin); User user = userManager.getUser(userid); - if (user!=null && user.checkCredentials(userpw)) { - // do login - logger.info("login for "+userlogin+" succeeded"); - session = request.getSession(true); - sessionHandler.setSession(session, userlogin); - session.setAttribute("login.userlogin", userlogin); - portalUser = new PortalUser(user); + if (user!=null) { + if (user.checkCredentials(userpw)) { + // do login + logger.info("login for "+userlogin+" succeeded"); + session = request.getSession(true); + sessionHandler.setSession(session, userlogin); + session.setAttribute("login.userlogin", userlogin); + portalUser = new PortalUser(user); + } } } return portalUser; |