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-01-11 14:05:05
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/core/db In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21256/org/cobricks/core/db Modified Files: DBAccessImpl.java Log Message: Index: DBAccessImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/db/DBAccessImpl.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- DBAccessImpl.java 16 Dec 2006 15:29:10 -0000 1.34 +++ DBAccessImpl.java 11 Jan 2007 14:04:58 -0000 1.35 @@ -315,7 +315,7 @@ { logger.debug("sqlInsert("+tablename+","+attrnames.toString() +","+attrs.toString()+")"); - int result = -1; + int result = 0; // TBD: do it all in one transaction ... DBTableDescriptor td = (DBTableDescriptor) |
|
From: Michael K. <ko...@us...> - 2007-01-11 14:05:03
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21256/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.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- ItemManagerImpl.java 19 Dec 2006 14:12:48 -0000 1.84 +++ ItemManagerImpl.java 11 Jan 2007 14:04:58 -0000 1.85 @@ -3012,16 +3012,15 @@ } Integer newVersionId = new Integer(versionid.intValue()+1); Map attrs = new java.util.HashMap(); - attrs.put("itemid", "" + itemid); + attrs.put("itemid", new Integer(itemid)); attrs.put("creatoruserid", new Integer(creator.getUserId())); attrs.put("creationtime", date); attrs.put("lang", lang); attrs.put("content", content); attrs.put("versionid", newVersionId); - int aid = this.dbAccess.sqlInsert("item_content", attrs); - - if (aid > 0) { + int aid = this.dbAccess.sqlInsert("item_content", attrs); + if (aid >= 0) { logger.info("New content version created"); return versionid.intValue(); } else { |
|
From: Michael K. <ko...@us...> - 2007-01-11 14:05:03
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21256/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.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- PortalManagerImpl.java 18 Dec 2006 16:39:04 -0000 1.95 +++ PortalManagerImpl.java 11 Jan 2007 14:04:59 -0000 1.96 @@ -1439,7 +1439,6 @@ getDirNames(f, "/", dirnames); // and now check if the portalfolder categories already exist - Map paths = new HashMap(); i = dirnames.iterator(); while (i.hasNext()) { String path = (String)i.next(); @@ -1451,18 +1450,19 @@ // create category object attrs = new HashMap(); attrs.put("categoryclass", "portalfolder"); + attrs.put("title_de", path); attrs.put("title_en", path); attrs.put("path", path); - int pos = path.lastIndexOf("/", path.length()-2); - String parentPath = path.substring(0, pos+1); - Integer parentid = (Integer)paths.get(parentPath); - if (parentid != null) - attrs.put("parent", parentid); + int pos = path.substring(0,path.length()-1).lastIndexOf("/"); + if (pos > -1) { + String parentPath = path.substring(0, pos+1); + PortalFolder cp = getPortalFolder(parentPath); + if (cp != null) { + attrs.put("parent", new Integer(cp.getId())); + } + } c = (PortalFolder)categoryManager.createCategory(attrs); addPortalFolderToCache(c); - paths.put(path, new Integer(c.getId())); - } else { - paths.put(path, new Integer(c.getId())); } } } |
|
From: Michael K. <ko...@us...> - 2007-01-10 06:54:41
|
Update of /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7543/de/tum/cobricks/univis Modified Files: UnivIS.java UnivISSyncParameters.java UnivISSyncTask.java Log Message: Index: UnivISSyncParameters.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis/UnivISSyncParameters.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- UnivISSyncParameters.java 22 Dec 2006 11:07:19 -0000 1.12 +++ UnivISSyncParameters.java 10 Jan 2007 06:54:34 -0000 1.13 @@ -241,14 +241,14 @@ public void log(String msg) { - if(msg.equalsIgnoreCase(name)){ - logMsgs.append("-"+msg); + if (msg.equalsIgnoreCase(name)){ + logMsgs.append("- "+msg); logMsgs.append("\n"); - }else{ + } else { Calendar cal = new GregorianCalendar(TimeZone.getDefault()); - SimpleDateFormat formater = new SimpleDateFormat(); + SimpleDateFormat formater = + new SimpleDateFormat("dd.MM.yyyy HH:mm"); String date = (formater.format(cal.getTime())).toString(); - logMsgs.append(date); logMsgs.append(": "); logMsgs.append(msg); Index: UnivIS.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis/UnivIS.java,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- UnivIS.java 22 Dec 2006 11:07:19 -0000 1.59 +++ UnivIS.java 10 Jan 2007 06:54:34 -0000 1.60 @@ -14,6 +14,8 @@ import org.cobricks.core.CobricksException; import org.cobricks.core.CoreManager; import org.cobricks.core.ComponentDirectory; +import org.cobricks.core.util.HTMLUtil; +import org.cobricks.core.util.LogUtil; import org.cobricks.course.Course; import org.cobricks.course.CourseLecturer; import org.cobricks.course.CourseRoom; @@ -21,6 +23,7 @@ import org.cobricks.course.CourseProgram; import org.cobricks.course.CourseDate; import org.cobricks.course.CourseManager; +import org.cobricks.course.CoursePresenter; import org.apache.log4j.Logger; import java.util.Properties; import java.util.List; @@ -71,6 +74,7 @@ private String componentId; static Logger logger = Logger.getLogger(UnivIS.class); public CourseManager courseManager; + public CoursePresenter coursePresenter; public UserManager userManager; private HttpClient httpClient; private HostConfiguration hc; @@ -86,6 +90,13 @@ properties = coreManager.getProperties(); ComponentDirectory cd = coreManager.getComponentDirectory(); courseManager = (CourseManager)cd.getManager("courseManager"); + + coursePresenter = new CoursePresenter(); + try { + coursePresenter.init("", coreManager.getProperties(), + coreManager); + } catch (Exception e) { } + String univISUser= properties.getProperty("univis.user"); String univISPWD= properties.getProperty("univis.pw"); String hostName= properties.getProperty("univis.host"); @@ -98,7 +109,7 @@ new UsernamePasswordCredentials(univISUser, univISPWD); httpClient.getState().setCredentials(new AuthScope(hostName, 80), defaultcreds); - //get the Host Configuration and set the proxy + // get the Host Configuration and set the proxy String proxyHost= properties.getProperty("http.proxy.host"); String proxyPort= properties.getProperty("http.proxy.port"); if (proxyHost != null && proxyHost.length()>0) { @@ -180,7 +191,7 @@ // course have been deleted from UnivIS, // so delete it from Cobricks - logger.info("Deleting lecture from Cobricks ..."); + logger.info("Deleting course from Cobricks ..."); int cid = c1.getId(); CourseModule cm = c1.getCourseModule(); int cmid = cm.getId(); @@ -205,7 +216,7 @@ } String univISId = updateUnivIS(c1, univISSync); wasUnivISUpdated = true; - //update the cextid and cextlastrep in course + // update the cextid and cextlastrep in course Map attrs = new HashMap(); attrs.put("cextid", univISId); attrs.put("cextlastrep", new Date()); @@ -218,7 +229,7 @@ if (univISSync.shouldLog("change")) { univISSync.log("Inserting course \"" +c1.getFullName(true)+"" - + "\" into univIS..."); + + "\" into UnivIS..."); } String univISId = insertLectureIntoUnivIS(c1, univISSync); @@ -334,49 +345,52 @@ String llastname = univISSync.getLecturerLastName(); String lfirstname = univISSync.getLecturerFirstName(); String cplabel = univISSync.getProgram(); - // TBD: organisation number is not used + // TBD: organisation number is not used List list = courseManager. - getCourses(cterm, llastname, lfirstname, cplabel); - if (list.size() == 0){ - univISSync.log("There are no new courses in Cobricks ..."); + getCourses(cterm, llastname, lfirstname, cplabel); + 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(); - while (it.hasNext()){ - Course course =(Course)it.next(); + while (it.hasNext()) { + Course course = (Course)it.next(); Date clastrep = course.getLastReplication(); String cextid = course.getExtId(); Date clastupdate = course.getLastUpdate(); - - if (cextid == null || clastrep == null) { + + if (cextid == null || cextid.length()<1 || clastrep == null) { // course is new in cobricks, so insert it in UnivIS - logger.info("Inserting lecture into UnivIS"); - if(univISSync.shouldLog("change")){ - univISSync.log("Inserting lecture \"" - +course.getFullName(true)+"\"" + - " into UnivIS"); + logger.info("Inserting course \""+course.getFullName(true) + +"\" into UnivIS"); + if (univISSync.shouldLog("change")) { + univISSync.log("Inserting course \"" + +course.getFullName(true)+"\"" + +" into UnivIS"); } String univISId = insertLectureIntoUnivIS(course, univISSync); - /* xxxx // 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)) { - logger.info("Updating UnivIS ..."); + + logger.info("Updating course \""+course.getFullName(true) + +"\" in UnivIS"); + // update univIS - if(univISSync.shouldLog("change")){ - univISSync.log("Updating UnivIS for course\"" + - " "+course.getFullName(true)+"\"..."); + if (univISSync.shouldLog("change")){ + univISSync.log("Updating course \"" + +course.getFullName(true)+"\"" + +" in UnivIS"); } String univISId = updateUnivIS(course, univISSync); // update the cextid and cextlastrep in course @@ -384,7 +398,14 @@ attrs.put("cextid", univISId); attrs.put("cextlastrep", new Date()); courseManager.updateCourseAttrs(course.getId(), attrs); + + } else { + + logger.debug("Course \""+course.getFullName(true) + +"\" not changed in Cobricks"); + } + } /* @@ -613,7 +634,7 @@ public int insertLectureIntoCobricks(UnivISLecture ul, String term, UnivISSyncParameters univISSync) { - logger.info("inserting lecture into Cobricks ..."); + logger.info("inserting course into Cobricks ..."); int cid = 0; int cmid = 0; int cparentid = 0; @@ -736,9 +757,10 @@ cid = course.getId(); } } catch (Exception e) { - logger.error(LogUtil.ex("Failed inserting lecture into cobricks.",e)); + logger.error(LogUtil.ex("Failed inserting course " + +"into Cobricks.",e)); if(univISSync.shouldLog("error")){ - univISSync.log("Failed inserting lecture into cobricks, " + univISSync.log("Failed inserting course into Cobricks, " + ""+e.toString()); } } @@ -785,9 +807,10 @@ } }catch(Exception e){ - logger.error(LogUtil.ex("Failed inserting lecturer into cobricks.",e)); + logger.error(LogUtil.ex("Failed inserting lecturer " + +"into Cobricks.",e)); if(univISSync.shouldLog("error")){ - univISSync.log("Failed inserting lecturer into cobricks: " + univISSync.log("Failed inserting lecturer into Cobricks: " + e.toString()); } } @@ -1502,6 +1525,8 @@ } } } + if (lv == null || lv.length()<1) + return ""; return "Lecture/"+lv; } @@ -1661,30 +1686,36 @@ post.addParameter("schein", ""); post.addParameter("benschein", ""); - if (course.getComment() != null){ + if (course.getComment() != null) { post.addParameter("comment", course.getComment()); } else { post.addParameter("comment", ""); } - if (course.getPrerequ() != null){ - post.addParameter("organ", course.getPrerequ()); + if (cm.getPrerequ() != null) { + String tmps2 = coursePresenter.printPrerequ(cm, "de", false); + post.addParameter("organ", tmps2); } else { post.addParameter("organ", ""); } - if(course.getPrerequ("en") != null){ - post.addParameter("ects_organ", course.getPrerequ("en")); - }else{ + if (cm.getPrerequ("en") != null) { + String tmps2 = coursePresenter.printPrerequ(cm, "en", false); + post.addParameter("ects_organ", tmps2); + } else { post.addParameter("ects_organ", ""); } - if (course.getContent() != null){ - post.addParameter("summary", course.getContent()); + if (cm.getContent() != null) { + String tmps2 = cm.getContent(); + tmps2 = HTMLUtil.formatHTMLString(tmps2, 78); + post.addParameter("summary", tmps2); } else { post.addParameter("summary", ""); } - if (course.getContent("en") != null) { - post.addParameter("ects_summary", course.getContent("en")); - } else{ + if (cm.getContent("en") != null) { + String tmps2 = cm.getContent("en"); + tmps2 = HTMLUtil.formatHTMLString(tmps2, 78); + post.addParameter("ects_summary", tmps2); + } else { post.addParameter("ects_summary", ""); } @@ -1797,7 +1828,7 @@ if (cdate.getRoom() != null){ roomId = (cdate.getRoom()).getExtId(); } - if(dtype != null && dtype.equalsIgnoreCase("s")){ + if (dtype != null && dtype.equalsIgnoreCase("s")){ repeat = "s1"; Date sdate = cdate.getStartDate(); if(sdate != null){ @@ -1809,27 +1840,35 @@ } Integer shour = (new Integer(cdate.getStartHour())); Integer smin = (new Integer(cdate.getStartMin())); - if(shour.intValue() == 0){ - starttime = "00:00"; - }else{ - String starthour = shour.toString(); - String startmin = smin.toString(); + if (shour.intValue() == 0){ + starttime = ""; + } else { + String starthour = (shour.toString()).trim(); + if (starthour.length()<2) + starthour = "0" + starthour; + String startmin = (smin.toString()).trim(); + if (startmin.length()<2) + startmin = "0" + startmin; starttime = starthour+":"+startmin; } Integer ehour = (new Integer(cdate.getEndHour())); Integer emin = (new Integer(cdate.getEndMin())); - if (ehour.intValue() == 0 ){ - endtime = "00:00"; + if (ehour.intValue() == 0) { + endtime = ""; } else { - String endhour = ehour.toString(); - String endmin = emin.toString(); + String endhour = (ehour.toString()).trim(); + if (endhour.length()<2) + endhour = "0" + endhour; + String endmin = (emin.toString()).trim(); + if (endmin.length()<2) + endmin = "0" + endmin; endtime = endhour+":"+endmin; } roomId = (cdate.getRoom()).getExtId(); if (roomId.startsWith("Room/")){ roomId = roomId.substring(5); } - if(repeat != null){ + if (repeat != null){ post.addParameter("term"+counter3+"::repeat", repeat); } @@ -1839,10 +1878,15 @@ endtime); post.addParameter("term"+counter3+"::room", roomId); + /* post.addParameter("term"+counter3+"::startdate", startdate); post.addParameter("term"+counter3+"::enddate", enddate); + + das neue UnivIS hat startdate, enddate global + fuer die Veranstaltung + */ } else if(dtype != null && dtype.equalsIgnoreCase("d")) { // bei univIS typ ist "b" und "0" bei cobricks String dweekday = @@ -1860,19 +1904,27 @@ Integer shour = (new Integer(cdate.getStartHour())); Integer smin = (new Integer(cdate.getStartMin())); if (shour.intValue() == 0){ - starttime = "00:00"; + starttime = ""; } else { String starthour = shour.toString(); + if (starthour.length()<2) + starthour = "0" + starthour; String startmin = smin.toString(); + if (startmin.length()<2) + startmin = "0" + startmin; starttime = starthour+":"+startmin; } Integer ehour = (new Integer(cdate.getEndHour())); Integer emin = (new Integer(cdate.getEndMin())); if (ehour.intValue() == 0 ){ - endtime = "00:00"; + endtime = ""; } else { String endhour = ehour.toString(); + if (endhour.length()<2) + endhour = "0" + endhour; String endmin = emin.toString(); + if (endmin.length()<2) + endmin = "0" + endmin; endtime = endhour+":"+endmin; } roomId = (cdate.getRoom()).getExtId(); @@ -1886,12 +1938,14 @@ post.addParameter("term"+counter3+"::endtime", endtime); post.addParameter("term"+counter3+"::room", roomId); + /* post.addParameter("term"+counter3+"::startdate", startdate); post.addParameter("term"+counter3+"::enddate", enddate); + */ } - if(dcycle == 0){ + if (dcycle == 0) { String dweekday = (new Integer(cdate.getWeekday())).toString(); if (dweekday.equals("1")){ @@ -1915,20 +1969,28 @@ } Integer shour = (new Integer(cdate.getStartHour())); Integer smin = (new Integer(cdate.getStartMin())); - if(shour.intValue() == 0){ - starttime = "00:00"; - }else{ + if (shour.intValue() == 0){ + starttime = ""; + } else { String starthour = shour.toString(); + if (starthour.length()<2) + starthour = "0" + starthour; String startmin = smin.toString(); + if (startmin.length()<2) + startmin = "0" + startmin; starttime = starthour+":"+startmin; } Integer ehour = (new Integer(cdate.getEndHour())); Integer emin = (new Integer(cdate.getEndMin())); if (ehour.intValue() == 0 ){ - endtime = "00:00"; + endtime = ""; } else { String endhour = ehour.toString(); + if (endhour.length()<2) + endhour = "0" + endhour; String endmin = emin.toString(); + if (endmin.length()<2) + endmin = "0" + endmin; endtime = endhour+":"+endmin; } @@ -1948,7 +2010,7 @@ post.addParameter("term"+counter3+"::enddate", enddate); - }else if(dcycle == 1 || dcycle == 2){ + } else if (dcycle == 1 || dcycle == 2) { // bei univIS dtype w = 1 bei cobricks String dweekday = (new Integer(cdate.getWeekday())).toString(); @@ -1964,20 +2026,28 @@ Integer shour = (new Integer(cdate.getStartHour())); Integer smin = (new Integer(cdate.getStartMin())); - if(shour.intValue() == 0){ - starttime = "00:00"; - }else{ + if (shour.intValue() == 0){ + starttime = ""; + } else { String starthour = shour.toString(); + if (starthour.length()<2) + starthour = "0" + starthour; String startmin = smin.toString(); + if (startmin.length()<2) + startmin = "0" + startmin; starttime = starthour+":"+startmin; } Integer ehour = (new Integer(cdate.getEndHour())); Integer emin = (new Integer(cdate.getEndMin())); if(ehour.intValue() == 0 ){ - endtime = "00:00"; - }else{ + endtime = ""; + } else { String endhour = ehour.toString(); + if (endhour.length()<2) + endhour = "0" + endhour; String endmin = emin.toString(); + if (endmin.length()<2) + endmin = "0" + endmin; endtime = endhour+":"+endmin; } //String roomId = (cdate.getRoom()).getExtId(); Index: UnivISSyncTask.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis/UnivISSyncTask.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- UnivISSyncTask.java 22 Dec 2006 11:07:19 -0000 1.29 +++ UnivISSyncTask.java 10 Jan 2007 06:54:34 -0000 1.30 @@ -62,7 +62,7 @@ { try { Iterator li= syncs.keySet().iterator(); - while(li.hasNext()) { + while (li.hasNext()) { String key = (String)li.next(); UnivISSyncParameters univISSync = (UnivISSyncParameters)syncs.get(key); @@ -86,12 +86,12 @@ MailUtil.sendMail(smtphost, logsink, defaultfrom, "Syncronizing" + - " univIS with cobricks " + + " UnivIS with Cobricks " + ""+univISSync.getTerm(), univISSync.getLogMsgs()); } catch (IOException e) { logger.error(LogUtil. - ex("Error while sending mail.",e)); + ex("Error while sending email.",e)); } } else { try{ |
|
From: Michael K. <ko...@us...> - 2007-01-10 06:54:41
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/core/util In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7543/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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- HTMLUtil.java 18 Oct 2006 16:47:49 -0000 1.2 +++ HTMLUtil.java 10 Jan 2007 06:54:35 -0000 1.3 @@ -145,7 +145,7 @@ } // add characters behind last break to result string - if (html.length()>pold) { + if (html.length() > pold) { appendString(task, html.substring(pold), ""); } newline(task); |
|
From: Michael K. <ko...@us...> - 2007-01-10 06:54:39
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7543/org/cobricks/course Modified Files: Course.java CoursePresenter.java Log Message: Index: Course.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/Course.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Course.java 22 Dec 2006 11:07:20 -0000 1.26 +++ Course.java 10 Jan 2007 06:54:35 -0000 1.27 @@ -230,7 +230,7 @@ */ public int getHoursLecture() { - Integer i = (Integer)attrs.get("cmhours_lec"); + Integer i = (Integer)attrs.get("chours_lec"); if (i == null) return 0; return i.intValue(); } @@ -240,7 +240,7 @@ */ public int getHoursExercises() { - Integer i = (Integer)attrs.get("cmhours_ex"); + Integer i = (Integer)attrs.get("chours_ex"); if (i == null) return 0; return i.intValue(); } @@ -250,7 +250,7 @@ */ public int getHoursSeminar() { - Integer i = (Integer)attrs.get("cmhours_sem"); + Integer i = (Integer)attrs.get("chours_sem"); if (i == null) return 0; return i.intValue(); } @@ -260,7 +260,7 @@ */ public int getHoursLab() { - Integer i = (Integer)attrs.get("cmhours_lab"); + Integer i = (Integer)attrs.get("chours_lab"); if (i == null) return 0; return i.intValue(); } Index: CoursePresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CoursePresenter.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- CoursePresenter.java 18 Dec 2006 16:39:04 -0000 1.31 +++ CoursePresenter.java 10 Jan 2007 06:54:35 -0000 1.32 @@ -209,7 +209,12 @@ Map attrs = new HashMap(); attrs.put("cmname", cmname); attrs.put("cmhidden", "0"); - result = courseManager.searchCourseModules(attrs,"cmname"); + result = courseManager.searchCourseModules(attrs, "cmname"); + attrs = new HashMap(); + attrs.put("cmsid", cmname); + attrs.put("cmhidden", "0"); + result.addAll(courseManager. + searchCourseModules(attrs, "cmname")); } catch (Exception e) { logger.error(LogUtil.ex("Failed getting course modules.", e)); } @@ -592,10 +597,15 @@ public String printPrerequ(CourseModule cm, String lang) { + return printPrerequ(cm, lang, true); + } + + public String printPrerequ(CourseModule cm, String lang, boolean inhtml) + { if (cm == null) return ""; String tmps = cm.getPrerequ(); try { - return printPrerequ(tmps, lang); + return printPrerequ(tmps, lang, inhtml); } catch (Exception e) { logger.error(LogUtil.ex("failed", e)); } @@ -604,15 +614,21 @@ public String printPrerequ(Course c, String lang) { + return printPrerequ(c, lang, true); + } + + 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); + return printPrerequ(tmps, lang, inhtml); } - public String printPrerequ(String tmps, String lang) + public String printPrerequ(String tmps, String lang, boolean inhtml) { // is it XML? + if (tmps==null) return ""; tmps = tmps.trim(); if (!tmps.startsWith("<")) { return tmps; @@ -636,21 +652,40 @@ if (node instanceof Element) { tagName = ((Element)node).getTagName(); if (tagName.equals("Vorkenntnis")) { - if (sb.length()>0) - sb.append("<br>\n"); - String art = ((Element)node).getAttribute("art"); + if (sb.length()>0) { + if (inhtml) + sb.append("<br>\n"); + else + sb.append("; "); + } + String art = ((Element)node). + getAttribute("art"); if (art.equals("Modul")) { - String idref = ((Element)node).getAttribute("idref"); - String tmps2 = ((Element)node).getAttribute("kommentar"); + String idref = ((Element)node). + getAttribute("idref"); + String tmps2 = ((Element)node). + getAttribute("kommentar"); if (lang!=null && lang.equals("en")) - tmps2 = ((Element)node).getAttribute("comment"); - sb.append("<a href=\"cm.html?id=").append(idref).append("\">").append("Modul ").append(idref).append("</a>"); + tmps2 = ((Element)node). + getAttribute("comment"); + if (inhtml) { + sb.append("<a href=\"cm.html?" + +"id=").append(idref). + append("\">").append("Modul "). + append(idref).append("</a>"); + } else { + sb.append("Modul "). + append(idref); + } if (tmps2!=null && tmps2.length()>0) - sb.append(" (").append(tmps2).append(")"); + sb.append(" (").append(tmps2). + append(")"); } else { - String tmps2 = ((Element)node).getAttribute("kommentar"); + String tmps2 = ((Element)node). + getAttribute("kommentar"); if (lang!=null && lang.equals("en")) { - tmps2 = ((Element)node).getAttribute("comment"); + tmps2 = ((Element)node). + getAttribute("comment"); } if (tmps2!=null && tmps2.length()>0) sb.append(tmps2); @@ -661,8 +696,9 @@ } } } - } catch (Exception e) { + } catch (Throwable e) { logger.error(LogUtil.ex("Failed parsing prerequ", e)); + return tmps; } return sb.toString(); } |
|
From: Michael K. <ko...@us...> - 2007-01-10 06:54:39
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7543/org/cobricks/portal Modified Files: CalendarPresenter.java Log Message: Index: CalendarPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/CalendarPresenter.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- CalendarPresenter.java 14 Dec 2006 22:06:48 -0000 1.8 +++ CalendarPresenter.java 10 Jan 2007 06:54:35 -0000 1.9 @@ -717,17 +717,17 @@ String sem = "NONE"; // months are represented by 0 to 11 - if( month>7 ) { - sem = currentYear+"w"; + if (month>7) { + sem = Integer.toString(currentYear)+"w"; gcal.add(Calendar.MONTH, 9-month); } - else if( month>7 | month<2) { - sem = currentYear+"w"; + else if (month<3) { + sem = Integer.toString(currentYear-1)+"w"; gcal.add(Calendar.MONTH, 9-month); gcal.add(Calendar.YEAR, -1); } - else if( month>2 && month<7 ) { - sem = currentYear+"s"; + else { + sem = Integer.toString(currentYear)+"s"; gcal.add(Calendar.MONTH, 3-month); } return sem; |
|
From: Wolfgang W. <wo...@us...> - 2007-01-02 13:57:18
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11018/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.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- generateHTMLOverviews.java 22 Dec 2006 12:09:13 -0000 1.3 +++ generateHTMLOverviews.java 2 Jan 2007 13:57:14 -0000 1.4 @@ -139,7 +139,13 @@ */ public void doIt() { - String filename = "vv" + querysem + Integer.toString(queryjahr); + String filename = "vv" + querysem; + String year = Integer.toString(queryjahr); + if (querysem.equals("SS") && year.length() > 2) + filename += year.substring(2,4); // Example SS 2007 -> file name with 07 only + else + filename += year; + try { makeInformatik(new File(filename+"-info.html")); makeWirtschaftsinformatik(new File(filename+"-wi.html")); @@ -178,6 +184,7 @@ public static void printFooter(PrintWriter out) { + /* String outs = "\n<P><HR><P>"+ "Diese Seite wird aus Effizienzgründen nicht on-the-fly "+ @@ -187,7 +194,7 @@ "zu sehen.<P>\n"+ "<p><a href=\"/studium/vvindex.html\">"+ "Veranstaltungsübersichten</a></p>"; - out.println(outs); + out.println(outs); */ } @@ -199,16 +206,6 @@ PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new java.io.FileOutputStream(file),"UTF8"))); -/* - out.println("<html><head><style type=\"text/css\">\n"+ - "#VL table { width:100%; border: 0px; border-spacing:0px; }\n"+ - "#VL td { border:0px solid #000; overflow:hidden; }\n"+ - "#VL td i { color: #0000FF; font style: normal;}\n"+ - "#VL th { border: 0px; background: #EAEAEA; }\n"+ - "#VL a {color: #0000FF; }\n"+ - "</style></head><body>"); */ - // New - out.println("$portalPresenter.parse(\"/pageheader.html\", $portalRequest)\n"); out.println("<H2>Studiengang Informatik (Diplom/Bachelor/Master)</h2><P>\n"); @@ -298,22 +295,22 @@ "aufnehmen\">"); */ - out.println("<p><hr><a name=\"infdiplom\">" + out.println("<p><hr><a name=\"infdipl\">" +"<p><h2>Informatik Diplom</h2>"); - out.println("<P><a name=\"infdiplom-vorl\"></a><h3>Vorlesungen</h3>"); + out.println("<P><a name=\"infdipl-vorl\"></a><h3>Vorlesungen</h3>"); tmpi = getData(out, "INF", "Vorlesung", ""); if (tmpi < 1) { out.println(ke); } - out.println("<P><a name=\"infdiplom-sem\"></a><h3>Seminare</h3>"); + out.println("<P><a name=\"infdipl-sem\"></a><h3>Seminare</h3>"); tmpi = getData(out, "INF", "Seminar", ""); if (tmpi < 1) { out.println(ke); } - out.println("<P><a name=\"infdiplom-prakt\"></a><h3>Praktika</h3>"); + out.println("<P><a name=\"infdipl-prakt\"></a><h3>Praktika</h3>"); tmpi = getData(out, "INF", "Praktikum", ""); if (tmpi < 1) { out.println(ke); @@ -344,13 +341,13 @@ PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new java.io.FileOutputStream(file),"UTF8"))); - out.println("<html><head><style type=\"text/css\">\n"+ + /* out.println("<html><head><style type=\"text/css\">\n"+ "#VL table { width:100%; border: 0px; border-spacing:0px; }\n"+ "#VL td { border:0px solid #000; overflow:hidden; }\n"+ "#VL td i { color: #0000FF; font style: normal;}\n"+ "#VL th { border: 0px; background: #EAEAEA; }\n"+ "#VL a {color: #0000FF; }\n"+ - "</style></head><body>"); // New + "</style></head><body>"); */ out.println("$portalPresenter.parse(\"/pageheader.html\", $portalRequest)\n"); @@ -387,7 +384,7 @@ out.println("<P><a name=\"bswi-vorl\"></a><h4>Vorlesungen</h4>"); tmpi = getData(out, "BS-WIRTINF", "Vorlesung", ""); - tmpi += getData(out, "BS-WIRTINF", "Ãbung", ""); + tmpi += getData(out, "BS-WIRTINF", "Übung", ""); if (tmpi < 1) { out.println(ke); } @@ -484,9 +481,14 @@ int fullcount = 0; Iterator i = clist.iterator(); + boolean flag_notempty = false; + if (i.hasNext()) - 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</th><th>Zeiten</th><th>Raum</th></tr><tr>"); // New - + { + 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 + } + Date today = new Date(); long todayTime = today.getTime(); @@ -575,7 +577,7 @@ out.print("</TD>"); - out.print("<td</td>"); // TODO + out.print("<td</td>"); // SWS int counter2=0; @@ -732,10 +734,13 @@ */ - out.print("</tr>"); // New + out.print("</tr>\n"); } - out.println("</table></div>"); // New + + if (flag_notempty) + out.println("</table></div>"); + return fullcount; } |
|
From: Wolfgang W. <wo...@us...> - 2007-01-02 08:31:02
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/user In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13636 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.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- LdapUserHandlerMyTUM.java 8 Dec 2006 10:22:37 -0000 1.5 +++ LdapUserHandlerMyTUM.java 2 Jan 2007 08:30:52 -0000 1.6 @@ -21,6 +21,9 @@ import org.cobricks.core.CoreManager; import org.cobricks.core.util.LogUtil; import org.cobricks.user.*; +import org.cobricks.user.User; +import org.cobricks.user.UserManager; + /** |
|
From: Wolfgang W. <wo...@us...> - 2006-12-22 12:09:20
|
Update of /cvsroot/cobricks/drehscheibe-in/src/de/tum/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6298/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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- generateHTMLOverviews.java 15 Dec 2006 12:06:22 -0000 1.2 +++ generateHTMLOverviews.java 22 Dec 2006 12:09:13 -0000 1.3 @@ -65,8 +65,8 @@ public static void main(String args[]) { String confdir = "WEB-INF/conf"; - querysem = "WS"; - queryjahr = 2006; + querysem = "SS"; + queryjahr = 2007; if (args.length > 0) confdir = args[0]; if (args.length > 1) @@ -199,14 +199,15 @@ PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new java.io.FileOutputStream(file),"UTF8"))); - +/* out.println("<html><head><style type=\"text/css\">\n"+ "#VL table { width:100%; border: 0px; border-spacing:0px; }\n"+ "#VL td { border:0px solid #000; overflow:hidden; }\n"+ "#VL td i { color: #0000FF; font style: normal;}\n"+ "#VL th { border: 0px; background: #EAEAEA; }\n"+ "#VL a {color: #0000FF; }\n"+ - "</style></head><body>"); // New + "</style></head><body>"); */ + // New out.println("$portalPresenter.parse(\"/pageheader.html\", $portalRequest)\n"); @@ -330,7 +331,7 @@ out.println("\n$portalPresenter.parse(\"/pagefooter.html\", $portalRequest)"); - out.println("</body></html>"); +/* out.println("</body></html>"); */ out.flush(); out.close(); @@ -503,7 +504,7 @@ // Modul String modulname = c.getCourseModule().getSId(); - int modulnr = c.getCourseModule().getId(); + int modulnr = c.getId(); out.print("<td><a href=\"/myintum/kurs_verwaltung/cm.html?id="); out.print(modulname+"\">"+modulname+"</a></td>"); |
|
From: Michael K. <ko...@us...> - 2006-12-22 11:07:24
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15350/org/cobricks/course Modified Files: Course.java CourseManager.java CourseManagerImpl.java Log Message: Index: CourseManager.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseManager.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- CourseManager.java 14 Dec 2006 22:06:46 -0000 1.36 +++ CourseManager.java 22 Dec 2006 11:07:20 -0000 1.37 @@ -543,6 +543,12 @@ public List getLecturersForCourse(int cid); /** + * @param cid + * @return + */ + public String getGroupForCourse(int cid); + + /** * @param lid * @return * @throws CobricksException Index: Course.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/Course.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Course.java 18 Dec 2006 16:39:04 -0000 1.25 +++ Course.java 22 Dec 2006 11:07:20 -0000 1.26 @@ -93,7 +93,9 @@ */ public String getName() { - return (String)attrs.get("cname"); + String tmps = (String)attrs.get("cname"); + if (tmps == null) tmps = ""; + return tmps; } /** Returns the name of the course @@ -114,13 +116,29 @@ */ public String getFullName() { + return getFullName(false); + } + + public String getFullName(boolean addmodulesid) + { String tmps = (String)attrs.get("cname"); if (tmps!=null && tmps.length()<1) tmps = null; if (courseModule != null) { - if (tmps==null) - return courseModule.getName(); - else - return courseModule.getName()+" - "+tmps; + if (tmps==null) { + if (addmodulesid) { + return courseModule.getName() + " (" + + courseModule.getSId() + ")"; + } else { + return courseModule.getName(); + } + } else { + if (addmodulesid) { + return courseModule.getName()+" - "+tmps+" (" + + courseModule.getSId() + ")"; + } else { + return courseModule.getName()+" - "+tmps; + } + } } return tmps; } @@ -131,13 +149,29 @@ */ public String getFullName(String lang) { + return getFullName(lang, false); + } + + public String getFullName(String lang, boolean addmodulesid) + { String tmps = getName(lang); if (tmps!=null && tmps.length()<1) tmps = null; if (courseModule != null) { - if (tmps==null) - return courseModule.getName(lang); - else - return courseModule.getName(lang)+" - "+tmps; + if (tmps==null) { + if (addmodulesid) { + return courseModule.getName(lang) + " (" + + courseModule.getSId() + ")"; + } else { + return courseModule.getName(lang); + } + } else { + if (addmodulesid) { + return courseModule.getName(lang) + " - " + tmps + " (" + + courseModule.getSId() + ")"; + } else { + return courseModule.getName(lang)+" - "+tmps; + } + } } return tmps; } Index: CourseManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseManagerImpl.java,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- CourseManagerImpl.java 18 Dec 2006 16:39:04 -0000 1.66 +++ CourseManagerImpl.java 22 Dec 2006 11:07:20 -0000 1.67 @@ -2069,7 +2069,37 @@ } return result; } - + + + /** + * @see org.cobricks.course.CourseManager#getGroupForCourse(int) + */ + public String getGroupForCourse(int cid) + { + String sql = "select course_lecturer.lid, course_lecturer.lgroup " + +"from course_lecturer, course_lecturerrel " + +"where cid = "+cid+" and " + +"course_lecturer.lid = course_lecturerrel.lid " + +"order by course_lecturer.ltyp desc, llastname"; + List sqlresult = dbAccess.sqlQuery(sql); + List result = new ArrayList(); + Iterator i = sqlresult.listIterator(); + String lgroup = null; + while (i.hasNext()) { + Map m = (Map)i.next(); + String tmps = (String)m.get("lgroup"); + if (tmps != null) { + lgroup = tmps; + break; + } + } + return lgroup; + } + + + /** + * + */ public CourseProgram getProgramForLabel(String cplabel) { Map dbres = dbAccess.sqlQuerySingleRow("select * from course_prog " + |
|
From: Michael K. <ko...@us...> - 2006-12-22 11:07:24
|
Update of /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15350/de/tum/cobricks/univis Modified Files: UnivIS.java UnivISLecture.java UnivISSyncParameters.java UnivISSyncTask.java Log Message: Index: UnivISSyncParameters.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis/UnivISSyncParameters.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- UnivISSyncParameters.java 14 Dec 2004 01:47:36 -0000 1.11 +++ UnivISSyncParameters.java 22 Dec 2006 11:07:19 -0000 1.12 @@ -24,7 +24,9 @@ * @version $Date$ */ -public class UnivISSyncParameters { +public class UnivISSyncParameters +{ + /** the name of the synchronisation*/ private String name; /** English name for semester*/ @@ -41,7 +43,7 @@ /** the Synchronisation mode*/ private String mode; /** which aktion musst be logged*/ - private String log; + private String log = "error"; /** where musst be logged*/ private String logSink; @@ -84,6 +86,7 @@ public String getProgram() { + if (program == null) return ""; return program; } @@ -100,6 +103,7 @@ */ public boolean shouldLog(String tmps) { + if (tmps == null) return false; if (log.equals("compare")) return true; if (log.equals("change")) { if (tmps.equals("compare")) return false; @@ -133,10 +137,13 @@ public String getLecturer() { + if (lecturer == null) return ""; return lecturer; } + public String getOrgNr() { + if (orgNr == null) return ""; return orgNr; } @@ -151,7 +158,7 @@ } /** * Dieses Parameter wird im sync-mode gebraucht, um zwichen - * das Einfügen in Cobricks und Löschen in UnivIS unterscheinden zu Können + * das Einfügen in Cobricks und Löschen in UnivIS unterscheinden zu Können */ public boolean getDeleteContion() { Index: UnivIS.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis/UnivIS.java,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- UnivIS.java 18 Dec 2006 16:39:03 -0000 1.58 +++ UnivIS.java 22 Dec 2006 11:07:19 -0000 1.59 @@ -81,7 +81,6 @@ public UnivIS(CoreManager coreManager) { - uparser = new UnivISParser(); this.coreManager = coreManager; properties = coreManager.getProperties(); @@ -119,373 +118,401 @@ } } [...1793 lines suppressed...] + } else if (lgroup.equals("infor15")) { + result = "in/infor/lehrst"; + } else if (lgroup.equals("infor16")) { + result = "in/infor/lehrst_1"; + } else if (lgroup.equals("infor17")) { + result = "in/infor/lehrst_2"; + } else if (lgroup.equals("infor18")) { + result = "in/infor/lehrun"; + } else if (lgroup.equals("infor19")) { + result = "in/infor/lehrun_1"; + } else if (lgroup.equals("inlrz")) { + result = "in/infor/inderf"; + } else { + result = "in/infor/zentr"; } - return chair.trim(); + return result; } } Index: UnivISLecture.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis/UnivISLecture.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- UnivISLecture.java 28 Sep 2004 21:03:40 -0000 1.20 +++ UnivISLecture.java 22 Dec 2006 11:07:19 -0000 1.21 @@ -1,5 +1,6 @@ /* - * Copyright (c) 2004 Cobricks Group. All rights reserved. + * Copyright (c) 2004-2006 Cobricks Group. All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software * License, either version 1.0 of the License, or (at your option) any @@ -7,6 +8,7 @@ * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. */ + package de.tum.cobricks.univis; import org.cobricks.core.CoreManager; @@ -25,50 +27,52 @@ * @author <a href="mailto:ma...@in...">Mazan Abdelkader</a> */ -public class UnivISLecture { - /** the univIS id of the Lecture */ +public class UnivISLecture +{ + + /** the univIS id of the Lecture */ private String univISId; - /** the univIS subtitle */ + /** the univIS subtitle */ private String classification; - /** the name of the lecture */ + /** the name of the lecture */ private String name; - /** oganisation name*/ + /** oganisation name*/ private String orgName; - /** shortname of the lecture */ + /** shortname of the lecture */ private String shortName; - /** URL of the lecture */ + /** URL of the lecture */ private String url; - /** comment of the lecture */ + /** comment of the lecture */ private String comment; - /** Semesterwochenstunde */ + /** Semesterwochenstunde */ private String time_description; private String sws; - /** type of the lecture. e.g. Praktikum */ + /** type of the lecture. e.g. Praktikum */ private String type; - /** schein */ + /** schein */ private String certificate; private String participants; - /**benotete schein*/ + /**benotete schein*/ private String markcertificate; private String ects; - /** ects_name */ + /** ects_name */ private String ects_name; - /** ects_name */ + /** ects_name */ private String ects_cred; - /** ects_summary */ + /** ects_summary */ private String ects_summary; private String summary; - /** ects_organizational */ + /** ects_organizational */ private String ects_organizational; - /** organizational */ + /** organizational */ private String organizational; - /** starttime */ + /** starttime */ private String starttime; - /** endtime */ + /** endtime */ private String endtime; - /** startdate */ + /** startdate */ private String startdate; - /** enddate */ + /** enddate */ private String enddate; private String pflicht; private String richt; @@ -76,22 +80,24 @@ private String turnout; private String repeat; private String cparentid; - /** Dozent Ids */ + /** Dozent Ids */ private List dozIds; - /** Termine */ + /** Termine */ private Map terms; - /** studs */ + /** studs */ private Map studs; + private CoreManager coreManager; + static Logger logger = Logger.getLogger(UnivISLecture.class); + static UnivISParser uparser; /** * Intialize the class with the data in a Lecture node * in a univIS-XML response. * @param lecture node in XML response returned by univIS. - */ - + */ public UnivISLecture(Element node) { uparser = new UnivISParser(); @@ -100,6 +106,7 @@ studs = new HashMap(); processLectureNode(node); } + /** * Process a lecture node in a XML response returned by univIS. * @param lecture node in a XML response returned by univIS. @@ -164,6 +171,7 @@ n = n.getNextSibling(); } } + /** * Process a doz node * @param doz node @@ -423,7 +431,7 @@ else if (type.equalsIgnoreCase("HSR")) type= "Hauptseminar"; else if (type.equalsIgnoreCase("PSR")) type= "Proseminar"; else if (type.equalsIgnoreCase("KO")) type= "Kolloquium"; - else if (type.equalsIgnoreCase("UE")) type= "Übung"; + else if (type.equalsIgnoreCase("UE")) type= "Ãbung"; else if (type.equalsIgnoreCase("KU")) type= "Kurs"; else if (type.equalsIgnoreCase("PS")) type= "Projektstudium"; else if (type.equalsIgnoreCase("EX")) type= "Exkursion"; Index: UnivISSyncTask.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis/UnivISSyncTask.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- UnivISSyncTask.java 15 Dec 2006 23:06:32 -0000 1.28 +++ UnivISSyncTask.java 22 Dec 2006 11:07:19 -0000 1.29 @@ -10,7 +10,6 @@ package de.tum.cobricks.univis; - import java.util.Properties; import java.io.File; import java.io.FileInputStream; @@ -57,8 +56,6 @@ syncs = new HashMap(); readConfig(); this.univIS = new UnivIS(coreManager); - - } public void doIt(String[] args) @@ -67,12 +64,15 @@ Iterator li= syncs.keySet().iterator(); while(li.hasNext()) { String key = (String)li.next(); - UnivISSyncParameters univISSync =(UnivISSyncParameters)syncs.get(key); + UnivISSyncParameters univISSync = + (UnivISSyncParameters)syncs.get(key); if (univISSync.shouldLog("sync")) { univISSync.log(univISSync.getName()); univISSync.log("Starting syncronization ..."); } + univIS.doSynchronize(univISSync); + univISSync.log("Ending syncronization ..."); // send log per email or save it to file @@ -86,10 +86,12 @@ MailUtil.sendMail(smtphost, logsink, defaultfrom, "Syncronizing" + - " univIS with cobricks " + ""+univISSync.getTerm(), + " univIS with cobricks " + + ""+univISSync.getTerm(), univISSync.getLogMsgs()); } catch (IOException e) { - logger.error(LogUtil.ex("Error while sending mail.",e)); + logger.error(LogUtil. + ex("Error while sending mail.",e)); } } else { try{ @@ -99,7 +101,8 @@ fw.write(msg); fw.close(); }catch(IOException e){ - logger.error(LogUtil.ex("Failed writing to file.",e)); + logger.error(LogUtil. + ex("Failed writing to file.",e)); } } } @@ -107,9 +110,11 @@ } } catch (Exception e) { e.printStackTrace(); - logger.error(LogUtil.ex("Failed synchronizing course with univIS.",e)); + logger.error(LogUtil. + ex("Failed synchronizing course with univIS.",e)); } } + /** * */ @@ -191,7 +196,8 @@ } catch (Exception e) { logger. - error(LogUtil.ex("Failed reading configuration parameters", e)); + error(LogUtil. + ex("Failed reading configuration parameters", e)); } } |
|
From: Michael K. <ko...@us...> - 2006-12-22 11:07:24
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15350/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.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- ItemServlet.java 15 Dec 2006 23:06:33 -0000 1.48 +++ ItemServlet.java 22 Dec 2006 11:07:20 -0000 1.49 @@ -390,6 +390,9 @@ return "error"; } + changedAttrs.put("updatetime", new Date()); + changedAttrs.put("updater", portalUser.getUser()); + try { item.updateFromMap(changedAttrs); item.setOntologyClassName(reqICName); |
|
From: Michael K. <ko...@us...> - 2006-12-19 14:12:55
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19694/org/cobricks/item Modified Files: Item.java ItemManagerImpl.java Log Message: Index: Item.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/Item.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- Item.java 18 Oct 2006 16:47:50 -0000 1.52 +++ Item.java 19 Dec 2006 14:12:48 -0000 1.53 @@ -52,7 +52,7 @@ */ public class Item extends DataObject - implements java.io.Externalizable + implements java.io.Externalizable, java.lang.Comparable { private static Logger logger = Logger.getLogger(Item.class); @@ -912,4 +912,17 @@ + " itemclass: " + ontologyclassname); } + + /** + * for Interface java.lang.Comparable + */ + public int compareTo(Object o) + { + if (o instanceof Item) { + String tmps = this.getTitle(); + return tmps.compareTo(((Item)o).getTitle()); + } + return 1; + } + } Index: ItemManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemManagerImpl.java,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- ItemManagerImpl.java 18 Dec 2006 16:39:04 -0000 1.83 +++ ItemManagerImpl.java 19 Dec 2006 14:12:48 -0000 1.84 @@ -3133,6 +3133,7 @@ boolean b = userManager. checkPermission(user.getId(), "item", "update", attrs); return b; + /* - no longer needed - is now in AccessControl if (b) return true; // if not than check rolewrite attribute |
|
From: Michael K. <ko...@us...> - 2006-12-19 14:12:52
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19694/org/cobricks/portal Modified Files: PortalObject.java Log Message: Index: PortalObject.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalObject.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- PortalObject.java 5 Oct 2006 15:07:45 -0000 1.6 +++ PortalObject.java 19 Dec 2006 14:12:49 -0000 1.7 @@ -367,4 +367,16 @@ } + /** + * for Interface java.lang.Comparable + */ + public int compareTo(Object o) + { + if (o instanceof PortalObject) { + String tmps = this.getPageName(); + return tmps.compareTo(((PortalObject)o).getPageName()); + } + return super.compareTo(o); + } + } |
|
From: Michael K. <ko...@us...> - 2006-12-18 16:39:57
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21447/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.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- ItemManagerImpl.java 16 Dec 2006 15:29:10 -0000 1.82 +++ ItemManagerImpl.java 18 Dec 2006 16:39:04 -0000 1.83 @@ -2759,6 +2759,7 @@ */ public void removeItemAttachment(Item item, ItemAttachment ia) { + if (ia == null) return; if (item!=null) item.removeItemAttachment(ia.getId()); dbAccess.sqlDelete("item_attachment", ia.getId()); |
|
From: Michael K. <ko...@us...> - 2006-12-18 16:39:11
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/message In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21447/org/cobricks/message Modified Files: MessageManagerImpl.java Log Message: Index: MessageManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/message/MessageManagerImpl.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- MessageManagerImpl.java 8 Dec 2006 16:22:41 -0000 1.13 +++ MessageManagerImpl.java 18 Dec 2006 16:39:04 -0000 1.14 @@ -692,6 +692,9 @@ velocityContext.put("obj", o); Velocity.evaluate(velocityContext, sw, "message template", templ); + if (o instanceof Item) { + subject = ((Item)o).getTitle(); + } } catch (Exception e) { logger.warn(LogUtil.ex("failed parsing template", e)); } |
|
From: Michael K. <ko...@us...> - 2006-12-18 16:39:11
|
Update of /cvsroot/cobricks/cobricks2/src/de/tum/cobricks/univis In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21447/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.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- UnivIS.java 15 Dec 2006 23:06:32 -0000 1.57 +++ UnivIS.java 18 Dec 2006 16:39:03 -0000 1.58 @@ -127,7 +127,7 @@ String term = univISSync.getTerm(); uparser.parseXmlResponse(xmlresponse, univISSync); if(univISSync.modeIs("univISmaster")){ - try{ + try { // handel deleted courses in UnivIS // get all Cobricks courses for the sync Parameters. //String cterm = univISSync.getTerm(); @@ -153,11 +153,13 @@ CourseModule cm = c.getCourseModule(); int cmid = cm.getId(); if(univISSync.shouldLog("change")){ - univISSync.log("Deleting course \""+c.getName()+"" + univISSync.log("Deleting course \"" + +c.getName()+"" + "\" from Cobricks..."); } courseManager.deleteCourse(cid, new User()); - courseManager.deleteLecturersFromCourse(cid, new User()); + courseManager. + deleteLecturersFromCourse(cid, new User()); courseManager.deleteCourseProgramsForModule(cmid); } } @@ -169,8 +171,8 @@ UnivISLecture ul = (UnivISLecture)it.next(); String univISId = ul.getUnivISId(); if (univISSync.shouldLog("compare")) { - univISSync.log("Comparing univIS with cobricks for course " + - "\""+ul.getName()+"\"" ); + univISSync.log("Comparing univIS with cobricks for " + +"course \""+ul.getName()+"\"" ); } // get Cobricks course for univISId = cextid Course course = courseManager.getCourseForExtId(univISId); @@ -183,8 +185,8 @@ "\""+course.getName()+"\" ..."); } updateCourse(ul, cid, univISSync); - // get lecturers for ul and update with them the lecturers - // for course + // get lecturers for ul and update with them the + // lecturers for course List lecturersIds = ul.getDozIds(); updateCourseLecturers(lecturersIds, cid, univISSync); Map terms = ul.getTerms(); @@ -196,8 +198,8 @@ // there is no course with the given cextid= univISId, // so insert it in to cobricks. if (univISSync.shouldLog("change")){ - univISSync.log("Inserting course \""+ul.getName()+"\"" + - " into cobriks..."); + univISSync.log("Inserting course \""+ul.getName() + +"\" into cobriks..."); } int cid = insertLectureIntoCobricks(ul, term, univISSync); List lecturersIds = ul.getDozIds(); @@ -211,8 +213,8 @@ } catch(Exception e) { - logger.error(LogUtil.ex("Failed synchronizing univIS with cobricks, " + - "master is univIS.",e)); + logger.error(LogUtil.ex("Failed synchronizing UnivIS with " + +"Cobricks, master is UnivIS.",e)); if(univISSync.shouldLog("error")) { univISSync.log("Failed synchronizing univIS with cobricks, " + "master is univIS: "+e.toString()); @@ -228,11 +230,13 @@ String lfirstname = univISSync.getLecturerFirstName(); String cplabel = univISSync.getProgram(); // TBD: organisation number is not used - List list = courseManager.getCourses(cterm, llastname, lfirstname, cplabel); + List list = courseManager. + getCourses(cterm, llastname, lfirstname, cplabel); if(list.size() == 0){ - univISSync.log("There is no new courses in Cobricks ..."); + univISSync.log("There are no new courses in Cobricks ..."); } - // check which courses have been inserted or updated in Cobricks + // check which courses have been inserted or updated + // in Cobricks Iterator it = list.listIterator(); while(it.hasNext()){ Course course =(Course)it.next(); @@ -240,59 +244,67 @@ String cextid = course.getExtId(); Date clastupdate = course.getLastUpdate(); - if(cextid == null || clastrep == null){ + if(cextid == null || clastrep == null) { - //course is new in cobricks, so insert it in univIS + // course is new in cobricks, so insert it in univIS logger.info("Inserting lecture into UnivIS"); if(univISSync.shouldLog("change")){ - univISSync.log("Inserting lecture\""+course.getName()+"\"" + + univISSync.log("Inserting lecture\"" + +course.getName()+"\"" + " into univIS..."); } - String univISId = insertLectureIntoUnivIS(course, univISSync); + 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); - }else if (clastrep != null && clastrep.before(clastupdate)) { + } else if (clastrep != null && + clastrep.before(clastupdate)) { logger.info("Updating UnivIS ..."); - //so update univIS + // so update univIS if(univISSync.shouldLog("change")){ univISSync.log("Updating UnivIS for course\"" + " "+course.getName()+"\"..."); } String univISId = updateUnivIS(course, univISSync); - //update the cextid and cextlastrep in course + // 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); } - } - // check which courses have been deleted in Cobricks (and should be - // deleted in UnivIS + // check which courses have been deleted in Cobricks + // (and should be deleted in UnivIS) List lectures = uparser.getLectures(); Iterator it1 = lectures.listIterator(); - while(it1.hasNext()){ + while (it1.hasNext()){ UnivISLecture ul = (UnivISLecture)it1.next(); String univISId = ul.getUnivISId(); + // ignore lectures from other faculties + if (!univISId.startsWith("Lecture/in")) + continue; Course c = courseManager.getCourseForExtId(univISId); - if(c == null){ + if (c == null){ deleteLectureFromUnivIS(ul, univISSync); if (univISSync.shouldLog("change")){ univISSync.log("Deleting course \"" - + ""+ul.getName()+"\" from UnivIS ..."); + + ""+ul.getName() + +"\" from UnivIS ..."); } } } } catch (Exception e) { - logger.error(LogUtil.ex("Failed synchronizing univIS with cobricks, " - +"master is cobricks.", e)); + logger.error(LogUtil. + ex("Failed synchronizing UnivIS with Cobricks, " + +"master is cobricks.", e)); if (univISSync.shouldLog("error")){ - univISSync.log("Failed synchronizing univIS with cobricks, " - +"master is cobricks : "+e.toString()); + univISSync.log("Failed synchronizing UnivIS with " + +"Cobricks, master is cobricks : " + +e.toString()); } } @@ -316,8 +328,8 @@ Date cextlastrep = c1.getLastReplication(); Date cextastupdate = c1.getLastUpdate(); - // check which courses have been deleted in UnivIS and should - // be deleted in cobricks + // check which courses have been deleted in UnivIS and + // should be deleted in cobricks if(id != null){ UnivISLecture ul = uparser.getLectureForId(id); @@ -331,18 +343,23 @@ CourseModule cm = c1.getCourseModule(); int cmid = cm.getId(); if(univISSync.shouldLog("change")){ - univISSync.log("Deleting course \""+c1.getName()+"" + univISSync.log("Deleting course \"" + +c1.getName()+"" + "\" from Cobricks..."); } courseManager.deleteCourse(cid, new User()); - courseManager.deleteLecturersFromCourse(cid, new User()); + courseManager. + deleteLecturersFromCourse(cid, new User()); courseManager.deleteCourseProgramsForModule(cmid); - }else if (ul != null && cextlastrep != null && (cextlastrep.before(cextastupdate))){ - // course has been changed after the last replication, - // so update UnivIS + } else if (ul != null && cextlastrep != null && + (cextlastrep.before(cextastupdate))){ + // course has been changed after the last + // replication, so update UnivIS if (univISSync.shouldLog("change")){ - univISSync.log("Updating UnivIS for course \"" + ""+c1.getName()+"\" ..."); + univISSync.log("Updating UnivIS for " + +"course \"" + +""+c1.getName()+"\" ..."); } String univISId = updateUnivIS(c1, univISSync); wasUnivISUpdated = true; @@ -352,22 +369,24 @@ attrs.put("cextlastrep", new Date()); courseManager.updateCourseAttrs(c1.getId(), attrs); } - }else if(id == null || cextlastrep == null){ + } else if(id == null || cextlastrep == null){ // course is new in Cobricks, so insert it in UnivIS - if(univISSync.shouldLog("change")){ - univISSync.log("Inserting course \""+c1.getName()+"" + if (univISSync.shouldLog("change")) { + univISSync.log("Inserting course \"" + +c1.getName()+"" + "\" into univIS..."); } - String univISId = insertLectureIntoUnivIS(c1, univISSync); + 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); - }/*else if (cextlastrep != null && (cextlastrep.before(cextastupdate))){ + } /*else if (cextlastrep != null && (cextlastrep.before(cextastupdate))){ // course has been changed after the last replication, // so update UnivIS |
|
From: Michael K. <ko...@us...> - 2006-12-18 16:39:10
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/category In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21447/org/cobricks/category Modified Files: CategoryPresenter.java Log Message: Index: CategoryPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/CategoryPresenter.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- CategoryPresenter.java 8 Dec 2006 07:48:06 -0000 1.24 +++ CategoryPresenter.java 18 Dec 2006 16:39:04 -0000 1.25 @@ -425,9 +425,10 @@ int rows, int cols, boolean readonly) { + if (aname == null) return ""; + String result = ""; String attr = aname; - if (aname.matches(".+_..")) { attr = aname.substring(0, aname.lastIndexOf("_")); } |
|
From: Michael K. <ko...@us...> - 2006-12-18 16:39:09
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21447/org/cobricks/course Modified Files: Course.java CourseManagerImpl.java CourseModule.java CoursePresenter.java CourseServlet.java Log Message: Index: CourseManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseManagerImpl.java,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- CourseManagerImpl.java 16 Dec 2006 15:29:10 -0000 1.65 +++ CourseManagerImpl.java 18 Dec 2006 16:39:04 -0000 1.66 @@ -704,7 +704,7 @@ +"course_lecturerrel.lid "); where = checkAndConcat(where,"AND course.cid = " +"course_lecturerrel.cid "); - orderby = "course_lecturer.lastname"; + orderby = "course_lecturer.llastname"; } else if (sortby.equals("cpid")) { from = checkAndConcat(from,",course_prog "); @@ -2275,7 +2275,11 @@ public List getCourses(String cterm, String llastname, String lfirstname, String cplabel) { - ArrayList result = new ArrayList(); + if (cterm == null) return null; + if (llastname == null) llastname = ""; + if (lfirstname == null) lfirstname = ""; + if (cplabel == null) cplabel = ""; + ArrayList result = new ArrayList(); String sql = "select course.cid from course, course_lecturer, " + "course_lecturerrel, course_prog, course_progrel where " + "course.cid = course_lecturerrel.cid and " Index: CoursePresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CoursePresenter.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- CoursePresenter.java 15 Dec 2006 23:06:32 -0000 1.30 +++ CoursePresenter.java 18 Dec 2006 16:39:04 -0000 1.31 @@ -174,7 +174,6 @@ return courseManager. getCourseModule(Integer.parseInt(cmid.trim())); } catch(Exception e ){ - logger.error(LogUtil.ex("Failed getting course module.", e)); } return null; } @@ -593,8 +592,14 @@ public String printPrerequ(CourseModule cm, String lang) { + if (cm == null) return ""; String tmps = cm.getPrerequ(); - return printPrerequ(tmps, lang); + try { + return printPrerequ(tmps, lang); + } catch (Exception e) { + logger.error(LogUtil.ex("failed", e)); + } + return ""; } public String printPrerequ(Course c, String lang) Index: CourseServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseServlet.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- CourseServlet.java 11 Dec 2006 10:08:05 -0000 1.28 +++ CourseServlet.java 18 Dec 2006 16:39:04 -0000 1.29 @@ -334,13 +334,12 @@ // check access rights PortalUser portalUser = prequest.getPortalUser(); - /** TODO if (!userManager.getAccessControl(). checkPermission(portalUser.getUserId(), "course", "create", null)) { prequest.setReturnCode(2000); return "noaccess"; - } */ + } Map attrs = getCourseRequestParameters(prequest); String tmps = (String)attrs.remove("cexaminername"); @@ -354,21 +353,23 @@ int cid = courseManager.createCourse(attrs, portalUser.getUser()); Course c = courseManager.getCourse(cid); - HttpServletRequest request = prequest.getHttpServletRequest(); - String hostname = request.getRemoteHost(); - if (hostname == null) - hostname = request.getRemoteAddr(); - courseManager. - addCourseUpdateHistory("create", cid, - c.getCourseModule().getId(), - portalUser.getUserId(), - c.getTerm(), - c.getFullName()+" ("+ - c.getCourseModule().getSId()+")", - hostname, new Date()); - - prequest.setReturnCode(1001); - return "success"; + if (c!=null) { + HttpServletRequest request = prequest.getHttpServletRequest(); + String hostname = request.getRemoteHost(); + if (hostname == null) + hostname = request.getRemoteAddr(); + courseManager. + addCourseUpdateHistory("create", cid, + c.getCourseModule().getId(), + portalUser.getUserId(), + c.getTerm(), + c.getFullName()+" ("+ + c.getCourseModule().getSId()+")", + hostname, new Date()); + + prequest.setReturnCode(1001); + return "success"; + } } catch (Exception e) { logger.error("Failed creatimg course",e); } @@ -1465,8 +1466,8 @@ uid = Integer.parseInt(prequest.getRequestParameter("uid")); cid = Integer.parseInt(prequest.getRequestParameter("cid")); } catch (Exception e) { - logger.error("Failed adding course to timetable: uid=" - +uid+", cid="+cid); + logger.warn("Failed adding course to timetable: uid=" + +uid+", cid="+cid); prequest.setReturnCode(2100); return "error"; } Index: CourseModule.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseModule.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- CourseModule.java 30 Nov 2006 14:01:59 -0000 1.5 +++ CourseModule.java 18 Dec 2006 16:39:04 -0000 1.6 @@ -217,27 +217,37 @@ public int getCapacity() { - return ((Integer)attrs.get("cmcapacity")).intValue(); + Integer i = (Integer)attrs.get("cmcapacity"); + if (i == null) return 0; + return i.intValue(); } public int getHoursLecture() { - return ((Integer)attrs.get("cmhours_lec")).intValue(); + Integer i = (Integer)attrs.get("cmhours_lec"); + if (i == null) return 0; + return i.intValue(); } public int getHoursExercises() { - return ((Integer)attrs.get("cmhours_ex")).intValue(); + Integer i = (Integer)attrs.get("cmhours_ex"); + if (i == null) return 0; + return i.intValue(); } public int getHoursSeminar() { - return ((Integer)attrs.get("cmhours_sem")).intValue(); + Integer i = (Integer)attrs.get("cmhours_sem"); + if (i == null) return 0; + return i.intValue(); } public int getHoursLab() { - return ((Integer)attrs.get("cmhours_lab")).intValue(); + Integer i = (Integer)attrs.get("cmhours_lab"); + if (i == null) return 0; + return i.intValue(); } /** Index: Course.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/Course.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Course.java 8 Dec 2006 16:22:41 -0000 1.24 +++ Course.java 18 Dec 2006 16:39:04 -0000 1.25 @@ -196,7 +196,9 @@ */ public int getHoursLecture() { - return ((Integer)attrs.get("chours_lec")).intValue(); + Integer i = (Integer)attrs.get("cmhours_lec"); + if (i == null) return 0; + return i.intValue(); } /** Returns the weekly count of exercise hours @@ -204,7 +206,9 @@ */ public int getHoursExercises() { - return ((Integer)attrs.get("chours_ex")).intValue(); + Integer i = (Integer)attrs.get("cmhours_ex"); + if (i == null) return 0; + return i.intValue(); } /** Returns the weekly count of seminar hours @@ -212,7 +216,9 @@ */ public int getHoursSeminar() { - return ((Integer)attrs.get("chours_sem")).intValue(); + Integer i = (Integer)attrs.get("cmhours_sem"); + if (i == null) return 0; + return i.intValue(); } /** Returns the weekly count of laboratory hours @@ -220,7 +226,9 @@ */ public int getHoursLab() { - return ((Integer)attrs.get("chours_lab")).intValue(); + Integer i = (Integer)attrs.get("cmhours_lab"); + if (i == null) return 0; + return i.intValue(); } /** Returns course conten explanation of the course |
|
From: Michael K. <ko...@us...> - 2006-12-18 16:39:09
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21447/org/cobricks/portal Modified Files: PortalManagerImpl.java PortalPresenter.java Log Message: Index: PortalPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPresenter.java,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- PortalPresenter.java 10 Dec 2006 18:35:39 -0000 1.56 +++ PortalPresenter.java 18 Dec 2006 16:39:04 -0000 1.57 @@ -692,6 +692,7 @@ String xpath = "/item[itemclass~'portalpage'] and " +"/item/folders/category/id="+folderid.trim(); List items = itemManager.searchItems(xpath); + Collections.sort(items); return items; } @@ -703,6 +704,7 @@ String xpath = "/item[itemclass~'portalpage'] and " +"/item/folders/category/id="+pf.getId(); List items = itemManager.searchItems(xpath); + Collections.sort(items); return items; } Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- PortalManagerImpl.java 18 Dec 2006 07:45:15 -0000 1.94 +++ PortalManagerImpl.java 18 Dec 2006 16:39:04 -0000 1.95 @@ -631,6 +631,9 @@ pc = new HashMap(); pc.put("en", "Failed loading "+notFoundPath); } + HttpServletResponse response = + portalRequest.getHttpServletResponse(); + response.setStatus(404); } else { // update page read statistics portalStats.addPageRead(pagePath, pageName); @@ -774,8 +777,9 @@ // check if the pagePath does exist (there is a context object // for this path) PortalFolder c = getPortalFolder(pagePath); - if (c == null) + if (c == null) { throw new CobricksException("portal", "nopath", ""); + } // check if the page already exits String xpath = "/item[itemclass~'portalobject'] and " |
|
From: Michael K. <ko...@us...> - 2006-12-18 07:45:20
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12450/org/cobricks/portal Modified Files: PortalCache.java PortalManagerImpl.java Log Message: Index: PortalCache.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalCache.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- PortalCache.java 7 Dec 2006 11:50:54 -0000 1.3 +++ PortalCache.java 18 Dec 2006 07:45:15 -0000 1.4 @@ -86,8 +86,10 @@ int toDelete = cacheSize - 800; Iterator iter = pathCache.keySet().iterator(); for (int i=0; i<toDelete; i++) { - Object key2 = iter.next(); - pathCache.remove(key2); + try { + Object key2 = iter.next(); + pathCache.remove(key2); + } catch (Exception e) { } } incleanup = false; logger.info("Portal objects cache reduced to "+pathCache.size() Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- PortalManagerImpl.java 6 Dec 2006 09:41:30 -0000 1.93 +++ PortalManagerImpl.java 18 Dec 2006 07:45:15 -0000 1.94 @@ -611,8 +611,12 @@ // no content returned (any language version)? if (pc == null || pc.size()<1) { + HttpServletRequest request = + portalRequest.getHttpServletRequest(); logger.warn("Failed getting content for page "+pagePath+pageName - +","+lang+" - loading "+notFoundPath); + +","+lang+" (referer: " + + request.getHeader("referer") + +" - loading "+notFoundPath); portalRequest.setContextObject("notfoundurl", pagePath+pageName); pagePath = notFoundPath; pageName = "notfound.html"; |
|
From: Michael K. <ko...@us...> - 2006-12-16 15:29:16
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/core In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29993/org/cobricks/core Modified Files: CorePresenter.java Log Message: Index: CorePresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/CorePresenter.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CorePresenter.java 15 Dec 2006 23:06:32 -0000 1.9 +++ CorePresenter.java 16 Dec 2006 15:29:09 -0000 1.10 @@ -26,6 +26,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.ListIterator; import java.util.Locale; import java.util.Map; import java.util.Properties; @@ -380,7 +381,36 @@ return result; } + public List sortList(List s) + { + if (s == null) return new ArrayList(); + List result = new ArrayList(s); + Collections.sort(result); + return result; + } + + + /** + * + */ + public List subList(List s, int start, int size) + { + if (s==null) return null; + List result = new ArrayList(); + int count = 0; + ListIterator i = s.listIterator(); + while (i.hasNext()) { + Object o = i.next(); + if (count >= start) + result.add(o); + count++; + if (count > start + size) + break; + } + return result; + } + /** * */ @@ -433,6 +463,32 @@ result.append("\n"); return 1; } + + + /** + * + */ + public String sqlExecute(String sql) + { + try { + coreManager.getDBAccess().sqlExecute(sql, null, true); + return null; + } catch(Exception e) { + return e.toString(); + } + } + + /** + * + */ + public List sqlQuery(String sql) + { + try { + return coreManager.getDBAccess().sqlQuery(sql, true); + } catch(Exception e) { + } + return null; + } } |
|
From: Michael K. <ko...@us...> - 2006-12-16 15:29:16
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/core/db In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29993/org/cobricks/core/db Modified Files: DBAccess.java DBAccessImpl.java Log Message: Index: DBAccessImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/db/DBAccessImpl.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- DBAccessImpl.java 14 Dec 2006 22:06:46 -0000 1.33 +++ DBAccessImpl.java 16 Dec 2006 15:29:10 -0000 1.34 @@ -880,7 +880,12 @@ */ public List sqlQuery(String sql) { - return sqlQuery(sql, -1); + return sqlQuery(sql, -1, false); + } + + public List sqlQuery(String sql, boolean donotlogerrors) + { + return sqlQuery(sql, -1, donotlogerrors); } @@ -891,6 +896,11 @@ */ public List sqlQuery(String sql, int maxRows) { + return sqlQuery(sql, maxRows, false); + } + + public List sqlQuery(String sql, int maxRows, boolean donotlogerrors) + { // tbd: we might want to use the QueryRunner class in the // Apache Jakarta JDBC Utility Component instead: // QueryRunner run = new QueryRunner(dataSource); @@ -914,9 +924,11 @@ maxRows--; } } catch(Exception e) { - e.printStackTrace(); - logger.error(LogUtil.exception("Failed executing sql statement: " - +sql, e)); + if (!donotlogerrors) { + e.printStackTrace(); + logger.error(LogUtil.ex("Failed executing sql statement: " + +sql, e)); + } } try { if (rs!=null) rs.close(); } catch (Exception e) { } try { if (stmt!=null) stmt.close(); } catch (Exception e) { } Index: DBAccess.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/db/DBAccess.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- DBAccess.java 10 Dec 2006 21:51:16 -0000 1.14 +++ DBAccess.java 16 Dec 2006 15:29:10 -0000 1.15 @@ -62,7 +62,9 @@ public List sqlSelect(String tableName, Map conditions, List fields, int maxRows); public List sqlQuery(String sql); + public List sqlQuery(String sql, boolean donotlogerrors); public List sqlQuery(String sql, int maxRows); + public List sqlQuery(String sql, int maxRows, boolean donotlogerrors); public List sqlQuery(String sql, List objects, int maxRows); public Map sqlQuerySingleRow(String sql); @@ -70,6 +72,8 @@ public String sqlExecute(String sql); public String sqlExecute(String sql, List objects); public String sqlExecute(String sql, boolean donotlogerrors); + public String sqlExecute(String sql, List objects, + boolean donotlogerrors); // create a new value for the primary key column of the given table public String getNewPrimaryKey(String tablename, String primarykeycol); |
|
From: Michael K. <ko...@us...> - 2006-12-16 15:29:14
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29993/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.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- CourseManagerImpl.java 15 Dec 2006 23:06:32 -0000 1.64 +++ CourseManagerImpl.java 16 Dec 2006 15:29:10 -0000 1.65 @@ -614,6 +614,17 @@ ("AND (lfirstname like '%"+attrs.get("lecturername")+"%' " +"OR llastname like '%"+attrs.get("lecturername") +"%' ) "); + } + else if ((attrs.get("lgroup")!=null) && + (((String)attrs.get("lgroup")).length()>0)) { + from = checkAndConcat(from,",course_lecturer "); + from = checkAndConcat(from,",course_lecturerrel "); + where = checkAndConcat(where,"AND course_lecturer.lid = " + +"course_lecturerrel.lid "); + where = checkAndConcat(where,"AND course.cid = " + +"course_lecturerrel.cid "); + where += + ("AND (lgroup = '"+attrs.get("lgroup")+"') "); } if (attrs.get("cpid")!=null) { from = checkAndConcat(from,",course_progrel "); @@ -1397,6 +1408,12 @@ copyAttr("lgroup", attrs, sqlAttrs); copyAttr("lhidden", attrs, sqlAttrs); copyAttr("luserid", attrs, sqlAttrs); + String tmps = (String)sqlAttrs.get("lfirstname"); + if (tmps!=null && tmps.length()>20) + sqlAttrs.put("lfirstname", tmps.substring(0,20)); + tmps = (String)sqlAttrs.get("llastname"); + if (tmps!=null && tmps.length()>20) + sqlAttrs.put("llastname", tmps.substring(0,20)); try { clid = dbAccess.sqlInsert("course_lecturer", sqlAttrs); @@ -1430,7 +1447,13 @@ copyAttr("lgroup", attrs, sqlAttrs); copyAttr("lhidden", attrs, sqlAttrs); copyAttr("luserid", attrs, sqlAttrs); - + String tmps = (String)sqlAttrs.get("lfirstname"); + if (tmps!=null && tmps.length()>20) + sqlAttrs.put("lfirstname", tmps.substring(0,20)); + tmps = (String)sqlAttrs.get("llastname"); + if (tmps!=null && tmps.length()>20) + sqlAttrs.put("llastname", tmps.substring(0,20)); + try { dbAccess.sqlUpdate("course_lecturer", sqlAttrs, lid); } catch (Exception e) { |