You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(233) |
Sep
(199) |
Oct
(206) |
Nov
(185) |
Dec
(270) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(232) |
Feb
(426) |
Mar
(623) |
Apr
(592) |
May
(506) |
Jun
(389) |
Jul
(160) |
Aug
(3) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(5) |
2007 |
Jan
(1) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(4) |
Jun
(2) |
Jul
|
Aug
(3) |
Sep
(5) |
Oct
(9) |
Nov
(6) |
Dec
(6) |
2008 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(3) |
May
(3) |
Jun
(5) |
Jul
(10) |
Aug
(2) |
Sep
(12) |
Oct
(10) |
Nov
(54) |
Dec
(49) |
2009 |
Jan
(19) |
Feb
(13) |
Mar
(20) |
Apr
(24) |
May
(44) |
Jun
(29) |
Jul
(32) |
Aug
(10) |
Sep
(7) |
Oct
(10) |
Nov
(4) |
Dec
(17) |
2010 |
Jan
(14) |
Feb
(5) |
Mar
(23) |
Apr
(50) |
May
(31) |
Jun
(9) |
Jul
(5) |
Aug
(4) |
Sep
(7) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
(12) |
Feb
(5) |
Mar
(5) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2015 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Author: szimano Date: 2005-09-21 11:20:11 -0400 (Wed, 21 Sep 2005) New Revision: 1166 Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiSearch.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiType.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java Log: fixed errors in attachemnt list plugin (ability to rolback even not loged in) Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-21 10:53:44 UTC (rev 1165) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-21 15:20:11 UTC (rev 1166) @@ -22,6 +22,8 @@ import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.FileItem; +import sun.security.krb5.internal.crypto.w; + /** * The WikiPortlet. * <p> @@ -231,10 +233,7 @@ + rReq.getServerPort()); // prepare some data for plugins in session - if (rReq.getUser() != null) { - rReq.getPortletSession().setAttribute("user", - rReq.getUser().getUserName()); - } + rReq.getPortletSession().setAttribute("user", (rReq.getUser() != null) ? rReq.getUser().getUserName() : null); rReq.getPortletSession().setAttribute("hostURL", hostURL); rReq.getPortletSession().setAttribute("actionURL", wikiURL.toString()); @@ -399,7 +398,7 @@ rReq.setAttribute("logedIn", (rReq.getUser() != null) ? "true" : "false"); - + rReq.setAttribute("defaultPage", defaultPage); // FIXME make this more elegant (ie. plugin) Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-21 10:53:44 UTC (rev 1165) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-21 15:20:11 UTC (rev 1166) @@ -49,7 +49,7 @@ private MediaDataSource mediaDataSource; private AttchementDataSource attachementDataSource; - + WikiPage noSuchPage; /** @@ -190,7 +190,7 @@ public void init() { mediaDataSource = new FileDataSource(); attachementDataSource = new FileDataSource(); - + pages = new HashMap<String, WikiPage>(); wikiTypes = new HashMap<String, WikiType>(); @@ -331,7 +331,8 @@ WikiContext wc = new WikiContext(null, wt, null); WikiPage wp = new WikiPage("name", new Credentials("tomek"), - "[content|ble sme]", 1, 1, new Date(), we.getMediaDataSource(), we.getAttachementDataSource()); + "[content|ble sme]", 1, 1, new Date(), we.getMediaDataSource(), + we.getAttachementDataSource()); wp = wc.process(wp); @@ -354,6 +355,7 @@ for (String name : pages) { WikiPage temp = getByName(name, null); + if (temp != null) { int searchScore; @@ -363,13 +365,13 @@ } } } - + Object[] entryArr = resPages.entrySet().toArray(); // Sorting the resPages by entry values (which are numbers), descending. Arrays.sort(entryArr, new Comparator<Object>() { public int compare(Object entry1, Object entry2) { - int i1 = ((Entry<String,Integer>)entry1).getValue(); - int i2 = ((Entry<String,Integer>)entry2).getValue(); + int i1 = ((Entry<String, Integer>) entry1).getValue(); + int i2 = ((Entry<String, Integer>) entry2).getValue(); if (i1 == i2) return 0; @@ -378,10 +380,10 @@ }); resPages = new LinkedHashMap<String, Integer>(); - + for (int i = 0; i < entryArr.length; i++) { - Entry<String,Integer> entry = (Entry<String,Integer>)entryArr[i]; - + Entry<String, Integer> entry = (Entry<String, Integer>) entryArr[i]; + resPages.put(entry.getKey(), entry.getValue()); } // System.out.println("Search completed"); @@ -391,7 +393,7 @@ public AttchementDataSource getAttachementDataSource() { return attachementDataSource; } - + public Set<String> getPagesFor(String pageName) { return mediaDataSource.getPagesFor(pageName); } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiSearch.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiSearch.java 2005-09-21 10:53:44 UTC (rev 1165) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiSearch.java 2005-09-21 15:20:11 UTC (rev 1166) @@ -67,7 +67,7 @@ }*/ for (int i = 0; i < requestTokens.size(); i++) { - int fromIndex = 0; + int fromIndex = -1; while ((fromIndex = content.indexOf(requestTokens.get(i), fromIndex+1)) != -1) { // found at least one required token Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiType.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiType.java 2005-09-21 10:53:44 UTC (rev 1165) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiType.java 2005-09-21 15:20:11 UTC (rev 1166) @@ -83,12 +83,12 @@ newPage = (WikiPage)wikiPage.clone(); } catch (CloneNotSupportedException cnse) { - System.out.println("cannot clone the page: " + cnse); + System.err.println("cannot clone the page: " + cnse); } // execute the plugins for (int i = 0; i < plugins.size(); i++) { - System.out.println("Executing plugin: "+plugins.get(i).getName()); + //System.out.println("Executing plugin: "+plugins.get(i).getName()); newPage = (plugins.get(i)).process(newPage, wikiSession); } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java 2005-09-21 10:53:44 UTC (rev 1165) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java 2005-09-21 15:20:11 UTC (rev 1166) @@ -9,40 +9,77 @@ @Override public WikiPage process(WikiPage wikiPage, WikiSession wikiSession) { + String userName = (String) wikiSession.getAttribute("user"); StringBuilder history = new StringBuilder(); - String attachementName = (String)wikiSession.getAttribute("var1"); + String attachementName = (String) wikiSession.getAttribute("var1"); Object rollbackToVer = wikiSession.getAttribute("var2"); - - String attURL = (String)wikiSession.getAttribute("hostURL")+"/wiki/"+wikiPage.getName()+"/"; - String actionURL = (String)wikiSession.getAttribute("actionURL"); - - if ((rollbackToVer != null)&&(wikiSession.getAttribute("user") != null)&&(Integer.valueOf((String)rollbackToVer) < wikiEngine.getAttachementDataSource().getLastAttachementVersion(wikiPage.getName(),attachementName))) { - WikiAttachment wikiAttachment = wikiEngine.getAttachementDataSource().getAttachement(wikiPage.getName(),attachementName, Integer.valueOf((String)rollbackToVer)); - wikiEngine.getAttachementDataSource().addAtachement(wikiAttachment.getFile(), attachementName, wikiPage, (String)wikiSession.getAttribute("user")); + + String attURL = (String) wikiSession.getAttribute("hostURL") + "/wiki/" + + wikiPage.getName() + "/file:"; + String actionURL = (String) wikiSession.getAttribute("actionURL"); + + if ((rollbackToVer != null) + && (userName != null) + && (Integer.valueOf((String) rollbackToVer) < wikiEngine + .getAttachementDataSource().getLastAttachementVersion( + wikiPage.getName(), attachementName))) { + WikiAttachment wikiAttachment = wikiEngine + .getAttachementDataSource().getAttachement( + wikiPage.getName(), attachementName, + Integer.valueOf((String) rollbackToVer)); + wikiEngine.getAttachementDataSource().addAtachement( + wikiAttachment.getFile(), attachementName, wikiPage, + (String) wikiSession.getAttribute("user")); } - - history.append("<h3>History of file: ").append(attachementName).append(" page: ").append(wikiPage.getName()).append("</h3>\n"); + + history.append("<h3>History of file: ").append(attachementName).append( + " page: ").append(wikiPage.getName()).append("</h3>\n"); history.append("<hr>\n").append("<table border=\"1\">\n"); - history.append("<tr><td><b>Version</b></td><td><b>Date</b></td><td><b>Author</b></td><td><b>Size</b></td><td><b>Rollback</b></td></tr>\n"); + history + .append("<tr><td><b>Version</b></td><td><b>Date</b></td><td><b>Author</b></td><td><b>Size</b></td><td><b>Rollback</b></td></tr>\n"); - int lastVer = wikiEngine.getAttachementDataSource().getLastAttachementVersion(wikiPage.getName(),attachementName); + int lastVer = wikiEngine.getAttachementDataSource() + .getLastAttachementVersion(wikiPage.getName(), attachementName); for (int i = lastVer; i > 0; i--) { - WikiAttachment wikiAttachment = wikiEngine.getAttachementDataSource().getAttachement(wikiPage.getName(), attachementName, i); - history.append("<tr><td>").append("<a href=\"").append(attURL).append(attachementName).append((i != lastVer) ? ":"+i : "").append("\" >").append(i).append("</a></td>").append("<td>").append(wikiAttachment.getDate()).append("</td>").append("<td>").append(wikiAttachment.getUser()).append("</td>").append("<td>").append(wikiAttachment.getSize()).append("</td>"); - + WikiAttachment wikiAttachment = wikiEngine + .getAttachementDataSource().getAttachement( + wikiPage.getName(), attachementName, i); + history.append("<tr><td>").append("<a href=\"").append(attURL) + .append(attachementName).append( + (i != lastVer) ? ":" + i : "").append("\" >") + .append(i).append("</a></td>").append("<td>").append( + wikiAttachment.getDate()).append("</td>").append( + "<td>").append(wikiAttachment.getUser()).append( + "</td>").append("<td>").append( + wikiAttachment.getSize()).append("</td>"); + if (i != lastVer) { - history.append("<td><a href=\"").append(actionURL).append("&type=fileInfo&page=").append(wikiPage.getName()).append("&var1=").append(attachementName).append("&var2=").append(i).append("\" >").append("Rollback version ").append(i).append("</a></td>"); - } - else { + history.append("<td>"); + + if (userName != null) + history.append("<a href=\"").append(actionURL).append( + "&type=fileInfo&page=").append(wikiPage.getName()) + .append("&var1=").append(attachementName).append( + "&var2=").append(i).append("\" >"); + + history.append((userName == null) ? "<i>" : "").append( + "Rollback version ").append(i).append( + (userName == null) ? " (after login)</i>" : ""); + + if (userName != null) + history.append("</a>"); + + history.append("<td>"); + } else { history.append("<td></td>"); } - + history.append("</tr>\n"); } history.append("</table>\n"); wikiPage.setPageContent(history.toString()); - - return wikiPage; + + return wikiPage; } @Override |
From: <jbo...@li...> - 2005-09-21 10:54:17
|
Author: mla...@jb... Date: 2005-09-21 06:53:44 -0400 (Wed, 21 Sep 2005) New Revision: 1165 Modified: trunk/labs/jbossweb/xdocs/images/design/sendfileflowchart.png trunk/labs/jbossweb/xdocs/sources/sendfileflowchart.vsd Log: Update sendfileflowchart diagram Modified: trunk/labs/jbossweb/xdocs/images/design/sendfileflowchart.png =================================================================== (Binary files differ) Modified: trunk/labs/jbossweb/xdocs/sources/sendfileflowchart.vsd =================================================================== (Binary files differ) |
From: <jbo...@li...> - 2005-09-21 08:09:00
|
Author: aron.gombas Date: 2005-09-21 04:08:47 -0400 (Wed, 21 Sep 2005) New Revision: 1164 Added: trunk/labs/kosmos/src/test/hu/midori/kosmos/server/cc/CcServiceTest.java trunk/labs/kosmos/src/test/hu/midori/kosmos/server/jira/JiraServiceTest.java trunk/labs/kosmos/src/test/hu/midori/kosmos/server/sf/SfServiceTest.java trunk/labs/kosmos/src/test/hu/midori/kosmos/server/svn/SvnServiceTest.java Removed: trunk/labs/kosmos/src/test/hu/midori/kosmos/server/cc/CcServiceImplTest.java trunk/labs/kosmos/src/test/hu/midori/kosmos/server/jira/JiraServiceImplTest.java trunk/labs/kosmos/src/test/hu/midori/kosmos/server/sf/SfServiceImplTest.java trunk/labs/kosmos/src/test/hu/midori/kosmos/server/svn/SvnServiceImplTest.java Log: Unit tests prepared Deleted: trunk/labs/kosmos/src/test/hu/midori/kosmos/server/cc/CcServiceImplTest.java =================================================================== --- trunk/labs/kosmos/src/test/hu/midori/kosmos/server/cc/CcServiceImplTest.java 2005-09-21 08:04:05 UTC (rev 1163) +++ trunk/labs/kosmos/src/test/hu/midori/kosmos/server/cc/CcServiceImplTest.java 2005-09-21 08:08:47 UTC (rev 1164) @@ -1,13 +0,0 @@ -/* - * Kosmos. - * - * Distributable under LGPL license. - * See terms of license at gnu.org. - */ -package hu.midori.kosmos.server.cc; - -/** - * TODO !!! - */ -public class CcServiceImplTest { -} Added: trunk/labs/kosmos/src/test/hu/midori/kosmos/server/cc/CcServiceTest.java =================================================================== --- trunk/labs/kosmos/src/test/hu/midori/kosmos/server/cc/CcServiceTest.java 2005-09-21 08:04:05 UTC (rev 1163) +++ trunk/labs/kosmos/src/test/hu/midori/kosmos/server/cc/CcServiceTest.java 2005-09-21 08:08:47 UTC (rev 1164) @@ -0,0 +1,16 @@ +/* + * Kosmos. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package hu.midori.kosmos.server.cc; + +/** + * Unit test. + * + * @author <a href="mailto:aro...@mi...">Aron Gombas</a> + * @version $Id$ + */ +public class CcServiceTest {// TODO just pass in test logfiles and check the result returned +} Deleted: trunk/labs/kosmos/src/test/hu/midori/kosmos/server/jira/JiraServiceImplTest.java =================================================================== --- trunk/labs/kosmos/src/test/hu/midori/kosmos/server/jira/JiraServiceImplTest.java 2005-09-21 08:04:05 UTC (rev 1163) +++ trunk/labs/kosmos/src/test/hu/midori/kosmos/server/jira/JiraServiceImplTest.java 2005-09-21 08:08:47 UTC (rev 1164) @@ -1,13 +0,0 @@ -/* - * Kosmos. - * - * Distributable under LGPL license. - * See terms of license at gnu.org. - */ -package hu.midori.kosmos.server.jira; - -/** - * TODO !!! - */ -public class JiraServiceImplTest { -} Added: trunk/labs/kosmos/src/test/hu/midori/kosmos/server/jira/JiraServiceTest.java =================================================================== --- trunk/labs/kosmos/src/test/hu/midori/kosmos/server/jira/JiraServiceTest.java 2005-09-21 08:04:05 UTC (rev 1163) +++ trunk/labs/kosmos/src/test/hu/midori/kosmos/server/jira/JiraServiceTest.java 2005-09-21 08:08:47 UTC (rev 1164) @@ -0,0 +1,16 @@ +/* + * Kosmos. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package hu.midori.kosmos.server.jira; + +/** + * Unit test. + * + * @author <a href="mailto:aro...@mi...">Aron Gombas</a> + * @version $Id$ + */ +public class JiraServiceTest {// TODO just pass in test URLs and check the result returned +} Deleted: trunk/labs/kosmos/src/test/hu/midori/kosmos/server/sf/SfServiceImplTest.java =================================================================== --- trunk/labs/kosmos/src/test/hu/midori/kosmos/server/sf/SfServiceImplTest.java 2005-09-21 08:04:05 UTC (rev 1163) +++ trunk/labs/kosmos/src/test/hu/midori/kosmos/server/sf/SfServiceImplTest.java 2005-09-21 08:08:47 UTC (rev 1164) @@ -1,13 +0,0 @@ -/* - * Kosmos. - * - * Distributable under LGPL license. - * See terms of license at gnu.org. - */ -package hu.midori.kosmos.server.sf; - -/** - * !!! - */ -public class SfServiceImplTest { -} Added: trunk/labs/kosmos/src/test/hu/midori/kosmos/server/sf/SfServiceTest.java =================================================================== --- trunk/labs/kosmos/src/test/hu/midori/kosmos/server/sf/SfServiceTest.java 2005-09-21 08:04:05 UTC (rev 1163) +++ trunk/labs/kosmos/src/test/hu/midori/kosmos/server/sf/SfServiceTest.java 2005-09-21 08:08:47 UTC (rev 1164) @@ -0,0 +1,16 @@ +/* + * Kosmos. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package hu.midori.kosmos.server.sf; + +/** + * Unit test. + * + * @author <a href="mailto:aro...@mi...">Aron Gombas</a> + * @version $Id$ + */ +public class SfServiceTest {// TODO just pass in test URLs and check the result returned +} Deleted: trunk/labs/kosmos/src/test/hu/midori/kosmos/server/svn/SvnServiceImplTest.java =================================================================== --- trunk/labs/kosmos/src/test/hu/midori/kosmos/server/svn/SvnServiceImplTest.java 2005-09-21 08:04:05 UTC (rev 1163) +++ trunk/labs/kosmos/src/test/hu/midori/kosmos/server/svn/SvnServiceImplTest.java 2005-09-21 08:08:47 UTC (rev 1164) @@ -1,13 +0,0 @@ -/* - * Kosmos. - * - * Distributable under LGPL license. - * See terms of license at gnu.org. - */ -package hu.midori.kosmos.server.svn; - -/** - * !!! - */ -public class SvnServiceImplTest { -} Added: trunk/labs/kosmos/src/test/hu/midori/kosmos/server/svn/SvnServiceTest.java =================================================================== --- trunk/labs/kosmos/src/test/hu/midori/kosmos/server/svn/SvnServiceTest.java 2005-09-21 08:04:05 UTC (rev 1163) +++ trunk/labs/kosmos/src/test/hu/midori/kosmos/server/svn/SvnServiceTest.java 2005-09-21 08:08:47 UTC (rev 1164) @@ -0,0 +1,16 @@ +/* + * Kosmos. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package hu.midori.kosmos.server.svn; + +/** + * Unit test. + * + * @author <a href="mailto:aro...@mi...">Aron Gombas</a> + * @version $Id$ + */ +public class SvnServiceTest {// TODO just pass in test URLs and check the result returned +} |
From: <jbo...@li...> - 2005-09-21 08:04:14
|
Author: mla...@jb... Date: 2005-09-21 04:04:05 -0400 (Wed, 21 Sep 2005) New Revision: 1163 Added: trunk/labs/jbossweb/xdocs/reference/arch03.xml Modified: trunk/labs/jbossweb/xdocs/reference/arch02.xml trunk/labs/jbossweb/xdocs/reference/project.xml Log: Add Configuration model chapter Modified: trunk/labs/jbossweb/xdocs/reference/arch02.xml =================================================================== --- trunk/labs/jbossweb/xdocs/reference/arch02.xml 2005-09-21 07:48:04 UTC (rev 1162) +++ trunk/labs/jbossweb/xdocs/reference/arch02.xml 2005-09-21 08:04:05 UTC (rev 1163) @@ -16,7 +16,11 @@ <section name="Design"> <p>Hybrid connection model </p> - <figure src="/images/design/acceptflowchart.png" name="Figure 3" text="Accept flowchart"/> + <figure src="/images/design/acceptflowchart.png" name="Figure 4" text="Accept flowchart"/> + <br/> + <p>Sendfile Support + </p> + <figure src="/images/design/sendfileflowchart.png" name="Figure 5" text="Sendfile flowchart"/> </section> </body> </document> Added: trunk/labs/jbossweb/xdocs/reference/arch03.xml =================================================================== --- trunk/labs/jbossweb/xdocs/reference/arch03.xml 2005-09-21 07:48:04 UTC (rev 1162) +++ trunk/labs/jbossweb/xdocs/reference/arch03.xml 2005-09-21 08:04:05 UTC (rev 1163) @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="arch03.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>Configuration Model</title> + </properties> + +<body> + +<section name="Design"> + <p>JBoss Web uses Embedded Tomcat. The Configuration model is the same as for the JBoss + Application Server. This gives you an easy transition from JBoss Web Server to full-blown + Application Server. + </p> + <figure src="/images/design/configlayout.png" name="Figure 5" text="Configuration Files"/> +</section> +</body> +</document> Modified: trunk/labs/jbossweb/xdocs/reference/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/reference/project.xml 2005-09-21 07:48:04 UTC (rev 1162) +++ trunk/labs/jbossweb/xdocs/reference/project.xml 2005-09-21 08:04:05 UTC (rev 1163) @@ -11,6 +11,7 @@ <item name="Overview" href="arch.html"/> <item name="Native" href="arch01.html"/> <item name="Hybrid connection model" href="arch02.html"/> + <item name="Configuration layout" href="arch03.html"/> </menu> <menu name="Links"> <item name="Documentation Home" href="../index.html"/> |
From: <jbo...@li...> - 2005-09-21 07:48:21
|
Author: mla...@jb... Date: 2005-09-21 03:48:04 -0400 (Wed, 21 Sep 2005) New Revision: 1162 Modified: trunk/labs/jbossweb/xdocs/images/design/sendfileflowchart.png trunk/labs/jbossweb/xdocs/sources/sendfileflowchart.vsd Log: Update sendfileflowchart diagram Modified: trunk/labs/jbossweb/xdocs/images/design/sendfileflowchart.png =================================================================== (Binary files differ) Modified: trunk/labs/jbossweb/xdocs/sources/sendfileflowchart.vsd =================================================================== (Binary files differ) |
From: <jbo...@li...> - 2005-09-21 07:39:47
|
Author: mla...@jb... Date: 2005-09-21 03:39:22 -0400 (Wed, 21 Sep 2005) New Revision: 1161 Added: trunk/labs/jbossweb/xdocs/images/design/sendfileflowchart.png trunk/labs/jbossweb/xdocs/sources/sendfileflowchart.vsd Log: Add sendfileflowchart files Added: trunk/labs/jbossweb/xdocs/images/design/sendfileflowchart.png =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/images/design/sendfileflowchart.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossweb/xdocs/sources/sendfileflowchart.vsd =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/sources/sendfileflowchart.vsd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <jbo...@li...> - 2005-09-21 07:20:26
|
Author: mla...@jb... Date: 2005-09-21 03:20:09 -0400 (Wed, 21 Sep 2005) New Revision: 1160 Added: trunk/labs/jbossweb/xdocs/images/design/configlayout.png trunk/labs/jbossweb/xdocs/sources/configlayout.vsd Log: Add configlayout files Added: trunk/labs/jbossweb/xdocs/images/design/configlayout.png =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/images/design/configlayout.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossweb/xdocs/sources/configlayout.vsd =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/sources/configlayout.vsd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
Author: adamw Date: 2005-09-20 18:01:52 -0400 (Tue, 20 Sep 2005) New Revision: 1159 Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationTools.java Log: Fix of outside links in navigation Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java 2005-09-20 18:14:46 UTC (rev 1158) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java 2005-09-20 22:01:52 UTC (rev 1159) @@ -411,4 +411,16 @@ return createLink(portalName, XmlTools.getAttributeValue(root, "type"), XmlTools.unmarshallText(root)); } + + /** + * Checks if the link is an outside link. + * @param link Link to check. + * @return True iff the given link is an outside link. + */ + public static boolean isOutsideLink(String link) { + link = link.trim(); + return link.startsWith("http:") || link.startsWith("ftp:") + || link.startsWith("https:") || link.startsWith("mailto:") + || link.startsWith("news:") || link.startsWith("file:"); + } } Modified: trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java =================================================================== --- trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java 2005-09-20 18:14:46 UTC (rev 1158) +++ trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java 2005-09-20 22:01:52 UTC (rev 1159) @@ -55,10 +55,7 @@ */ private boolean isOutsideLink(String link) { link = link.trim(); - return link.startsWith("http:") || link.startsWith("ftp:") - || link.startsWith("https:") || link.startsWith("mailto:") - || link.startsWith("news:") || link.startsWith("file:") - || link.startsWith("/"); + return link.startsWith("/") || ForgeHelper.isOutsideLink(link); } // modifies path to page/resource so folder structure can be supported Modified: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationTools.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationTools.java 2005-09-20 18:14:46 UTC (rev 1158) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationTools.java 2005-09-20 22:01:52 UTC (rev 1159) @@ -51,7 +51,9 @@ return link; // To each link, adding a noproject param, unless it's a project link. - if ((!link.contains(NO_PROJECT_PARAM)) && (!link.contains("project="))) + if ((!link.contains(NO_PROJECT_PARAM)) && + (!link.contains("project=")) && + (!ForgeHelper.isOutsideLink(link))) return link + NO_PROJECT_PARAM; return link; |
From: <jbo...@li...> - 2005-09-20 18:14:54
|
Author: szimano Date: 2005-09-20 14:14:46 -0400 (Tue, 20 Sep 2005) New Revision: 1158 Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RecentlyChangedPagesPlugin.java Log: fixed errors caused by getAllPageNames Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java 2005-09-20 17:32:30 UTC (rev 1157) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java 2005-09-20 18:14:46 UTC (rev 1158) @@ -88,7 +88,7 @@ boolean status = false; if (pageExists(page.getName())) { // page exists on - // harddisk - add new + // harddisk - add new // version Properties pageProps = getPageProps(page.getName()); @@ -346,9 +346,8 @@ System.err.println(ioe); } - page = new WikiPage(pageName, author, pageContent - .toString(), i, i, new Date(pageFile.lastModified()), - this, this); + page = new WikiPage(pageName, author, pageContent.toString(), + i, i, new Date(pageFile.lastModified()), this, this); page.setLength(pageFile.length()); } @@ -406,8 +405,7 @@ getContentAtVersion(page, loadContent, version); - page.setLastAuthor(getAuthorAtVersion(page.getName(), - version)); + page.setLastAuthor(getAuthorAtVersion(page.getName(), version)); page.setVersion(version); @@ -571,20 +569,36 @@ public Set<String> getAllPageNames() { Set<String> attSet = new HashSet<String>(); - File attDir = new File(pathToMedia + "/"); + getPageNamesFor("", attSet); + return attSet; + } + + private void getPageNamesFor(String directory, Set<String> attSet) { + File attDir = new File(pathToMedia + "/" + directory); + File[] pageFiles = attDir.listFiles(); for (int i = 0; i < pageFiles.length; i++) { if ((pageFiles[i].isFile()) && (pageFiles[i].getName().endsWith(".txt"))) { - String[] tokens = pageFiles[i].getName().split("/"); - attSet.add(tokens[tokens.length - 1].substring(0, - tokens[tokens.length - 1].length() - 4)); + //String[] tokens = pageFiles[i].getName().split("/"); + attSet.add((directory+"/"+pageFiles[i].getName().substring(0, pageFiles[i].getName().length() - ".txt".length())).substring(1)); } } - return attSet; + for (int i = 0; i < pageFiles.length; i++) { + if ((pageFiles[i].isDirectory()) + && (!pageFiles[i].getName().endsWith("-att"))) { + + // do not take dirs from OLD + if (!pageFiles[i].getAbsolutePath().equals(pathToMedia + "/OLD")) { + // get names for subpages + getPageNamesFor(directory + "/" + pageFiles[i].getName(), + attSet); + } + } + } } public WikiAttachment getAttachement(String pageName, String attachementName) { @@ -598,7 +612,7 @@ String[] tokens = attachementName.split("\\."); Properties props = getAttProps(pageName, attachementName, false); - + if (props == null) { return null; } @@ -628,7 +642,7 @@ if (props == null) return -1; - + // looking for the newest version int version = 1; Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RecentlyChangedPagesPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RecentlyChangedPagesPlugin.java 2005-09-20 17:32:30 UTC (rev 1157) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RecentlyChangedPagesPlugin.java 2005-09-20 18:14:46 UTC (rev 1158) @@ -35,6 +35,7 @@ for (String name : pages) { WikiPage temp = wikiEngine.getByName(name, null); + then.setTime(temp.getEditDate()); then.add(Calendar.DAY_OF_MONTH, numOfDays); |
From: <jbo...@li...> - 2005-09-20 17:32:41
|
Author: adamw Date: 2005-09-20 13:32:30 -0400 (Tue, 20 Sep 2005) New Revision: 1157 Modified: trunk/forge/portal-extensions/forge-freezone/project.xml trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java Log: Idiot-proof freezone parser ver. alpha Modified: trunk/forge/portal-extensions/forge-freezone/project.xml =================================================================== --- trunk/forge/portal-extensions/forge-freezone/project.xml 2005-09-20 17:06:52 UTC (rev 1156) +++ trunk/forge/portal-extensions/forge-freezone/project.xml 2005-09-20 17:32:30 UTC (rev 1157) @@ -42,6 +42,6 @@ <artifactId>javax.servlet</artifactId> <version>1.0</version> <jar>javax.servlet.jar</jar> - </dependency> + </dependency> </dependencies> </project> Modified: trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java =================================================================== --- trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java 2005-09-20 17:06:52 UTC (rev 1156) +++ trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java 2005-09-20 17:32:30 UTC (rev 1157) @@ -8,9 +8,9 @@ *****************************************/ package org.jboss.forge.projects.freezone; -import java.io.BufferedReader; -import java.io.FileReader; import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.jboss.forge.common.content.ContentManager; import org.jboss.forge.common.ForgeHelper; @@ -31,6 +31,13 @@ */ private final static String DEFAULT_PAGE = "index.html"; + private final static String ANCHOR_PATTERN = "<a[^<]*href[^>]*>"; + private final static String IMG_PATTERN = "<img[^<]*src[^>]*>"; + + private final static String ATTRIBUTE_PATTERN = " *= *[\"']? ?[^ \"'>]* ?[\"']?"; + private final static String HREF_PATTERN = "href" + ATTRIBUTE_PATTERN; + private final static String SRC_PATTERN = "src" + ATTRIBUTE_PATTERN; + private ContentManager cm; public void init() { @@ -38,44 +45,7 @@ } /** - * In the given content, finds a first string of the form: <link ... href=, - * and returns the text inside the reference. - * - * @param content - * String in which to look for the reference. - * @param refName - * Name of the reference. - * @return Text contained in the reference or null if no reference is found. - */ - private String findNextReference(String content, String refName) { - int h; - int start; - if (refName.equals("link")) { - h = content.indexOf(" href="); // search for one of the link types - if (h == -1) { - return null; - } else - start = h; - int begin = content.substring(start).indexOf('"'); - int end = content.substring(start + begin + 1).indexOf('"'); - begin += start; - end += begin; - return content.substring(begin + 1, end + 1); - } else if (refName.equals("image")) { - start = content.indexOf("<img src="); - if (start == -1) - return null; - int begin = content.substring(start).indexOf('"'); - int end = content.substring(start + begin + 1).indexOf('"'); - begin += start; - end += begin; - return content.substring(begin + 1, end + 1); - } else - return null; - } - - /** - * Figures out if a link is qualified for changing: this is the case when + * Figures out if a link shouldn't be changed: this is the case when * either it is an off-site link, or it starts with '/'. This recognizes the most * common protocols by checking how it starts (clears all white space in * case the link starts with '\n' or [space]). @@ -83,12 +53,12 @@ * @author Janne Jalkanen * @author adamw */ - private boolean qualifyLink(String link) { + private boolean isOutsideLink(String link) { link = link.trim(); return link.startsWith("http:") || link.startsWith("ftp:") - || link.startsWith("https:") || link.startsWith("mailto:") - || link.startsWith("news:") || link.startsWith("file:") - || link.startsWith("/"); + || link.startsWith("https:") || link.startsWith("mailto:") + || link.startsWith("news:") || link.startsWith("file:") + || link.startsWith("/"); } // modifies path to page/resource so folder structure can be supported @@ -142,6 +112,31 @@ return mainPath + '/' + element; } + /** + * Prepares a link for transforming - cuts off unnecessary spaces and + * removes any ' or " around it. + * @param link Link to prepare. + * @return A trimmed link with ' and " cut off from the beginning/end. + */ + private String prepareLink(String link) { + link = link.trim(); + + // Cutting off the ' or " from the beginning and end of + // the link. + if (('\'' == link.charAt(0)) || ('\"' == link.charAt(0))) + link = link.substring(1); + + int linkLength = link.length(); + if ((linkLength >= 1) && + (('\'' == link.charAt(linkLength-1)) || + ('\"' == link.charAt(linkLength-1)))) + link = link.substring(0, linkLength-1); + + link = link.trim(); + + return link; + } + public void doView(JBossRenderRequest request, JBossRenderResponse response) throws IOException { response.setContentType("text/html"); @@ -172,205 +167,130 @@ if (pageContent == null) throw new Exception(); - String nextRef; - String nextRef2; + int patternFlags = + Pattern.CASE_INSENSITIVE | + Pattern.DOTALL | + Pattern.MULTILINE; + + Pattern anchor = Pattern.compile(ANCHOR_PATTERN, patternFlags); + Pattern href = Pattern.compile(HREF_PATTERN, patternFlags); + Pattern img = Pattern.compile(IMG_PATTERN, patternFlags); + Pattern src = Pattern.compile(SRC_PATTERN, patternFlags); + + // This should be prepended to all links that want to read + // from file-access. String fileAccessPrepend = "/file-access/" + portalName + "/" - + ProjectsHelper.MEMBERS_DIR + "/" + projectId + "/" - + ProjectsHelper.FREEZONE_DIR + "/"; - while (pageContent.indexOf("HREF=") != -1) { - pageContent = ForgeHelper - .replace(pageContent, "HREF=", "href="); - } + + ProjectsHelper.MEMBERS_DIR + "/" + projectId + "/" + + ProjectsHelper.FREEZONE_DIR + "/"; - while (pageContent.indexOf("<IMG SRC=") != -1) { - pageContent = ForgeHelper.replace(pageContent, "<IMG SRC=", - "<img src="); - } + // REPLACING ANCHORS + Matcher anchorMatcher = anchor.matcher(pageContent); + + // Here we will build the freezone-parsed page content. + StringBuffer replacedPageContent = new StringBuffer(); - // Replacing links - while ((nextRef = findNextReference(pageContent, "link")) != null) { - if (!qualifyLink(nextRef)) { - // it would be relative not outside link - nextRef2 = modifyPath(pagePath, nextRef); - if (nextRef2.endsWith(".png")) { - nextRef2 = fileAccessPrepend + nextRef2 - + "\" target=\"_blank\""; - pageContent = ForgeHelper - .replace(pageContent, "href=" + '"' + nextRef - + '"', "*ref=" + '"' + nextRef2); - } if (nextRef2.endsWith(".css")) { - nextRef2 = fileAccessPrepend + nextRef2 + "\""; - pageContent = ForgeHelper - .replace(pageContent, "href=" + '"' + nextRef - + '"', "*ref=" + '"' + nextRef2); - } else - pageContent = ForgeHelper.replace(pageContent, "href=" - + '"' + nextRef + '"', ProjectsHelper - .createFreezonePageLink(portalName, projectId, - nextRef2 + '"')); + // First we iterate over all anchors. (<a ...>) + while (anchorMatcher.find()) { + String nextAnchor = pageContent.substring( + anchorMatcher.start(), anchorMatcher.end()); + + StringBuffer nextAnchorReplacement; + + // Parsing the anchor to get the href element. + Matcher hrefMatcher = href.matcher(nextAnchor); + if (hrefMatcher.find()) { + // Now we have the href attribute. We must get the + // link from it, and if it is not an outside or / + // link, then transform it to a freezone one. + String nextHref = nextAnchor.substring( + hrefMatcher.start(), hrefMatcher.end()); + + // Getting the proper link from the href. + String link = nextHref.substring(nextHref.indexOf('=')+1); + + link = prepareLink(link); + + // Prepending necessary things to the link. + if (!isOutsideLink(link)) { + link = modifyPath(pagePath, link); + if (link.endsWith(".css")) { + link = fileAccessPrepend + link; + } else if (!((link.contains(".html")) + || (link.contains(".htm")))) { + // Must be an image or other media. + link = fileAccessPrepend + link + + "\" target=\"_blank"; + } else + // Must be a html page. + link = ProjectsHelper + .createFreezonePageLink(portalName, projectId, + link); + } + + // Replacing the old link with a new one. + nextAnchorReplacement = new StringBuffer(); + hrefMatcher.appendReplacement(nextAnchorReplacement, + "href=\"" + link + "\""); + hrefMatcher.appendTail(nextAnchorReplacement); } else { - pageContent = ForgeHelper.replace(pageContent, "href=" - + '"' + nextRef, "$" + nextRef + '"'); + nextAnchorReplacement = new StringBuffer(nextAnchor); } + + anchorMatcher.appendReplacement(replacedPageContent, + nextAnchorReplacement.toString()); } - // Replacing images - while ((nextRef = findNextReference(pageContent, "image")) != null) { - if (!qualifyLink(nextRef)) { - nextRef2 = modifyPath(pagePath, nextRef); - - pageContent = ForgeHelper.replace(pageContent, "<img src=" - + '"' + nextRef + '"', "*img src=" + '"' + fileAccessPrepend - + nextRef2 + '"'); - } else - pageContent = ForgeHelper.replace(pageContent, "<img src=" - + '"' + nextRef + '"', "*img src=" + '"' - + nextRef + '"'); - } + anchorMatcher.appendTail(replacedPageContent); - // fix back internal links - while (pageContent.indexOf("*ref=") != -1) - pageContent = ForgeHelper.replace(pageContent, "*ref=", - " href="); + // REPLACING IMAGES + pageContent = replacedPageContent.toString(); + Matcher imgMatcher = img.matcher(pageContent); - while (pageContent.indexOf(" /portal/index.html?ctrl:id") != -1) - pageContent = ForgeHelper.replace(pageContent, - " /portal/index.html?ctrl:id", " href=" + '"' - + "/portal/index.html?ctrl:id"); + replacedPageContent = new StringBuffer(); - // fix back external links - - while (pageContent.indexOf("$http:") != -1 - || pageContent.indexOf("$ftp:") != -1 - || pageContent.indexOf("$https:") != -1 - || pageContent.indexOf("$file:") != -1 - || pageContent.indexOf("$mailto:") != -1 - || pageContent.indexOf("$news:") != -1) { - pageContent = ForgeHelper.replace(pageContent, "$", - " href=" + '"'); - } - // fix back image links - while (pageContent.indexOf("*img src=") != -1) { - pageContent = ForgeHelper.replace(pageContent, "*img src=", - "<img src="); - } - - response.getWriter().write(pageContent); - } catch (Exception e) { - e.printStackTrace(); - response.getWriter().write( - "The page you requested cannot be accessed "); - } - } - - // - // - // - // - // - - public void test(String portalName, String projectId, String pagePath, - String pageContent) { - try { - String nextRef; - String nextRef2; - String fileAccessPrepend = "/file-access/" + portalName + "/" - + ProjectsHelper.MEMBERS_DIR + "/" + projectId + "/" - + ProjectsHelper.FREEZONE_DIR + "/"; - while (pageContent.indexOf("HREF=") != -1) { - pageContent = pageContent.replace("HREF=", "href="); - } - - while (pageContent.indexOf("<IMG SRC=") != -1) { - pageContent = pageContent.replace("<IMG SRC=", - "<img src="); - } - - // Replacing links - while ((nextRef = findNextReference(pageContent, "link")) != null) { - if (!qualifyLink(nextRef)) { - // it would be relative not outside link - nextRef2 = modifyPath(pagePath, nextRef); - if (nextRef2.endsWith(".png")) { - nextRef2 = fileAccessPrepend + nextRef2 - + "\" target=\"_blank\""; - pageContent = ForgeHelper - .replace(pageContent, "href=" + '"' + nextRef - + '"', "*ref=" + '"' + nextRef2); - } if (nextRef2.endsWith(".css")) { - nextRef2 = fileAccessPrepend + nextRef2 + "\""; - pageContent = pageContent.replace("href=" + '"' + nextRef - + '"', "*ref=" + '"' + nextRef2); - } else - pageContent = pageContent.replace("href=" - + '"' + nextRef + '"', ""); + // Iterating over all image references (<img ...>). + while (imgMatcher.find()) { + String nextImg = pageContent.substring( + imgMatcher.start(), imgMatcher.end()); + + StringBuffer nextImgReplacement; + + // Parsing the image to get the src element. + Matcher srcMatcher = src.matcher(nextImg); + if (srcMatcher.find()) { + String nextSrc = nextImg.substring( + srcMatcher.start(), srcMatcher.end()); + + // Getting the proper link from the src. + String link = nextSrc.substring(nextSrc.indexOf('=')+1); + + link = prepareLink(link); + + // Modifying the link. + if (!isOutsideLink(link)) { + link = modifyPath(pagePath, link); + link = fileAccessPrepend + link; + } + + // Replacing the old link with a new one. + nextImgReplacement = new StringBuffer(); + srcMatcher.appendReplacement(nextImgReplacement, + "src=\"" + link + "\""); + srcMatcher.appendTail(nextImgReplacement); } else { - pageContent = pageContent.replace("href=" - + '"' + nextRef, "$" + nextRef + '"'); + nextImgReplacement = new StringBuffer(nextImg); } + + imgMatcher.appendReplacement(replacedPageContent, + nextImgReplacement.toString()); } - // Replacing images - while ((nextRef = findNextReference(pageContent, "image")) != null) { - if (!qualifyLink(nextRef)) { - nextRef2 = modifyPath(pagePath, nextRef); - - pageContent = pageContent.replace("<img src=" - + '"' + nextRef + '"', "*img src=" + '"' + fileAccessPrepend - + nextRef2 + '"'); - } else - pageContent = pageContent.replace("<img src=" - + '"' + nextRef + '"', "*img src=" + '"' - + nextRef + '"'); - } + imgMatcher.appendTail(replacedPageContent); - // fix back internal links - while (pageContent.indexOf("*ref=") != -1) - pageContent = pageContent.replace("*ref=", - " href="); - - while (pageContent.indexOf(" /portal/index.html?ctrl:id") != -1) - pageContent = pageContent.replace( - " /portal/index.html?ctrl:id", " href=" + '"' - + "/portal/index.html?ctrl:id"); - - // fix back external links - - while (pageContent.indexOf("$http:") != -1 - || pageContent.indexOf("$ftp:") != -1 - || pageContent.indexOf("$https:") != -1 - || pageContent.indexOf("$file:") != -1 - || pageContent.indexOf("$mailto:") != -1 - || pageContent.indexOf("$news:") != -1) { - pageContent = pageContent.replace("$", - " href=" + '"'); - } - // fix back image links - while (pageContent.indexOf("*img src=") != -1) { - pageContent = pageContent.replace("*img src=", - "<img src="); - } + response.getWriter().write(replacedPageContent.toString()); } catch (Exception e) { e.printStackTrace(); + response.getWriter().write("The page you requested cannot be accessed"); } } - - public static void main(String[] argv) throws IOException { - BufferedReader bf = new BufferedReader(new FileReader( - "/home/adamw/portal-content/default/members/jbossejb3/freezone/index.html")); - - StringBuffer sf = new StringBuffer(); - while (true) { - String line = bf.readLine(); - if (line == null) - break; - sf.append(line); - sf.append('\n'); - } - - String pageContent = sf.toString(); - bf.close(); - - new Freezone().test("default", "jbossejb3", "index.html", pageContent); - } } |
From: <jbo...@li...> - 2005-09-20 17:07:19
|
Author: szimano Date: 2005-09-20 13:06:52 -0400 (Tue, 20 Sep 2005) New Revision: 1156 Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSWikiType.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/SubpagesListPlugin.java Modified: trunk/forge/portal-extensions/jbosswiki/build.properties.sample trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java trunk/forge/portal-extensions/jbosswiki/wiki-common/.classpath trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiType.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachmentListPlugin.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/TrailPlugin.java Log: subpages added Modified: trunk/forge/portal-extensions/jbosswiki/build.properties.sample =================================================================== --- trunk/forge/portal-extensions/jbosswiki/build.properties.sample 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/build.properties.sample 2005-09-20 17:06:52 UTC (rev 1156) @@ -1,5 +1,5 @@ # Path to where JBoss AS is to be copied. -local.server.dir=/home/tomek/jboss/jboss +local.server.dir= # Path to where your portal extensions are to be deployed - you shouldn't # have to change that. Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java 2005-09-20 17:06:52 UTC (rev 1156) @@ -126,6 +126,14 @@ wikiSession.setAttribute("hostURL", hostURL); String requestURI = httpRequest.getRequestURI(); + // get off "/wiki/" from the begining + requestURI = requestURI.substring("/wiki/".length()); + + while (requestURI.endsWith("/")) { + // get rid of ending "/" character(s) + requestURI = requestURI.substring(0, requestURI.length() - 1); + } + int version = -1; if (requestURI.matches(".*:\\d+")) { @@ -138,9 +146,35 @@ // Parse URI to get filename and page name String[] tokens = requestURI.split("[/]"); - // System.out.println("length " + tokens.length); + // check if all tokens are UpperCase (meanins they are all wiki + // pages) + boolean isAllUpperCase = true; - if (tokens[tokens.length - 2].equals(WikiCommon.wikiButtons)) { + for (int i = 0; i < tokens.length; i++) + if (!Character.isUpperCase(tokens[i].charAt(0))) { + isAllUpperCase = false; + break; + } + + if (isAllUpperCase) { + String pageName = ""; + + for (int i = 0; i < tokens.length; i++) { + pageName += "/" + tokens[i]; + } + + if (Character.isUpperCase(tokens[tokens.length - 1].charAt(0))) { + httpResponse.sendRedirect(hostURL + wikiHome + "&page=" + + pageName.substring(1) + + ((version != -1) ? "&version=" + version : "")); + } else { + PrintWriter out = httpResponse.getWriter(); + httpResponse.setContentType("text/html"); + out + .println("<html><body><h3>ERROR</h3><br />\nPage name must start with upper case letter.</body></html>"); + } + + } else if (tokens[0].equals(WikiCommon.wikiButtons)) { // show apropriate buttons InputStream imageIS = WikiFileAccessFilter.class .getResourceAsStream("/" + tokens[tokens.length - 1]); @@ -165,96 +199,99 @@ imageIS.close(); } - } else if (tokens.length == 3) { + } else if (Character.isLowerCase(tokens[0].charAt(0))) { + boolean isPageNameUC = true; - if (Character.isUpperCase(tokens[tokens.length - 1].charAt(0))) { - httpResponse.sendRedirect(hostURL + wikiHome + "&page=" - + tokens[tokens.length - 1] - + ((version != -1) ? "&version=" + version : "")); - } else { - PrintWriter out = httpResponse.getWriter(); - httpResponse.setContentType("text/html"); - out - .println("<html><body><h3>ERROR</h3><br />\nPage name must start with upper case letter.</body></html>"); - } + for (int i = 1; i < tokens.length; i++) + if (Character.isLowerCase(tokens[i].charAt(0))) { + isPageNameUC = false; + break; + } - } else { - // get fileName of attachement and page which is connected to - String firstToken = tokens[tokens.length - 2]; - String secondToken = tokens[tokens.length - 1]; + if (isPageNameUC) { + // SHOW wikiType firstToken with page secondToken - if (Character.isUpperCase(firstToken.charAt(0))) { - // Show file of a page - String pageName = firstToken; - String fileName = secondToken; + String wikiTypeName = tokens[0]; - WikiAttachment wikiAttachment; - - if (version == -1) { - wikiAttachment = wikiEngine.getAttachementDataSource() - .getAttachement(pageName, fileName); - } else { - wikiAttachment = wikiEngine.getAttachementDataSource() - .getAttachement(pageName, fileName, version); + // get pageName + String pageName = ""; + for (int i = 1; i < tokens.length; i++) { + pageName += "/" + tokens[i]; } - if (wikiAttachment != null) { - InputStream fileIS = wikiAttachment.getInputStream(); + pageName = pageName.substring(1); - ServletOutputStream os = response.getOutputStream(); + WikiPage page = wikiEngine.getByName(pageName, + new WikiContext("", wikiEngine + .getWikiType(wikiTypeName), wikiSession)); - response.setContentType(mimeTypes - .getContentType(fileName)); - // response.setContentLength((int) fileIS.); + httpResponse.setContentType(wikiEngine + .getWikiType(wikiTypeName).getContentType()); - // Transferring the bytes - try { - byte[] buffer = new byte[BUF_SIZE]; - int read; - while ((read = fileIS.read(buffer)) != -1) - os.write(buffer, 0, read); - } catch (Exception e2) { - // Nothing that we can really do. Just send an - // incomplete - // file. - } finally { - os.close(); - fileIS.close(); - } - } else { - ServletOutputStream os = response.getOutputStream(); + httpResponse.setContentLength(page.getPageContent() + .length()); - response.setContentType("text/html"); + httpResponse.getWriter().print(page.getPageContent()); - os - .println("<html><body><h3>ERROR</h3><br />\nThere is no such file or there is no such version of file</body></html>"); - } + httpResponse.getWriter().flush(); } else { - // SHOW wikiType firstToken with page secondToken + httpResponse.setContentType("text/html"); + httpResponse + .getWriter() + .println( + "<html><body><h3>ERROR</h3><br />\nPage name must start with upper case letter.</body></html>"); + } + } else if (tokens[tokens.length - 1].matches("file:.*")) { + // Show file of a page - String wikiTypeName = firstToken; - String pageName = secondToken; + // get pageName + String pageName = ""; + for (int i = 0; i < tokens.length - 1; i++) { + pageName += "/" + tokens[i]; + } - WikiPage page = wikiEngine.getByName(pageName, - new WikiContext("", wikiEngine - .getWikiType(wikiTypeName), wikiSession)); + String fileName = tokens[tokens.length - 1].substring("file:" + .length()); - PrintWriter out = httpResponse.getWriter(); - httpResponse.setContentType("text/xml"); + WikiAttachment wikiAttachment; - if (Character.isUpperCase(pageName.charAt(0))) { + if (version == -1) { + wikiAttachment = wikiEngine.getAttachementDataSource() + .getAttachement(pageName, fileName); + } else { + wikiAttachment = wikiEngine.getAttachementDataSource() + .getAttachement(pageName, fileName, version); + } - httpResponse.setContentLength(page.getPageContent() - .length()); + if (wikiAttachment != null) { + InputStream fileIS = wikiAttachment.getInputStream(); - out.print(page.getPageContent()); + ServletOutputStream os = response.getOutputStream(); - out.flush(); - } else { - httpResponse.setContentType("text/html"); - out - .println("<html><body><h3>ERROR</h3><br />\nPage name must start with upper case letter.</body></html>"); + response.setContentType(mimeTypes.getContentType(fileName)); + // response.setContentLength((int) fileIS.); + + // Transferring the bytes + try { + byte[] buffer = new byte[BUF_SIZE]; + int read; + while ((read = fileIS.read(buffer)) != -1) + os.write(buffer, 0, read); + } catch (Exception e2) { + // Nothing that we can really do. Just send an + // incomplete + // file. + } finally { + os.close(); + fileIS.close(); } + } else { + ServletOutputStream os = response.getOutputStream(); + + response.setContentType("text/html"); + + os + .println("<html><body><h3>ERROR</h3><br />\nThere is no such file or there is no such version of file</body></html>"); } } } else { Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/.classpath =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/.classpath 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/.classpath 2005-09-20 17:06:52 UTC (rev 1156) @@ -21,8 +21,6 @@ </classpathentry> <classpathentry kind="var" path="MAVEN_REPO/commons-fileupload/jars/commons-fileupload-1.0.jar"> </classpathentry> - <classpathentry kind="var" path="MAVEN_REPO/informa/jars/informa-0.6.0.jar"> - </classpathentry> <classpathentry kind="var" path="MAVEN_REPO/dom4j/jars/dom4j-1.6.jar"> </classpathentry> <classpathentry kind="var" path="MAVEN_REPO/jdom/jars/jdom-1.0.jar"> Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-20 17:06:52 UTC (rev 1156) @@ -13,8 +13,8 @@ <class>org.jboss.wiki.plugins.TrailPlugin</class> </plugin> <plugin> - <name>wikiToHtmlTranslator</name> - <class>org.jboss.wiki.plugins.HTMLTranslator</class> + <name>subPagesList</name> + <class>org.jboss.wiki.plugins.SubpagesListPlugin</class> </plugin> <plugin> <name>attachmentList</name> @@ -24,6 +24,10 @@ <name>friendlyLinks</name> <class>org.jboss.wiki.plugins.FriendlyLinkPlugin</class> </plugin> + <plugin> + <name>wikiToHtmlTranslator</name> + <class>org.jboss.wiki.plugins.HTMLTranslatorParts</class> + </plugin> </wikiType> <wikiType> <name>diff</name> @@ -46,12 +50,12 @@ </plugin> <plugin> <name>wikiToHtmlTranslator</name> - <class>org.jboss.wiki.plugins.HTMLTranslator</class> + <class>org.jboss.wiki.plugins.HTMLTranslatorParts</class> </plugin> </wikiType> <wikiType> <name>rss</name> - <class>org.jboss.wiki.plugins.DefaultWikiType</class> + <class>org.jboss.wiki.plugins.RSSWikiType</class> <plugin> <name>RSSPlugin</name> <class>org.jboss.wiki.plugins.RSSPlugin</class> Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java 2005-09-20 17:06:52 UTC (rev 1156) @@ -18,6 +18,7 @@ import java.util.HashSet; import java.util.Properties; import java.util.Set; +import java.util.TreeSet; /** * <p> @@ -40,7 +41,7 @@ private String pathToAttachments; - //private Properties fileDSProps; + // private Properties fileDSProps; private final int BUF_SIZE = 32768; @@ -50,15 +51,15 @@ Properties fileDSProps = new Properties(); try { - + fileDSProps.load(FileDataSource.class .getResourceAsStream(propFileName)); - + } catch (IOException ioe) { System.err.println("Can't load the file " + propFileName + "\n" + ioe); } - + loadProperties(fileDSProps); } @@ -86,7 +87,8 @@ boolean status = false; - if (pageExists(page.getName())) { // page exists on harddisk - add new + if (pageExists(page.getName())) { // page exists on + // harddisk - add new // version Properties pageProps = getPageProps(page.getName()); @@ -169,6 +171,17 @@ pageWriter.close(); + String pageDirName = pathToMedia; + String[] pageNames = page.getName().split("/"); + + for (int i = 0; i < pageNames.length - 1; i++) { + pageDirName += "/" + pageNames[i]; + } + + File pageDir = new File(pageDirName); + + pageDir.mkdirs(); + pageWriter = new FileOutputStream(new File(pathToMedia + "/" + page.getName() + ".txt")); @@ -223,7 +236,8 @@ pagePropsFile.createNewFile(); if (pageExists(pageName)) { - // if page exists it looks like there is lack of the props structure + // if page exists it looks like there is lack of the props + // structure FileOutputStream fpo = new FileOutputStream(pagePropsFile); pageProps.setProperty("1.author", "unknown"); @@ -241,15 +255,21 @@ return pageProps; } - public Properties getAttProps(String pageName, String attName) { + public Properties getAttProps(String pageName, String attName, + boolean createProps) { Properties attProps = new Properties(); File propFile = new File(pathToAttachments + "/" + pageName + "-att/" + attName + "-dir/"); if (!propFile.exists()) { - // create dirs for this property file - propFile.mkdirs(); + + if (createProps) { + // create dirs for this property file + propFile.mkdirs(); + } else { + return null; + } } propFile = new File(pathToAttachments + "/" + pageName + "-att/" @@ -326,8 +346,9 @@ System.err.println(ioe); } - page = new WikiPage(pageName, author, pageContent.toString(), - i, i, new Date(pageFile.lastModified()), this, this); + page = new WikiPage(pageName, author, pageContent + .toString(), i, i, new Date(pageFile.lastModified()), + this, this); page.setLength(pageFile.length()); } @@ -385,7 +406,8 @@ getContentAtVersion(page, loadContent, version); - page.setLastAuthor(getAuthorAtVersion(page.getName(), version)); + page.setLastAuthor(getAuthorAtVersion(page.getName(), + version)); page.setVersion(version); @@ -452,6 +474,7 @@ } public boolean pageExists(String pageName) { + File pageFile = new File(pathToMedia + "/" + pageName + ".txt"); if (pageFile.exists()) { @@ -464,7 +487,7 @@ public void addAtachement(File attFile, String attName, WikiPage page, String user) { String pageName = page.getName(); - Properties attProps = getAttProps(pageName, attName); + Properties attProps = getAttProps(pageName, attName, true); int lastVersion = 1; @@ -565,17 +588,23 @@ } public WikiAttachment getAttachement(String pageName, String attachementName) { - return getAttachement(pageName, attachementName, getLastAttachementVersion(pageName, attachementName)); + return getAttachement(pageName, attachementName, + getLastAttachementVersion(pageName, attachementName)); } - public WikiAttachment getAttachement(String pageName, String attachementName, int version) { - + public WikiAttachment getAttachement(String pageName, + String attachementName, int version) { + String[] tokens = attachementName.split("\\."); + + Properties props = getAttProps(pageName, attachementName, false); - Properties props = getAttProps(pageName, attachementName); - - String user = props.getProperty(version+".author"); - + if (props == null) { + return null; + } + + String user = props.getProperty(version + ".author"); + File file = new File( pathToAttachments + "/" @@ -587,25 +616,31 @@ + "." + ((attachementName.indexOf(".") != -1) ? tokens[tokens.length - 1] : "bin")); - - return new WikiAttachment(attachementName,new Date(file.lastModified()),user,file.length(),file,version); + + return new WikiAttachment(attachementName, + new Date(file.lastModified()), user, file.length(), file, + version); } public int getLastAttachementVersion(String pageName, String attachementName) { + + Properties props = getAttProps(pageName, attachementName, false); + + if (props == null) + return -1; - Properties props = getAttProps(pageName, attachementName); - - // looking for the newest version + // looking for the newest version int version = 1; while (props.getProperty((version + 1) + ".author") != null) { version++; } - + return version; } - - public long getAttachementSize(String pageName, String attachementName, int version) { + + public long getAttachementSize(String pageName, String attachementName, + int version) { String[] tokens = attachementName.split("\\."); File file = new File( @@ -619,8 +654,32 @@ + "." + ((attachementName.indexOf(".") != -1) ? tokens[tokens.length - 1] : "bin")); - + return file.length(); } + public Set<String> getPagesFor(String pageName) { + Set<String> pages = new TreeSet<String>(); + + File pageDir = new File(pathToAttachments + "/" + pageName); + + if ((pageDir.exists()) && (pageDir.isDirectory())) { + File[] subFiles = pageDir.listFiles(); + + for (int i = 0; i < subFiles.length; i++) { + if ((subFiles[i].isFile()) + && (subFiles[i].getName().endsWith(".txt"))) { + pages.add(pageName + + "/" + + subFiles[i].getName().substring( + 0, + subFiles[i].getName().length() + - ".txt".length())); + } + } + } + + return pages; + } + } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java 2005-09-20 17:06:52 UTC (rev 1156) @@ -83,6 +83,8 @@ int version); public Set<String> getAllPageNames(); + + public Set<String> getPagesFor(String pageName); } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-20 17:06:52 UTC (rev 1156) @@ -84,7 +84,6 @@ } public boolean pageExists(String pageName) { - return mediaDataSource.pageExists(pageName); } @@ -392,4 +391,8 @@ public AttchementDataSource getAttachementDataSource() { return attachementDataSource; } + + public Set<String> getPagesFor(String pageName) { + return mediaDataSource.getPagesFor(pageName); + } } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiType.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiType.java 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiType.java 2005-09-20 17:06:52 UTC (rev 1156) @@ -115,4 +115,8 @@ public void setWikiEngine(WikiEngine wikiEngine) { this.wikiEngine = wikiEngine; } + + public String getContentType() { + return "text/html"; + } } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachmentListPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachmentListPlugin.java 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachmentListPlugin.java 2005-09-20 17:06:52 UTC (rev 1156) @@ -41,7 +41,7 @@ newContent += "\n<hr />\n<h3>Attachments:</h3>\n<table border='0'>"; for (String file : attachements) { - String href = host+newPage.getName() + "/" + file; + String href = host+newPage.getName() + "/file:" + file; newContent += "<tr><td><a href=\""+href+"\">"+href + "</a></td>"; newContent += "<td><a href=\""+fileEditURL+"&var1="+file+"\" ><img border=\"0\" src=\""+host+WikiCommon.wikiButtons+"/historyButton.png\" /></a></td></tr>\n"; } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-20 17:06:52 UTC (rev 1156) @@ -361,7 +361,12 @@ case '<': s = m_allowHTML ? "<" : "<"; break; - + + //TODO this should be changed somehow to make paes XML compatible (change & to & if it is standalone &) + /*case '&': + s = "&"; + break;*/ + case '>': s = m_allowHTML ? ">" : ">"; break; @@ -847,7 +852,7 @@ // check if not an image link as well else if (checkImageLink(link)) { - result = "<img src=\"" + imagePath + "/" + pageName + "/" + result = "<img src=\"" + imagePath + "/" + pageName + "/file:" + link + "\" alt=\"" + text + "\" />"; } @@ -935,7 +940,7 @@ // for (int i = 0; i < clean.length(); i++) { - if (!(Character.isLetterOrDigit(clean.charAt(i)) + if ((clean.charAt(i) != '/')&&!(Character.isLetterOrDigit(clean.charAt(i)) || clean.charAt(i) == '_' || clean.charAt(i) == '.')) { clean.deleteCharAt(i); --i; // We just shortened this buffer. @@ -971,8 +976,7 @@ public void next() { } - public WikiPage process(final WikiPage wikiPage, WikiSession wikiSession) { - WikiPage newPage = null; + public void initTranslator() { m_allowHTML = false; m_isbold = false; m_isitalic = false; @@ -985,6 +989,10 @@ m_camelCaseLinks = true; // camelCase enabled /** Tag that gets closed at EOL. */ m_closeTag = null; + } + + public WikiPage process(final WikiPage wikiPage, WikiSession wikiSession) { + WikiPage newPage = null; portalHome = (String) wikiSession.getAttribute("hostURL") + (String) wikiSession.getAttribute("actionURL"); @@ -1012,13 +1020,16 @@ int lastBegIndx = 0; while ((lastBegIndx = newPageContent.indexOf(pagePartRegexStart, lastBegIndx)) != -1) { + + initTranslator(); + int endIndx = newPageContent.indexOf(pagePartRegexEnd, lastBegIndx); if (endIndx != -1) { String pagePart = newPageContent.substring(lastBegIndx + pagePartRegexStart.length(), endIndx); - String replace = parseLinks(pagePart).replaceAll("&", "&"); + String replace = parseLinks(pagePart)/*.replaceAll("&", "&")*/; newPageContent = newPageContent.substring(0, lastBegIndx) + replace Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSWikiType.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSWikiType.java 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSWikiType.java 2005-09-20 17:06:52 UTC (rev 1156) @@ -0,0 +1,10 @@ +package org.jboss.wiki.plugins; + +import org.jboss.wiki.WikiType; + +public class RSSWikiType extends WikiType { + + public String getContentType() { + return "text/xml"; + } +} Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/SubpagesListPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/SubpagesListPlugin.java 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/SubpagesListPlugin.java 2005-09-20 17:06:52 UTC (rev 1156) @@ -0,0 +1,38 @@ +package org.jboss.wiki.plugins; + +import java.util.Set; + +import org.jboss.wiki.WikiPage; +import org.jboss.wiki.WikiPlugin; +import org.jboss.wiki.WikiSession; + +public class SubpagesListPlugin extends WikiPlugin { + + @Override + public WikiPage process(WikiPage wikiPage, WikiSession wikiSession) { + StringBuilder subpageList = new StringBuilder(wikiPage.getPageContent()+"\n"); + + subpageList.append(HTMLTranslatorParts.pagePartRegexStart).append("----\n!!Subpages list:\\\\\n"); + + Set<String> subPages = wikiEngine.getPagesFor(wikiPage.getName()); + + for (String page : subPages) { + subpageList.append("[").append(page).append("]\\\\\n"); + } + + subpageList.append(HTMLTranslatorParts.pagePartRegexEnd); + + if (subPages.size() > 0 ) { + wikiPage.setPageContent(subpageList.toString()); + } + + return wikiPage; + } + + @Override + public void init() { + // TODO Auto-generated method stub + + } + +} Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/TrailPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/TrailPlugin.java 2005-09-20 14:20:15 UTC (rev 1155) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/TrailPlugin.java 2005-09-20 17:06:52 UTC (rev 1156) @@ -31,7 +31,7 @@ wikiSession.setAttribute("TRAIL", trail); - newPage.setPageContent("Your trail: "+trail+"\n----\n"+newPage.getContent()); + newPage.setPageContent(HTMLTranslatorParts.pagePartRegexStart+"Your trail: "+trail+"\n----\n"+newPage.getContent()+HTMLTranslatorParts.pagePartRegexEnd); return newPage; } |
From: <jbo...@li...> - 2005-09-20 14:20:42
|
Author: mla...@jb... Date: 2005-09-20 10:20:15 -0400 (Tue, 20 Sep 2005) New Revision: 1155 Added: trunk/labs/jbossweb/xdocs/images/design/jbosswebarch.png trunk/labs/jbossweb/xdocs/sources/jbosswebarch.vsd Modified: trunk/labs/jbossweb/xdocs/images/design/jbosswebblockda.png trunk/labs/jbossweb/xdocs/images/design/tcnativeblockda.png trunk/labs/jbossweb/xdocs/index.xml trunk/labs/jbossweb/xdocs/reference/arch.xml trunk/labs/jbossweb/xdocs/reference/arch01.xml trunk/labs/jbossweb/xdocs/sources/jbosswebblockda.vsd trunk/labs/jbossweb/xdocs/sources/tcnativeblockda.vsd Log: Update architecture model Added: trunk/labs/jbossweb/xdocs/images/design/jbosswebarch.png =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/images/design/jbosswebarch.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/labs/jbossweb/xdocs/images/design/jbosswebblockda.png =================================================================== (Binary files differ) Modified: trunk/labs/jbossweb/xdocs/images/design/tcnativeblockda.png =================================================================== (Binary files differ) Modified: trunk/labs/jbossweb/xdocs/index.xml =================================================================== --- trunk/labs/jbossweb/xdocs/index.xml 2005-09-20 08:00:08 UTC (rev 1154) +++ trunk/labs/jbossweb/xdocs/index.xml 2005-09-20 14:20:15 UTC (rev 1155) @@ -33,12 +33,10 @@ performance hybrid technology that incorporates the best of the most recent OS technologies for processing high volume data, while keeping all the reference Java specifications. It supports both in and out of -the process execution of CGI and PHP scripts, and together with new -AJP 1.4 protocol offers a scalable loadbalancing solutions for high -availability applications. The hybrid technology model offers the best -from threading and event processing models, and that makes the JBoss -Web Server one of the fastest and most scalable web servers -in the market. +the process execution of CGI and PHP scripts, as well as .NET applications. +The hybrid technology model offers the best from threading and event +processing models, and that makes the JBoss Web Server one of the fastest +and most scalable web servers in the market. </p> <p> <image src="/images/tomcat_pb.gif"/> Modified: trunk/labs/jbossweb/xdocs/reference/arch.xml =================================================================== --- trunk/labs/jbossweb/xdocs/reference/arch.xml 2005-09-20 08:00:08 UTC (rev 1154) +++ trunk/labs/jbossweb/xdocs/reference/arch.xml 2005-09-20 14:20:15 UTC (rev 1155) @@ -17,7 +17,9 @@ <p>JBoss Web Server is based on the <a href="http://tomcat.apache.org">Apache Tomcat</a>. </p> - <figure src="/images/design/jbosswebblockda.png" name="Figure 1" text="JBossWeb architecture"/> + <figure src="/images/design/jbosswebarch.png" name="Figure 1" text="JBossWeb architecture"/> + <br/> + <figure src="/images/design/jbosswebblockda.png" name="Figure 2" text="JBossWeb extensions"/> </section> </body> </document> Modified: trunk/labs/jbossweb/xdocs/reference/arch01.xml =================================================================== --- trunk/labs/jbossweb/xdocs/reference/arch01.xml 2005-09-20 08:00:08 UTC (rev 1154) +++ trunk/labs/jbossweb/xdocs/reference/arch01.xml 2005-09-20 14:20:15 UTC (rev 1155) @@ -17,7 +17,7 @@ <p>Tomcat Native uses <a href="http://apr.apache.org">APR</a> and <a href="http://www.openssl.org">OpenSSL</a> </p> - <figure src="/images/design/tcnativeblockda.png" name="Figure 2" text="Tomcat Native"/> + <figure src="/images/design/tcnativeblockda.png" name="Figure 3" text="Tomcat Native"/> </section> </body> </document> Added: trunk/labs/jbossweb/xdocs/sources/jbosswebarch.vsd =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/sources/jbosswebarch.vsd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/labs/jbossweb/xdocs/sources/jbosswebblockda.vsd =================================================================== (Binary files differ) Modified: trunk/labs/jbossweb/xdocs/sources/tcnativeblockda.vsd =================================================================== (Binary files differ) |
From: <jbo...@li...> - 2005-09-20 08:00:19
|
Author: aron.gombas Date: 2005-09-20 04:00:08 -0400 (Tue, 20 Sep 2005) New Revision: 1154 Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/AbstractKosmosService.java trunk/labs/kosmos/web-server/WEB-INF/web.xml Log: Support for HTTPS, overrideable client URLs added Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/AbstractKosmosService.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/AbstractKosmosService.java 2005-09-20 06:52:07 UTC (rev 1153) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/AbstractKosmosService.java 2005-09-20 08:00:08 UTC (rev 1154) @@ -15,6 +15,7 @@ import java.util.Map; import org.apache.commons.httpclient.HttpURL; +import org.apache.commons.httpclient.HttpsURL; import org.apache.commons.httpclient.URIException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -100,27 +101,37 @@ * the absolute URL pointing to the resulted file. */ protected String saveCachedFile(String filename, InputStream in) throws URIException, IOException { - // determine server-side cache path and cache URL + // grab parameters String url = ctx.getServletContext().getInitParameter("webdav.url"); String user = ctx.getServletContext().getInitParameter("webdav.user"); String password = ctx.getServletContext().getInitParameter("webdav.password"); + String clientUrl = ctx.getServletContext().getInitParameter("webdav.clientUrl"); + log.debug(String.format("Connecting to \"%s\" as \"%s\" (\"%s\")...", url, user, password)); if((url == null) || (url.trim().length() == 0)) throw new IllegalStateException("'webdav.url' was not specified as servlet-context init-params"); - HttpURL webdavUrl = new HttpURL(url); - if((user != null) && (user.trim().length() != 0)) - webdavUrl.setUser(user); - if((password != null) && (password.trim().length() != 0)) - webdavUrl.setPassword(password); + // determine server-side cache path and cache URL + boolean isHttps = url.startsWith("https://"); + HttpURL webdavUrl = isHttps ? new HttpsURL(url) : new HttpURL(url); + if (!isHttps) {// TODO check this -> If you use the setUser method with a HttpsUrl, a NPE is thrown, in the string's init, somewhere from HttpClient - maybe that's a bug there? + if((user != null) && (user.trim().length() != 0)) + webdavUrl.setUser(user); + if((password != null) && (password.trim().length() != 0)) + webdavUrl.setPassword(password); + } + // use "webdav.url" if "webdav.clientUrl" was not specified + if((clientUrl == null) || (clientUrl.trim().length() == 0)) + clientUrl = webdavUrl.getURI(); + String cacheDirPath = webdavUrl.getPath() + "/kosmos-cache/"; String cachedFilePath = cacheDirPath + filename; - String cachedFileUrl = webdavUrl.getURI() + "/kosmos-cache/" + URLEncoder.encode(filename, "utf-8"); + String cachedFileUrl = clientUrl + "/kosmos-cache/" + URLEncoder.encode(filename, "utf-8"); // create WebDAV dir if not existing - WebdavResource webdavResource = new WebdavResource(webdavUrl); - // TODO check if the dir was not existing yet - webdavResource.mkcolMethod(cacheDirPath); + WebdavResource webdavResource = new WebdavResource(webdavUrl); // TODO check if the dir was not existing yet + if (!isHttps) // using this with https throws an exception + webdavResource.mkcolMethod(cacheDirPath); // put resource to WebDAV log.debug(String.format("Putting WebDAV resource \"%s\"...", cachedFilePath)); Modified: trunk/labs/kosmos/web-server/WEB-INF/web.xml =================================================================== --- trunk/labs/kosmos/web-server/WEB-INF/web.xml 2005-09-20 06:52:07 UTC (rev 1153) +++ trunk/labs/kosmos/web-server/WEB-INF/web.xml 2005-09-20 08:00:08 UTC (rev 1154) @@ -4,10 +4,12 @@ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> +<!-- $Id$ --> <web-app> <display-name>Kosmos services servlet</display-name> <description>Server component of Kosmos</description> - + + <!-- Both HTTP and HTTPS protocol can be used here. --> <context-param> <param-name>webdav.url</param-name> <param-value>http://localhost:8080/slide/files</param-value> @@ -20,7 +22,15 @@ <param-name>webdav.password</param-name> <param-value></param-value> </context-param> - + <!-- This URL will be used as base URL for the generated images. + If you don't specify anything here, the value of "webdav.url" + will be used. Uncomment this, if you want to override that. + <context-param> + <param-name>webdav.clientUrl</param-name> + <param-value>http://myserver/my-webdav/kosmos/images</param-value> + </context-param> + --> + <servlet> <servlet-name>kosmos-services</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
From: <jbo...@li...> - 2005-09-20 06:52:16
|
Author: aron.gombas Date: 2005-09-20 02:52:07 -0400 (Tue, 20 Sep 2005) New Revision: 1153 Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java Log: Minor refactoring Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java 2005-09-20 06:42:52 UTC (rev 1152) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java 2005-09-20 06:52:07 UTC (rev 1153) @@ -144,13 +144,11 @@ public Set<String> committersLast31Days = new HashSet<String>(); /* No of commits per author. */ - public Map<String,Integer> commitsPerAuthorMap = new TreeMap<String,Integer>(); -public List<Map.Entry<String,Integer>> commitsPerAuthor;// TODO write comment + public List<Map.Entry<String,Integer>> commitsPerAuthor; public String commitsPerAuthorChartUrl; /* No of commits per file. */ - public Map<String,Integer> commitsPerFileMap = new TreeMap<String,Integer>(); -public List<Map.Entry<String,Integer>> commitsPerFile;// TODO write comment + public List<Map.Entry<String,Integer>> commitsPerFile; public String commitsPerFileChartUrl; /* No of commits per week. */ @@ -162,11 +160,7 @@ public String repoEntriesPerWeekChartUrl; /** Must be called to validate its content, after the processing was done. */ - public void validate() { - // sort maps - commitsPerAuthor = (List<Map.Entry<String, Integer>>)ChartUtils.intValuedMapToSortedList(commitsPerAuthorMap); - commitsPerFile = (List<Map.Entry<String, Integer>>)ChartUtils.intValuedMapToSortedList(commitsPerFileMap); - + public void validate() { // revert history Collections.reverse(commits); @@ -185,9 +179,6 @@ calculatedCommitsTotal += commitsPerWeek.getDataItem(i).getValue().intValue(); if(calculatedCommitsTotal != commitsTotal) throw new IllegalStateException(String.format("Calculated commits (%d) does not equal statistical commits (%d)", calculatedCommitsTotal, commitsTotal)); - // TODO check this one, too, there is still some problem (bug) with it - if(repoEntriesPerWeek.getItemCount() > 0) - System.out.println(" =============== calculated no of files: " + repoEntriesPerWeek.getDataItem(repoEntriesPerWeek.getItemCount() - 1).getValue().intValue()); } } @@ -201,6 +192,8 @@ // analyze long now = new Date().getTime(); + Map<String,Integer> commitsPerAuthorMap = new TreeMap<String,Integer>(); + Map<String,Integer> commitsPerFileMap = new TreeMap<String,Integer>(); for(SVNLogEntry logEntry : logEntries) { // skip invalid entries if(logEntry.getAuthor() == null) { @@ -236,8 +229,8 @@ } // count commits-per-author - Integer commitsPerCurrentAuthor = stats.commitsPerAuthorMap.get(logEntry.getAuthor()); - stats.commitsPerAuthorMap.put(logEntry.getAuthor(), (commitsPerCurrentAuthor == null) ? 1 : commitsPerCurrentAuthor + 1); + Integer commitsPerCurrentAuthor = commitsPerAuthorMap.get(logEntry.getAuthor()); + commitsPerAuthorMap.put(logEntry.getAuthor(), (commitsPerCurrentAuthor == null) ? 1 : commitsPerCurrentAuthor + 1); // count commits-per-week Week commitWeek = new Week(logEntry.getDate()); @@ -254,8 +247,8 @@ SVNLogEntryPath logEntryPath = (SVNLogEntryPath)changedPaths.get(it.next()); // count commits-per-file - Integer commitsPerCurrentFile = stats.commitsPerFileMap.get(logEntryPath.getPath()); - stats.commitsPerFileMap.put(logEntryPath.getPath(), (commitsPerCurrentFile == null) ? 1 : commitsPerCurrentFile + 1); + Integer commitsPerCurrentFile = commitsPerFileMap.get(logEntryPath.getPath()); + commitsPerFileMap.put(logEntryPath.getPath(), (commitsPerCurrentFile == null) ? 1 : commitsPerCurrentFile + 1); // count files-per-week TimeSeriesDataItem repoEntriesPerCurrentWeek = stats.repoEntriesPerWeek.getDataItem(commitWeek); @@ -269,6 +262,8 @@ } // validate + stats.commitsPerAuthor = ChartUtils.intValuedMapToSortedList(commitsPerAuthorMap); + stats.commitsPerFile = ChartUtils.intValuedMapToSortedList(commitsPerFileMap); stats.validate(); return stats; |
From: <jbo...@li...> - 2005-09-20 06:43:10
|
Author: aron.gombas Date: 2005-09-20 02:42:52 -0400 (Tue, 20 Sep 2005) New Revision: 1152 Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/sf/sfmonitoringportlet.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/sf/sfmonitoringportlet_hu.properties trunk/labs/kosmos/web-portlet/pages/cc_monitoring_help.jsp trunk/labs/kosmos/web-portlet/pages/jira_monitoring_help.jsp trunk/labs/kosmos/web-portlet/pages/sf_monitoring_help.jsp trunk/labs/kosmos/web-portlet/pages/svn_monitoring_help.jsp Log: "Back" added to HELP screens Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/sf/sfmonitoringportlet.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/sf/sfmonitoringportlet.properties 2005-09-19 12:06:11 UTC (rev 1151) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/sf/sfmonitoringportlet.properties 2005-09-20 06:42:52 UTC (rev 1152) @@ -16,3 +16,4 @@ lastupdate=Last Update action.refresh=Refresh +action.back=Back Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/sf/sfmonitoringportlet_hu.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/sf/sfmonitoringportlet_hu.properties 2005-09-19 12:06:11 UTC (rev 1151) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/sf/sfmonitoringportlet_hu.properties 2005-09-20 06:42:52 UTC (rev 1152) @@ -16,3 +16,4 @@ lastupdate=Utolsisss action.refresh=Friss+action.back=Vissza Modified: trunk/labs/kosmos/web-portlet/pages/cc_monitoring_help.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/cc_monitoring_help.jsp 2005-09-19 12:06:11 UTC (rev 1151) +++ trunk/labs/kosmos/web-portlet/pages/cc_monitoring_help.jsp 2005-09-20 06:42:52 UTC (rev 1152) @@ -10,3 +10,7 @@ <%@include file="includes/legend.jsp"%> <%@include file="includes/about.jsp"%> + +<form action="<portlet:renderURL portletMode="view"/>" method="post"> + <input type="submit" class="portlet-form-button" name="submit" value="<fmt:message key="action.back"/>"/> +</form> Modified: trunk/labs/kosmos/web-portlet/pages/jira_monitoring_help.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/jira_monitoring_help.jsp 2005-09-19 12:06:11 UTC (rev 1151) +++ trunk/labs/kosmos/web-portlet/pages/jira_monitoring_help.jsp 2005-09-20 06:42:52 UTC (rev 1152) @@ -9,3 +9,7 @@ <%@include file="includes/legend.jsp"%> <%@include file="includes/about.jsp"%> + +<form action="<portlet:renderURL portletMode="view"/>" method="post"> + <input type="submit" class="portlet-form-button" name="submit" value="<fmt:message key="action.back"/>"/> +</form> Modified: trunk/labs/kosmos/web-portlet/pages/sf_monitoring_help.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/sf_monitoring_help.jsp 2005-09-19 12:06:11 UTC (rev 1151) +++ trunk/labs/kosmos/web-portlet/pages/sf_monitoring_help.jsp 2005-09-20 06:42:52 UTC (rev 1152) @@ -10,3 +10,7 @@ <%@include file="includes/legend.jsp"%> <%@include file="includes/about.jsp"%> + +<form action="<portlet:renderURL portletMode="view"/>" method="post"> + <input type="submit" class="portlet-form-button" name="submit" value="<fmt:message key="action.back"/>"/> +</form> Modified: trunk/labs/kosmos/web-portlet/pages/svn_monitoring_help.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/svn_monitoring_help.jsp 2005-09-19 12:06:11 UTC (rev 1151) +++ trunk/labs/kosmos/web-portlet/pages/svn_monitoring_help.jsp 2005-09-20 06:42:52 UTC (rev 1152) @@ -9,3 +9,7 @@ <%@include file="includes/legend.jsp"%> <%@include file="includes/about.jsp"%> + +<form action="<portlet:renderURL portletMode="view"/>" method="post"> + <input type="submit" class="portlet-form-button" name="submit" value="<fmt:message key="action.back"/>"/> +</form> |
From: <jbo...@li...> - 2005-09-19 12:06:17
|
Author: aron.gombas Date: 2005-09-19 08:06:11 -0400 (Mon, 19 Sep 2005) New Revision: 1151 Modified: trunk/labs/kosmos/web-portlet/pages/jira_monitoring_issue_details.jsp Log: Renaming Modified: trunk/labs/kosmos/web-portlet/pages/jira_monitoring_issue_details.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/jira_monitoring_issue_details.jsp 2005-09-19 11:56:23 UTC (rev 1150) +++ trunk/labs/kosmos/web-portlet/pages/jira_monitoring_issue_details.jsp 2005-09-19 12:06:11 UTC (rev 1151) @@ -35,7 +35,7 @@ <td><img src="<c:out value="${project.openIssuesPerAssigneeChartUrl}"/>" title="<fmt:message key="jiraproject.openIssuesByAssignee"/>"/></td> <td valign="top"> <table> - <c:forEach var="item" items="${project.issuesPerAssignee}" varStatus="status"> + <c:forEach var="item" items="${project.openIssuesPerAssignee}" varStatus="status"> <c:if test="${status.index < 8}"> <tr class="portlet-section-body"> <td><c:out value="${1 + status.index}"/></td> |
From: <jbo...@li...> - 2005-09-19 11:56:40
|
Author: aron.gombas Date: 2005-09-19 07:56:23 -0400 (Mon, 19 Sep 2005) New Revision: 1150 Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/JiraProject.java trunk/labs/kosmos/src/java/hu/midori/kosmos/model/SvnRepository.java trunk/labs/kosmos/src/java/hu/midori/kosmos/server/jira/JiraServiceImpl.java trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java trunk/labs/kosmos/src/java/hu/midori/kosmos/server/util/ChartUtils.java Log: KOSMOS-17 issue fixed Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/JiraProject.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/model/JiraProject.java 2005-09-19 10:10:48 UTC (rev 1149) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/model/JiraProject.java 2005-09-19 11:56:23 UTC (rev 1150) @@ -45,7 +45,7 @@ private int optionalOpenIssues = 0; /** Open-issues-per-assignee sorted by issues in descending order. */ - private List<Map.Entry<String,Integer>> issuesPerAssignee; + private List<Map.Entry<String,Integer>> openIssuesPerAssignee; /** URL of the issues-per-status chart image. */ private String issuesPerStatusChartUrl; @@ -62,7 +62,11 @@ super(null); } - public JiraProject(String name, String url, String key, String projectUrl, String description, String lead, int openIssues, int codingInProgressIssues, int reopenedIssues, int resolvedIssues, int closedIssues, int blockerOpenIssues, int criticalOpenIssues, int majorOpenIssues, int minorOpenIssues, int trivialOpenIssues, int optionalOpenIssues, List<Map.Entry<String,Integer>> issuesPerAssignee, String issuesPerStatusChartUrl, String openIssuesPerPriorityChartUrl, String openIssuesPerAssigneeChartUrl) { + public JiraProject(String name, String url, String key, String projectUrl, String description, String lead, + int openIssues, int codingInProgressIssues, int reopenedIssues, int resolvedIssues, int closedIssues, + int blockerOpenIssues, int criticalOpenIssues, int majorOpenIssues, int minorOpenIssues, int trivialOpenIssues, int optionalOpenIssues, + List<Map.Entry<String,Integer>> openIssuesPerAssignee, + String issuesPerStatusChartUrl, String openIssuesPerPriorityChartUrl, String openIssuesPerAssigneeChartUrl) { super(name + url + key + projectUrl); this.name = name; @@ -85,7 +89,7 @@ this.trivialOpenIssues = trivialOpenIssues; this.optionalOpenIssues = optionalOpenIssues; - this.issuesPerAssignee = issuesPerAssignee; + this.openIssuesPerAssignee = openIssuesPerAssignee; this.issuesPerStatusChartUrl = issuesPerStatusChartUrl; this.openIssuesPerPriorityChartUrl = openIssuesPerPriorityChartUrl; @@ -160,8 +164,8 @@ return optionalOpenIssues; } - public List<Map.Entry<String,Integer>> getIssuesPerAssignee() { - return issuesPerAssignee; + public List<Map.Entry<String,Integer>> getOpenIssuesPerAssignee() { + return openIssuesPerAssignee; } public String getIssuesPerStatusChartUrl() { @@ -182,6 +186,6 @@ @Override public String toString() { - return String.format("%s [%s] (%s), %s, %s, %s, %d/%d/%d/%d/%d, %d/%d/%d/%d/%d/%d, %s, %s, %s, %s", name, url, key, projectUrl, description, lead, openIssues, codingInProgressIssues, reopenedIssues, resolvedIssues, closedIssues, blockerOpenIssues, criticalOpenIssues, majorOpenIssues, minorOpenIssues, trivialOpenIssues, optionalOpenIssues, issuesPerAssignee, issuesPerStatusChartUrl, openIssuesPerPriorityChartUrl, openIssuesPerAssigneeChartUrl); + return String.format("%s [%s] (%s), %s, %s, %s, %d/%d/%d/%d/%d, %d/%d/%d/%d/%d/%d, %s, %s, %s, %s", name, url, key, projectUrl, description, lead, openIssues, codingInProgressIssues, reopenedIssues, resolvedIssues, closedIssues, blockerOpenIssues, criticalOpenIssues, majorOpenIssues, minorOpenIssues, trivialOpenIssues, optionalOpenIssues, openIssuesPerAssignee, issuesPerStatusChartUrl, openIssuesPerPriorityChartUrl, openIssuesPerAssigneeChartUrl); } } Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/SvnRepository.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/model/SvnRepository.java 2005-09-19 10:10:48 UTC (rev 1149) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/model/SvnRepository.java 2005-09-19 11:56:23 UTC (rev 1150) @@ -74,7 +74,13 @@ super(null); } - public SvnRepository(String location, long revision, Date createdDate, List<ScmRepositoryChange> commits, int commitsTotal, int commitsToday, int commitsLast7Days, int commitsLast31Days, int committersTotal, int committersToday, int committersLast7Days, int committersLast31Days, String commitsPerAuthorChartUrl, String commitsPerFileChartUrl, String commitsPerWeekChartUrl, String repoEntriesPerWeekChartUrl, int dirs, int files, int totalFileSize, List<Map.Entry<String,Integer>> commitsPerAuthor, List<Map.Entry<String,Integer>> commitsPerFile) { + public SvnRepository(String location, long revision, + Date createdDate, List<ScmRepositoryChange> commits, + int commitsTotal, int commitsToday, int commitsLast7Days, int commitsLast31Days, + int committersTotal, int committersToday, int committersLast7Days, int committersLast31Days, + String commitsPerAuthorChartUrl, String commitsPerFileChartUrl, String commitsPerWeekChartUrl, String repoEntriesPerWeekChartUrl, + int dirs, int files, int totalFileSize, + List<Map.Entry<String,Integer>> commitsPerAuthor, List<Map.Entry<String,Integer>> commitsPerFile) { super(location + revision + commits.get(0).getDate()); this.location = location; Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/jira/JiraServiceImpl.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/jira/JiraServiceImpl.java 2005-09-19 10:10:48 UTC (rev 1149) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/jira/JiraServiceImpl.java 2005-09-19 11:56:23 UTC (rev 1150) @@ -208,7 +208,7 @@ } // scrape issue assignees - Map<String, Integer> openIssuesPerAssignee = new HashMap<String, Integer>(); + Map<String, Integer> openIssuesPerAssigneeMap = new HashMap<String, Integer>(); for(Iterator itIssueAssignee = resultIssueAssignee.iterator(); itIssueAssignee.hasNext();) { String valueIssueAssignee = ((NodeInfo)itIssueAssignee.next()).getStringValue(); log.debug(String.format("Scraped issue assignee: \"%s\"", valueIssueAssignee)); @@ -216,51 +216,56 @@ StringTokenizer tokenizerIssueAssignee = new StringTokenizer(valueIssueAssignee, "|"); String assignee = tokenizerIssueAssignee.nextToken(); int count = Integer.parseInt(tokenizerIssueAssignee.nextToken()); - openIssuesPerAssignee.put(assignee, count); + openIssuesPerAssigneeMap.put(assignee, count); } - + List<Map.Entry<String, Integer>> openIssuesPerAssignee = (List<Map.Entry<String, Integer>>)ChartUtils.intValuedMapToSortedList(openIssuesPerAssigneeMap); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ChartUtils.writeChartAsPng(ChartUtils.generatePieChart(ChartUtils.collectionToPieDataset(openIssuesPerAssignee, ChartUtils.MAX_ITEMS)), out);// TODO fix all generics warnings + String openIssuesPerAssigneeChartUrl = saveCachedFile(encodeCachedFileName(url + "_open_issues_per_assignee.png"), new ByteArrayInputStream(out.toByteArray())); + // generate issues-per-status chart - Map<Integer, Integer> issuesPerStatus = new HashMap<Integer, Integer>(); + Map<Integer, Integer> issuesPerStatusMap = new HashMap<Integer, Integer>(); if(openIssues > 0) - issuesPerStatus.put(OPEN_COLOR, openIssues); + issuesPerStatusMap.put(OPEN_COLOR, openIssues); if(codingInProgressIssues > 0) - issuesPerStatus.put(CODING_IN_PROGRESS_COLOR, codingInProgressIssues); + issuesPerStatusMap.put(CODING_IN_PROGRESS_COLOR, codingInProgressIssues); if(reopenedIssues > 0) - issuesPerStatus.put(REOPENED_COLOR, reopenedIssues); + issuesPerStatusMap.put(REOPENED_COLOR, reopenedIssues); if(resolvedIssues > 0) - issuesPerStatus.put(RESOLVED_COLOR, resolvedIssues); + issuesPerStatusMap.put(RESOLVED_COLOR, resolvedIssues); if(closedIssues > 0) - issuesPerStatus.put(CLOSED_COLOR, closedIssues); + issuesPerStatusMap.put(CLOSED_COLOR, closedIssues); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - ChartUtils.writeChartAsPng(ChartUtils.generateColorCodedPieChart(ChartUtils.mapToPieDataset(issuesPerStatus)), out); + out.reset(); + ChartUtils.writeChartAsPng(ChartUtils.generateColorCodedPieChart(ChartUtils.mapToPieDataset(issuesPerStatusMap)), out); String issuesPerStatusChartUrl = saveCachedFile(encodeCachedFileName(url + "_issues_per_status.png"), new ByteArrayInputStream(out.toByteArray())); // generate issues-per-priority chart - Map<Integer, Integer> openIssuesPerPriority = new HashMap<Integer, Integer>(); + Map<Integer, Integer> openIssuesPerPriorityMap = new HashMap<Integer, Integer>(); if(blockerOpenIssues > 0) - openIssuesPerPriority.put(BLOCKER_COLOR, blockerOpenIssues); + openIssuesPerPriorityMap.put(BLOCKER_COLOR, blockerOpenIssues); if(criticalOpenIssues > 0) - openIssuesPerPriority.put(CRITICAL_COLOR, criticalOpenIssues); + openIssuesPerPriorityMap.put(CRITICAL_COLOR, criticalOpenIssues); if(majorOpenIssues > 0) - openIssuesPerPriority.put(MAJOR_COLOR, majorOpenIssues); + openIssuesPerPriorityMap.put(MAJOR_COLOR, majorOpenIssues); if(minorOpenIssues > 0) - openIssuesPerPriority.put(MINOR_COLOR, minorOpenIssues); + openIssuesPerPriorityMap.put(MINOR_COLOR, minorOpenIssues); if(trivialOpenIssues > 0) - openIssuesPerPriority.put(TRIVIAL_COLOR, trivialOpenIssues); + openIssuesPerPriorityMap.put(TRIVIAL_COLOR, trivialOpenIssues); if(optionalOpenIssues > 0) - openIssuesPerPriority.put(OPTIONAL_COLOR, optionalOpenIssues); + openIssuesPerPriorityMap.put(OPTIONAL_COLOR, optionalOpenIssues); out.reset(); - ChartUtils.writeChartAsPng(ChartUtils.generateColorCodedPieChart(ChartUtils.mapToPieDataset(openIssuesPerPriority)), out); + ChartUtils.writeChartAsPng(ChartUtils.generateColorCodedPieChart(ChartUtils.mapToPieDataset(openIssuesPerPriorityMap)), out); String openIssuesPerPriorityChartUrl = saveCachedFile(encodeCachedFileName(url + "_open_issues_per_priority.png"), new ByteArrayInputStream(out.toByteArray())); - - out.reset(); - ChartUtils.writeChartAsPng(ChartUtils.generatePieChart(ChartUtils.mapToPieDataset(openIssuesPerAssignee, ChartUtils.MAX_ITEMS)), out); - String openIssuesPerAssigneeChartUrl = saveCachedFile(encodeCachedFileName(url + "_open_issues_per_assignee.png"), new ByteArrayInputStream(out.toByteArray())); - + // save - JiraProject project = new JiraProject(name, url, projectKey, projectUrl, description, lead, openIssues, codingInProgressIssues, reopenedIssues, resolvedIssues, closedIssues, blockerOpenIssues, criticalOpenIssues, majorOpenIssues, minorOpenIssues, trivialOpenIssues, optionalOpenIssues, ChartUtils.sortDescByIntegerValue(openIssuesPerAssignee), issuesPerStatusChartUrl, openIssuesPerPriorityChartUrl, openIssuesPerAssigneeChartUrl); + JiraProject project = new JiraProject(name, url, projectKey, projectUrl, description, lead, + openIssues, codingInProgressIssues, reopenedIssues, resolvedIssues, closedIssues, + blockerOpenIssues, criticalOpenIssues, majorOpenIssues, minorOpenIssues, trivialOpenIssues, optionalOpenIssues, + (List<Map.Entry<String, Integer>>)openIssuesPerAssignee, + issuesPerStatusChartUrl, openIssuesPerPriorityChartUrl, openIssuesPerAssigneeChartUrl); log.debug(String.format("Adding %s...", project)); projects.add(project); } Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java 2005-09-19 10:10:48 UTC (rev 1149) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java 2005-09-19 11:56:23 UTC (rev 1150) @@ -105,6 +105,7 @@ SvnRepositoryLogStats logStats = analyzeLog(repo); SvnRepositoryContentStats contentStats = analyzeContent(repo); + generateCharts(repo, logStats); // save previousLatestRevision = repo.getLatestRevision(); @@ -114,7 +115,7 @@ logStats.committersTotal.size(), logStats.committersToday.size(), logStats.committersLast7Days.size(), logStats.committersLast31Days.size(), logStats.commitsPerAuthorChartUrl, logStats.commitsPerFileChartUrl, logStats.commitsPerWeekChartUrl, logStats.repoEntriesPerWeekChartUrl, contentStats.dirs, contentStats.files, contentStats.totalSize, - ChartUtils.sortDescByIntegerValue(logStats.commitsPerAuthor), ChartUtils.sortDescByIntegerValue(logStats.commitsPerFile)); + (List<Map.Entry<String, Integer>>)logStats.commitsPerAuthor, (List<Map.Entry<String, Integer>>)logStats.commitsPerFile); log.debug(String.format("Adding %s...", repository)); repositories.add(repository); } catch (Exception ex) { @@ -143,11 +144,13 @@ public Set<String> committersLast31Days = new HashSet<String>(); /* No of commits per author. */ - public Map<String,Integer> commitsPerAuthor = new TreeMap<String,Integer>(); + public Map<String,Integer> commitsPerAuthorMap = new TreeMap<String,Integer>(); +public List<Map.Entry<String,Integer>> commitsPerAuthor;// TODO write comment public String commitsPerAuthorChartUrl; /* No of commits per file. */ - public Map<String,Integer> commitsPerFile = new TreeMap<String,Integer>(); + public Map<String,Integer> commitsPerFileMap = new TreeMap<String,Integer>(); +public List<Map.Entry<String,Integer>> commitsPerFile;// TODO write comment public String commitsPerFileChartUrl; /* No of commits per week. */ @@ -158,8 +161,12 @@ public TimeSeries repoEntriesPerWeek = new TimeSeries("", Week.class); public String repoEntriesPerWeekChartUrl; - /** Must be called after the processing was done. */ + /** Must be called to validate its content, after the processing was done. */ public void validate() { + // sort maps + commitsPerAuthor = (List<Map.Entry<String, Integer>>)ChartUtils.intValuedMapToSortedList(commitsPerAuthorMap); + commitsPerFile = (List<Map.Entry<String, Integer>>)ChartUtils.intValuedMapToSortedList(commitsPerFileMap); + // revert history Collections.reverse(commits); @@ -229,8 +236,8 @@ } // count commits-per-author - Integer commitsPerCurrentAuthor = stats.commitsPerAuthor.get(logEntry.getAuthor()); - stats.commitsPerAuthor.put(logEntry.getAuthor(), (commitsPerCurrentAuthor == null) ? 1 : commitsPerCurrentAuthor + 1); + Integer commitsPerCurrentAuthor = stats.commitsPerAuthorMap.get(logEntry.getAuthor()); + stats.commitsPerAuthorMap.put(logEntry.getAuthor(), (commitsPerCurrentAuthor == null) ? 1 : commitsPerCurrentAuthor + 1); // count commits-per-week Week commitWeek = new Week(logEntry.getDate()); @@ -247,8 +254,8 @@ SVNLogEntryPath logEntryPath = (SVNLogEntryPath)changedPaths.get(it.next()); // count commits-per-file - Integer commitsPerCurrentFile = stats.commitsPerFile.get(logEntryPath.getPath()); - stats.commitsPerFile.put(logEntryPath.getPath(), (commitsPerCurrentFile == null) ? 1 : commitsPerCurrentFile + 1); + Integer commitsPerCurrentFile = stats.commitsPerFileMap.get(logEntryPath.getPath()); + stats.commitsPerFileMap.put(logEntryPath.getPath(), (commitsPerCurrentFile == null) ? 1 : commitsPerCurrentFile + 1); // count files-per-week TimeSeriesDataItem repoEntriesPerCurrentWeek = stats.repoEntriesPerWeek.getDataItem(commitWeek); @@ -261,9 +268,8 @@ } } - // validate and generate charts + // validate stats.validate(); - generateCharts(repository, stats); return stats; } @@ -322,11 +328,11 @@ // generate charts ByteArrayOutputStream out = new ByteArrayOutputStream(); - ChartUtils.writeChartAsPng(ChartUtils.generatePieChart(ChartUtils.mapToPieDataset(stats.commitsPerAuthor, ChartUtils.MAX_ITEMS)), out); + ChartUtils.writeChartAsPng(ChartUtils.generatePieChart(ChartUtils.collectionToPieDataset(stats.commitsPerAuthor, ChartUtils.MAX_ITEMS)), out); stats.commitsPerAuthorChartUrl = saveCachedFile(encodeCachedFileName(prefix + "_commits_per_author.png"), new ByteArrayInputStream(out.toByteArray())); out.reset(); - ChartUtils.writeChartAsPng(ChartUtils.generatePieChart(ChartUtils.mapToPieDataset(stats.commitsPerFile, ChartUtils.MAX_ITEMS)), out); + ChartUtils.writeChartAsPng(ChartUtils.generatePieChart(ChartUtils.collectionToPieDataset(stats.commitsPerFile, ChartUtils.MAX_ITEMS)), out); stats.commitsPerFileChartUrl = saveCachedFile(encodeCachedFileName(prefix + "_commits_per_file.png"), new ByteArrayInputStream(out.toByteArray())); out.reset(); Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/util/ChartUtils.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/util/ChartUtils.java 2005-09-19 10:10:48 UTC (rev 1149) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/util/ChartUtils.java 2005-09-19 11:56:23 UTC (rev 1150) @@ -12,9 +12,9 @@ import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.Comparator; -import java.util.Iterator; import java.util.List; import java.util.Map; @@ -106,54 +106,35 @@ ChartUtilities.writeChartAsPNG(out, chart, CHART_RESOLUTION_X, CHART_RESOLUTION_Y, true, 0); } - /** - * Returns the passed list as pie-dataset. - * @see #listToPieDataset(List<Map.Entry>, int) - * */ - public static PieDataset listToPieDataset(List<Map.Entry> data) { - return listToPieDataset(data, -1); + /** Returns the passed data as unclamped pie-dataset. */ + public static PieDataset mapToPieDataset(Map data) {// TODO should be Map<? extends Comparable, Integer> + return collectionToPieDataset(new ArrayList<Map.Entry>(data.entrySet()), -1); } - + /** - * Returns the passed list as pie-dataset (equivalent key-value pairs), - * clamped to a maximum number of items to prevent unreadably busy charts. + * Returns the passed collection of <code>Map.Entry</code> objects as pie-dataset + * (equivalent key-value pairs), optionally clamped to a maximum number of items + * to prevent unreadably busy charts. * @param maxItems the maximum number of items in the returned pie-dataset or -1 if clamping is not needed. */ - public static PieDataset listToPieDataset(List<Map.Entry> data, int maxItems) { + public static PieDataset collectionToPieDataset(Collection items, int maxItems) { DefaultPieDataset dataset = new DefaultPieDataset(); // generate dataset int counter = 0; - for(Iterator it = data.iterator(); it.hasNext();) { - Map.Entry entry = (Map.Entry)it.next(); - if((maxItems != -1) && (++counter >= maxItems)) + for(Map.Entry<? extends Comparable, Integer> item : (Collection<Map.Entry<? extends Comparable, Integer>>)items) { + if((maxItems != -1) && (++counter > maxItems)) break; - dataset.setValue((Comparable)entry.getKey(), (Number)entry.getValue());// TODO ILYEN LEGYEN A BEMENET + dataset.setValue(item.getKey(), item.getValue()); } return dataset; } - - /** - * Returns the passed list as pie-dataset. - * @see #mapToPieDataset(Map, int) - * */ - public static PieDataset mapToPieDataset(Map data) { - return mapToPieDataset(data, -1); - } - - /** - * Returns the passed list as pie-dataset. - * @see #listToPieDataset(List<Map.Entry>, int) - */ - public static PieDataset mapToPieDataset(Map data, int maxItems) { - return listToPieDataset(new ArrayList(data.entrySet()), maxItems); - } - + /** Returns the list of the entries in the map sorted by their value (not by their key!) in descending order. */ - public static List<Map.Entry<String, Integer>> sortDescByIntegerValue(Map<String,Integer> map) { - List<Map.Entry<String, Integer>> sorted = new ArrayList<Map.Entry<String, Integer>>(map.entrySet()); - Collections.sort(sorted, new Comparator() { + public static List intValuedMapToSortedList(Map map) {// TODO should be Map<?, Integer> and List<Map.Entry<?, Integer>> + List<Map.Entry> sorted = new ArrayList<Map.Entry>(map.entrySet()); + Collections.sort(sorted, new Comparator() {// TODO should be Comparator<Map.Entry<?, Integer>> public int compare(Object o1, Object o2) { Integer v1 = (Integer)((Map.Entry)o1).getValue(); Integer v2 = (Integer)((Map.Entry)o2).getValue(); |
From: <jbo...@li...> - 2005-09-19 10:11:02
|
Author: aron.gombas Date: 2005-09-19 06:10:48 -0400 (Mon, 19 Sep 2005) New Revision: 1149 Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/CcProject.java trunk/labs/kosmos/src/java/hu/midori/kosmos/server/cc/CcServiceImpl.java Log: Reformatting Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/CcProject.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/model/CcProject.java 2005-09-19 08:50:20 UTC (rev 1148) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/model/CcProject.java 2005-09-19 10:10:48 UTC (rev 1149) @@ -47,7 +47,10 @@ super(null); } - public CcProject(String name, String buildLabel, int status, Date timestamp, int modifications, String buildTime, int tests, int errors, int failures, String testsPerCategoryChartUrl) { + public CcProject(String name, String buildLabel, int status, Date timestamp, + int modifications, String buildTime, + int tests, int errors, int failures, + String testsPerCategoryChartUrl) { super(name + buildLabel + timestamp.getTime()); this.name = name; Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/cc/CcServiceImpl.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/cc/CcServiceImpl.java 2005-09-19 08:50:20 UTC (rev 1148) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/cc/CcServiceImpl.java 2005-09-19 10:10:48 UTC (rev 1149) @@ -117,7 +117,10 @@ // save previousLatestLogModified = latestLog.lastModified(); - CcProject project = new CcProject(name, buildLabel, status, timestamp, modifications, buildTime, tests, errors, failures, testsPerCategoryChartUrl); + CcProject project = new CcProject(name, buildLabel, status, timestamp, + modifications, buildTime, + tests, errors, failures, + testsPerCategoryChartUrl); log.debug(String.format("Adding %s...", project)); projects.add(project); } catch(Exception ex) { |
From: <jbo...@li...> - 2005-09-19 08:50:25
|
Author: aron.gombas Date: 2005-09-19 04:50:20 -0400 (Mon, 19 Sep 2005) New Revision: 1148 Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/jira/JiraServiceImpl.java Log: Cleanup Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/jira/JiraServiceImpl.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/jira/JiraServiceImpl.java 2005-09-19 08:29:09 UTC (rev 1147) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/jira/JiraServiceImpl.java 2005-09-19 08:50:20 UTC (rev 1148) @@ -82,7 +82,7 @@ try { Document dom = ScrapingUtils.downloadHtmlDom(new URL(url)); - //!!! EZEKET A QUERY-KET UJRA MEGNEZ + // TODO review these queries // run XQueries String queryProject = "for " + @@ -94,7 +94,7 @@ "{ data(fn:substring-after(fn:normalize-space($d/child::tr/child::td/child::h3/text()), ' ')) }|" + "{ data(fn:substring-after(fn:substring-before($d/child::tr/child::td/child::h3/font/text(), ')'), ' ')) }|" + "{ data($d/following-sibling::table/child::tr/child::td/child::p[1]/child::a[2]) }|" + - "{ data(fn:normalize-space(fn:string-join($d/following-sibling::table/child::tr/child::td/child::p[1]/text(), ''))) }|" +//!!! SPACE-EKET TRIMMEL + "{ data(fn:normalize-space(fn:string-join($d/following-sibling::table/child::tr/child::td/child::p[1]/text(), ''))) }|" + "{ data($d/following-sibling::table/child::tr/child::td/child::p[1]/child::a[1]) }" + "</dummy>"; List resultProject = ScrapingUtils.runXQuery(dom, queryProject); @@ -107,10 +107,10 @@ "where " + "count($d/child::td) = 4 and " + "contains($d/child::td[2]/child::a[1]/@href, '/secure/IssueNavigator.jspa') and " + - "contains($d/child::td[2]/child::a[1]/@href, 'status') " + // can be "status" or "statusIds" + "contains($d/child::td[2]/child::a[1]/@href, 'status') " + // can be "status" or "statusIds" "return " + "<dummy>" + - "{ data(fn:substring-after(fn:substring-after($d/child::td[2]/child::a[1]/@href, 'status'), '=')) }|" +// TODO ugy kene, h okosan a status utani szamot (barhol lehet!) kiszedni + "{ data(fn:substring-after(fn:substring-after($d/child::td[2]/child::a[1]/@href, 'status'), '=')) }|" +// TODO should grab the next number after "status" "{ data(fn:normalize-space(fn:string-join($d/child::td[3]/text(), ''))) }" + "</dummy>"; List resultIssueStatus = ScrapingUtils.runXQuery(dom, queryIssueStatus); @@ -124,7 +124,7 @@ "contains($d/child::td[2]/child::a[1]/@href, 'priority') " + "return " + "<dummy>" + - "{ data(fn:substring(fn:substring-after(fn:substring-after($d/child::td[2]/child::a[1]/@href, 'priority'), '='), 1, 1)) }|" +// TODO DE IGY BE VAN DROTOZVA HOGY A PRIORITY MINDIG 1 KARAKTER! + "{ data(fn:substring(fn:substring-after(fn:substring-after($d/child::td[2]/child::a[1]/@href, 'priority'), '='), 1, 1)) }|" +// TODO not appropriate, because priority is hardwired to a single character "{ data(fn:normalize-space(fn:string-join($d/child::td[3]/text(), ''))) }" + "</dummy>"; List resultIssuePriority = ScrapingUtils.runXQuery(dom, queryIssuePriority); @@ -172,7 +172,7 @@ int count = Integer.parseInt(tokenizerIssueStatus.nextToken()); switch(status) { case 1: openIssues = count; break; - // TODO 2? + // TODO what is 2? case 3: codingInProgressIssues = count; break; case 4: reopenedIssues = count; break; case 5: resolvedIssues = count; break; @@ -201,14 +201,14 @@ case 3: majorOpenIssues = count; break; case 4: minorOpenIssues = count; break; case 5: trivialOpenIssues = count; break; - // TODO 6? + // TODO what is 6? case 7: optionalOpenIssues = count; break; default: throw new IllegalArgumentException(String.format("Unknown issue priority: %d", priority)); } } // scrape issue assignees - Map<String, Integer> openIssuesPerAssignee = new HashMap<String, Integer>();//!!! openIssues! + Map<String, Integer> openIssuesPerAssignee = new HashMap<String, Integer>(); for(Iterator itIssueAssignee = resultIssueAssignee.iterator(); itIssueAssignee.hasNext();) { String valueIssueAssignee = ((NodeInfo)itIssueAssignee.next()).getStringValue(); log.debug(String.format("Scraped issue assignee: \"%s\"", valueIssueAssignee)); @@ -219,8 +219,7 @@ openIssuesPerAssignee.put(assignee, count); } - //!!! KEPEK GENERALASA -> KIEMEL UJ METODUSBA - // generate charts + // generate issues-per-status chart Map<Integer, Integer> issuesPerStatus = new HashMap<Integer, Integer>(); if(openIssues > 0) issuesPerStatus.put(OPEN_COLOR, openIssues); @@ -237,7 +236,7 @@ ChartUtils.writeChartAsPng(ChartUtils.generateColorCodedPieChart(ChartUtils.mapToPieDataset(issuesPerStatus)), out); String issuesPerStatusChartUrl = saveCachedFile(encodeCachedFileName(url + "_issues_per_status.png"), new ByteArrayInputStream(out.toByteArray())); - //!!! MEG EGY KEP + // generate issues-per-priority chart Map<Integer, Integer> openIssuesPerPriority = new HashMap<Integer, Integer>(); if(blockerOpenIssues > 0) openIssuesPerPriority.put(BLOCKER_COLOR, blockerOpenIssues); |
Author: aron.gombas Date: 2005-09-19 04:29:09 -0400 (Mon, 19 Sep 2005) New Revision: 1147 Added: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/ScmRepositoryChange.java Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/SvnRepository.java trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svnmonitoringportlet.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svnmonitoringportlet_hu.properties trunk/labs/kosmos/web-portlet/pages/svn_monitoring.jsp trunk/labs/kosmos/web-portlet/pages/svn_monitoring_activity_details.jsp trunk/labs/kosmos/web-portlet/pages/svn_monitoring_revision_details.jsp Log: SVN change history monitoring added Added: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/ScmRepositoryChange.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/model/ScmRepositoryChange.java 2005-09-19 08:07:11 UTC (rev 1146) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/model/ScmRepositoryChange.java 2005-09-19 08:29:09 UTC (rev 1147) @@ -0,0 +1,52 @@ +/* + * Kosmos. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package hu.midori.kosmos.model; + +import java.util.Date; + +/** + * Wraps a change committed to an SCM repository. + * + * @author <a href="mailto:aro...@mi...">Aron Gombas</a> + * @version $Id$ + */ +public class ScmRepositoryChange { + /** Date of the change. */ + public Date date; + /** Author of the change. */ + public String author; + /** Change log message. */ + public String message; + + public ScmRepositoryChange(Date date, String author, String message) { + this.date = date; + this.author = author; + this.message = message; + } + + public String getAuthor() { + return author; + } + + public Date getDate() { + return date; + } + + public String getMessage() { + return message; + } + + /** Returns its age in milliseconds. */ + public long getAge() { + return new Date().getTime() - date.getTime(); + } + + /** Returns its age in days. */ + public long getAgeInDays() { + return getAge()/ModelUtils.MILLIS_PER_DAY; + } +} Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/SvnRepository.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/model/SvnRepository.java 2005-09-19 08:07:11 UTC (rev 1146) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/model/SvnRepository.java 2005-09-19 08:29:09 UTC (rev 1147) @@ -10,7 +10,6 @@ import java.util.List; import java.util.Map; - /** * Wraps a <i>Subversion</i> repository. * @@ -25,13 +24,9 @@ /** Date of the first touch, i.e. the created date of the repo. */ private Date createdDate; - /** Date of the most recent touch. */ - private Date latestTouchDate; - /** Author of the most recent touch. */ - private String latestTouchAuthor; - /** Log message of the most recent touch. */ - private String latestTouchMessage; - + /** Full history of the commits in reversed order. */ + public List<ScmRepositoryChange> commits; + /** Number of commits since the repo was created. */ private int commitsTotal; /** Number of commits today. */ @@ -41,6 +36,15 @@ /** Number of commits over the last 31 days (about one month). */ private int commitsLast31Days; + /** Number of committers since the repo was created. */ + private int committersTotal; + /** Number of committers today. */ + private int committersToday; + /** Number of committers over the last 7 days (one week). */ + private int committersLast7Days; + /** Number of committers over the last 31 days (about one month). */ + private int committersLast31Days; + /** URL of the commits-per-author chart image. */ private String commitsPerAuthorChartUrl; /** URL of the commits-per-file chart image. */ @@ -70,22 +74,25 @@ super(null); } - public SvnRepository(String location, long revision, Date createdDate, Date latestTouchDate, String latestTouchAuthor, String latestTouchMessage, int commitsTotal, int commitsToday, int commitsLast7Days, int commitsLast31Days, String commitsPerAuthorChartUrl, String commitsPerFileChartUrl, String commitsPerWeekChartUrl, String repoEntriesPerWeekChartUrl, int dirs, int files, int totalFileSize, List<Map.Entry<String,Integer>> commitsPerAuthor, List<Map.Entry<String,Integer>> commitsPerFile) { - super(location + revision + latestTouchDate.getTime()); + public SvnRepository(String location, long revision, Date createdDate, List<ScmRepositoryChange> commits, int commitsTotal, int commitsToday, int commitsLast7Days, int commitsLast31Days, int committersTotal, int committersToday, int committersLast7Days, int committersLast31Days, String commitsPerAuthorChartUrl, String commitsPerFileChartUrl, String commitsPerWeekChartUrl, String repoEntriesPerWeekChartUrl, int dirs, int files, int totalFileSize, List<Map.Entry<String,Integer>> commitsPerAuthor, List<Map.Entry<String,Integer>> commitsPerFile) { + super(location + revision + commits.get(0).getDate()); this.location = location; this.revision = revision; this.createdDate = createdDate; - this.latestTouchDate = latestTouchDate; - this.latestTouchAuthor = latestTouchAuthor; - this.latestTouchMessage = latestTouchMessage; + this.commits = commits; this.commitsTotal = commitsTotal; this.commitsToday = commitsToday; this.commitsLast7Days = commitsLast7Days; this.commitsLast31Days = commitsLast31Days; + this.committersTotal = committersTotal; + this.committersToday = committersToday; + this.committersLast7Days = committersLast7Days; + this.committersLast31Days = committersLast31Days; + this.commitsPerAuthorChartUrl = commitsPerAuthorChartUrl; this.commitsPerFileChartUrl = commitsPerFileChartUrl; this.commitsPerWeekChartUrl = commitsPerWeekChartUrl; @@ -111,18 +118,10 @@ return createdDate; } - public Date getLatestTouchDate() { - return latestTouchDate; + public List<ScmRepositoryChange> getCommits() { + return commits; } - public String getLatestTouchAuthor() { - return latestTouchAuthor; - } - - public String getLatestTouchMessage() { - return latestTouchMessage; - } - public int getCommitsTotal() { return commitsTotal; } @@ -139,6 +138,22 @@ return commitsLast31Days; } + public int getCommittersTotal() { + return committersTotal; + } + + public int getCommittersToday() { + return committersToday; + } + + public int getCommittersLast7Days() { + return committersLast7Days; + } + + public int getCommittersLast31Days() { + return committersLast31Days; + } + public String getCommitsPerAuthorChartUrl() { return commitsPerAuthorChartUrl; } @@ -182,7 +197,7 @@ /** Returns the age of its latest touch in milliseconds. */ public long getLatestTouchAge() { - return new Date().getTime() - latestTouchDate.getTime(); + return new Date().getTime() - commits.get(0).getDate().getTime(); } /** Returns the age of its latest touch in days. */ @@ -201,8 +216,6 @@ @Override public String toString() { - return String.format("%s %s %s %s %s %s %d/%d/%d/%d %s %s %s %s %d/%d %d", location, revision, createdDate, latestTouchDate, latestTouchAuthor, latestTouchMessage, commitsTotal, commitsToday, commitsLast7Days, commitsLast31Days, commitsPerAuthorChartUrl, commitsPerFileChartUrl, commitsPerWeekChartUrl, repoEntriesPerWeekChartUrl, dirs, files, totalFileSize); + return String.format("%s %s %s %d %d/%d/%d/%d %s %s %s %s %d/%d %d", location, revision, createdDate, commits.size(), commitsTotal, commitsToday, commitsLast7Days, commitsLast31Days, commitsPerAuthorChartUrl, commitsPerFileChartUrl, commitsPerWeekChartUrl, repoEntriesPerWeekChartUrl, dirs, files, totalFileSize); } - - // TODO getComplexity() -> find out a real formula based on #files, #dirs, #filesize and such } Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java 2005-09-19 08:07:11 UTC (rev 1146) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java 2005-09-19 08:29:09 UTC (rev 1147) @@ -7,6 +7,7 @@ package hu.midori.kosmos.server.svn; import hu.midori.kosmos.model.ModelUtils; +import hu.midori.kosmos.model.ScmRepositoryChange; import hu.midori.kosmos.model.SvnRepository; import hu.midori.kosmos.protocol.SvnService; import hu.midori.kosmos.server.AbstractKosmosService; @@ -18,10 +19,13 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Date; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.TreeMap; import org.apache.commons.logging.Log; @@ -94,7 +98,6 @@ SVNRepositoryFactoryImpl.setup(); try { - // get repository info SVNURL svnUrl = SVNURL.parseURIEncoded(url); SVNRepository repo = SVNRepositoryFactory.create(svnUrl); @@ -104,9 +107,12 @@ SvnRepositoryContentStats contentStats = analyzeContent(repo); // save - previousLatestRevision = repo.getLatestRevision(); + previousLatestRevision = repo.getLatestRevision(); SvnRepository repository = new SvnRepository(repo.getLocation().toString(), repo.getLatestRevision(), - logStats.createdDate, logStats.latestTouchDate, logStats.latestTouchAuthor, logStats.latestTouchMessage, logStats.commitsTotal, logStats.commitsToday, logStats.commitsLast7Days, logStats.commitsLast31Days, logStats.commitsPerAuthorChartUrl, logStats.commitsPerFileChartUrl, logStats.commitsPerWeekChartUrl, logStats.repoEntriesPerWeekChartUrl, + logStats.createdDate, logStats.commits, + logStats.commitsTotal, logStats.commitsToday, logStats.commitsLast7Days, logStats.commitsLast31Days, + logStats.committersTotal.size(), logStats.committersToday.size(), logStats.committersLast7Days.size(), logStats.committersLast31Days.size(), + logStats.commitsPerAuthorChartUrl, logStats.commitsPerFileChartUrl, logStats.commitsPerWeekChartUrl, logStats.repoEntriesPerWeekChartUrl, contentStats.dirs, contentStats.files, contentStats.totalSize, ChartUtils.sortDescByIntegerValue(logStats.commitsPerAuthor), ChartUtils.sortDescByIntegerValue(logStats.commitsPerFile)); log.debug(String.format("Adding %s...", repository)); @@ -117,31 +123,54 @@ return repositories; } - + /** Wraps the stats retrieved from the content of a SVN repository. */ - private class SvnRepositoryLogStats { + private class SvnRepositoryLogStats {// TODO rewrite as bean public Date createdDate; - public Date latestTouchDate; - public String latestTouchAuthor; - public String latestTouchMessage; + /** Full history of the commits in reversed order. */ + public List<ScmRepositoryChange> commits = new ArrayList<ScmRepositoryChange>(); + + /* No of commits over a certain period. */ public int commitsTotal; public int commitsToday; public int commitsLast7Days; public int commitsLast31Days; + + /* Author of commits over a certain period. */ + public Set<String> committersTotal = new HashSet<String>(); + public Set<String> committersToday = new HashSet<String>(); + public Set<String> committersLast7Days = new HashSet<String>(); + public Set<String> committersLast31Days = new HashSet<String>(); + + /* No of commits per author. */ public Map<String,Integer> commitsPerAuthor = new TreeMap<String,Integer>(); public String commitsPerAuthorChartUrl; + + /* No of commits per file. */ public Map<String,Integer> commitsPerFile = new TreeMap<String,Integer>(); public String commitsPerFileChartUrl; + + /* No of commits per week. */ public TimeSeries commitsPerWeek = new TimeSeries("", Week.class); public String commitsPerWeekChartUrl; + + /* No of repository entries per week. */ public TimeSeries repoEntriesPerWeek = new TimeSeries("", Week.class); public String repoEntriesPerWeekChartUrl; /** Must be called after the processing was done. */ public void validate() { + // revert history + Collections.reverse(commits); + // cummulate files-per-week values for(int i = 1; i < repoEntriesPerWeek.getItemCount(); i++) repoEntriesPerWeek.update(i, repoEntriesPerWeek.getValue(i).intValue() + repoEntriesPerWeek.getValue(i - 1).intValue()); + + // add files-per-week value for the current week even if no activity + Week currentWeek = new Week(new Date()); + if(repoEntriesPerWeek.getDataItem(currentWeek) == null) + repoEntriesPerWeek.add(currentWeek, repoEntriesPerWeek.getValue(repoEntriesPerWeek.getItemCount() - 1)); // assert calculations int calculatedCommitsTotal = 0; @@ -165,7 +194,6 @@ // analyze long now = new Date().getTime(); - stats.commitsTotal = logEntries.size(); for(SVNLogEntry logEntry : logEntries) { // skip invalid entries if(logEntry.getAuthor() == null) { @@ -180,18 +208,25 @@ // save basic stats if (stats.createdDate == null) stats.createdDate = logEntry.getDate(); - stats.latestTouchDate = logEntry.getDate(); - stats.latestTouchAuthor = logEntry.getAuthor(); - stats.latestTouchMessage = logEntry.getMessage(); + stats.commits.add(new ScmRepositoryChange(logEntry.getDate(), logEntry.getAuthor(), logEntry.getMessage())); - // count commits over period + // count commits-over-period and author-over-period long ageInMillis = now - logEntry.getDate().getTime(); - if(ageInMillis < ModelUtils.MILLIS_PER_DAY) + + stats.commitsTotal++; + stats.committersTotal.add(logEntry.getAuthor()); + if(ageInMillis < ModelUtils.MILLIS_PER_DAY) { stats.commitsToday++; - if(ageInMillis < ModelUtils.MILLIS_PER_WEEK) + stats.committersToday.add(logEntry.getAuthor()); + } + if(ageInMillis < ModelUtils.MILLIS_PER_WEEK) { stats.commitsLast7Days++; - if(ageInMillis < ModelUtils.MILLIS_PER_MONTH) + stats.committersLast7Days.add(logEntry.getAuthor()); + } + if(ageInMillis < ModelUtils.MILLIS_PER_MONTH) { stats.commitsLast31Days++; + stats.committersLast31Days.add(logEntry.getAuthor()); + } // count commits-per-author Integer commitsPerCurrentAuthor = stats.commitsPerAuthor.get(logEntry.getAuthor()); @@ -218,13 +253,12 @@ // count files-per-week TimeSeriesDataItem repoEntriesPerCurrentWeek = stats.repoEntriesPerWeek.getDataItem(commitWeek); char type = logEntryPath.getType(); - if(repoEntriesPerCurrentWeek != null) { + if(repoEntriesPerCurrentWeek != null) stats.repoEntriesPerWeek.addOrUpdate(commitWeek, repoEntriesPerCurrentWeek.getValue().intValue() + commitTypeToAdder(type)); - // TODO System.out.println("==== filez: " + filesPerCurrentWeek.getValue() + ", type: " + logEntryPath.getType() + ", path: " + logEntryPath.getPath()); - } else + else stats.repoEntriesPerWeek.add(commitWeek, commitTypeToAdder(type)); } - } + } } // validate and generate charts Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svnmonitoringportlet.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svnmonitoringportlet.properties 2005-09-19 08:07:11 UTC (rev 1146) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svnmonitoringportlet.properties 2005-09-19 08:29:09 UTC (rev 1147) @@ -19,8 +19,6 @@ svnrepository.totalFileSize=Total File Size svnrepository.repositoryEntryHistory=Repository Entry History -svnrepository.latestTouchAuthor=Latest Author -svnrepository.latestTouchMessage=Latest Message svnrepository.mostActiveCommitters=Most Active Committers svnrepository.mostActiveFiles=Most Active Files @@ -28,6 +26,10 @@ svnrepository.commitsToday=Commits Today svnrepository.commitsLast7Days=Commits Last 7 Days svnrepository.commitsLast31Days=Commits Last 31 Days +svnrepository.committersTotal=Committers Total +svnrepository.committersToday=Committers Today +svnrepository.committersLast7Days=Committers Last 7 Days +svnrepository.committersLast31Days=Committers Last 31 Days svnrepository.commitHistory=Commit History legend.title=Legend Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svnmonitoringportlet_hu.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svnmonitoringportlet_hu.properties 2005-09-19 08:07:11 UTC (rev 1146) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svnmonitoringportlet_hu.properties 2005-09-19 08:29:09 UTC (rev 1147) @@ -19,8 +19,6 @@ svnrepository.totalFileSize=Fok szmte svnrepository.repositoryEntryHistory=Bejegyzk az Idggvn -svnrepository.latestTouchAuthor=Utolsdos -svnrepository.latestTouchMessage=Utolsplegyz svnrepository.mostActiveCommitters=Legaktbb Fejlesztsvnrepository.mostActiveFiles=Legaktbb Fok @@ -28,6 +26,10 @@ svnrepository.commitsToday=Msok Ma svnrepository.commitsLast7Days=Msok 7 Nap Sor svnrepository.commitsLast31Days=Msok 31 Nap Sor+svnrepository.committersTotal=Fejlesztsszesen +svnrepository.committersToday=Fejleszta +svnrepository.committersLast7Days=Fejleszt Nap Sor+svnrepository.committersLast31Days=Fejleszt1 Nap Sor svnrepository.commitHistory=Msok az Idggvn legend.title=Jelmagyart Modified: trunk/labs/kosmos/web-portlet/pages/svn_monitoring.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/svn_monitoring.jsp 2005-09-19 08:07:11 UTC (rev 1146) +++ trunk/labs/kosmos/web-portlet/pages/svn_monitoring.jsp 2005-09-19 08:29:09 UTC (rev 1147) @@ -38,9 +38,6 @@ <img src="<%= renderRequest.getContextPath() %>/pages/images/info.gif" title="<fmt:message key="svnrepository.activityDetails"/>" border="0"/> </a> </display:column> - <display:column titleKey="svnrepository.latestTouchDate" style="white-space:nowrap" sortProperty="latestTouchDate" sortable="true"> - <fmt:formatDate value="${repositoriesIt.latestTouchDate}" pattern="dd/MMM/yy hh:mm"/> - </display:column> <display:column titleKey="svnrepository.latestTouchAge" style="white-space:nowrap" sortProperty="latestTouchAge" sortable="true"> <c:if test="${repositoriesIt.latestTouchAgeInDays > 7}"><span class="portlet-msg-error"></c:if> <c:out value="${repositoriesIt.latestTouchAgeInDays}"/> <fmt:message key="svnrepository.latestTouchAge.days"/> Modified: trunk/labs/kosmos/web-portlet/pages/svn_monitoring_activity_details.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/svn_monitoring_activity_details.jsp 2005-09-19 08:07:11 UTC (rev 1146) +++ trunk/labs/kosmos/web-portlet/pages/svn_monitoring_activity_details.jsp 2005-09-19 08:29:09 UTC (rev 1147) @@ -6,25 +6,48 @@ <table> <tr class="portlet-section-body"> <td><fmt:message key="svnrepository.commitsToday"/>:</td> - <td colspan="2"><c:out value="${repository.commitsToday}"/></td> + <td><c:out value="${repository.commitsToday}"/></td> + <td><fmt:message key="svnrepository.committersToday"/>:</td> + <td><c:out value="${repository.committersToday}"/></td> </tr> <tr class="portlet-section-alternate"> <td><fmt:message key="svnrepository.commitsLast7Days"/>:</td> - <td colspan="2"><c:out value="${repository.commitsLast7Days}"/></td> + <td><c:out value="${repository.commitsLast7Days}"/></td> + <td><fmt:message key="svnrepository.committersLast7Days"/>:</td> + <td><c:out value="${repository.committersLast7Days}"/></td> </tr> <tr class="portlet-section-body"> <td><fmt:message key="svnrepository.commitsLast31Days"/>:</td> - <td colspan="2"><c:out value="${repository.commitsLast31Days}"/></td> + <td><c:out value="${repository.commitsLast31Days}"/></td> + <td><fmt:message key="svnrepository.committersLast31Days"/>:</td> + <td><c:out value="${repository.committersLast31Days}"/></td> </tr> <tr class="portlet-section-alternate"> <td><fmt:message key="svnrepository.commitsTotal"/>:</td> - <td colspan="2"><c:out value="${repository.commitsTotal}"/></td> + <td><c:out value="${repository.commitsTotal}"/></td> + <td><fmt:message key="svnrepository.committersTotal"/>:</td> + <td><c:out value="${repository.committersTotal}"/></td> </tr> <tr class="portlet-section-body"> <td><fmt:message key="svnrepository.commitHistory"/>:</td> <td><img src="<c:out value="${repository.commitsPerWeekChartUrl}"/>" title="<fmt:message key="svnrepository.commitHistory"/>"/></td> - <td valign="top"> - TODO LATEST 8 MODIFICATIONS COME HERE + <td colspan="2" valign="top"> + <table> + <c:forEach var="commit" items="${repository.commits}" varStatus="status"> + <c:if test="${status.index < 8}"> + <tr class="portlet-section-alternate"> + <td><c:out value="${commit.message}"/></td> + <td><c:out value="${commit.author}"/></td> + <td><fmt:formatDate value="${commit.date}" pattern="dd/MMM/yy hh:mm"/></td> + <td> + <c:if test="${commit.ageInDays == 0}"><span class="portlet-msg-alert"></c:if> + <c:out value="${commit.ageInDays}"/> <fmt:message key="svnrepository.latestTouchAge.days"/> + <c:if test="${commit.ageInDays == 0}"></span></c:if> + </td> + </tr> + </c:if> + </c:forEach> + </table> </td> </tr> <%@include file="includes/table_footer.jsp"%> Modified: trunk/labs/kosmos/web-portlet/pages/svn_monitoring_revision_details.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/svn_monitoring_revision_details.jsp 2005-09-19 08:07:11 UTC (rev 1146) +++ trunk/labs/kosmos/web-portlet/pages/svn_monitoring_revision_details.jsp 2005-09-19 08:29:09 UTC (rev 1147) @@ -4,22 +4,14 @@ <fmt:setBundle basename="hu.midori.kosmos.portlet.svn.svnmonitoringportlet" scope="application"/> <table> - <tr class="portlet-section-body"> - <td><fmt:message key="svnrepository.latestTouchAuthor"/>:</td> - <td colspan="2"><c:out value="${repository.latestTouchAuthor}"/></td> - </tr> <tr class="portlet-section-alternate"> - <td><fmt:message key="svnrepository.latestTouchMessage"/>:</td> - <td colspan="2"><c:out value="${repository.latestTouchMessage}"/></td> - </tr> - <tr class="portlet-section-body"> <td><fmt:message key="svnrepository.mostActiveCommitters"/>:</td> <td><img src="<c:out value="${repository.commitsPerAuthorChartUrl}"/>" title="<fmt:message key="svnrepository.mostActiveCommitters"/>"/></td> <td valign="top"> <table> <c:forEach var="item" items="${repository.commitsPerAuthor}" varStatus="status"> <c:if test="${status.index < 8}"> - <tr class="portlet-section-alternate"> + <tr class="portlet-section-body"> <td><c:out value="${1 + status.index}"/></td> <td><c:out value="${item.key}"/></td> <td><c:out value="${item.value}"/></td> @@ -29,14 +21,14 @@ </table> </td> </tr> - <tr class="portlet-section-alternate"> + <tr class="portlet-section-body"> <td><fmt:message key="svnrepository.mostActiveFiles"/>:</td> <td><img src="<c:out value="${repository.commitsPerFileChartUrl}"/>" title="<fmt:message key="svnrepository.mostActiveFiles"/>"/></td> <td valign="top"> <table> <c:forEach var="item" items="${repository.commitsPerFile}" varStatus="status"> <c:if test="${status.index < 8}"> - <tr class="portlet-section-body"> + <tr class="portlet-section-alternate"> <td><c:out value="${1 + status.index}"/></td> <td><c:out value="${item.key}"/></td> <td><c:out value="${item.value}"/></td> |
From: <jbo...@li...> - 2005-09-19 08:07:19
|
Author: aron.gombas Date: 2005-09-19 04:07:11 -0400 (Mon, 19 Sep 2005) New Revision: 1146 Modified: trunk/labs/kosmos/web-portlet/pages/includes/about.jsp Log: Kosmos link added to About Modified: trunk/labs/kosmos/web-portlet/pages/includes/about.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/includes/about.jsp 2005-09-19 08:05:59 UTC (rev 1145) +++ trunk/labs/kosmos/web-portlet/pages/includes/about.jsp 2005-09-19 08:07:11 UTC (rev 1146) @@ -1,3 +1,3 @@ <p class="portlet-section-footer"> - @project.name@ @project.version@ (@build.date@) + <a href="http://labs.jboss.com/projects/kosmos">@project.name@</a> @project.version@ (@build.date@) </p> \ No newline at end of file |
From: <jbo...@li...> - 2005-09-19 08:06:05
|
Author: aron.gombas Date: 2005-09-19 04:05:59 -0400 (Mon, 19 Sep 2005) New Revision: 1145 Modified: trunk/labs/kosmos/xdocs/reference/reference-manual.xml Log: Revision tag added Modified: trunk/labs/kosmos/xdocs/reference/reference-manual.xml =================================================================== --- trunk/labs/kosmos/xdocs/reference/reference-manual.xml 2005-09-16 16:53:07 UTC (rev 1144) +++ trunk/labs/kosmos/xdocs/reference/reference-manual.xml 2005-09-19 08:05:59 UTC (rev 1145) @@ -8,6 +8,8 @@ <subtitle>For the Kosmos 0.1.x branch</subtitle> + <subtitle>Revision: $Id$</subtitle> + <bookinfo> <edition>First</edition> |
From: <jbo...@li...> - 2005-09-16 16:53:13
|
Author: aron.gombas Date: 2005-09-16 12:53:07 -0400 (Fri, 16 Sep 2005) New Revision: 1144 Modified: trunk/labs/kosmos/build/build.xml Log: native2ascii is used Modified: trunk/labs/kosmos/build/build.xml =================================================================== --- trunk/labs/kosmos/build/build.xml 2005-09-16 16:26:24 UTC (rev 1143) +++ trunk/labs/kosmos/build/build.xml 2005-09-16 16:53:07 UTC (rev 1144) @@ -73,11 +73,15 @@ <filter token="build.date" value="${build.date}"/> </filterset> </copy> + <!-- convert resource files --> + <native2ascii encoding="ISO-8859-1" src="${web.dir}" dest="${dist-bin.bin.dir}" includes="**/portlet/**/*portlet.properties"/> + <native2ascii encoding="ISO-8859-2" src="${web.dir}" dest="${dist-bin.bin.dir}" includes="**/portlet/**/*portlet_hu.properties"/> <!-- copy other binary files --> <copy todir="${dist-bin.bin.dir}"> <fileset dir="${web.dir}" excludes="**/*.jsp"> <exclude name="**/portlet-api*.jar"/> <exclude name="**/servletapi*.jar"/> + <exclude name="**/portlet/**/*.properties"/> </fileset> </copy> </target> |
From: <jbo...@li...> - 2005-09-16 16:26:34
|
Author: aron.gombas Date: 2005-09-16 12:26:24 -0400 (Fri, 16 Sep 2005) New Revision: 1143 Modified: trunk/labs/kosmos/web-portlet/WEB-INF/portlet.xml trunk/labs/kosmos/web-server/WEB-INF/web.xml trunk/labs/kosmos/xdocs/reference/reference-manual.xml Log: Port changed 8081 -> 8080 Modified: trunk/labs/kosmos/web-portlet/WEB-INF/portlet.xml =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/portlet.xml 2005-09-16 16:06:56 UTC (rev 1142) +++ trunk/labs/kosmos/web-portlet/WEB-INF/portlet.xml 2005-09-16 16:26:24 UTC (rev 1143) @@ -11,7 +11,7 @@ </init-param> <init-param> <name>service.url</name> - <value>http://localhost:8081/kosmos-server/kosmos-services/cc-service</value> + <value>http://localhost:8080/kosmos-server/kosmos-services/cc-service</value> </init-param> <init-param> <name>monitored.dirs</name><!-- replace these with your local paths --> @@ -44,7 +44,7 @@ </init-param> <init-param> <name>service.url</name> - <value>http://localhost:8081/kosmos-server/kosmos-services/jira-service</value> + <value>http://localhost:8080/kosmos-server/kosmos-services/jira-service</value> </init-param> <init-param> <name>monitored.urls</name> @@ -84,7 +84,7 @@ </init-param> <init-param> <name>service.url</name> - <value>http://localhost:8081/kosmos-server/kosmos-services/jira-service</value> + <value>http://localhost:8080/kosmos-server/kosmos-services/jira-service</value> </init-param> <init-param> <name>monitored.urls</name> @@ -126,7 +126,7 @@ </init-param> <init-param> <name>service.url</name> - <value>http://localhost:8081/kosmos-server/kosmos-services/jira-service</value> + <value>http://localhost:8080/kosmos-server/kosmos-services/jira-service</value> </init-param> <init-param> <name>monitored.urls</name> @@ -187,7 +187,7 @@ </init-param> <init-param> <name>service.url</name> - <value>http://localhost:8081/kosmos-server/kosmos-services/sf-service</value> + <value>http://localhost:8080/kosmos-server/kosmos-services/sf-service</value> </init-param> <init-param> <name>monitored.urls</name> @@ -222,7 +222,7 @@ </init-param> <init-param> <name>service.url</name> - <value>http://localhost:8081/kosmos-server/kosmos-services/sf-service</value> + <value>http://localhost:8080/kosmos-server/kosmos-services/sf-service</value> </init-param> <init-param> <name>monitored.urls</name> @@ -252,7 +252,7 @@ </init-param> <init-param> <name>service.url</name> - <value>http://localhost:8081/kosmos-server/kosmos-services/sf-service</value> + <value>http://localhost:8080/kosmos-server/kosmos-services/sf-service</value> </init-param> <init-param> <name>monitored.urls</name> @@ -283,7 +283,7 @@ </init-param> <init-param> <name>service.url</name> - <value>http://localhost:8081/kosmos-server/kosmos-services/svn-service</value> + <value>http://localhost:8080/kosmos-server/kosmos-services/svn-service</value> </init-param> <init-param> <name>monitored.urls</name> @@ -320,7 +320,7 @@ </init-param> <init-param> <name>service.url</name> - <value>http://localhost:8081/kosmos-server/kosmos-services/svn-service</value> + <value>http://localhost:8080/kosmos-server/kosmos-services/svn-service</value> </init-param> <init-param> <name>monitored.urls</name> Modified: trunk/labs/kosmos/web-server/WEB-INF/web.xml =================================================================== --- trunk/labs/kosmos/web-server/WEB-INF/web.xml 2005-09-16 16:06:56 UTC (rev 1142) +++ trunk/labs/kosmos/web-server/WEB-INF/web.xml 2005-09-16 16:26:24 UTC (rev 1143) @@ -10,7 +10,7 @@ <context-param> <param-name>webdav.url</param-name> - <param-value>http://localhost:8081/slide/files</param-value> + <param-value>http://localhost:8080/slide/files</param-value> </context-param> <context-param> <param-name>webdav.user</param-name> Modified: trunk/labs/kosmos/xdocs/reference/reference-manual.xml =================================================================== --- trunk/labs/kosmos/xdocs/reference/reference-manual.xml 2005-09-16 16:06:56 UTC (rev 1142) +++ trunk/labs/kosmos/xdocs/reference/reference-manual.xml 2005-09-16 16:26:24 UTC (rev 1143) @@ -1161,7 +1161,7 @@ entities: <programlisting><context-param> <param-name>webdav.url</param-name> - <param-value>http://localhost:8081/slide/files</param-value> + <param-value>http://localhost:8080/slide/files</param-value> </context-param> <context-param> <param-name>webdav.user</param-name> @@ -1245,7 +1245,7 @@ <para>It points to the appropriate Hessian-service. For example, in the case of <literal> SfMonitoringPortlet</literal> it can be: <literal> - http://localhost:8081/kosmos-server/sf-service</literal>. + http://localhost:8080/kosmos-server/sf-service</literal>. A quick check to test whether the service is available at the given URL is opening the URL in a normal browser window. You should see a <quote>Hessian requires @@ -1344,7 +1344,7 @@ </init-param> <init-param> <name>service.url</name> - <value>http://localhost:8081/kosmos-server/kosmos-services/sf-service</value> + <value>http://localhost:8080/kosmos-server/kosmos-services/sf-service</value> </init-param> <init-param> <name>monitored.urls</name> |
Author: szimano Date: 2005-09-16 12:06:56 -0400 (Fri, 16 Sep 2005) New Revision: 1142 Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RecentlyChangedPagesPlugin.java Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/wikiPlugins.properties trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttchementDataSource.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java Log: http://jira.jboss.com/jira/browse/JBWIKI-5 recently changed pages Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-16 15:25:24 UTC (rev 1141) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-16 16:06:56 UTC (rev 1142) @@ -26,6 +26,7 @@ <a href="<%=actionURL%>&page=<%=defaultPage%>"><%=wikiName%></a> : <%=wikiPage%> </td> <td style="text-align: right;"> +[<a href="<%=actionURL%>&type=recentChanges">Recent changes</a>] [<a href="<%=actionURL%>&page=<%=defaultPage%>"><%=defaultPage%></a>] </td> </table> Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-16 15:25:24 UTC (rev 1141) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-16 16:06:56 UTC (rev 1142) @@ -65,4 +65,16 @@ <class>org.jboss.wiki.plugins.AttachementInfoPlugin</class> </plugin> </wikiType> + <wikiType> + <name>recentChanges</name> + <class>org.jboss.wiki.plugins.DefaultWikiType</class> + <plugin> + <name>recentChanges</name> + <class>org.jboss.wiki.plugins.RecentlyChangedPagesPlugin</class> + </plugin> + <plugin> + <name>HTMLTranslatorParts</name> + <class>org.jboss.wiki.plugins.HTMLTranslatorParts</class> + </plugin> + </wikiType> </wikiTypes> \ No newline at end of file Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/wikiPlugins.properties =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/wikiPlugins.properties 2005-09-16 15:25:24 UTC (rev 1141) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/wikiPlugins.properties 2005-09-16 16:06:56 UTC (rev 1142) @@ -5,3 +5,6 @@ #wikiHome part of url. Leave it you use default portlet conifguration wikiHome = /portal/index.html?ctrl:id=window.default.WikiPortletWindow&ctrl:type=action + +#number of days that should be included in recent changes plugin +recentDays = 30 Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttchementDataSource.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttchementDataSource.java 2005-09-16 15:25:24 UTC (rev 1141) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttchementDataSource.java 2005-09-16 16:06:56 UTC (rev 1142) @@ -9,8 +9,6 @@ public Set<String> getAttachementsSet(WikiPage page); - public Set<String> getAllPageNames(); - public WikiAttachment getAttachement(String pageName, String attachementName); public WikiAttachment getAttachement(String pageName, String attachementName, int version); Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java 2005-09-16 15:25:24 UTC (rev 1141) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java 2005-09-16 16:06:56 UTC (rev 1142) @@ -81,6 +81,8 @@ public void getContentAtVersion(WikiPage page, boolean loadContent, int version); + + public Set<String> getAllPageNames(); } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-16 15:25:24 UTC (rev 1141) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-16 16:06:56 UTC (rev 1142) @@ -351,7 +351,7 @@ Map<String, Integer> resPages = new HashMap<String, Integer>(); - Set<String> pages = getAttachementDataSource().getAllPageNames(); + Set<String> pages = getMediaDataSource().getAllPageNames(); for (String name : pages) { WikiPage temp = getByName(name, null); Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java 2005-09-16 15:25:24 UTC (rev 1141) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java 2005-09-16 16:06:56 UTC (rev 1142) @@ -12,9 +12,7 @@ StringBuilder history = new StringBuilder(); String attachementName = (String)wikiSession.getAttribute("var1"); Object rollbackToVer = wikiSession.getAttribute("var2"); - - System.out.println(rollbackToVer); - + String attURL = (String)wikiSession.getAttribute("hostURL")+"/wiki/"+wikiPage.getName()+"/"; String actionURL = (String)wikiSession.getAttribute("actionURL"); Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-16 15:25:24 UTC (rev 1141) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-16 16:06:56 UTC (rev 1142) @@ -1020,8 +1020,7 @@ endIndx); String replace = parseLinks(pagePart).replaceAll("&", "&"); - newPageContent = newPageContent.substring(0, lastBegIndx - + pagePartRegexStart.length()) + newPageContent = newPageContent.substring(0, lastBegIndx) + replace + newPageContent.substring(endIndx + pagePartRegexEnd.length()); Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RecentlyChangedPagesPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RecentlyChangedPagesPlugin.java 2005-09-16 15:25:24 UTC (rev 1141) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RecentlyChangedPagesPlugin.java 2005-09-16 16:06:56 UTC (rev 1142) @@ -0,0 +1,94 @@ +package org.jboss.wiki.plugins; + +import java.util.Calendar; +import java.util.Date; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; + +import org.jboss.wiki.WikiPage; +import org.jboss.wiki.WikiPlugin; +import org.jboss.wiki.WikiSession; + +public class RecentlyChangedPagesPlugin extends WikiPlugin { + + private int numOfDays = 30; + + @Override + public WikiPage process(WikiPage wikiPage, WikiSession wikiSession) { + StringBuilder recentChanges = new StringBuilder(); + + recentChanges.append("<h3>Recent changes from last ").append(numOfDays).append(" days</h3>\n"); + recentChanges.append("<hr>\n"); + recentChanges.append(HTMLTranslatorParts.pagePartRegexStart); + + int offset = recentChanges.length(); + + Set<String> pages = wikiEngine.getMediaDataSource().getAllPageNames(); + + TreeMap<Calendar, TreeSet<String>> sortedByDate = new TreeMap<Calendar, TreeSet<String>>(); + + // get now date + Calendar now = Calendar.getInstance(); + Calendar then = Calendar.getInstance(); + now.setTime(new Date()); + + for (String name : pages) { + WikiPage temp = wikiEngine.getByName(name, null); + then.setTime(temp.getEditDate()); + + then.add(Calendar.DAY_OF_MONTH, numOfDays); + + if (then.after(now)) { + //this page has been edited in last numOfDays days + Calendar key = Calendar.getInstance(); + + key.setTime(temp.getEditDate()); + + //make it 0:00:00 hour + key.set(Calendar.HOUR, 0); + key.set(Calendar.MINUTE, 0); + key.set(Calendar.SECOND, 0); + key.set(Calendar.MILLISECOND, 0); + + if (sortedByDate.get(key) == null) { + TreeSet<String> set = new TreeSet<String>(); + set.add(temp.getName()); + sortedByDate.put(key, set); + } + else { + sortedByDate.get(key).add(temp.getName()); + } + } + } + + // add pages to recentChanges page + + Set<Calendar> keySet = sortedByDate.keySet(); + + for (Calendar date : keySet) { + StringBuilder day = new StringBuilder(); + + day.append("!''").append(date.get(Calendar.DAY_OF_MONTH)).append("/").append(date.get(Calendar.MONTH)).append("/").append(date.get(Calendar.YEAR)).append("''\n"); + for (String pageName : sortedByDate.get(date)) { + day.append("[").append(pageName).append("]\\\\\n"); + } + + recentChanges.insert(offset, day.toString()); + } + + recentChanges.append(HTMLTranslatorParts.pagePartRegexEnd).append("\n"); + + wikiPage.setPageContent(recentChanges.toString()); + + return wikiPage; + } + + @Override + public void init() { + if (getProperty("recentDays") != null) { + numOfDays = Integer.valueOf(getProperty("recentDays")); + } + } + +} |