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
|
From: <jbo...@li...> - 2005-09-27 13:23:48
|
Author: adamw Date: 2005-09-27 09:23:35 -0400 (Tue, 27 Sep 2005) New Revision: 1220 Added: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/AddDelayedOperation.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/CommitDelayedOperation.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/DelayedOperation.java Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNewNode.java trunk/forge/portal-extensions/shotoku/shotoku-test/src/java/org/jboss/shotoku/test/ShotokuTest.java Log: Property get/set, improved delayed operations support Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java 2005-09-27 10:16:00 UTC (rev 1219) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java 2005-09-27 13:23:35 UTC (rev 1220) @@ -52,7 +52,7 @@ * @return True if there are any changes in properties. */ protected boolean checkForChanges() { - return modifiedProperties.size() > 1; + return modifiedProperties.size() > 0; } /** Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java 2005-09-27 10:16:00 UTC (rev 1219) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java 2005-09-27 13:23:35 UTC (rev 1220) @@ -81,7 +81,7 @@ public Directory getDirectory(String path) { File file = getFileForPath(path); - if (!file.isFile()) + if (!file.isDirectory()) throw new ResourceDoesNotExist(); return new SvnDirectory(id, getPrefixedPath(path), file); Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java 2005-09-27 10:16:00 UTC (rev 1219) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java 2005-09-27 13:23:35 UTC (rev 1220) @@ -9,6 +9,7 @@ import org.jboss.shotoku.Node; import org.jboss.shotoku.NodeList; import org.jboss.shotoku.exceptions.RepositoryException; +import org.jboss.shotoku.exceptions.ResourceAlreadyExists; public class SvnDirectory extends AbstractSvnResource implements Directory { public SvnDirectory(String id, String fullPath, File file) { @@ -69,9 +70,15 @@ public Node newNode(String name) { String childFullPath = fullPath + '/' + name; + try { - return new SvnNewNode(id, childFullPath, new File(service - .getFileSystemPath(id, childFullPath))); + File newFile = new File(service.getFileSystemPath(id, + childFullPath)); + + if (newFile.exists()) + throw new ResourceAlreadyExists(); + + return new SvnNewNode(id, childFullPath, newFile); } catch (SvnOperationFailed e) { throw new RepositoryException(e); } @@ -80,8 +87,13 @@ public Directory newDirectory(String name) { String childFullPath = fullPath + '/' + name; try { - return new SvnNewDirectory(id, childFullPath, new File(service - .getFileSystemPath(id, childFullPath))); + File newDir = new File(service.getFileSystemPath(id, + childFullPath)); + + if (newDir.exists()) + throw new ResourceAlreadyExists(); + + return new SvnNewDirectory(id, childFullPath, newDir); } catch (SvnOperationFailed e) { throw new RepositoryException(e); } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNewNode.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNewNode.java 2005-09-27 10:16:00 UTC (rev 1219) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNewNode.java 2005-09-27 13:23:35 UTC (rev 1220) @@ -84,8 +84,15 @@ return -1; } + protected boolean checkForChanges() { + if (saved) + return super.checkForChanges(); + else + return true; + } + @Override - public void save(String logMessage) { + public void save(String logMessage) throws RepositoryException { if (!saved) { try { file.createNewFile(); @@ -95,11 +102,11 @@ } catch (SvnOperationFailed e) { throw new RepositoryException(e); } - - saved = true; } super.save(logMessage); + + saved = true; } @Override Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java 2005-09-27 10:16:00 UTC (rev 1219) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java 2005-09-27 13:23:35 UTC (rev 1220) @@ -1,19 +1,22 @@ package org.jboss.shotoku.svn.service; import java.io.File; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Set; import java.util.concurrent.Semaphore; import org.apache.log4j.Logger; +import org.jboss.shotoku.svn.SvnOperationFailed; +import org.jboss.shotoku.svn.service.operations.DelayedOperation; import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.core.SVNURL; import org.tmatesoft.svn.core.wc.ISVNOptions; +import org.tmatesoft.svn.core.wc.ISVNPropertyHandler; import org.tmatesoft.svn.core.wc.SVNClientManager; -import org.tmatesoft.svn.core.wc.SVNCommitClient; +import org.tmatesoft.svn.core.wc.SVNPropertyData; import org.tmatesoft.svn.core.wc.SVNRevision; import org.tmatesoft.svn.core.wc.SVNUpdateClient; import org.tmatesoft.svn.core.wc.SVNWCUtil; @@ -30,7 +33,7 @@ private String url; private String localpath; private File wc; - private Set<String[]> toCommit; + private List<DelayedOperation> delayedOperations; private Map<String, Semaphore> semaphores; public SvnRepository(String username, String password, @@ -43,7 +46,7 @@ this.localpath = localpath; wc = new File(localpath); - toCommit = Collections.synchronizedSet(new HashSet<String[]>()); + delayedOperations = Collections.synchronizedList(new ArrayList<DelayedOperation>()); semaphores = new HashMap<String, Semaphore>(); } @@ -81,44 +84,43 @@ SVNRevision.HEAD, SVNRevision.HEAD, true); } } catch (SVNException e) { + // TODO e.printStackTrace(); + tryCleanup(); } } /** - * Adds a given file with a given log message to a commit queue. - * @param path Path (file/ directory) to commit. - * @param logMessage Log message with thich to commit. + * Adds a delayed operation to an execution queue. + * @param op Operation to add. */ - public void addToCommit(String path, String logMessage) { - toCommit.add(new String[] { path, logMessage }); + public void addDelayedOperation(DelayedOperation op) { + delayedOperations.add(op); } /** - * Commits all paths (files/ directories) that were scheduled for a commit. + * Performs all scheduled delayed operations. */ - public void commit() { - String[][] allToCommit; + public void performDelayedOperations() { + DelayedOperation[] allOps; - synchronized (toCommit) { - allToCommit = toCommit.toArray(new String[0][0]); - toCommit.clear(); + synchronized (delayedOperations) { + allOps = delayedOperations.toArray(new DelayedOperation[0]); + delayedOperations.clear(); } - for (String[] oneToCommit : allToCommit) { - SVNCommitClient commitClient = ourClientManager.getCommitClient(); + for (DelayedOperation op : allOps) { try { - log.info("Commiting: " + oneToCommit[0]); - commitClient.doCommit( - new File[] { new File(getFileSystemPath(oneToCommit[0])) }, - false, oneToCommit[1], true, false); + log.info("Performing delayed op: " + op.getClass().getName()); - putWriteLock(oneToCommit[0]); + op.performOperation(ourClientManager); } catch (SVNException e) { + // TODO Delete + e.printStackTrace(); + tryCleanup(); - putWriteLock(oneToCommit[0]); - log.warn("Commiting: " + oneToCommit[0] + " failed", e); + log.warn("Performing delayed op: " + op.getClass().getName() + " failed.", e); } } } @@ -159,4 +161,30 @@ return '/' == File.separatorChar ? path : path.replace('/', File.separatorChar); } + + public String getProperty(String path, String name) + throws SvnOperationFailed { + try { + SVNPropertyData data = + ourClientManager.getWCClient().doGetProperty( + new File(getFileSystemPath(path)), name, + SVNRevision.WORKING, SVNRevision.WORKING, + false); + + return data == null ? null : data.getValue(); + } catch (SVNException e) { + throw new SvnOperationFailed(e); + } + } + + public void setProperty(String path, String name, String value) + throws SvnOperationFailed { + try { + ourClientManager.getWCClient().doSetProperty( + new File(getFileSystemPath(path)), name, + value, true, false, ISVNPropertyHandler.NULL); + } catch (SVNException e) { + throw new SvnOperationFailed(e); + } + } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2005-09-27 10:16:00 UTC (rev 1219) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2005-09-27 13:23:35 UTC (rev 1220) @@ -12,7 +12,10 @@ import org.jboss.annotation.ejb.Service; import org.jboss.shotoku.ContentManager; import org.jboss.shotoku.Tools; +import org.jboss.shotoku.svn.SvnOperationFailed; import org.jboss.shotoku.svn.SvnService; +import org.jboss.shotoku.svn.service.operations.AddDelayedOperation; +import org.jboss.shotoku.svn.service.operations.CommitDelayedOperation; import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory; import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl; import org.w3c.dom.Document; @@ -112,7 +115,7 @@ public void update() { for (SvnRepository repo : repositories.values()) { repo.update(); - repo.commit(); + repo.performDelayedOperations(); } } @@ -128,16 +131,21 @@ repositories.get(id).putWriteLock(path); } - public void commit(String id, String path, String logMessage) { - repositories.get(id).addToCommit(path, logMessage); + public void commit(String id, String path, String logMessage) + throws SvnOperationFailed { + SvnRepository repo = repositories.get(id); + repo.addDelayedOperation( new CommitDelayedOperation(repo, path, + logMessage)); } - public void setProperty(String id, String path, String name, String value) { - + public void setProperty(String id, String path, String name, String value) + throws SvnOperationFailed{ + repositories.get(id).setProperty(path, name, value); } - public String getProperty(String id, String path, String name) { - return null; + public String getProperty(String id, String path, String name) + throws SvnOperationFailed{ + return repositories.get(id).getProperty(path, name); } public String getNodeAtRevision(String id, String path, int revision) { @@ -156,8 +164,9 @@ } - public void add(String id, String path) { - + public void add(String id, String path) throws SvnOperationFailed { + SvnRepository repo = repositories.get(id); + repo.addDelayedOperation(new AddDelayedOperation(repo, path)); } public String getFileSystemPath(String id, String path) { Added: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/AddDelayedOperation.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/AddDelayedOperation.java 2005-09-27 10:16:00 UTC (rev 1219) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/AddDelayedOperation.java 2005-09-27 13:23:35 UTC (rev 1220) @@ -0,0 +1,22 @@ +package org.jboss.shotoku.svn.service.operations; + +import java.io.File; + +import org.jboss.shotoku.svn.service.SvnRepository; +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.wc.SVNClientManager; + +public class AddDelayedOperation implements DelayedOperation { + private String fileSystemPath; + + public AddDelayedOperation(SvnRepository repo, String path) { + fileSystemPath = repo.getFileSystemPath(path); + } + + public void performOperation(SVNClientManager clientManager) + throws SVNException { + clientManager.getWCClient().doAdd(new File(fileSystemPath), true, + false, false, false); + } + +} Added: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/CommitDelayedOperation.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/CommitDelayedOperation.java 2005-09-27 10:16:00 UTC (rev 1219) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/CommitDelayedOperation.java 2005-09-27 13:23:35 UTC (rev 1220) @@ -0,0 +1,34 @@ +package org.jboss.shotoku.svn.service.operations; + +import java.io.File; + +import org.jboss.shotoku.svn.service.SvnRepository; +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.wc.SVNClientManager; + +public class CommitDelayedOperation implements DelayedOperation { + private String path; + + private String logMessage; + + private SvnRepository repo; + + public CommitDelayedOperation(SvnRepository repo, String path, + String logMessage) { + this.path = path; + this.logMessage = logMessage; + this.repo = repo; + } + + public void performOperation(SVNClientManager clientManager) + throws SVNException { + try { + clientManager.getCommitClient().doCommit( + new File[] { new File(repo.getFileSystemPath(path)) }, + false, logMessage, true, false); + } finally { + repo.putWriteLock(path); + } + } + +} Added: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/DelayedOperation.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/DelayedOperation.java 2005-09-27 10:16:00 UTC (rev 1219) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/operations/DelayedOperation.java 2005-09-27 13:23:35 UTC (rev 1220) @@ -0,0 +1,9 @@ +package org.jboss.shotoku.svn.service.operations; + +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.wc.SVNClientManager; + +public interface DelayedOperation { + public void performOperation(SVNClientManager clientManager) + throws SVNException; +} Modified: trunk/forge/portal-extensions/shotoku/shotoku-test/src/java/org/jboss/shotoku/test/ShotokuTest.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-test/src/java/org/jboss/shotoku/test/ShotokuTest.java 2005-09-27 10:16:00 UTC (rev 1219) +++ trunk/forge/portal-extensions/shotoku/shotoku-test/src/java/org/jboss/shotoku/test/ShotokuTest.java 2005-09-27 13:23:35 UTC (rev 1220) @@ -21,7 +21,7 @@ ContentManager cm = ContentManager.getContentManager(""); - String filePath = "shotoku-test/test1.txt"; + /*String filePath = "shotoku-test/test1.txt"; Node n = cm.getNode(filePath); @@ -40,7 +40,13 @@ pw.println("Saving ... <br />"); n.save("Shotoku test 2"); - pw.println("done<br />"); + pw.println("done<br />");*/ + + Node n = cm.getNode("shotoku-test/test2.txt"); + pw.println(n.getProperty("z") + "<br />"); + n.setProperty("z", "y"); + pw.println(n.getProperty("z") + "<br />"); + n.save("test"); } } |
Author: adamw Date: 2005-09-27 06:16:00 -0400 (Tue, 27 Sep 2005) New Revision: 1219 Added: trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/portlet.css Modified: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/layouts/jbossForge.jsp Log: Added a css for portlets Modified: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java 2005-09-27 06:25:06 UTC (rev 1218) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java 2005-09-27 10:16:00 UTC (rev 1219) @@ -73,8 +73,6 @@ private Set<String> allLinks; - - public Entry(String portalName, Node root) { permission = XmlTools.getAttributeValue(root, PERMISSION_ATTRIBUTE); Modified: trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/layouts/jbossForge.jsp =================================================================== --- trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/layouts/jbossForge.jsp 2005-09-27 06:25:06 UTC (rev 1218) +++ trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/layouts/jbossForge.jsp 2005-09-27 10:16:00 UTC (rev 1219) @@ -19,6 +19,7 @@ <link rel="stylesheet" href="/jbossForge/common.css" type="text/css" media="all"> <link rel="stylesheet" href="/jbossForge/jboss-forge.css" type="text/css" media="all"> <link rel="stylesheet" href="/jbossForge/jboss-forge-forums.css" type="text/css" media="all"> +<link rel="stylesheet" href="/jbossForge/portlet.css" type="text/css" media="all"> <!-- insert the dynamically determined theme elements here, or use the 'simple-sample' theme by default --> <!-- <p:theme themeName='jboss-forge' /> --> Added: trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/portlet.css =================================================================== --- trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/portlet.css 2005-09-27 06:25:06 UTC (rev 1218) +++ trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/portlet.css 2005-09-27 10:16:00 UTC (rev 1219) @@ -0,0 +1,200 @@ +/******** +* FONTS * +*********/ + +/* Font attributes for the normal fragment font. + Used for the display of non-accentuated information */ +.portlet-font { + color:#4A4A4A; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + margin-top: 7px; + margin-bottom: 5px; +} + +/* Font attributes similar to the portlet.font but the color is lighter */ +.portlet-font-dim { + color:#FFFFFF; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; +} +/******** +* FORMS * +*********/ + +/* Text used for the descriptive label of the whole form (not the label for fields) */ +.portlet-form-label { + color:#4A4A4A; + text-decoration:none; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; +} + +/* Text of the user-input in an input field */ +.portlet-form-input-field { + color:#4A4A4A; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; +} + +/* Text on a button */ +.portlet-form-button { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + font-weight: bold; + color: #270F07; +} + +/* Text that appears beside a context dependent action icon */ +.portlet-icon-label { + +} + +/* Text that appears beside a "standard" icon (e.g Ok, or Cancel) */ +.portlet-dlg-icon-label { + +} + +/* Text for a separator of fields (e.g. checkboxes, etc.) */ +.portlet-form-field-label { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + color: #4A4A4A; + +} + +/* Text for a field (not input field, eg. checkboxes, etc.) */ +.portlet-form-field { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + color: #4A4A4A; + margin-top: 10px; + +} + +/*********** +* MESSAGES * +************/ + +/* Status of the current operation. */ +.portlet-msg-status { + +} + +/* Help messages, general additional information, etc. */ +.portlet-msg-info { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + font-style: italic; + color: #242424; + +} + +/* Error messages. */ +.portlet-msg-error { + color:red; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + font-weight: bold; +} + +/* Warning messages. */ +.portlet-msg-alert { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + font-weight: bold; + +} + +/* Verification of the successful completion of a task. */ +.portlet-msg-success { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + font-weight: bold; + color: #00FF00; + +} +/*********** +* SECTIONS * +************/ + +/* Table or section header */ +.portlet-section-header { + font-weight: bold; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 14px; + /*background-image: url(interf/head.jpg);*/ +} + +/* Normal text in a table cell */ +.portlet-section-body { + background-color: #F0F0F0; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; +} + +/* Text in every other row in the cell */ +.portlet-section-alternate { + background-color: #E0E0E0; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; +} + +/* Text in a selected cell range */ +.portlet-section-selected { + background-color: #89AEC6; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; +} + +/* Text of a subheading */ +.portlet-section-subheader { + font-weight: bold; + font-size: 9px; + font-family: Verdana, Arial, Helvetica, sans-serif; + color: #FFFFFF; + margin: 3px; + padding: 3px; +} + +/* Table or section footnote */ +.portlet-section-footer { + font-size: 6px; +} + +/* Text that belongs to the table but does not fall in one of the other categories + (e.g. explanatory or help text that is associated with the section. */ +.portlet-section-text { + +} + +/******** +* MENUS * +*********/ + +.portlet-menu { + +} + +.portlet-menu-item { + color: #242424; + text-decoration: none; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; +} + +.portlet-menu-item:hover { + color: #5699B7; + text-decoration: none; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; +} + +.portlet-form-field-middle { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + color: #4A4A4A; + margin-top: 10px; + width: 91px; +} + |
From: <jbo...@li...> - 2005-09-27 06:25:24
|
Author: aron.gombas Date: 2005-09-27 02:25:06 -0400 (Tue, 27 Sep 2005) New Revision: 1218 Added: trunk/labs/kosmos/web-portlet/pages/images/green_light.gif trunk/labs/kosmos/web-portlet/pages/images/red_light.gif trunk/labs/kosmos/web-portlet/pages/images/yellow_light.gif Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet_hu.properties trunk/labs/kosmos/web-portlet/pages/cc_monitoring.jsp trunk/labs/kosmos/web-portlet/pages/cc_monitoring_help.jsp trunk/labs/kosmos/web-portlet/pages/cc_monitoring_test_details.jsp trunk/labs/kosmos/web-portlet/pages/images/error.gif trunk/labs/kosmos/web-portlet/pages/images/success.gif trunk/labs/kosmos/web-portlet/pages/includes/legend.jsp Log: Testcase details 99% done Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet.properties 2005-09-27 06:24:30 UTC (rev 1217) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet.properties 2005-09-27 06:25:06 UTC (rev 1218) @@ -18,14 +18,14 @@ ccproject.tests=Tests Total ccproject.testsPerCategory=Tests Success Rate -status.success=Successful build with successful tests. -status.failure=Failed build or successful build with test failures, errors. - legend.title=Legend +legend.success=Successful build and tests. +legend.warning=Successful build with test failures, errors. +legend.error=Failed build. legend.buildSuccess=Successful build. legend.buildError=Failed build. legend.testSuccess=Succesful test. -legend.testFailure=Failed test. +legend.testWarning=Failed test. legend.testError=Test error. lastupdate=Last Update Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet_hu.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet_hu.properties 2005-09-27 06:24:30 UTC (rev 1217) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet_hu.properties 2005-09-27 06:25:06 UTC (rev 1218) @@ -18,14 +18,14 @@ ccproject.tests=Unit Tesztek szesen ccproject.testsPerCategory=Unit Teszt Eloszl -status.success=Sikeres build sikeres tesztekkel. -status.failure=Sikertelen build vagy sikeres build sikertelen tesztekkel. - legend.title=Jelmagyart +legend.success=Sikeres build sikeres tesztekkel. +legend.warning=Sikeres build sikertelen vagy hibtesztekkel. +legend.error=Sikertelen build. legend.buildSuccess=Sikeres build. legend.buildError=Sikertelen build. legend.testSuccess=Sikeres unit teszt. -legend.testFailure=Sikertelen unit teszt. +legend.testWarning=Sikertelen unit teszt. legend.testError=Hibunit teszt. lastupdate=Utolsisss Modified: trunk/labs/kosmos/web-portlet/pages/cc_monitoring.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/cc_monitoring.jsp 2005-09-27 06:24:30 UTC (rev 1217) +++ trunk/labs/kosmos/web-portlet/pages/cc_monitoring.jsp 2005-09-27 06:25:06 UTC (rev 1218) @@ -8,10 +8,13 @@ <display:column style="width:20px"> <c:choose> <c:when test="${(projectsIt.status == 1) && (projectsIt.failures == 0) && (projectsIt.errors == 0)}"> - <img src="<%= renderRequest.getContextPath() %>/pages/images/success.gif" title="<fmt:message key="status.success"/>"/> + <img src="<%= renderRequest.getContextPath() %>/pages/images/success.gif" title="<fmt:message key="legend.success"/>"/> </c:when> + <c:when test="${(projectsIt.status == 1)}"> + <img src="<%= renderRequest.getContextPath() %>/pages/images/warning.gif" title="<fmt:message key="legend.warning"/>"/> + </c:when> <c:otherwise> - <img src="<%= renderRequest.getContextPath() %>/pages/images/error.gif" title="<fmt:message key="status.failure"/>"/> + <img src="<%= renderRequest.getContextPath() %>/pages/images/error.gif" title="<fmt:message key="legend.error"/>"/> </c:otherwise> </c:choose> </display:column> Modified: trunk/labs/kosmos/web-portlet/pages/cc_monitoring_help.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/cc_monitoring_help.jsp 2005-09-27 06:24:30 UTC (rev 1217) +++ trunk/labs/kosmos/web-portlet/pages/cc_monitoring_help.jsp 2005-09-27 06:25:06 UTC (rev 1218) @@ -8,7 +8,11 @@ <%@include file="includes/help.jsp"%> <c:set var="legend_success" value="1"/> +<c:set var="legend_warning" value="1"/> <c:set var="legend_error" value="1"/> +<c:set var="legend_test_success" value="1"/> +<c:set var="legend_test_warning" value="1"/> +<c:set var="legend_test_error" value="1"/> <%@include file="includes/legend.jsp"%> <form action="<portlet:renderURL portletMode="view"/>" method="post"> Modified: trunk/labs/kosmos/web-portlet/pages/cc_monitoring_test_details.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/cc_monitoring_test_details.jsp 2005-09-27 06:24:30 UTC (rev 1217) +++ trunk/labs/kosmos/web-portlet/pages/cc_monitoring_test_details.jsp 2005-09-27 06:25:06 UTC (rev 1218) @@ -42,38 +42,56 @@ </td> </tr> <tr class="portlet-section-alternate"> - <td><fmt:message key="ccproject.testsPerCategory"/>:</td> - <td><img src="<c:out value="${project.testsPerCategoryChartUrl}"/>" title="<fmt:message key="ccproject.testsPerCategory"/>"/></td> + <td valign="top"><fmt:message key="ccproject.testsPerCategory"/>:</td> + <td valign="top"><img src="<c:out value="${project.testsPerCategoryChartUrl}"/>" title="<fmt:message key="ccproject.testsPerCategory"/>"/></td> <td valign="top"> + + + +<!-- TODO ezt csak ilyen benan lehet? --> +<c:forEach items="${project.testCases}" varStatus="status"> + <c:set var="listSize" value="${status.index}"/> +</c:forEach> + +<%@include file="includes/table_expander.jsp" %> + + + + <table> <c:forEach var="testcase" items="${project.testCases}" varStatus="status"> - <c:if test="${status.index < 138}"><!-- TODO 8, tooltips, result ordered by type? --> - <tr class="portlet-section-body"> - <td> - <c:choose> - <c:when test="${testcase.result == 1}"> - <img src="<%= renderRequest.getContextPath() %>/pages/images/success.gif" title="<fmt:message key="legend.testSuccess"/>"/> - </c:when> - <c:when test="${testcase.result == -1}"> - <img src="<%= renderRequest.getContextPath() %>/pages/images/failure.gif" title="<fmt:message key="legend.testFailure"/>"/> - </c:when> - <c:otherwise> - <img src="<%= renderRequest.getContextPath() %>/pages/images/error.gif" title="<fmt:message key="legend.testError"/>"/> - </c:otherwise> - </c:choose> - </td> - <td> - <c:if test="${testcase.result != 1}"><span class="portlet-msg-error"></c:if> - <c:out value="${testcase.className}"/> - <c:if test="${testcase.result != 1}"></span></c:if> - </td> - <td> - <c:if test="${testcase.result != 1}"><span class="portlet-msg-error"></c:if> - <c:out value="${testcase.testCaseName}"/> - <c:if test="${testcase.result != 1}"></span></c:if> - </td> - </tr> - </c:if> + <c:choose> + <c:when test="${status.index < 10}"> + <tr id="row-<portlet:namespace/>-<c:out value="${status.index}"/>" class="portlet-section-body"> + </c:when> + <c:otherwise> + <tr id="row-<portlet:namespace/>-<c:out value="${status.index}"/>" style="display: none" class="portlet-section-body"> + </c:otherwise> + </c:choose> + <td> + <c:choose> + <c:when test="${testcase.result == 1}"> + <img src="<%= renderRequest.getContextPath() %>/pages/images/green_light.gif" title="<fmt:message key="legend.testSuccess"/>"/> + </c:when> + <c:when test="${testcase.result == -1}"> + <img src="<%= renderRequest.getContextPath() %>/pages/images/yellow_light.gif" title="<fmt:message key="legend.testWarning"/>"/> + </c:when> + <c:otherwise> + <img src="<%= renderRequest.getContextPath() %>/pages/images/red_light.gif" title="<fmt:message key="legend.testError"/>"/> + </c:otherwise> + </c:choose> + </td> + <td> + <c:if test="${testcase.result != 1}"><span class="portlet-msg-error"></c:if> + <c:out value="${testcase.className}"/> + <c:if test="${testcase.result != 1}"></span></c:if> + </td> + <td> + <c:if test="${testcase.result != 1}"><span class="portlet-msg-error"></c:if> + <c:out value="${testcase.testCaseName}"/> + <c:if test="${testcase.result != 1}"></span></c:if> + </td> + </tr> </c:forEach> </table> </td> Modified: trunk/labs/kosmos/web-portlet/pages/images/error.gif =================================================================== (Binary files differ) Added: trunk/labs/kosmos/web-portlet/pages/images/green_light.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/kosmos/web-portlet/pages/images/green_light.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/kosmos/web-portlet/pages/images/red_light.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/kosmos/web-portlet/pages/images/red_light.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/labs/kosmos/web-portlet/pages/images/success.gif =================================================================== (Binary files differ) Added: trunk/labs/kosmos/web-portlet/pages/images/yellow_light.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/kosmos/web-portlet/pages/images/yellow_light.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/labs/kosmos/web-portlet/pages/includes/legend.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/includes/legend.jsp 2005-09-27 06:24:30 UTC (rev 1217) +++ trunk/labs/kosmos/web-portlet/pages/includes/legend.jsp 2005-09-27 06:25:06 UTC (rev 1218) @@ -15,14 +15,29 @@ <td><img src="<%= renderRequest.getContextPath() %>/pages/images/success.gif"/></td><td><fmt:message key="legend.success"/></td> </tr> </c:if> + <c:if test="${legend_warning == '1'}"> + <tr class="portlet-section-alternate"> + <td><img src="<%= renderRequest.getContextPath() %>/pages/images/warning.gif"/></td><td><fmt:message key="legend.warning"/></td> + </tr> + </c:if> <c:if test="${legend_error == '1'}"> - <tr class="portlet-section-alternate"> + <tr class="portlet-section-body"> <td><img src="<%= renderRequest.getContextPath() %>/pages/images/error.gif"/></td><td><fmt:message key="legend.error"/></td> </tr> </c:if> - <c:if test="${legend_warning == '1'}"> + <c:if test="${legend_test_success == '1'}"> + <tr class="portlet-section-alternate"> + <td><img src="<%= renderRequest.getContextPath() %>/pages/images/red_light.gif"/></td><td><fmt:message key="legend.testSuccess"/></td> + </tr> + </c:if> + <c:if test="${legend_test_warning == '1'}"> <tr class="portlet-section-body"> - <td><img src="<%= renderRequest.getContextPath() %>/pages/images/warning.gif"/></td><td><fmt:message key="legend.warning"/></td> + <td><img src="<%= renderRequest.getContextPath() %>/pages/images/yellow_light.gif"/></td><td><fmt:message key="legend.testWarning"/></td> </tr> </c:if> + <c:if test="${legend_test_error == '1'}"> + <tr class="portlet-section-alternate"> + <td><img src="<%= renderRequest.getContextPath() %>/pages/images/green_light.gif"/></td><td><fmt:message key="legend.testError"/></td> + </tr> + </c:if> </table> |
From: <jbo...@li...> - 2005-09-27 06:24:44
|
Author: aron.gombas Date: 2005-09-27 02:24:30 -0400 (Tue, 27 Sep 2005) New Revision: 1217 Added: trunk/labs/kosmos/web-portlet/pages/images/collapse.gif trunk/labs/kosmos/web-portlet/pages/images/expand.gif trunk/labs/kosmos/web-portlet/pages/includes/table_expander.jsp Modified: trunk/labs/kosmos/web-portlet/pages/svn_monitoring_activity_details.jsp Log: Expandable lists initial checkin Added: trunk/labs/kosmos/web-portlet/pages/images/collapse.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/kosmos/web-portlet/pages/images/collapse.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/kosmos/web-portlet/pages/images/expand.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/kosmos/web-portlet/pages/images/expand.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/kosmos/web-portlet/pages/includes/table_expander.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/includes/table_expander.jsp 2005-09-26 21:17:50 UTC (rev 1216) +++ trunk/labs/kosmos/web-portlet/pages/includes/table_expander.jsp 2005-09-27 06:24:30 UTC (rev 1217) @@ -0,0 +1,6 @@ +<script language="javascript" type="text/javascript"> + <%@include file="../scripts/main.js"%> +</script> +<a href="javascript:void(0)" onclick="javascript:toggle('row-<portlet:namespace/>-', 'expander-<portlet:namespace/>', <c:out value="${listSize}"/>, '<%= renderRequest.getContextPath() %>/pages/images/expand.gif', '<%= renderRequest.getContextPath() %>/pages/images/collapse.gif')"> + <img id="expander-<portlet:namespace/>" border="0" src="<%= renderRequest.getContextPath() %>/pages/images/expand.gif" title="TODO Expand List"/> +</a> 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-26 21:17:50 UTC (rev 1216) +++ trunk/labs/kosmos/web-portlet/pages/svn_monitoring_activity_details.jsp 2005-09-27 06:24:30 UTC (rev 1217) @@ -29,23 +29,38 @@ <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"><fmt:message key="svnrepository.commitHistory"/>:</td> + <td valign="top"><img src="<c:out value="${repository.commitsPerWeekChartUrl}"/>" title="<fmt:message key="svnrepository.commitHistory"/>"/></td> <td colspan="2" valign="top"> + +<!-- TODO ezt csak ilyen benan lehet? --> +<c:forEach items="${repository.commits}" varStatus="status"> + <c:set var="listSize" value="${status.index}"/> +</c:forEach> + +<%@include file="includes/table_expander.jsp" %> + + + <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:choose> + <c:when test="${status.index < 10}"> + <tr id="row-<portlet:namespace/>-<c:out value="${status.index}"/>" class="portlet-section-alternate"> + </c:when> + <c:otherwise> + <tr id="row-<portlet:namespace/>-<c:out value="${status.index}"/>" style="display: none" class="portlet-section-alternate"> + </c:otherwise> + </c:choose> + <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:forEach> </table> </td> |
Author: adamw Date: 2005-09-26 16:56:01 -0400 (Mon, 26 Sep 2005) New Revision: 1215 Added: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/NodeReadOnly.java trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/RepositoryException.java trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/ResourceAlreadyExists.java trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/ResourceDoesNotExist.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceLocal.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceManagement.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnHeadNode.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnHistoricNode.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNewDirectory.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNewNode.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnOperationFailed.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/Tools.java trunk/forge/portal-extensions/shotoku/shotoku-test/ trunk/forge/portal-extensions/shotoku/shotoku-test/maven.xml trunk/forge/portal-extensions/shotoku/shotoku-test/project.properties trunk/forge/portal-extensions/shotoku/shotoku-test/project.xml trunk/forge/portal-extensions/shotoku/shotoku-test/src/ trunk/forge/portal-extensions/shotoku/shotoku-test/src/java/ trunk/forge/portal-extensions/shotoku/shotoku-test/src/java/org/ trunk/forge/portal-extensions/shotoku/shotoku-test/src/java/org/jboss/ trunk/forge/portal-extensions/shotoku/shotoku-test/src/java/org/jboss/shotoku/ trunk/forge/portal-extensions/shotoku/shotoku-test/src/java/org/jboss/shotoku/test/ trunk/forge/portal-extensions/shotoku/shotoku-test/src/java/org/jboss/shotoku/test/ShotokuTest.java trunk/forge/portal-extensions/shotoku/shotoku-test/src/web/ trunk/forge/portal-extensions/shotoku/shotoku-test/src/web/WEB-INF/ trunk/forge/portal-extensions/shotoku/shotoku-test/src/web/WEB-INF/web.xml Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/AbstractResource.java trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/Directory.java trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/History.java trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/Node.java trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/NodeList.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java Log: Further implementation, comments Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/AbstractResource.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/AbstractResource.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/AbstractResource.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -1,5 +1,7 @@ package org.jboss.shotoku; +import org.jboss.shotoku.exceptions.RepositoryException; + /** * @author adamw * Common parts of nodes and directories interface. @@ -9,8 +11,9 @@ * Gets the value of a given property. * @param propertyName Name of the property to get. * @return Value of the given property. + * @throws RepositoryException */ - public String getProperty(String propertyName); + public String getProperty(String propertyName) throws RepositoryException; /** * Sets the value of a given property. * @param propertyName Name of the property to set. @@ -22,19 +25,23 @@ * @return A directory to which this node/ directory belongs. Null * if this directory is already the root directory. */ - public Directory getParent(); + public Directory getParent() throws RepositoryException; /** * Saves modified properties and possibly content (in case of nodes). * @param logMessage Log message for saving this node/ directory. + * @throws RepositoryException */ - public void save(String logMessage); + public void save(String logMessage) throws RepositoryException; /** * Gets a log message with which this node/ directory was saved. * @return Log message with which this node/ directory was saved. + * @throws RepositoryException */ - public String getLogMessage(); + public String getLogMessage() throws RepositoryException; /** - * Deletes this node or directory. + * Deletes this node or directory. This node should not be used after + * performing this operation. + * @throws RepositoryException */ - public void delete(); + public void delete() throws RepositoryException; } Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -6,144 +6,169 @@ import org.apache.log4j.Logger; import org.apache.xerces.parsers.DOMParser; +import org.jboss.shotoku.exceptions.ResourceDoesNotExist; +import org.jboss.shotoku.exceptions.RepositoryException; import org.jboss.shotoku.search.SearchParameters; import org.w3c.dom.Document; import org.xml.sax.InputSource; /** - * @author adamw - * A base class which provides access to nodes and directories. + * @author adamw A base class which provides access to nodes and directories. */ public abstract class ContentManager { /** * Gets a root directory that is represented by this content manager. - * @return A directory that is the root directory of this content - * manager. + * + * @return A directory that is the root directory of this content manager. + * @throws RepositoryException */ - public abstract Directory getRootDirectory(); + public abstract Directory getRootDirectory() throws RepositoryException; + /** - * Gets a node which can be found under the given path. - * @param Path for which to get the node. + * Gets a head version of a node which can be found under the given path. + * + * @param path + * for which to get the node. * @return A node corresponding to the gien path. + * @throws ResourceDoesNotExist + * @throws RepositoryException */ - public abstract Node getNode(String path); + public abstract Node getNode(String path) throws ResourceDoesNotExist, + RepositoryException; + /** * Gets a directory which can be found under the given path. - * @param Path for which to get the directory. + * + * @param path + * for which to get the directory. * @return A directory corresponding to the gien path. + * @throws ResourceDoesNotExist + * @throws RepositoryException */ - public abstract Directory getDirectory(String path); + public abstract Directory getDirectory(String path) + throws ResourceDoesNotExist, RepositoryException; + /** * Performs a search with the given parameters. - * @param parameters Parameters for the search. + * + * @param parameters + * Parameters for the search. * @return A list of found nodes. + * @throws RepositoryException */ - public abstract NodeList search(SearchParameters parameters); - + public abstract NodeList search(SearchParameters parameters) + throws RepositoryException; + protected ContentManager(String id, String prefix) { - + } - + /* * Content manager loading. */ - + private static final Logger log = Logger.getLogger(ContentManager.class); - + /** - * <code>defaultId</code> - id of the default content manager. May - * be overriden by a setting in the xml configuration file. + * <code>defaultId</code> - id of the default content manager. May be + * overriden by a setting in the xml configuration file. */ private static String defaultId = "default"; + /** - * <code>contentManagers</code> - map (content manager id -> - * content manager constructor). + * <code>contentManagers</code> - map (content manager id -> content + * manager constructor). */ private static Map<String, Constructor> contentManagers; - + static { contentManagers = new HashMap<String, Constructor>(); - + // Loading configuration file. try { DOMParser parser = new DOMParser(); - parser.parse(new InputSource( - ContentManager.class.getResourceAsStream("/shotoku.xml"))); + parser.parse(new InputSource(ContentManager.class + .getResourceAsStream("/shotoku.xml"))); Document doc = parser.getDocument(); - + org.w3c.dom.Node node = doc.getDocumentElement(); org.w3c.dom.NodeList nodes = node.getChildNodes(); org.w3c.dom.Node n; - + for (int i = 0; i < nodes.getLength(); i++) { n = nodes.item(i); - + if (n.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) { if ("default-id".equals(n.getNodeName())) { // Overriding the default content manager id. defaultId = Tools.getAttributeValue(n, "id"); - + log.info("Set default id to: " + defaultId); } else if ("content-manager".equals(n.getNodeName())) { // Creating a new content manager (getting its // constructor). String id = Tools.getAttributeValue(n, "id"); - String implementation = - Tools.getAttributeValue(n, "implementation"); - - contentManagers.put(id, - Class.forName(implementation).getConstructor( - new Class[] { String.class, + String implementation = Tools.getAttributeValue(n, + "implementation"); + + contentManagers.put(id, Class.forName(implementation) + .getConstructor( + new Class[] { String.class, String.class })); - - log.info("Added content manager: " + id + ", " + - implementation); + + log.info("Added content manager: " + id + ", " + + implementation); } } - } + } } catch (Exception e) { - log.warn("Error while loading content manager configuration: " + - e); + log.warn("Error while loading content manager configuration: " + e); } } - + /** * Gets a content manager with a default id and an empty prefix. + * * @return A ""-prefixed, default content manager, or null, if a default - * content manager is not registered. + * content manager is not registered. */ public static ContentManager getContentManager() { return getContentManager(""); } - + /** * Gets a content manager with a default id and the given prefix. - * @param prefix Prefix for the new content manager (all paths will - * have this prepended). + * + * @param prefix + * Prefix for the new content manager (all paths will have this + * prepended). * @return A prefixed, default content manager, or null, if a default - * content manager is not registered. + * content manager is not registered. */ public static ContentManager getContentManager(String prefix) { return getContentManager(defaultId, prefix); } - + /** * Gets a content manager with the given id and prefix. - * @param id Id of the content manager. - * @param prefix Prefix for the new content manager (all paths will - * have this prepended). + * + * @param id + * Id of the content manager. + * @param prefix + * Prefix for the new content manager (all paths will have this + * prepended). * @return A prefixed content manager with the given id or null, if a - * content manager with the given id registers. + * content manager with the given id registers. */ public static ContentManager getContentManager(String id, String prefix) { Constructor constructor = contentManagers.get(id); - + if (constructor == null) return null; - + try { - return (ContentManager) - constructor.newInstance(new Object[] { id, prefix }); + return (ContentManager) constructor.newInstance(new Object[] { id, + prefix }); } catch (Exception e) { return null; } Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/Directory.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/Directory.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/Directory.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -2,51 +2,78 @@ import java.util.List; +import org.jboss.shotoku.exceptions.RepositoryException; +import org.jboss.shotoku.exceptions.ResourceAlreadyExists; + /** - * @author adamw - * Interface that must be implemented by classes which represent - * directories, that is resources, which can contain other - * directories and nodes. + * @author adamw Interface that must be implemented by classes which represent + * directories, that is resources, which can contain other directories + * and nodes. */ public interface Directory extends AbstractResource { /** * Gets a list of nodes that are contained in this directory. + * * @return A list of nodes that are contained in this directory. + * @throws RepositoryException */ - public NodeList getNodes(); + public NodeList getNodes() throws RepositoryException; + /** * Gets a list of directories that are contained in this directory. + * * @return A list of directories that are contained in this directory. + * @throws RepositoryException */ - public List<Directory> getDirectories(); + public List<Directory> getDirectories() throws RepositoryException; + /** - * Creates and returns a new node in this directory. Only after saving, - * this node will be visible by other functions. - * @param name Name of the new node. + * Creates and returns a new node in this directory. Only after saving, this + * node will be visible by other functions. + * + * @param name + * Name of the new node. * @return A new node with the given name. + * @throws ResourceAlreadyExists + * @throws RepositoryException */ - public Node newNode(String name); + public Node newNode(String name) throws ResourceAlreadyExists, + RepositoryException; + /** * Creates a new directory in this directory. Only after saving this * directory, it will be visible by other functions. Also, new nodes/ * directories in it will be possible to create only after saving. - * @param name Name of the directory to create. + * + * @param name + * Name of the directory to create. * @return A new directory with the given name. + * @throws ResourceAlreadyExists + * @throws RepositoryException */ - public Directory newDirectory(String name); + public Directory newDirectory(String name) throws ResourceAlreadyExists, + RepositoryException; + /** * Checks if an index is created on the given property. - * @param propertyName Name of the property for which to check the - * index. + * + * @param propertyName + * Name of the property for which to check the index. * @return True iff an index is created for the given property. + * @throws RepositoryException */ - public boolean hasIndex(String propertyName); + public boolean hasIndex(String propertyName) throws RepositoryException; + /** * Creates or deletes an index on a property. - * @param propertyName Name of the property for which to create/ delete - * an index. - * @param index True if and index should be created, false in an index - * should be deleted. + * + * @param propertyName + * Name of the property for which to create/ delete an index. + * @param index + * True if and index should be created, false in an index should + * be deleted. + * @throws RepositoryException */ - public void setIndex(String propertyName, boolean index); + public void setIndex(String propertyName, boolean index) + throws RepositoryException; } Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/History.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/History.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/History.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -1,25 +1,38 @@ package org.jboss.shotoku; +import org.jboss.shotoku.exceptions.RepositoryException; +import org.jboss.shotoku.exceptions.ResourceDoesNotExist; + /** - * @author adamw - * An interface that should be implemented by classes which represent - * a node's history. + * @author adamw An interface that should be implemented by classes which + * represent a node's history. */ public interface History { /** - * Gets the number of revisions for this node's history. - * @return + * Gets the number of revisions of this node's history. + * + * @return Number of revisions of this node's history. + * @throws RepositoryException */ - public int getRevisionsCount(); + public int getRevisionsCount() throws RepositoryException; + /** * Gets a node with a given revision. - * @param revision Revision number to get. + * + * @param revision + * Revision number to get. * @return A node at the given revision. + * @throws ResourceDoesNotExist + * @throws RepositoryException */ - public Node getNodeAtRevision(int revision); + public Node getNodeAtRevision(int revision) throws ResourceDoesNotExist, + RepositoryException; + /** * Gets a list of all nodes in this history. + * * @return A list of all nodes in this history. + * @throws RepositoryException */ - public NodeList getAllRevisions(); + public NodeList getAllRevisions() throws RepositoryException; } Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/Node.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/Node.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/Node.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -2,50 +2,76 @@ import java.io.InputStream; +import org.jboss.shotoku.exceptions.RepositoryException; + /** - * @author adamw - * An interface which should be implemented by classes representing a node, - * that is a resource, which is versionable and has some text content. + * @author adamw An interface which should be implemented by classes + * representing a node, that is a resource, which is versionable and has + * some text content. */ public interface Node extends AbstractResource { /** * Gets the content of this node. + * * @return Content of this node. + * @throws RepositoryException */ - public String getContent(); + public String getContent() throws RepositoryException; + /** * Sets the content of this node. - * @param content New content of this node. + * + * @param content + * New content of this node. */ public void setContent(String content); + /** * Gets a history of this node. + * * @return A history of this node. + * @throws RepositoryException */ - public History getHistory(); + public History getHistory() throws RepositoryException; + /** * Gets the revision number of this node. + * * @return Revision number of this node. + * @throws RepositoryException */ - public int getRevisionNumber(); + public int getRevisionNumber() throws RepositoryException; + /** * Copies this node's content to the given file. - * @param filename Name of the file to which to copy this node's content. + * + * @param filename + * Name of the file to which to copy this node's content. + * @throws RepositoryException */ - public void copyToFile(String filename); + public void copyToFile(String filename) throws RepositoryException; + /** * Gets the content of this node as an input stream. + * * @return Content of this node as an input stream. + * @throws RepositoryException */ - public InputStream getContentInputStream(); + public InputStream getContentInputStream() throws RepositoryException; + /** * Gets the length of this node's content. + * * @return Length of this node's content. + * @throws RepositoryException */ - public long getLength(); + public long getLength() throws RepositoryException; + /** * Gets the last modification time of this node. + * * @return Last modification time of this node. + * @throws RepositoryException */ - public long getLastModfication(); + public long getLastModfication() throws RepositoryException; } Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/NodeList.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/NodeList.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/NodeList.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -5,7 +5,8 @@ /** * @author adamw - * TODO + * A class representing a list of nodes and providing the possibility to + * manipulate these nodes. */ public class NodeList { private List<Node> nodeList; @@ -18,10 +19,18 @@ this.nodeList = nodeList; } + /** + * Adds the given node to the node list. + * @param node Node to add. + */ public void add(Node node) { nodeList.add(node); } + /** + * Gets a <code>java.util.List</code> representation of this node list. + * @return A <code>java.util.List</code> representation of this node list. + */ public List toList() { return nodeList; } Added: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/NodeReadOnly.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/NodeReadOnly.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/NodeReadOnly.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,5 @@ +package org.jboss.shotoku.exceptions; + +public class NodeReadOnly extends RuntimeException { + +} Added: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/RepositoryException.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/RepositoryException.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/RepositoryException.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,7 @@ +package org.jboss.shotoku.exceptions; + +public class RepositoryException extends RuntimeException { + public RepositoryException(Exception e) { + super(e); + } +} Added: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/ResourceAlreadyExists.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/ResourceAlreadyExists.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/ResourceAlreadyExists.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,5 @@ +package org.jboss.shotoku.exceptions; + +public class ResourceAlreadyExists extends RuntimeException { + +} Added: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/ResourceDoesNotExist.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/ResourceDoesNotExist.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/exceptions/ResourceDoesNotExist.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,5 @@ +package org.jboss.shotoku.exceptions; + +public class ResourceDoesNotExist extends RuntimeException { + +} Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -5,8 +5,13 @@ import java.util.Map; import org.jboss.shotoku.AbstractResource; +import org.jboss.shotoku.exceptions.RepositoryException; public abstract class AbstractSvnResource implements AbstractResource { + /** + * <code>modifiedProperties</code> - a map of properties that have been + * modified for this resource and have to be written upon save. + */ private Map<String, String> modifiedProperties; protected SvnService service; @@ -25,19 +30,45 @@ } public String getProperty(String name) { - return service.getProperty(id, fullPath, name); + // First trying to get the properties from the ones that have been + // already modified, only if it hasn't been written, getting it + // from svn. + if (modifiedProperties.containsKey(name)) + return modifiedProperties.get(name); + + try { + return service.getProperty(id, fullPath, name); + } catch (SvnOperationFailed e) { + throw new RepositoryException(e); + } } public void setProperty(String name, String value) { modifiedProperties.put(name, value); } - protected boolean save() { + /** + * Checks if there are any changes to properties in this resource. + * @return True if there are any changes in properties. + */ + protected boolean checkForChanges() { + return modifiedProperties.size() > 1; + } + + /** + * Saves modified properties, if any, and clears the modified + * properties map. + */ + protected void save() { for (String name : modifiedProperties.keySet()) { - service.setProperty(id, fullPath, name, - modifiedProperties.get(name)); + try { + service.setProperty(id, fullPath, name, + modifiedProperties.get(name)); + } catch (SvnOperationFailed e) { + throw new RepositoryException(e); + } } - return modifiedProperties.size() > 1; + modifiedProperties.clear(); } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -6,12 +6,26 @@ import org.jboss.shotoku.Directory; import org.jboss.shotoku.Node; import org.jboss.shotoku.NodeList; -import org.jboss.shotoku.exceptions.NodeDoesNotExist; +import org.jboss.shotoku.exceptions.RepositoryException; +import org.jboss.shotoku.exceptions.ResourceDoesNotExist; import org.jboss.shotoku.search.SearchParameters; +/** + * @author adamw + * An implementation of the content manager based on subversion. + */ public class SvnContentManager extends ContentManager { + /** + * <code>prefix</code> - prefix of this content manager. + */ private String prefix; + /** + * <code>id</code> - id of a corresponding repository. + */ private String id; + /** + * <code>service</code> - service interface binding. + */ private SvnService service; public SvnContentManager(String id, String prefix) { @@ -23,13 +37,29 @@ service = Tools.getService(); } + /** + * Gets a full repository path for the given path - that is, adds a prefix + * this content manager's prefix. + * @param path Path to this resource. + * @return A prefixed path to the given resource. + */ private String getPrefixedPath(String path) { return prefix + '/' + path; } + /** + * Gets a <code>java.io.File</code> object that corresponds to a resource + * that, in the repository, can be found under the given path. + * @param path Path to the resource in the repository. + * @return A <code>java.io.File</code> object for the given path. + */ private File getFileForPath(String path) { - return new File( - service.getFileSystemPath(id, getPrefixedPath(path))); + try { + return new File( + service.getFileSystemPath(id, getPrefixedPath(path))); + } catch (SvnOperationFailed e) { + throw new RepositoryException(e); + } } @Override @@ -42,7 +72,7 @@ File file = getFileForPath(path); if (!file.isFile()) - throw new NodeDoesNotExist(); + throw new ResourceDoesNotExist(); return new SvnHeadNode(id, getPrefixedPath(path), file); } @@ -52,7 +82,7 @@ File file = getFileForPath(path); if (!file.isFile()) - throw new NodeDoesNotExist(); + throw new ResourceDoesNotExist(); return new SvnDirectory(id, getPrefixedPath(path), file); } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -1,31 +1,90 @@ package org.jboss.shotoku.svn; import java.io.File; +import java.io.FilenameFilter; +import java.util.ArrayList; import java.util.List; import org.jboss.shotoku.Directory; import org.jboss.shotoku.Node; import org.jboss.shotoku.NodeList; +import org.jboss.shotoku.exceptions.RepositoryException; public class SvnDirectory extends AbstractSvnResource implements Directory { public SvnDirectory(String id, String fullPath, File file) { super(id, fullPath, file); } - + public NodeList getNodes() { - throw new RuntimeException("Operation not yet implemented"); + List<Node> ret = new ArrayList<Node>(); + + try { + // Filtering files from this directory and adding them. + for (String directory : new File(service.getFileSystemPath(id, + fullPath)).list(new FilenameFilter() { + public boolean accept(File dir, String name) { + if (new File(dir.getAbsolutePath() + File.separator + name) + .isDirectory()) + return false; + return true; + } + })) { + String childFullPath = fullPath + '/' + directory; + ret.add(new SvnHeadNode(id, childFullPath, new File(service + .getFileSystemPath(id, childFullPath)))); + } + } catch (SvnOperationFailed e) { + throw new RepositoryException(e); + } + + return new NodeList(ret); } public List<Directory> getDirectories() { - throw new RuntimeException("Operation not yet implemented"); + List<Directory> ret = new ArrayList<Directory>(); + + try { + // Filtering directories from this directory and adding them. + for (String directory : new File(service.getFileSystemPath(id, + fullPath)).list(new FilenameFilter() { + public boolean accept(File dir, String name) { + if (name.equals(".svn")) + return false; + if (new File(dir.getAbsolutePath() + File.separator + name) + .isDirectory()) + return true; + return false; + } + })) { + String childFullPath = fullPath + '/' + directory; + ret.add(new SvnDirectory(id, childFullPath, new File(service + .getFileSystemPath(id, childFullPath)))); + } + } catch (SvnOperationFailed e) { + throw new RepositoryException(e); + } + + return ret; } public Node newNode(String name) { - throw new RuntimeException("Operation not yet implemented"); + String childFullPath = fullPath + '/' + name; + try { + return new SvnNewNode(id, childFullPath, new File(service + .getFileSystemPath(id, childFullPath))); + } catch (SvnOperationFailed e) { + throw new RepositoryException(e); + } } public Directory newDirectory(String name) { - throw new RuntimeException("Operation not yet implemented"); + String childFullPath = fullPath + '/' + name; + try { + return new SvnNewDirectory(id, childFullPath, new File(service + .getFileSystemPath(id, childFullPath))); + } catch (SvnOperationFailed e) { + throw new RepositoryException(e); + } } public boolean hasIndex(String propertyName) { Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnHeadNode.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnHeadNode.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnHeadNode.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,128 @@ +package org.jboss.shotoku.svn; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; + +import org.jboss.shotoku.Directory; +import org.jboss.shotoku.History; +import org.jboss.shotoku.exceptions.RepositoryException; + +public class SvnHeadNode extends SvnNode { + private String newContent; + private String oldContent; + + public SvnHeadNode(String id, String fullPath, File file) { + super(id, fullPath, file); + newContent = null; + } + + public String getContent() { + if (newContent != null) return newContent; + + if (oldContent == null) { + try { + BufferedReader bf = new BufferedReader(new FileReader(file)); + + StringBuffer sf = new StringBuffer(); + while (true) { + String line = bf.readLine(); + if (line == null) + break; + sf.append(line); + sf.append('\n'); + } + + oldContent = sf.toString(); + bf.close(); + } catch (IOException e) { + throw new RepositoryException(e); + } + } + + return oldContent; + } + + public void setContent(String content) { + newContent = content; + } + + public History getHistory() { + throw new RuntimeException("Operation not yet implemented"); + } + + public int getRevisionNumber() { + throw new RuntimeException("Operation not yet implemented"); + } + + public InputStream getContentInputStream() { + try { + return new FileInputStream(file); + } catch (FileNotFoundException e) { + throw new RepositoryException(e); + } + } + + public long getLength() { + return file.length(); + } + + public long getLastModfication() { + return file.lastModified(); + } + + public Directory getParent() { + throw new RuntimeException("Operation not yet implemented"); + } + + protected boolean checkForChanges() { + return newContent != null || super.checkForChanges(); + } + + public void save(String logMessage) { + // Checking if there is anything to save. + if (!checkForChanges()) return; + + try { + service.getWriteLock(id, fullPath); + + // Saving modified properties. + save(); + + // Saving modified content. + if (newContent != null) { + PrintWriter pw; + + try { + pw = new PrintWriter(file); + } catch (FileNotFoundException e) { + service.putWriteLock(id, fullPath); + throw new RepositoryException(e); + } + + pw.println(newContent); + pw.close(); + + oldContent = newContent; + newContent = null; + } + + service.commit(id, fullPath, logMessage); + } catch (SvnOperationFailed e) { + throw new RepositoryException(e); + } + } + + public String getLogMessage() { + throw new RuntimeException("Operation not yet implemented"); + } + + public void delete() { + throw new RuntimeException("Operation not yet implemented"); + } +} Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnHistoricNode.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnHistoricNode.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnHistoricNode.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,66 @@ +package org.jboss.shotoku.svn; + +import java.io.File; +import java.io.InputStream; + +import org.jboss.shotoku.Directory; +import org.jboss.shotoku.History; +import org.jboss.shotoku.exceptions.NodeReadOnly; + +public class SvnHistoricNode extends SvnNode { + public SvnHistoricNode(String id, String fullPath, File file) { + super(id, fullPath, file); + } + + public String getContent() { + throw new RuntimeException("Operation not yet implemented"); + } + + public History getHistory() { + throw new RuntimeException("Operation not yet implemented"); + } + + public int getRevisionNumber() { + throw new RuntimeException("Operation not yet implemented"); + } + + public InputStream getContentInputStream() { + throw new RuntimeException("Operation not yet implemented"); + } + + public long getLength() { + throw new RuntimeException("Operation not yet implemented"); + } + + public long getLastModfication() { + throw new RuntimeException("Operation not yet implemented"); + } + + public String getProperty(String arg0) { + throw new RuntimeException("Operation not yet implemented"); + } + + public Directory getParent() { + throw new RuntimeException("Operation not yet implemented"); + } + + public String getLogMessage() { + throw new RuntimeException("Operation not yet implemented"); + } + + public void setContent(String content) { + throw new NodeReadOnly(); + } + + public void setProperty(String name, String value) { + throw new NodeReadOnly(); + } + + public void save(String logMessage) { + throw new NodeReadOnly(); + } + + public void delete() { + throw new NodeReadOnly(); + } +} Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNewDirectory.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNewDirectory.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNewDirectory.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,97 @@ +package org.jboss.shotoku.svn; + +import java.io.File; +import java.util.List; + +import org.jboss.shotoku.Directory; +import org.jboss.shotoku.Node; +import org.jboss.shotoku.NodeList; +import org.jboss.shotoku.exceptions.RepositoryException; + +public class SvnNewDirectory extends SvnDirectory { + private boolean saved; + + public SvnNewDirectory(String id, String fullPath, File file) { + super(id, fullPath, file); + + saved = false; + } + + @Override + public void delete() { + // We only have to delete a corresponding directory if this directory + // has been saved already. + if (saved) + super.delete(); + } + + @Override + public List<Directory> getDirectories() { + if (saved) + return super.getDirectories(); + else + return null; + } + + @Override + public String getLogMessage() { + if (saved) + return super.getLogMessage(); + else + return null; + } + + @Override + public NodeList getNodes() { + if (saved) + return super.getNodes(); + else + return null; + } + + @Override + public boolean hasIndex(String propertyName) { + if (saved) + return super.hasIndex(propertyName); + else + return false; + } + + @Override + public Directory newDirectory(String name) { + if (saved) + return super.newDirectory(name); + else + return null; + } + + @Override + public Node newNode(String name) { + if (saved) + return super.newNode(name); + else + return null; + } + + @Override + public void save(String logMessage) { + if (!saved) { + file.mkdir(); + + try { + service.add(id, fullPath); + } catch (SvnOperationFailed e) { + throw new RepositoryException(e); + } + saved = true; + } + + super.save(logMessage); + } + + @Override + public void setIndex(String propertyName, boolean index) { + if (saved) + super.setIndex(propertyName, index); + } +} Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNewNode.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNewNode.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNewNode.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,113 @@ +package org.jboss.shotoku.svn; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Calendar; + +import org.jboss.shotoku.History; +import org.jboss.shotoku.exceptions.RepositoryException; + +public class SvnNewNode extends SvnHeadNode { + private String content; + private boolean saved; + + public SvnNewNode(String id, String fullPath, File file) { + super(id, fullPath, file); + + content = null; + saved = false; + } + + @Override + public void delete() { + // We only have to delete a corresponding file if this node has + // been saved already. + if (saved) + super.delete(); + } + + @Override + public String getContent() { + if (saved) + return super.getContent(); + else + return content; + } + + @Override + public InputStream getContentInputStream() { + if (saved) + return super.getContentInputStream(); + else + // TODO + return null; + } + + @Override + public History getHistory() { + if (saved) + return super.getHistory(); + else + return null; + } + + @Override + public long getLastModfication() { + if (saved) + return super.getLastModfication(); + else + return Calendar.getInstance().getTimeInMillis(); + } + + @Override + public long getLength() { + if (saved) + return super.getLength(); + else + return content.length(); + } + + @Override + public String getLogMessage() { + if (saved) + return super.getLogMessage(); + else + return null; + } + + @Override + public int getRevisionNumber() { + if (saved) + return super.getRevisionNumber(); + else + return -1; + } + + @Override + public void save(String logMessage) { + if (!saved) { + try { + file.createNewFile(); + service.add(id, fullPath); + } catch (IOException e) { + throw new RepositoryException(e); + } catch (SvnOperationFailed e) { + throw new RepositoryException(e); + } + + saved = true; + } + + super.save(logMessage); + } + + @Override + public void setContent(String content) { + if (saved) + super.setContent(content); + else + this.content = content; + } + +} Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnOperationFailed.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnOperationFailed.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnOperationFailed.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,11 @@ +package org.jboss.shotoku.svn; + +public class SvnOperationFailed extends Exception { + public SvnOperationFailed(Exception e) { + super(e); + } + + public SvnOperationFailed(String msg) { + super(msg); + } +} Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -1,17 +1,118 @@ package org.jboss.shotoku.svn; public abstract interface SvnService { - public abstract void commit(String id, String path, String logMessage); + /** + * Gets an exclusive write lock for a given path. The lock should be + * requiered before making any changes to the file. Later, the file + * must be added for a commit, unless an exception is thrown. After + * commiting the file, the lock is released. + * @param id Id of the repository. + * @param path Path to lock. + */ + public abstract void getWriteLock(String id, String path); + /** + * Puts an earlier acquiered exclusive write lock for a given path. + * This should be called only in case of an internal node-implementation + * execption that occures while saving. + * @param id Id of the repository. + * @param path Path to release the lock for. + */ + public abstract void putWriteLock(String id, String path); + /** + * Adds the given path to a commite quese of a repository with the + * given id. + * @param id Id of the repository. + * @param path Path to commit. + * @param logMessage Log message to commit with. + * @throws SvnOperationFailed + */ + public abstract void commit(String id, String path, String logMessage) + throws SvnOperationFailed; + /** + * Sets a property on the given path. + * @param id Id of the repository. + * @param path Path to set the property on. + * @param name Name of the property to set. + * @param value Value of the property to set. + * @throws SvnOperationFailed + */ public abstract void setProperty(String id, String path, String name, - String value); - public abstract String getProperty(String id, String path, String name); + String value) throws SvnOperationFailed; + /** + * Gets a property from the given path. + * @param id Id of the repository. + * @param path Path to get the property from. + * @param name Name of the property to get. + * @return Value of the property or null, if it is not set. + * @throws SvnOperationFailed + */ + public abstract String getProperty(String id, String path, String name) + throws SvnOperationFailed; + /** + * Gets content of a node at the specified revision. + * @param id Id of the repository. + * @param path Path to a file to get the revision of. + * @param revision Number of the revision to get (revisions are counted + * from 1 with step 1). + * @return String representation of this node's content at the given + * revision or null, if this node does not have the given revision. + * @throws SvnOperationFailed + */ public abstract String getNodeAtRevision(String id, String path, - int revision); - public abstract String getLogMessage(String id, String revision); - public abstract int getRevisionCount(String id, String path); - public abstract void delete(String id, String path); - public abstract void add(String id, String path); - public abstract String getFileSystemPath(String id, String path); + int revision) throws SvnOperationFailed; + /** + * Gets a log message with which the given revision was commited. + * @param id Id of the repository. + * @param revision Number of the revision (svn revision number). + * @return Log message with which the given reivison was commited + * or null, if no such revision exists. + * @throws SvnOperationFailed + */ + public abstract String getLogMessage(String id, String revision) + throws SvnOperationFailed; + /** + * Gets the number of revisions of a given path. + * @param id Id of the repository. + * @param path Path for which to determine the number of revisions + * (number of different versions). + * @return Number of revisions of a given path. + * @throws SvnOperationFailed + */ + public abstract int getRevisionCount(String id, String path) + throws SvnOperationFailed; + /** + * Deletes a given path (node/ directory) from the repository. The + * resource is automatically added to a commite queue. + * @param id Id of the repository. + * @param path Path to delete. + * @throws SvnOperationFailed + */ + public abstract void delete(String id, String path) + throws SvnOperationFailed; + /** + * Adds a given path (node/ directory) to a repository. The resource + * is automatically added to a commite queue. + * @param id Id of the repository. + * @param path Path to add. + * @throws SvnOperationFailed + */ + public abstract void add(String id, String path) + throws SvnOperationFailed; + /** + * Gets a full path on the file system to a resource with the given + * repository-path. + * @param id Id of the repository. + * @param path Path to the resource. + * @return A full path on the file system to the given resource (represented + * by a path). + * @throws SvnOperationFailed + */ + public abstract String getFileSystemPath(String id, String path) + throws SvnOperationFailed; + /** + * <code>SVN_SERVICE_NAME</code> - name under which the svn service + * is registered. + */ public final static String SVN_SERVICE_NAME = "shotoku:service=svn"; } Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/Tools.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/Tools.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/Tools.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,24 @@ +package org.jboss.shotoku.svn; + +import javax.management.MalformedObjectNameException; + +import org.jboss.mx.util.MBeanProxyExt; +import org.jboss.mx.util.MBeanServerLocator; + +public class Tools { + private static SvnService instance; + + public static SvnService getService() { + try { + if (instance == null) + instance = (SvnService) MBeanProxyExt.create( + SvnService.class, + SvnService.SVN_SERVICE_NAME, + MBeanServerLocator.locate()); + + return instance; + } catch (MalformedObjectNameException e) { + throw new RuntimeException(e); + } + } +} Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -2,8 +2,11 @@ import java.io.File; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Set; +import java.util.concurrent.Semaphore; import org.apache.log4j.Logger; import org.tmatesoft.svn.core.SVNException; @@ -15,6 +18,11 @@ import org.tmatesoft.svn.core.wc.SVNUpdateClient; import org.tmatesoft.svn.core.wc.SVNWCUtil; +/** + * @author adamw + * A class for performing operations on a single subversion repository and + * its local working copy. + */ public class SvnRepository { private static final Logger log = Logger.getLogger(SvnRepository.class); @@ -23,6 +31,7 @@ private String localpath; private File wc; private Set<String[]> toCommit; + private Map<String, Semaphore> semaphores; public SvnRepository(String username, String password, String url, String localpath) { @@ -35,8 +44,13 @@ wc = new File(localpath); toCommit = Collections.synchronizedSet(new HashSet<String[]>()); + semaphores = new HashMap<String, Semaphore>(); } + /** + * Tries to perform a cleanup on the local working copy. Called in case + * of execptions that occure while performing other operations. + */ private void tryCleanup() { try { ourClientManager.getWCClient().doCleanup(wc); @@ -45,6 +59,9 @@ } } + /** + * Updates the local working copy. + */ public synchronized void update() { try { SVNURL repositoryURL = SVNURL.parseURIEncoded(url); @@ -69,10 +86,18 @@ } } + /** + * Adds a given file with a given log message to a commit queue. + * @param path Path (file/ directory) to commit. + * @param logMessage Log message with thich to commit. + */ public void addToCommit(String path, String logMessage) { toCommit.add(new String[] { path, logMessage }); } + /** + * Commits all paths (files/ directories) that were scheduled for a commit. + */ public void commit() { String[][] allToCommit; @@ -84,12 +109,16 @@ for (String[] oneToCommit : allToCommit) { SVNCommitClient commitClient = ourClientManager.getCommitClient(); try { + log.info("Commiting: " + oneToCommit[0]); commitClient.doCommit( new File[] { new File(getFileSystemPath(oneToCommit[0])) }, false, oneToCommit[1], true, false); + + putWriteLock(oneToCommit[0]); } catch (SVNException e) { tryCleanup(); - log.warn("Commiting of " + oneToCommit[0] + " failed", e); + putWriteLock(oneToCommit[0]); + log.warn("Commiting: " + oneToCommit[0] + " failed", e); } } } @@ -98,6 +127,34 @@ return replaceSeparators(localpath + '/' + path); } + public void getWriteLock(String path) { + Semaphore s; + + synchronized (semaphores) { + s = semaphores.get(path); + if (s == null) { + s = new Semaphore(1); + semaphores.put(path, s); + } + } + + try { + s.acquire(); + } catch (InterruptedException e) { + // We never interrupt the threads. + } + } + + public void putWriteLock(String path) { + Semaphore s; + + synchronized (semaphores) { + s = semaphores.get(path); + } + + s.release(); + } + private String replaceSeparators(String path) { return '/' == File.separatorChar ? path : path.replace('/', File.separatorChar); Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -27,7 +27,7 @@ * <code>DEFAULT_TIMER_INTERVAL</code> - default interval lenght of the * timer. */ - private final static long DEFAULT_TIMER_INTERVAL = 1000*60; // 1 minute + private final static long DEFAULT_TIMER_INTERVAL = 1000*5; // 5 seconds private long timerInterval; @EJB @@ -120,6 +120,14 @@ * SvnService implementation. */ + public void getWriteLock(String id, String path) { + repositories.get(id).getWriteLock(path); + } + + public void putWriteLock(String id, String path) { + repositories.get(id).putWriteLock(path); + } + public void commit(String id, String path, String logMessage) { repositories.get(id).addToCommit(path, logMessage); } Added: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceLocal.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceLocal.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceLocal.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,7 @@ +package org.jboss.shotoku.svn.service; + +public interface SvnServiceLocal { + public void setTimerInterval(long timerInterval); + public long getTimerInterval(); + public void update(); +} Added: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceManagement.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceManagement.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceManagement.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,12 @@ +package org.jboss.shotoku.svn.service; + +import org.jboss.annotation.ejb.Management; +import org.jboss.shotoku.svn.SvnService; + +@Management +public interface SvnServiceManagement extends SvnService, SvnServiceLocal { + public void create() throws Exception; + public void start() throws Exception; + public void stop(); + public void destroy(); +} Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java 2005-09-26 20:56:01 UTC (rev 1215) @@ -10,7 +10,6 @@ import javax.ejb.Timer; import javax.management.MalformedObjectNameException; -import org.apache.log4j.Logger; import org.jboss.mx.util.MBeanProxyExt; import org.jboss.mx.util.MBeanServerLocator; import org.jboss.shotoku.svn.SvnService; @@ -18,7 +17,7 @@ @Stateless @Local(SvnServiceTimerLocal.class) public class SvnServiceTimer { - private static final Logger log = Logger.getLogger(SvnServiceTimer.class); + //private static final Logger log = Logger.getLogger(SvnServiceTimer.class); private @Resource SessionContext ctx; public void scheduleTimer(long interval) { @@ -35,9 +34,7 @@ SvnService.SVN_SERVICE_NAME, MBeanServerLocator.locate())); - log.info("Updating svn service ..."); ssi.update(); - log.info("Done updating svn service."); scheduleTimer(ssi.getTimerInterval()); } catch (MalformedObjectNameException e) { Property changes on: trunk/forge/portal-extensions/shotoku/shotoku-test ___________________________________________________________________ Name: svn:ignore + target .classpath .settings .project Added: trunk/forge/portal-extensions/shotoku/shotoku-test/maven.xml =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-test/maven.xml 2005-09-26 20:14:14 UTC (rev 1214) +++ trunk/forge/portal-extensions/shotoku/shotoku-test/maven.xml 2005-09-26 20:56:01 UTC (rev 1215) @@ -0,0 +1,30 @@ +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<project xmlns:j="jelly:core" ... [truncated message content] |
From: <jbo...@li...> - 2005-09-26 20:14:20
|
Author: szimano Date: 2005-09-26 16:14:14 -0400 (Mon, 26 Sep 2005) New Revision: 1214 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/plugins/HTMLTranslatorParts.java Log: capitalising of pagenames in subpages links 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-26 18:55:27 UTC (rev 1213) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-26 20:14:14 UTC (rev 1214) @@ -121,13 +121,24 @@ } if (rReq.getParameter("page") != null) { - String page = rReq.getParameter("page"); - if (Character.isLowerCase(page.charAt(0))) { + StringBuffer sBuf = new StringBuffer(rReq.getParameter("page")); + + if (Character.isLowerCase(sBuf.charAt(0))) { // change first letter to upper if it isn't - page = Character.toUpperCase(page.charAt(0)) - + page.substring(1); + sBuf.setCharAt(0, Character.toUpperCase(sBuf.charAt(0))); } - rResp.setRenderParameter("page", page); + + // + // Capitalise words in subpages + // + + for (int i = 0; i < sBuf.length() - 1; i++) { + if ((sBuf.charAt(i) == '/')&&(Character.isLowerCase(sBuf.charAt(i+1)))) { + sBuf.setCharAt(i+1, Character.toUpperCase(sBuf.charAt(i+1))); + } + } + + rResp.setRenderParameter("page", sBuf.toString()); } 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-26 18:55:27 UTC (rev 1213) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-26 20:14:14 UTC (rev 1214) @@ -943,6 +943,16 @@ --i; // We just shortened this buffer. } } + + // + // Capitalise words in subpages + // + + for (int i = 0; i < clean.length() - 1; i++) { + if ((clean.charAt(i) == '/')&&(Character.isLowerCase(clean.charAt(i+1)))) { + clean.setCharAt(i+1, Character.toUpperCase(clean.charAt(i+1))); + } + } return clean.toString(); } |
From: <jbo...@li...> - 2005-09-26 18:55:37
|
Author: szimano Date: 2005-09-26 14:55:27 -0400 (Mon, 26 Sep 2005) New Revision: 1213 Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttachmentDataSource.java 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/WikiEngine.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AdminConsolePlugin.java Log: deleting pages/attachmnets http://jira.jboss.com/jira/browse/JBWIKI-53 Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttachmentDataSource.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttachmentDataSource.java 2005-09-26 17:04:39 UTC (rev 1212) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttachmentDataSource.java 2005-09-26 18:55:27 UTC (rev 1213) @@ -17,7 +17,7 @@ */ public interface AttachmentDataSource { - public static String attTrashName = "trash/attachemnts"; + public static String attTrashName = "trash/attachments"; /**Add atachment to a given page. * 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-26 17:04:39 UTC (rev 1212) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java 2005-09-26 18:55:27 UTC (rev 1213) @@ -883,7 +883,7 @@ String attTrashName = attTrashNameBase; // create dirs to trash - File trashFileDir = new File(pathToAttTrash + "/" + pageName); + File trashFileDir = new File(pathToAttTrash + "/" + pageName + "-att/"); if (!trashFileDir.exists()) { trashFileDir.mkdirs(); } 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-26 17:04:39 UTC (rev 1212) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-26 18:55:27 UTC (rev 1213) @@ -502,6 +502,10 @@ public boolean deletePage(String pageName, boolean deleteSubpages) { Set<String> subpages = new HashSet<String>(); + + System.out.println("DELETE SUBPAGES: "+deleteSubpages); + + if (deleteSubpages) { subpages = getMediaDataSource().getPagesFor(pageName); } @@ -509,17 +513,18 @@ if (getAttachementDataSource().getAttachmentsSet( getByName(pageName, null)) != null) { if (!getAttachementDataSource().deleteAttachments(pageName)) { + System.err.println("Couldn't delete attachments of page "+pageName); return false; } } boolean ret = true; - if ((!deleteSubpages)&&(subpages.size() > 0)) { + if ((deleteSubpages)&&(subpages.size() > 0)) { for (String subPage : subpages) { - if (!deletePage(pageName+"/"+subPage, deleteSubpages)) { - System.err.println("[WikiEngine]: Problems with deleteing subpage: "+pageName+"/"+subPage); + if (!deletePage(subPage, deleteSubpages)) { + System.err.println("[WikiEngine]: Problems with deleteing subpage: "+subPage); ret = false; } } @@ -532,8 +537,12 @@ pages.remove(pageName); } + System.out.println("Finishing deleting of page "+pageName+" with ret = "+ret); + return ret; - } else + } else { + System.err.println("Problems with deleting page "+pageName); return false; + } } } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AdminConsolePlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AdminConsolePlugin.java 2005-09-26 17:04:39 UTC (rev 1212) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AdminConsolePlugin.java 2005-09-26 18:55:27 UTC (rev 1213) @@ -1,5 +1,7 @@ package org.jboss.wiki.plugins; +import java.util.Set; + import org.jboss.wiki.Credentials; import org.jboss.wiki.WikiEngine; import org.jboss.wiki.WikiPage; @@ -8,6 +10,8 @@ public class AdminConsolePlugin extends WikiPlugin { + private boolean SHOWDELETE = true; + @Override public WikiPage process(WikiPage wikiPage, WikiSession wikiSession) { Credentials credentials = (Credentials) wikiSession @@ -38,8 +42,9 @@ .getAttribute("var3"))); viewable = editingPage.isViewable(); } - } /*else if (wikiSession.getAttribute("var1") - .equals("deletePage")) { + } else if ((SHOWDELETE) + && (wikiSession.getAttribute("var1") + .equals("deletePage"))) { boolean deleteSubpages = (wikiSession.getAttribute("var3") != null) ? Boolean .parseBoolean((String) wikiSession .getAttribute("var3")) @@ -50,19 +55,33 @@ .getAttribute("var2"); if (!nameToDelete.equals(WikiEngine.defaultPage)) { - if (wikiEngine.deletePage(nameToDelete, + if (!wikiEngine.deletePage(nameToDelete, deleteSubpages)) { errorMsg += "Couldn't delete whole or parts of page: " + nameToDelete - + " or it's subpages (see log for more info)"; + + " or it's subpages (see log for moreinfo)"; } } else { errorMsg += "You can't delete " + WikiEngine.defaultPage + " page !"; } } + } + else if ((SHOWDELETE) + && (wikiSession.getAttribute("var1") + .equals("deleteAtt"))) { + String attName = (wikiSession.getAttribute("var2") != null) ? (String)wikiSession.getAttribute("var2") : null; + + if (attName != null) { + if (!wikiEngine.getAttachementDataSource().deleteAttachment(wikiPage.getName(), attName)) { + errorMsg = "There was problem with deleting "+attName+" from page "+wikiPage.getName()+" (see log for more info)"; + } + } + else { + errorMsg = "Attachment to delete isn't specified"; + } + } - }*/ } StringBuilder adminConsole = new StringBuilder(wikiPage @@ -74,29 +93,47 @@ adminConsole.append("<i>" + errorMsg + "</i><br />\n"); } - /*if (!wikiPage.getName().equals(WikiEngine.defaultPage)) { - - // delete page button - adminConsole.append("<a href=\"").append(actionURL).append( - "&page=Main").append("&var1=deletePage").append( - "&var2=").append(wikiPage.getName()).append( - "&var3=false").append( - "\" >DELETE THIS PAGE</a><br />\n"); + if (SHOWDELETE) { + Set<String> attSet = wikiEngine.getAttachementDataSource() + .getAttachmentsSet(wikiPage); - // delete page with subpages button - adminConsole - .append("<a href=\"") - .append(actionURL) - .append("&page=Main") - .append(wikiPage.getName()) - .append("&var1=deletePage") - .append("&var2=") - .append(wikiPage.getName()) - .append("&var3=true") - .append( - "\" >DELETE THIS PAGE WITH SUBPAGES</a><br />\n<br />\n"); - }*/ + if (attSet != null) { + adminConsole.append("<h4>Attachments:</h4>\n<table border=\"0\">"); + for (String att : attSet) { + adminConsole.append("<tr><td>").append(att).append("</td><td><a href=\"").append( + actionURL).append("&page=").append( + wikiPage.getName()).append("&var1=deleteAtt") + .append("&var2=").append(att).append( + "\" >Delete</a></td></tr>"); + } + + } + + adminConsole.append("</table><br />\n<h4>Page managment:</h4>"); + + if (!wikiPage.getName().equals(WikiEngine.defaultPage)) { + + // delete page button + adminConsole.append("<a href=\"").append(actionURL).append( + "&page=Main").append("&var1=deletePage").append( + "&var2=").append(wikiPage.getName()).append( + "&var3=false").append( + "\" >DELETE THIS PAGE</a><br />\n"); + + // delete page with subpages button + adminConsole + .append("<a href=\"") + .append(actionURL) + .append("&page=Main") + .append("&var1=deletePage") + .append("&var2=") + .append(wikiPage.getName()) + .append("&var3=true") + .append( + "\" >DELETE THIS PAGE WITH SUBPAGES</a><br />\n<br />\n"); + } + } // switch editable button adminConsole.append("This page ").append( (editable) ? "is" : "isn't").append(" editable "); |
From: <jbo...@li...> - 2005-09-26 17:04:46
|
Author: szimano Date: 2005-09-26 13:04:39 -0400 (Mon, 26 Sep 2005) New Revision: 1212 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/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/AdminConsolePlugin.java Log: Deleting further changes, but disabled for promotion 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-26 16:54:23 UTC (rev 1211) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java 2005-09-26 17:04:39 UTC (rev 1212) @@ -784,8 +784,7 @@ } } - public synchronized boolean deletePage(String pageName, - boolean deleteSubpages) { + public synchronized boolean deletePage(String pageName) { if (pageExists(pageName)) { // moving page file @@ -797,7 +796,13 @@ File pageFile = new File(pageFileName); File pageTrashFile = new File(pageFileTrashName); -// look if page is already in trash (add i-bak) + // create dirs to trash + File trashFileDir = new File(pathToMediaTrash + "/" + pageName); + if (!trashFileDir.exists()) { + trashFileDir.mkdirs(); + } + + // look if page is already in trash (add i-bak) int i = 0; if (pageTrashFile.exists()) { @@ -818,13 +823,19 @@ // moving history directory String historyDirName = pathToMedia + "/OLD/" + pageName; - String historyTrashDirNameBase = pathToMediaTrash + "/OLD/" + pageName; + String historyTrashDirNameBase = pathToMediaTrash + "/OLD/" + + pageName; String historyTrashDirName = historyTrashDirNameBase; + // create dirs to trash (history) + trashFileDir = new File(pathToMediaTrash + "/OLD/" + pageName); + if (!trashFileDir.exists()) { + trashFileDir.mkdirs(); + } + pageFile = new File(historyDirName); pageTrashFile = new File(historyTrashDirName); - // look if history dir is already in trash (add i-bak) i = 0; @@ -836,7 +847,7 @@ } } - + if (!pageFile.renameTo(pageTrashFile)) { System.err.println("[FileDataSource]: Problems with moving " + historyDirName + " to " + historyTrashDirName); @@ -844,7 +855,7 @@ // return back the page history pageFile = new File(pageFileName); pageTrashFile = new File(pageFileTrashName); - + if (!pageTrashFile.renameTo(pageFile)) { System.err .println("[FileDataSource]: ERROR. I've tried moving previously moved page file from the trash, but there was some problem. This is not good and there is nothing i can do about it. The error ocured while moving " @@ -871,12 +882,18 @@ + attachmentName + "-dir"; String attTrashName = attTrashNameBase; +// create dirs to trash + File trashFileDir = new File(pathToAttTrash + "/" + pageName); + if (!trashFileDir.exists()) { + trashFileDir.mkdirs(); + } + // moving file directory File attFile = new File(attName); if (attFile.exists()) { - -// look if att dir is already in trash (add i-bak) + + // look if att dir is already in trash (add i-bak) File attTrashFile = new File(attTrashName); int i = 0; @@ -908,11 +925,17 @@ String attTrashNameBase = pathToAttTrash + "/" + pageName + "-att"; String attTrashName = attTrashNameBase; + // create dirs to trash + File trashFileDir = new File(pathToAttTrash + "/" + pageName); + if (!trashFileDir.exists()) { + trashFileDir.mkdirs(); + } + // moving file directory File attFile = new File(attName); if (attFile.exists()) { -// look if att dir is already in trash (add i-bak) + // look if att dir is already in trash (add i-bak) File attTrashFile = new File(attTrashName); int i = 0; 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-26 16:54:23 UTC (rev 1211) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java 2005-09-26 17:04:39 UTC (rev 1212) @@ -181,10 +181,9 @@ - /**Deletes (or moves to trash) given page with or wothout optional subpages + /**Deletes (or moves to trash) given page * * @param pageName Name of the page to delete. - * @param deleteSubpages If true - all subpages will be deleted also. */ - public boolean deletePage(String pageName, boolean deleteSubpages); + public boolean deletePage(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-26 16:54:23 UTC (rev 1211) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-26 17:04:39 UTC (rev 1212) @@ -13,6 +13,7 @@ import java.util.Comparator; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.InvalidPropertiesFormatException; import java.util.Iterator; import java.util.LinkedHashMap; @@ -499,21 +500,39 @@ } public boolean deletePage(String pageName, boolean deleteSubpages) { + Set<String> subpages = new HashSet<String>(); + if (deleteSubpages) { + subpages = getMediaDataSource().getPagesFor(pageName); + } + if (getAttachementDataSource().getAttachmentsSet( - getByName(pageName, null)).size() > 0) { + getByName(pageName, null)) != null) { if (!getAttachementDataSource().deleteAttachments(pageName)) { return false; } } - if (getMediaDataSource().deletePage(pageName, deleteSubpages)) { + boolean ret = true; + + if ((!deleteSubpages)&&(subpages.size() > 0)) { + for (String subPage : subpages) { + if (!deletePage(pageName+"/"+subPage, deleteSubpages)) { + System.err.println("[WikiEngine]: Problems with deleteing subpage: "+pageName+"/"+subPage); + ret = false; + } + } + + } + + if (getMediaDataSource().deletePage(pageName)) { + if (pages.containsKey(pageName)) { pages.remove(pageName); } - return true; + return ret; } else return false; } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AdminConsolePlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AdminConsolePlugin.java 2005-09-26 16:54:23 UTC (rev 1211) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AdminConsolePlugin.java 2005-09-26 17:04:39 UTC (rev 1212) @@ -38,24 +38,31 @@ .getAttribute("var3"))); viewable = editingPage.isViewable(); } - } - else if (wikiSession.getAttribute("var1").equals("deletePage")) { - boolean deleteSubpages = (wikiSession.getAttribute("var3") != null) ? Boolean.parseBoolean((String)wikiSession.getAttribute("var3")) : false; - + } /*else if (wikiSession.getAttribute("var1") + .equals("deletePage")) { + boolean deleteSubpages = (wikiSession.getAttribute("var3") != null) ? Boolean + .parseBoolean((String) wikiSession + .getAttribute("var3")) + : false; + if (wikiSession.getAttribute("var2") != null) { - String nameToDelete = (String)wikiSession.getAttribute("var2"); - + String nameToDelete = (String) wikiSession + .getAttribute("var2"); + if (!nameToDelete.equals(WikiEngine.defaultPage)) { - if (wikiEngine.deletePage(nameToDelete, deleteSubpages)) { - errorMsg += "Couldn't delete whole or parts of page: "+nameToDelete+" (see log for more info)"; + if (wikiEngine.deletePage(nameToDelete, + deleteSubpages)) { + errorMsg += "Couldn't delete whole or parts of page: " + + nameToDelete + + " or it's subpages (see log for more info)"; } + } else { + errorMsg += "You can't delete " + + WikiEngine.defaultPage + " page !"; } - else { - errorMsg += "You can't delete "+WikiEngine.defaultPage+" page !"; - } } - - } + + }*/ } StringBuilder adminConsole = new StringBuilder(wikiPage @@ -64,32 +71,40 @@ adminConsole.append("\n<hr><h3>Admin console</h3>\n"); if (errorMsg.length() > 0) { - adminConsole.append("<i>"+errorMsg+"</i><br />\n"); + adminConsole.append("<i>" + errorMsg + "</i><br />\n"); } - - // delete page button - adminConsole.append("<a href=\"").append(actionURL) - .append("&page=Main").append( - "&var1=deletePage").append("&var2=").append( - wikiPage.getName()).append("&var3=false").append( - "\" >DELETE THIS PAGE</a><br />\n"); - // delete page with subpages button - adminConsole.append("<a href=\"").append(actionURL) - .append("&page=Main").append(wikiPage.getName()).append( - "&var1=deletePage").append("&var2=").append( - wikiPage.getName()).append("&var3=true").append( - "\" >DELETE THIS PAGE WITH SUBPAGES</a><br />\n<br />\n"); - + /*if (!wikiPage.getName().equals(WikiEngine.defaultPage)) { + + // delete page button + adminConsole.append("<a href=\"").append(actionURL).append( + "&page=Main").append("&var1=deletePage").append( + "&var2=").append(wikiPage.getName()).append( + "&var3=false").append( + "\" >DELETE THIS PAGE</a><br />\n"); + + // delete page with subpages button + adminConsole + .append("<a href=\"") + .append(actionURL) + .append("&page=Main") + .append(wikiPage.getName()) + .append("&var1=deletePage") + .append("&var2=") + .append(wikiPage.getName()) + .append("&var3=true") + .append( + "\" >DELETE THIS PAGE WITH SUBPAGES</a><br />\n<br />\n"); + }*/ + // switch editable button adminConsole.append("This page ").append( (editable) ? "is" : "isn't").append(" editable "); adminConsole.append("<a href=\"").append(actionURL) - .append("&page=").append( - "&var1=chmod").append("&var2=").append(!editable) - .append("&var3=").append(viewable).append("\" >SWITCH IT ") - .append((editable) ? "NOT" : "").append( - " EDITABLE</a><br />\n"); + .append("&page=").append("&var1=chmod").append("&var2=") + .append(!editable).append("&var3=").append(viewable) + .append("\" >SWITCH IT ").append((editable) ? "NOT" : "") + .append(" EDITABLE</a><br />\n"); // switch viewable button adminConsole.append("This page ").append( |
Author: dam...@jb... Date: 2005-09-26 12:03:00 -0400 (Mon, 26 Sep 2005) New Revision: 1210 Added: branches/forge/damon/portal-extensions/podcasts/ branches/forge/damon/portal-extensions/podcasts/build.properties branches/forge/damon/portal-extensions/podcasts/forge-ads.iml branches/forge/damon/portal-extensions/podcasts/maven.xml branches/forge/damon/portal-extensions/podcasts/project.properties branches/forge/damon/portal-extensions/podcasts/project.xml branches/forge/damon/portal-extensions/podcasts/src/ branches/forge/damon/portal-extensions/podcasts/src/java/ branches/forge/damon/portal-extensions/podcasts/src/java/org/ branches/forge/damon/portal-extensions/podcasts/src/java/org/jbosslabs/ branches/forge/damon/portal-extensions/podcasts/src/java/org/jbosslabs/portlets/ branches/forge/damon/portal-extensions/podcasts/src/java/org/jbosslabs/portlets/podcasts/ branches/forge/damon/portal-extensions/podcasts/src/java/org/jbosslabs/portlets/podcasts/PodcastsPortlet.java branches/forge/damon/portal-extensions/podcasts/src/web/ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-app.xml branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-portlet.xml branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-service.xml branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-web.xml branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jsp/ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jsp/normal.jsp branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/portlet-instances.xml branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/portlet.xml branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/tld/ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/tld/forge.tld branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/tld/portlet.tld branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/web.xml branches/forge/damon/portal-extensions/primates/ branches/forge/damon/portal-extensions/primates/build.properties branches/forge/damon/portal-extensions/primates/forge-ads.iml branches/forge/damon/portal-extensions/primates/maven.xml branches/forge/damon/portal-extensions/primates/project.properties branches/forge/damon/portal-extensions/primates/project.xml branches/forge/damon/portal-extensions/primates/src/ branches/forge/damon/portal-extensions/primates/src/java/ branches/forge/damon/portal-extensions/primates/src/java/org/ branches/forge/damon/portal-extensions/primates/src/java/org/jbosslabs/ branches/forge/damon/portal-extensions/primates/src/java/org/jbosslabs/portlets/ branches/forge/damon/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/ branches/forge/damon/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesPortlet.java branches/forge/damon/portal-extensions/primates/src/web/ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-app.xml branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-portlet.xml branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-service.xml branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-web.xml branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jsp/ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jsp/normal.jsp branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/portlet-instances.xml branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/portlet.xml branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/tld/ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/tld/forge.tld branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/tld/portlet.tld branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/web.xml branches/forge/damon/portal-extensions/whuffie/ branches/forge/damon/portal-extensions/whuffie/build.properties branches/forge/damon/portal-extensions/whuffie/forge-ads.iml branches/forge/damon/portal-extensions/whuffie/maven.xml branches/forge/damon/portal-extensions/whuffie/project.properties branches/forge/damon/portal-extensions/whuffie/project.xml branches/forge/damon/portal-extensions/whuffie/src/ branches/forge/damon/portal-extensions/whuffie/src/java/ branches/forge/damon/portal-extensions/whuffie/src/java/org/ branches/forge/damon/portal-extensions/whuffie/src/java/org/jbosslabs/ branches/forge/damon/portal-extensions/whuffie/src/java/org/jbosslabs/portlets/ branches/forge/damon/portal-extensions/whuffie/src/java/org/jbosslabs/portlets/whuffie/ branches/forge/damon/portal-extensions/whuffie/src/java/org/jbosslabs/portlets/whuffie/WhuffiePortlet.java branches/forge/damon/portal-extensions/whuffie/src/web/ branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/ branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/jboss-app.xml branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/jboss-portlet.xml branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/jboss-service.xml branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/jboss-web.xml branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/jsp/ branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/jsp/normal.jsp branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/portlet-instances.xml branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/portlet.xml branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/tld/ branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/tld/forge.tld branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/tld/portlet.tld branches/forge/damon/portal-extensions/whuffie/src/web/WEB-INF/web.xml Modified: branches/forge/damon/portal-extensions/forge-ear/src/META-INF/application.xml branches/forge/damon/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties.sample branches/forge/damon/portal-extensions/portal-default/src/web/WEB-INF/default-portal.xml Log: Added podcasts, whuffie, and primates. Modified: branches/forge/damon/portal-extensions/forge-ear/src/META-INF/application.xml =================================================================== --- branches/forge/damon/portal-extensions/forge-ear/src/META-INF/application.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/forge-ear/src/META-INF/application.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -10,6 +10,11 @@ </module> <module> <web> + <web-uri>whuffie-portlet.war</web-uri> + </web> + </module> + <module> + <web> <web-uri>blog-portlet.war</web-uri> </web> </module> Modified: branches/forge/damon/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties.sample =================================================================== --- branches/forge/damon/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties.sample 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties.sample 2005-09-26 16:03:00 UTC (rev 1210) @@ -1,7 +1,9 @@ # FileDataSource configuration file # pathToMedia - points, where JSPWiki file structure is situated -pathToMedia = +#pathToMedia=/usr/local/forge/wiki +pathToMedia= # pathToAttachements - points, where JSPWiki attachemets are situated -pathToAttachements = +#pathToAttachements=/usr/local/forge/wiki +pathToAttachements= Added: branches/forge/damon/portal-extensions/podcasts/build.properties =================================================================== --- branches/forge/damon/portal-extensions/podcasts/build.properties 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/build.properties 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,21 @@ +# Path to where your portal extensions are to be deployed +local.deploy.dir=/Volumes/JBoss/servers/labs/server/all/deploy + +# Path to where yout portal with JBoss as are to be copied (it's de facto local.deploy.dir without server/all/deploy part ) +local.server.dir=/Volumes/JBoss/servers/labs + +# Path to your local maven repository - you can comment this out if you use +# the default location. You can also create a build.properties in your home +# directory to set the maven.repo.local for all projects. +# maven.repo.local= + +# URL of your content repository. You don't have to specify this if you don't +# plan to update the content by maven. +maven.scm.url= + +# Address, username and password to access the JBoss JMX Console. Necessary to +# successfully obtain the 'redeploy-portal' goal; comment out if you won't be +# using it. +jboss.jmx.console= +jboss.jmx.username= +jboss.jmx.password= Added: branches/forge/damon/portal-extensions/podcasts/forge-ads.iml =================================================================== --- branches/forge/damon/portal-extensions/podcasts/forge-ads.iml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/forge-ads.iml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module version="4" relativePaths="true" type="JAVA_MODULE"> + <component name="ModuleRootManager" /> + <component name="NewModuleRootManager"> + <output url="file://$MODULE_DIR$/target/classes" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntryProperties /> + </component> + <component name="org.mevenide.idea.module.ModuleSettings"> + <favoriteGoals> + <list size="0" /> + </favoriteGoals> + </component> +</module> + Added: branches/forge/damon/portal-extensions/podcasts/maven.xml =================================================================== --- branches/forge/damon/portal-extensions/podcasts/maven.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/maven.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,24 @@ +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util"> + <!-- Default war-project goals --> + + <goal name="all"> + <attainGoal name="prj-all" /> + </goal> + + <goal name="build"> + <attainGoal name="prj-war-build" /> + </goal> + + <goal name="deploy"> + <attainGoal name="prj-war-deploy" /> + </goal> + + <goal name="clean"> + <attainGoal name="prj-clean" /> + </goal> +</project> Added: branches/forge/damon/portal-extensions/podcasts/project.properties =================================================================== --- branches/forge/damon/portal-extensions/podcasts/project.properties 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/project.properties 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,3 @@ +maven.repo.remote=http://repository.atlassian.com,http://www.ibiblio.org/maven,http://dist.codehaus.org/ +maven.junit.fork=yes +maven.war.src=${basedir}/src/web Added: branches/forge/damon/portal-extensions/podcasts/project.xml =================================================================== --- branches/forge/damon/portal-extensions/podcasts/project.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/project.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,39 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<project> + <pomVersion>3</pomVersion> + <extend>../common.xml</extend> + <id>podcasts-portlet</id> + <name>Podcasts portlet</name> + <currentVersion>1.0</currentVersion> + <organization> + <name>Damon Sicore and JBoss portal team</name> + <url>http://damon.sicore.org and http://www.jboss.org</url> + </organization> + <description></description> + <dependencies> + <dependency> + <groupId>tmate</groupId> + <artifactId>javasvn</artifactId> + <version>1.0</version> + <jar>javasvn.jar</jar> + </dependency> + + <dependency> + <groupId>tmate</groupId> + <artifactId>jsch</artifactId> + <version>1.0</version> + <jar>jsch.jar</jar> + </dependency> + + <dependency> + <groupId>jboss-forge</groupId> + <artifactId>forge-common</artifactId> + <version>1.0</version> + </dependency> + </dependencies> +</project> Added: branches/forge/damon/portal-extensions/podcasts/src/java/org/jbosslabs/portlets/podcasts/PodcastsPortlet.java =================================================================== --- branches/forge/damon/portal-extensions/podcasts/src/java/org/jbosslabs/portlets/podcasts/PodcastsPortlet.java 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/src/java/org/jbosslabs/portlets/podcasts/PodcastsPortlet.java 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,77 @@ +/***************************************** + * * + * JBoss Portal: The OpenSource Portal * + * * + * Distributable under LGPL license. * + * See terms of license at gnu.org. * + * * + *****************************************/ +package org.jbosslabs.portlets.podcasts; + +import org.jboss.portlet.JBossRenderRequest; +import org.jboss.portlet.JBossRenderResponse; +import org.jboss.forge.common.ForgeHelper; +import org.jboss.forge.common.portlet.ContentPortlet; +import org.jboss.portal.core.servlet.jsp.PortalJsp; +import org.jboss.portal.common.context.DelegateContext; +import java.io.IOException; +import javax.portlet.*; + +public class PodcastsPortlet extends ContentPortlet { + public PodcastsPortlet() { + super("Podcasts", "podcasts"); + } + + protected String getCacheKey(JBossRenderRequest rReq, String portalName) { + return portalName + "podcasts"; + } + + protected String[] getWatchedFiles(JBossRenderRequest rReq) { + String []empty = new String [0]; + return empty; + } + + protected Object generateContent(JBossRenderRequest rReq, String portalName) + throws IOException { + String content = readFile(portalName+"/podcasts/podcasts.txt"); + System.out.println("podcasts.txt content:\n "+ content); + String[] data = parse(content); + DelegateContext root = new DelegateContext(); + for (int j = 0; j < data.length/2; j++) { + DelegateContext menuContext = root.next("menuentry"); + menuContext.put("url", data[j * 2]);//adds link of the image + //System.out.println("added to navigation the name "+ data[j * 2]); + menuContext.put("name", data[j * 2 + 1]);//adds name of image + } + return root; + } + + public void prepareRequest(JBossRenderRequest rReq) { + ForgeHelper.prepareRequest(rReq); + } + + protected void displayContent(JBossRenderRequest rReq, + JBossRenderResponse rRes, WindowState ws, Object content) + throws PortletException, IOException { + String fileName = "/WEB-INF/jsp/normal.jsp"; + + rRes.setContentType("text/html"); + rReq.setAttribute(PortalJsp.CTX_REQUEST, content); + writeJsp(rReq, rRes, fileName); + } + + protected static String[] parse(String target) { + String[] cnt; + String[] separated; + cnt = target.split(";"); + separated = new String[cnt.length * 2]; + for (int i = 0; i < cnt.length; i++) { + separated[i * 2] = cnt[i].split(",")[0].trim();//split to image name and + // trim whitespaces + separated[i * 2 + 1] = cnt[i].split(",")[1].trim();//split to + // link and trim whitespaces + } + + return separated; + } +} Added: branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-app.xml =================================================================== --- branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-app.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-app.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,3 @@ +<jboss-app> + <app-name>whuffie</app-name> +</jboss-app> Added: branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-portlet.xml =================================================================== --- branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-portlet.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-portlet.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,6 @@ +<portlet-app> + <portlet> + <portlet-name>WhuffiePortlet</portlet-name> + <security></security> + </portlet> +</portlet-app> Added: branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-service.xml =================================================================== --- branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-service.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-service.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,2 @@ +<server> +</server> Added: branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-web.xml =================================================================== --- branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-web.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jboss-web.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<jboss-web> +</jboss-web> Added: branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jsp/normal.jsp =================================================================== --- branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jsp/normal.jsp 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/jsp/normal.jsp 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,27 @@ +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %> + <%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="n" %> + <%@ taglib uri="/WEB-INF/tld/forge.tld" prefix="forge" %> + <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> + <%@ page isELIgnored ="false" %> + <portlet:defineObjects/> + + <h1>Die Mother Fucker Die</h1> +<div id="blog-entry"> + +<n:iterate ctx="menuentry"> + <!-- iterated menuentry --> + <div class="item"> + <a href="${n:out("menuentry.url")}"><img src="<forge:imagePath src="ads/images/${n:out('menuentry.name')}"/>" + width="175" height="64" border="0" /> + </a> + </div> +</n:iterate> + +</div> + + Added: branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/portlet-instances.xml =================================================================== --- branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/portlet-instances.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/portlet-instances.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,7 @@ +<?xml version="1.0" standalone="yes"?> +<instances> + <instance> + <instance-name>WhuffiePortletInstance</instance-name> + <component-ref>WhuffiePortlet</component-ref> + </instance> +</instances> Added: branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/portlet.xml =================================================================== --- branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/portlet.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/portlet.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd /opt/SUNWps/dtd/portlet.xsd" version="1.0"> + <portlet> + <portlet-name>WhuffiePortlet</portlet-name> + <portlet-class>org.jbosslabs.portlets.whuffie.WhuffiePortlet</portlet-class> + <supported-locale>en</supported-locale> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>VIEW</portlet-mode> + </supports> + <portlet-info> + <title>JBoss Whuffie Portlet</title> + </portlet-info> + </portlet> +</portlet-app> Added: branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/tld/forge.tld =================================================================== --- branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/tld/forge.tld 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/tld/forge.tld 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,139 @@ +<taglib xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd" + version="2.0"> + <!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> + <tlib-version>1.1</tlib-version> + <jsp-version>2.0</jsp-version> + <shortname>forge</shortname> + <info>Forge tags</info> + + <tag> + <name>pageURL</name> + <tagclass>org.jboss.forge.common.taglib.PageURLTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>form</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>param</name> + <tagclass>org.jboss.forge.common.taglib.ParamTag</tagclass> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>value</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>wikiURL</name> + <tagclass>org.jboss.forge.common.taglib.WikiURLTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>freezoneURL</name> + <tagclass>org.jboss.forge.common.taglib.FreezoneURLTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>projectURL</name> + <tagclass>org.jboss.forge.common.taglib.ProjectURLTag</tagclass> + <attribute> + <name>project</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>page</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>form</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>categoryURL</name> + <tagclass>org.jboss.forge.common.taglib.CategoryURLTag</tagclass> + <attribute> + <name>category</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>form</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>selectedProject</name> + <tagclass>org.jboss.forge.common.taglib.SelectedProjectTag</tagclass> + </tag> + + <tag> + <name>imagePath</name> + <tagclass>org.jboss.forge.common.taglib.ImagePathTag</tagclass> + <attribute> + <name>src</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>project</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>attrValue</name> + <tagclass>org.jboss.forge.common.taglib.AttrValueTag</tagclass> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>attrIf</name> + <tagclass>org.jboss.forge.common.taglib.AttrIfTag</tagclass> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> +</taglib> Added: branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/tld/portlet.tld =================================================================== --- branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/tld/portlet.tld 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/tld/portlet.tld 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> + +<taglib> + + <tlib-version>1.0</tlib-version> + <jsp-version>1.2</jsp-version> + <short-name>portlet</short-name> + + <uri>http://java.sun.com/portlet</uri> + + <tag> + + <name>param</name> + <tag-class>org.jboss.portal.portlet.taglib.URLParameterTag</tag-class> + <body-content>empty</body-content> + + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>value</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + + </attribute> + </tag> + <function> + <name>i18n</name> + <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class> + <function-signature>java.lang.String getMessage(java.lang.String)</function-signature> + </function> + + <function> + <name>out</name> + <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class> + <function-signature>java.lang.String out(java.lang.String)</function-signature> + </function> + + <function> + <name>i18nout</name> + <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class> + <function-signature>java.lang.String i18nOut(java.lang.String)</function-signature> + </function> + + <tag> + <name>if</name> + <tagclass>org.jboss.portal.core.servlet.jsp.taglib.IfTag</tagclass> + <attribute> + <name>ctx</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>iterate</name> + <tagclass>org.jboss.portal.core.servlet.jsp.taglib.IterateTag</tagclass> + <attribute> + <name>ctx</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>include</name> + <tagclass>org.jboss.portal.core.servlet.jsp.taglib.IncludeTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + + <name>defineObjects</name> + <tag-class>org.jboss.portal.portlet.taglib.DefineObjectsTag</tag-class> + <tei-class>org.jboss.portal.portlet.taglib.DefineObjectsTagTEI</tei-class> + <body-content>empty</body-content> + + </tag> + <tag> + + <name>namespace</name> + <tag-class>org.jboss.portal.portlet.taglib.NamespaceTag</tag-class> + <body-content>empty</body-content> + + </tag> + <tag> + + <name>renderURL</name> + <tag-class>org.jboss.portal.portlet.taglib.RenderURLTag</tag-class> + <tei-class>org.jboss.portal.portlet.taglib.GenerateURLTagTEI</tei-class> + <body-content>JSP</body-content> + + <attribute> + <name>portletMode</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>secure</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>var</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>windowState</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + </tag> + <tag> + + <name>actionURL</name> + <tag-class>org.jboss.portal.portlet.taglib.ActionURLTag</tag-class> + <tei-class>org.jboss.portal.portlet.taglib.GenerateURLTagTEI</tei-class> + <body-content>JSP</body-content> + + <attribute> + <name>portletMode</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>secure</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>var</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>windowState</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + </tag> + +</taglib> Added: branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/web.xml =================================================================== --- branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/web.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/podcasts/src/web/WEB-INF/web.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<!DOCTYPE web-app PUBLIC + "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" + "http://java.sun.com/dtd/web-app_2_3.dtd"> +<web-app> +</web-app> Modified: branches/forge/damon/portal-extensions/portal-default/src/web/WEB-INF/default-portal.xml =================================================================== --- branches/forge/damon/portal-extensions/portal-default/src/web/WEB-INF/default-portal.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/portal-default/src/web/WEB-INF/default-portal.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -54,7 +54,7 @@ <instance-ref>blog.BlogPortlet.BlogPortletInstance</instance-ref> <default>true</default> <region>center</region> - <height>0</height> + <height>1</height> </window> <window> <window-name>NavigationPortletWindowDefaultDefault</window-name> @@ -70,6 +70,13 @@ <height>2</height> <window-state>normal</window-state> </window> + <window> + <window-name>WhuffiePortletWindowDefaultDefault</window-name> + <instance-ref>whuffie.WhuffiePortlet.WhuffiePortletInstance</instance-ref> + <region>center</region> + <height>0</height> + <window-state>normal</window-state> + </window> </page> <!-- login page --> @@ -96,6 +103,13 @@ <height>2</height> <window-state>normal</window-state> </window> + <window> + <window-name>WhuffiePortletWindowDefaultLogin</window-name> + <instance-ref>whuffie.WhuffiePortlet.WhuffiePortletInstance</instance-ref> + <region>left</region> + <height>2</height> + <window-state>normal</window-state> + </window> </page> <page> @@ -115,6 +129,13 @@ <height>2</height> <window-state>normal</window-state> </window> + <window> + <window-name>WhuffiePortletWindowDefaultMap</window-name> + <instance-ref>whuffie.WhuffiePortlet.WhuffiePortletInstance</instance-ref> + <region>left</region> + <height>3</height> + <window-state>normal</window-state> + </window> <window> <window-name>MapWindowDefaultMap</window-name> @@ -141,6 +162,13 @@ <height>2</height> <window-state>normal</window-state> </window> + <window> + <window-name>WhuffiePortletWindowDefaultWiki</window-name> + <instance-ref>whuffie.WhuffiePortlet.WhuffiePortletInstance</instance-ref> + <region>left</region> + <height>3</height> + <window-state>normal</window-state> + </window> <!--<window> <window-name>JSPWikiPortletWindow</window-name> <instance-ref>jspwikiportlet.JSPWikiPortlet.JSPWikiPortletInstance</instance-ref> @@ -209,6 +237,13 @@ <height>2</height> <window-state>normal</window-state> </window> + <window> + <window-name>WhuffiePortletWindowDefaultInfo</window-name> + <instance-ref>whuffie.WhuffiePortlet.WhuffiePortletInstance</instance-ref> + <region>left</region> + <height>2</height> + <window-state>normal</window-state> + </window> <window> <window-name>PrjInfoPortletWindowDefaultInfo</window-name> @@ -235,6 +270,13 @@ <height>2</height> <window-state>normal</window-state> </window> + <window> + <window-name>WhuffiePortletWindowDefaultBlog</window-name> + <instance-ref>whuffie.WhuffiePortlet.WhuffiePortletInstance</instance-ref> + <region>left</region> + <height>3</height> + <window-state>normal</window-state> + </window> <window> <window-name>PrjBlogPortletWindowDefaultBlog</window-name> @@ -262,6 +304,13 @@ <height>2</height> <window-state>normal</window-state> </window> + <window> + <window-name>WhuffiePortletWindowDefaultDownloads</window-name> + <instance-ref>whuffie.WhuffiePortlet.WhuffiePortletInstance</instance-ref> + <region>left</region> + <height>3</height> + <window-state>normal</window-state> + </window> <window> <window-name>PrjDownloadsPortletWindowDefaultDownloads</window-name> @@ -289,6 +338,13 @@ <height>2</height> <window-state>normal</window-state> </window> + <window> + <window-name>WhuffiePortletWindowDefaultCon</window-name> + <instance-ref>whuffie.WhuffiePortlet.WhuffiePortletInstance</instance-ref> + <region>left</region> + <height>2</height> + <window-state>normal</window-state> + </window> <window> <window-name>ConPortletWindowDefault</window-name> @@ -316,6 +372,13 @@ <height>2</height> <window-state>normal</window-state> </window> + <window> + <window-name>WhuffiePortletWindowDefaultFreezone</window-name> + <instance-ref>whuffie.WhuffiePortlet.WhuffiePortletInstance</instance-ref> + <region>left</region> + <height>3</height> + <window-state>normal</window-state> + </window> <window> <window-name>FreezonePortletWindowDefaultFreezone</window-name> @@ -343,6 +406,13 @@ <height>2</height> <window-state>normal</window-state> </window> + <window> + <window-name>WhuffiePortletWindowDefaultForums</window-name> + <instance-ref>whuffie.WhuffiePortlet.WhuffiePortletInstance</instance-ref> + <region>left</region> + <height>3</height> + <window-state>normal</window-state> + </window> <window> <window-name>ForumsPortletWindowDefaultForums</window-name> Added: branches/forge/damon/portal-extensions/primates/build.properties =================================================================== --- branches/forge/damon/portal-extensions/primates/build.properties 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/build.properties 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,21 @@ +# Path to where your portal extensions are to be deployed +local.deploy.dir=/Volumes/JBoss/servers/labs/server/all/deploy + +# Path to where yout portal with JBoss as are to be copied (it's de facto local.deploy.dir without server/all/deploy part ) +local.server.dir=/Volumes/JBoss/servers/labs + +# Path to your local maven repository - you can comment this out if you use +# the default location. You can also create a build.properties in your home +# directory to set the maven.repo.local for all projects. +# maven.repo.local= + +# URL of your content repository. You don't have to specify this if you don't +# plan to update the content by maven. +maven.scm.url= + +# Address, username and password to access the JBoss JMX Console. Necessary to +# successfully obtain the 'redeploy-portal' goal; comment out if you won't be +# using it. +jboss.jmx.console= +jboss.jmx.username= +jboss.jmx.password= Added: branches/forge/damon/portal-extensions/primates/forge-ads.iml =================================================================== --- branches/forge/damon/portal-extensions/primates/forge-ads.iml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/forge-ads.iml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module version="4" relativePaths="true" type="JAVA_MODULE"> + <component name="ModuleRootManager" /> + <component name="NewModuleRootManager"> + <output url="file://$MODULE_DIR$/target/classes" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntryProperties /> + </component> + <component name="org.mevenide.idea.module.ModuleSettings"> + <favoriteGoals> + <list size="0" /> + </favoriteGoals> + </component> +</module> + Added: branches/forge/damon/portal-extensions/primates/maven.xml =================================================================== --- branches/forge/damon/portal-extensions/primates/maven.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/maven.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,24 @@ +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util"> + <!-- Default war-project goals --> + + <goal name="all"> + <attainGoal name="prj-all" /> + </goal> + + <goal name="build"> + <attainGoal name="prj-war-build" /> + </goal> + + <goal name="deploy"> + <attainGoal name="prj-war-deploy" /> + </goal> + + <goal name="clean"> + <attainGoal name="prj-clean" /> + </goal> +</project> Added: branches/forge/damon/portal-extensions/primates/project.properties =================================================================== --- branches/forge/damon/portal-extensions/primates/project.properties 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/project.properties 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,3 @@ +maven.repo.remote=http://repository.atlassian.com,http://www.ibiblio.org/maven,http://dist.codehaus.org/ +maven.junit.fork=yes +maven.war.src=${basedir}/src/web Added: branches/forge/damon/portal-extensions/primates/project.xml =================================================================== --- branches/forge/damon/portal-extensions/primates/project.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/project.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,39 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<project> + <pomVersion>3</pomVersion> + <extend>../common.xml</extend> + <id>primates-portlet</id> + <name>Primates portlet</name> + <currentVersion>1.0</currentVersion> + <organization> + <name>Damon Sicore and JBoss portal team</name> + <url>http://damon.sicore.org and http://www.jboss.org</url> + </organization> + <description></description> + <dependencies> + <dependency> + <groupId>tmate</groupId> + <artifactId>javasvn</artifactId> + <version>1.0</version> + <jar>javasvn.jar</jar> + </dependency> + + <dependency> + <groupId>tmate</groupId> + <artifactId>jsch</artifactId> + <version>1.0</version> + <jar>jsch.jar</jar> + </dependency> + + <dependency> + <groupId>jboss-forge</groupId> + <artifactId>forge-common</artifactId> + <version>1.0</version> + </dependency> + </dependencies> +</project> Added: branches/forge/damon/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesPortlet.java =================================================================== --- branches/forge/damon/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesPortlet.java 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesPortlet.java 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,77 @@ +/***************************************** + * * + * JBoss Portal: The OpenSource Portal * + * * + * Distributable under LGPL license. * + * See terms of license at gnu.org. * + * * + *****************************************/ +package org.jbosslabs.portlets.primates; + +import org.jboss.portlet.JBossRenderRequest; +import org.jboss.portlet.JBossRenderResponse; +import org.jboss.forge.common.ForgeHelper; +import org.jboss.forge.common.portlet.ContentPortlet; +import org.jboss.portal.core.servlet.jsp.PortalJsp; +import org.jboss.portal.common.context.DelegateContext; +import java.io.IOException; +import javax.portlet.*; + +public class PrimatesPortlet extends ContentPortlet { + public PrimatesPortlet() { + super("Primates", "primates"); + } + + protected String getCacheKey(JBossRenderRequest rReq, String portalName) { + return portalName + "primates"; + } + + protected String[] getWatchedFiles(JBossRenderRequest rReq) { + String []empty = new String [0]; + return empty; + } + + protected Object generateContent(JBossRenderRequest rReq, String portalName) + throws IOException { + String content = readFile(portalName+"/primates/primates.txt"); + System.out.println("wuffie.txt content:\n "+ content); + String[] data = parse(content); + DelegateContext root = new DelegateContext(); + for (int j = 0; j < data.length/2; j++) { + DelegateContext menuContext = root.next("menuentry"); + menuContext.put("url", data[j * 2]);//adds link of the image + //System.out.println("added to navigation the name "+ data[j * 2]); + menuContext.put("name", data[j * 2 + 1]);//adds name of image + } + return root; + } + + public void prepareRequest(JBossRenderRequest rReq) { + ForgeHelper.prepareRequest(rReq); + } + + protected void displayContent(JBossRenderRequest rReq, + JBossRenderResponse rRes, WindowState ws, Object content) + throws PortletException, IOException { + String fileName = "/WEB-INF/jsp/normal.jsp"; + + rRes.setContentType("text/html"); + rReq.setAttribute(PortalJsp.CTX_REQUEST, content); + writeJsp(rReq, rRes, fileName); + } + + protected static String[] parse(String target) { + String[] cnt; + String[] separated; + cnt = target.split(";"); + separated = new String[cnt.length * 2]; + for (int i = 0; i < cnt.length; i++) { + separated[i * 2] = cnt[i].split(",")[0].trim();//split to image name and + // trim whitespaces + separated[i * 2 + 1] = cnt[i].split(",")[1].trim();//split to + // link and trim whitespaces + } + + return separated; + } +} Added: branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-app.xml =================================================================== --- branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-app.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-app.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,3 @@ +<jboss-app> + <app-name>whuffie</app-name> +</jboss-app> Added: branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-portlet.xml =================================================================== --- branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-portlet.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-portlet.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,6 @@ +<portlet-app> + <portlet> + <portlet-name>WhuffiePortlet</portlet-name> + <security></security> + </portlet> +</portlet-app> Added: branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-service.xml =================================================================== --- branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-service.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-service.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,2 @@ +<server> +</server> Added: branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-web.xml =================================================================== --- branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-web.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jboss-web.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<jboss-web> +</jboss-web> Added: branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jsp/normal.jsp =================================================================== --- branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jsp/normal.jsp 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/jsp/normal.jsp 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,27 @@ +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %> + <%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="n" %> + <%@ taglib uri="/WEB-INF/tld/forge.tld" prefix="forge" %> + <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> + <%@ page isELIgnored ="false" %> + <portlet:defineObjects/> + + <h1>Die Mother Fucker Die</h1> +<div id="blog-entry"> + +<n:iterate ctx="menuentry"> + <!-- iterated menuentry --> + <div class="item"> + <a href="${n:out("menuentry.url")}"><img src="<forge:imagePath src="ads/images/${n:out('menuentry.name')}"/>" + width="175" height="64" border="0" /> + </a> + </div> +</n:iterate> + +</div> + + Added: branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/portlet-instances.xml =================================================================== --- branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/portlet-instances.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/portlet-instances.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,7 @@ +<?xml version="1.0" standalone="yes"?> +<instances> + <instance> + <instance-name>WhuffiePortletInstance</instance-name> + <component-ref>WhuffiePortlet</component-ref> + </instance> +</instances> Added: branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/portlet.xml =================================================================== --- branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/portlet.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/portlet.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd /opt/SUNWps/dtd/portlet.xsd" version="1.0"> + <portlet> + <portlet-name>WhuffiePortlet</portlet-name> + <portlet-class>org.jbosslabs.portlets.whuffie.WhuffiePortlet</portlet-class> + <supported-locale>en</supported-locale> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>VIEW</portlet-mode> + </supports> + <portlet-info> + <title>JBoss Whuffie Portlet</title> + </portlet-info> + </portlet> +</portlet-app> Added: branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/tld/forge.tld =================================================================== --- branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/tld/forge.tld 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/tld/forge.tld 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,139 @@ +<taglib xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd" + version="2.0"> + <!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> + <tlib-version>1.1</tlib-version> + <jsp-version>2.0</jsp-version> + <shortname>forge</shortname> + <info>Forge tags</info> + + <tag> + <name>pageURL</name> + <tagclass>org.jboss.forge.common.taglib.PageURLTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>form</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>param</name> + <tagclass>org.jboss.forge.common.taglib.ParamTag</tagclass> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>value</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>wikiURL</name> + <tagclass>org.jboss.forge.common.taglib.WikiURLTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>freezoneURL</name> + <tagclass>org.jboss.forge.common.taglib.FreezoneURLTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>projectURL</name> + <tagclass>org.jboss.forge.common.taglib.ProjectURLTag</tagclass> + <attribute> + <name>project</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>page</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>form</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>categoryURL</name> + <tagclass>org.jboss.forge.common.taglib.CategoryURLTag</tagclass> + <attribute> + <name>category</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>form</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>selectedProject</name> + <tagclass>org.jboss.forge.common.taglib.SelectedProjectTag</tagclass> + </tag> + + <tag> + <name>imagePath</name> + <tagclass>org.jboss.forge.common.taglib.ImagePathTag</tagclass> + <attribute> + <name>src</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>project</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>attrValue</name> + <tagclass>org.jboss.forge.common.taglib.AttrValueTag</tagclass> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>attrIf</name> + <tagclass>org.jboss.forge.common.taglib.AttrIfTag</tagclass> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> +</taglib> Added: branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/tld/portlet.tld =================================================================== --- branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/tld/portlet.tld 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/tld/portlet.tld 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> + +<taglib> + + <tlib-version>1.0</tlib-version> + <jsp-version>1.2</jsp-version> + <short-name>portlet</short-name> + + <uri>http://java.sun.com/portlet</uri> + + <tag> + + <name>param</name> + <tag-class>org.jboss.portal.portlet.taglib.URLParameterTag</tag-class> + <body-content>empty</body-content> + + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>value</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + + </attribute> + </tag> + <function> + <name>i18n</name> + <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class> + <function-signature>java.lang.String getMessage(java.lang.String)</function-signature> + </function> + + <function> + <name>out</name> + <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class> + <function-signature>java.lang.String out(java.lang.String)</function-signature> + </function> + + <function> + <name>i18nout</name> + <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class> + <function-signature>java.lang.String i18nOut(java.lang.String)</function-signature> + </function> + + <tag> + <name>if</name> + <tagclass>org.jboss.portal.core.servlet.jsp.taglib.IfTag</tagclass> + <attribute> + <name>ctx</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>iterate</name> + <tagclass>org.jboss.portal.core.servlet.jsp.taglib.IterateTag</tagclass> + <attribute> + <name>ctx</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>include</name> + <tagclass>org.jboss.portal.core.servlet.jsp.taglib.IncludeTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + + <name>defineObjects</name> + <tag-class>org.jboss.portal.portlet.taglib.DefineObjectsTag</tag-class> + <tei-class>org.jboss.portal.portlet.taglib.DefineObjectsTagTEI</tei-class> + <body-content>empty</body-content> + + </tag> + <tag> + + <name>namespace</name> + <tag-class>org.jboss.portal.portlet.taglib.NamespaceTag</tag-class> + <body-content>empty</body-content> + + </tag> + <tag> + + <name>renderURL</name> + <tag-class>org.jboss.portal.portlet.taglib.RenderURLTag</tag-class> + <tei-class>org.jboss.portal.portlet.taglib.GenerateURLTagTEI</tei-class> + <body-content>JSP</body-content> + + <attribute> + <name>portletMode</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>secure</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>var</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>windowState</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + </tag> + <tag> + + <name>actionURL</name> + <tag-class>org.jboss.portal.portlet.taglib.ActionURLTag</tag-class> + <tei-class>org.jboss.portal.portlet.taglib.GenerateURLTagTEI</tei-class> + <body-content>JSP</body-content> + + <attribute> + <name>portletMode</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>secure</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>var</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>windowState</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + </tag> + +</taglib> Added: branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/web.xml =================================================================== --- branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/web.xml 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/primates/src/web/WEB-INF/web.xml 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<!DOCTYPE web-app PUBLIC + "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" + "http://java.sun.com/dtd/web-app_2_3.dtd"> +<web-app> +</web-app> Added: branches/forge/damon/portal-extensions/whuffie/build.properties =================================================================== --- branches/forge/damon/portal-extensions/whuffie/build.properties 2005-09-26 15:46:59 UTC (rev 1209) +++ branches/forge/damon/portal-extensions/whuffie/build.properties 2005-09-26 16:03:00 UTC (rev 1210) @@ -0,0 +1,21 @@ +# Path to where your portal extensions are to be deployed +local.deploy.dir=/Volumes/JBoss/servers/labs/server/all/deploy + +# Path to where yout portal with JBoss as are to be copied (it'... [truncated message content] |
From: <jbo...@li...> - 2005-09-26 15:47:20
|
Author: dam...@jb... Date: 2005-09-26 11:46:59 -0400 (Mon, 26 Sep 2005) New Revision: 1209 Added: branches/forge/damon/portal-extensions/ Log: Branching.. for add of podcasts, primates, and whuffie. Copied: branches/forge/damon/portal-extensions (from rev 1207, trunk/forge/portal-extensions) |
From: <jbo...@li...> - 2005-09-26 15:42:39
|
Author: dam...@jb... Date: 2005-09-26 11:42:37 -0400 (Mon, 26 Sep 2005) New Revision: 1208 Added: branches/forge/damon/ Log: Added a special little branch dir for Damon. |
From: <jbo...@li...> - 2005-09-26 15:35:06
|
Author: szimano Date: 2005-09-26 11:34:56 -0400 (Mon, 26 Sep 2005) New Revision: 1207 Modified: trunk/forge/portal-extensions/maven.xml Log: changed maven help Modified: trunk/forge/portal-extensions/maven.xml =================================================================== --- trunk/forge/portal-extensions/maven.xml 2005-09-25 14:53:11 UTC (rev 1206) +++ trunk/forge/portal-extensions/maven.xml 2005-09-26 15:34:56 UTC (rev 1207) @@ -124,6 +124,7 @@ 3. blojsom/to-copy/blojsom.war/WEB-INF/blojsom.properties 4. forge-login/to-copy/portal-login-ds.xml 5. federation-register/src/web/WEB-INF/faces-config (only for the JOSF portal). +6. jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties Available goals: - help - prints this info |
From: <jbo...@li...> - 2005-09-25 14:53:37
|
Author: aron.gombas Date: 2005-09-25 10:53:11 -0400 (Sun, 25 Sep 2005) New Revision: 1206 Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/CcProject.java trunk/labs/kosmos/src/java/hu/midori/kosmos/model/CcTestResult.java trunk/labs/kosmos/src/java/hu/midori/kosmos/model/ModelUtils.java trunk/labs/kosmos/src/java/hu/midori/kosmos/server/cc/CcServiceImpl.java trunk/labs/kosmos/src/java/hu/midori/kosmos/server/jira/JiraServiceImpl.java trunk/labs/kosmos/src/java/hu/midori/kosmos/server/util/ScrapingUtils.java trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet_hu.properties trunk/labs/kosmos/web-portlet/pages/cc_monitoring.jsp trunk/labs/kosmos/web-portlet/pages/cc_monitoring_test_details.jsp Log: Testcase parsing 99% done 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-25 14:52:36 UTC (rev 1205) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/model/CcProject.java 2005-09-25 14:53:11 UTC (rev 1206) @@ -37,7 +37,7 @@ /** Number of unit test case errors. */ private int errors; /** All testcases run during this build. */ - private List<CcTest> testcases;// TODO better name? + private List<CcTest> testCases; /** URL of the tests-per-category chart image. */ private String testsPerCategoryChartUrl; @@ -52,7 +52,7 @@ public CcProject(String name, String buildLabel, int status, Date timestamp, int modifications, String buildTime, - int tests, int errors, int failures, List<CcTest> testcases, + int tests, int errors, int failures, List<CcTest> testCases, String testsPerCategoryChartUrl) { super(name + buildLabel + timestamp.getTime()); @@ -67,7 +67,7 @@ this.tests = tests; this.errors = errors; this.failures = failures; - this.testcases = testcases; + this.testCases = testCases; this.testsPerCategoryChartUrl = testsPerCategoryChartUrl; } @@ -112,8 +112,8 @@ return errors; } - public List<CcTest> getTestcases() { - return testcases; + public List<CcTest> getTestCases() { + return testCases; } public String getTestsPerCategoryChartUrl() { Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/CcTestResult.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/model/CcTestResult.java 2005-09-25 14:52:36 UTC (rev 1205) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/model/CcTestResult.java 2005-09-25 14:53:11 UTC (rev 1206) @@ -15,6 +15,10 @@ * @version $Id$ */ public class CcTestResult { + /** This class should never be instantiated. */ + protected CcTestResult() { + } + public static final int UNKNOWN = 0; public static final int SUCCEEDED = 1; public static final int FAILED = -1; Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/ModelUtils.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/model/ModelUtils.java 2005-09-25 14:52:36 UTC (rev 1205) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/model/ModelUtils.java 2005-09-25 14:53:11 UTC (rev 1206) @@ -14,7 +14,8 @@ */ public class ModelUtils { /** This class should never be instantiated. */ - protected ModelUtils() { } + protected ModelUtils() { + } /** Millis in one day. */ public final static long MILLIS_PER_DAY = 24*60*60*1000; 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-25 14:52:36 UTC (rev 1205) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/cc/CcServiceImpl.java 2005-09-25 14:53:11 UTC (rev 1206) @@ -30,7 +30,6 @@ import java.util.Map; import java.util.StringTokenizer; -import net.sf.saxon.expr.Tokenizer; import net.sf.saxon.om.NodeInfo; import org.apache.commons.logging.Log; @@ -98,7 +97,7 @@ File latestLog = findLatestLog(dir); Document dom = ScrapingUtils.downloadDom(latestLog.toURL()); - // TODO is it possible to have more than one CC project in the same log? I think I saw such a logfile somewhere + // scape "global" properties String name = ScrapingUtils.runXQueryString(dom, "<dummy> { data(//property[@name='projectname']/@value) } </dummy>"); String buildLabel = ScrapingUtils.runXQueryString(dom, "<dummy> { data(//property[@name='label']/@value) } </dummy>"); int status = (ScrapingUtils.runXQueryString(dom, "<dummy> { data(//build/@error) } </dummy>").length() == 0) ? CcBuildStatus.SUCCEEDED : CcBuildStatus.FAILED; @@ -109,40 +108,36 @@ int errors = ScrapingUtils.runXQueryInt(dom, "<dummy> { data(count(//testcase/error)) } </dummy>"); int failures = ScrapingUtils.runXQueryInt(dom, "<dummy> { data(count(//testcase/failure)) } </dummy>"); -// TODO process testcases here -// TODO nevezektant rendberak -List<CcTest> testCases = new ArrayList(); -String query = - "for " + - "$d in //testcase " + - "return " + - "<dummy>" + - "{ data($d/@classname) }|" + - "{ data($d/@name) }|" + - "{ count($d/failure) }|" + - "{ count($d/error) }" + - "</dummy>"; - -List result = ScrapingUtils.runXQuery(dom, query); -for(Iterator it = result.iterator(); it.hasNext();) { - String value = ((NodeInfo)it.next()).getStringValue(); -if(value.charAt(0) == '|') - value = " " + value;// TODO kiemel es '-'-re cserel? JIRA-bol uezt hasznalni -System.out.println("value: " + value); - - StringTokenizer tokenizer = new StringTokenizer(value, "|"); - String className = tokenizer.nextToken(); - String testCaseName = tokenizer.nextToken(); - int result_ = CcTestResult.SUCCEEDED;//!!! - if(!tokenizer.nextToken().equals("0")) - result_ = CcTestResult.FAILED; - else if(!tokenizer.nextToken().equals("0")) - result_ = CcTestResult.ERROR; - - System.out.println(" ===> className: '" + className + "', testCaseName: '" + testCaseName + "', result: " + result_); - testCases.add(new CcTest(result_, className, testCaseName)); -} -// === + // scrape testcases + List<CcTest> testCases = new ArrayList<CcTest>(); + String query = + "for " + + "$d in //testcase " + + "return " + + "<dummy>" + + "{ data($d/@classname) }|" + + "{ data($d/@name) }|" + + "{ count($d/failure) }|" + + "{ count($d/error) }" + + "</dummy>"; + + List result = ScrapingUtils.runXQuery(dom, query); + for(Iterator it = result.iterator(); it.hasNext();) { + String value = ScrapingUtils.eliminateEmptyValues(((NodeInfo)it.next()).getStringValue()); + log.debug(String.format("Scraped testcase: \"%s\"", value)); + + StringTokenizer tokenizer = new StringTokenizer(value, "|"); + String className = tokenizer.nextToken(); + String testCaseName = tokenizer.nextToken(); + int result_ = CcTestResult.SUCCEEDED; + if(!tokenizer.nextToken().equals("0")) + result_ = CcTestResult.FAILED; + else if(!tokenizer.nextToken().equals("0")) + result_ = CcTestResult.ERROR; + + testCases.add(new CcTest(result_, className, testCaseName)); + } + // generate chart Map<Integer, Integer> testsPerCategory = new HashMap<Integer, Integer>(); int success = tests - errors - failures; 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-25 14:52:36 UTC (rev 1205) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/jira/JiraServiceImpl.java 2005-09-25 14:53:11 UTC (rev 1206) @@ -145,9 +145,7 @@ // scrape for(Iterator itProject = resultProject.iterator(); itProject.hasNext();) { - String valueProject = ((NodeInfo)itProject.next()).getStringValue(); - valueProject = valueProject.replaceAll("\\|\\|\\|", "| | |"); // to eliminate empty items - valueProject = valueProject.replaceAll("\\|\\|", "| |"); // to eliminate empty items + String valueProject = ScrapingUtils.eliminateEmptyValues(((NodeInfo)itProject.next()).getStringValue()); log.debug(String.format("Scraped project: \"%s\"", valueProject)); StringTokenizer tokenizerProject = new StringTokenizer(valueProject, "|"); Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/util/ScrapingUtils.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/util/ScrapingUtils.java 2005-09-25 14:52:36 UTC (rev 1205) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/util/ScrapingUtils.java 2005-09-25 14:53:11 UTC (rev 1206) @@ -82,4 +82,16 @@ return ((NodeInfo)list.get(0)).getStringValue(); } + + /** + * Eliminates the empty items from a scraped value string to make + * the tokenizer happy. E.g. <code>||xxx|</code> will be transformed to <code> | |xxx| </code>. + */ + public static String eliminateEmptyValues(String value) { + if(value.charAt(0) == '|') + value = " " + value; + value = value.replaceAll("\\|\\|\\|", "| | |"); + value = value.replaceAll("\\|\\|", "| |"); + return value; + } } Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet.properties 2005-09-25 14:52:36 UTC (rev 1205) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet.properties 2005-09-25 14:53:11 UTC (rev 1206) @@ -18,12 +18,15 @@ ccproject.tests=Tests Total ccproject.testsPerCategory=Tests Success Rate -status.success=Success. -status.failure=Failure. +status.success=Successful build with successful tests. +status.failure=Failed build or successful build with test failures, errors. legend.title=Legend -legend.success=Successful build. -legend.error=Failed build or successful build with failed tests. +legend.buildSuccess=Successful build. +legend.buildError=Failed build. +legend.testSuccess=Succesful test. +legend.testFailure=Failed test. +legend.testError=Test error. lastupdate=Last Update Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet_hu.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet_hu.properties 2005-09-25 14:52:36 UTC (rev 1205) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/ccmonitoringportlet_hu.properties 2005-09-25 14:53:11 UTC (rev 1206) @@ -18,12 +18,15 @@ ccproject.tests=Unit Tesztek szesen ccproject.testsPerCategory=Unit Teszt Eloszl -status.success=Sikeres. -status.failure=Sikertelen. +status.success=Sikeres build sikeres tesztekkel. +status.failure=Sikertelen build vagy sikeres build sikertelen tesztekkel. legend.title=Jelmagyart -legend.success=Sikeres build. -legend.error=Hibbuild vagy sikeres build sikertelen unit tesztekkel. +legend.buildSuccess=Sikeres build. +legend.buildError=Sikertelen build. +legend.testSuccess=Sikeres unit teszt. +legend.testFailure=Sikertelen unit teszt. +legend.testError=Hibunit teszt. lastupdate=Utolsisss Modified: trunk/labs/kosmos/web-portlet/pages/cc_monitoring.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/cc_monitoring.jsp 2005-09-25 14:52:36 UTC (rev 1205) +++ trunk/labs/kosmos/web-portlet/pages/cc_monitoring.jsp 2005-09-25 14:53:11 UTC (rev 1206) @@ -8,10 +8,10 @@ <display:column style="width:20px"> <c:choose> <c:when test="${(projectsIt.status == 1) && (projectsIt.failures == 0) && (projectsIt.errors == 0)}"> - <img src="<%= renderRequest.getContextPath() %>/pages/images/success.gif" title="<fmt:message key="legend.success"/>"/> + <img src="<%= renderRequest.getContextPath() %>/pages/images/success.gif" title="<fmt:message key="status.success"/>"/> </c:when> <c:otherwise> - <img src="<%= renderRequest.getContextPath() %>/pages/images/error.gif" title="<fmt:message key="legend.error"/>"/> + <img src="<%= renderRequest.getContextPath() %>/pages/images/error.gif" title="<fmt:message key="status.failure"/>"/> </c:otherwise> </c:choose> </display:column> @@ -23,10 +23,10 @@ <display:column titleKey="ccproject.status" sortProperty="status" sortable="true"> <c:choose> <c:when test="${projectsIt.status == 1}"> - <img src="<%= renderRequest.getContextPath() %>/pages/images/success.gif" title="<fmt:message key="status.success"/>"/> + <img src="<%= renderRequest.getContextPath() %>/pages/images/success.gif" title="<fmt:message key="legend.buildSuccess"/>"/> </c:when> <c:otherwise> - <img src="<%= renderRequest.getContextPath() %>/pages/images/error.gif" title="<fmt:message key="status.failure"/>"/> + <img src="<%= renderRequest.getContextPath() %>/pages/images/error.gif" title="<fmt:message key="legend.buildError"/>"/> </c:otherwise> </c:choose> </display:column> Modified: trunk/labs/kosmos/web-portlet/pages/cc_monitoring_test_details.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/cc_monitoring_test_details.jsp 2005-09-25 14:52:36 UTC (rev 1205) +++ trunk/labs/kosmos/web-portlet/pages/cc_monitoring_test_details.jsp 2005-09-25 14:53:11 UTC (rev 1206) @@ -46,19 +46,19 @@ <td><img src="<c:out value="${project.testsPerCategoryChartUrl}"/>" title="<fmt:message key="ccproject.testsPerCategory"/>"/></td> <td valign="top"> <table> - <c:forEach var="testcase" items="${project.testcases}" varStatus="status"> + <c:forEach var="testcase" items="${project.testCases}" varStatus="status"> <c:if test="${status.index < 138}"><!-- TODO 8, tooltips, result ordered by type? --> <tr class="portlet-section-body"> <td> <c:choose> <c:when test="${testcase.result == 1}"> - <img src="<%= renderRequest.getContextPath() %>/pages/images/success.gif" title="<fmt:message key="legend.success"/>"/> + <img src="<%= renderRequest.getContextPath() %>/pages/images/success.gif" title="<fmt:message key="legend.testSuccess"/>"/> </c:when> <c:when test="${testcase.result == -1}"> - <img src="<%= renderRequest.getContextPath() %>/pages/images/failure.gif" title="<fmt:message key="legend.failure"/>"/> + <img src="<%= renderRequest.getContextPath() %>/pages/images/failure.gif" title="<fmt:message key="legend.testFailure"/>"/> </c:when> <c:otherwise> - <img src="<%= renderRequest.getContextPath() %>/pages/images/error.gif" title="<fmt:message key="legend.error"/>"/> + <img src="<%= renderRequest.getContextPath() %>/pages/images/error.gif" title="<fmt:message key="legend.testError"/>"/> </c:otherwise> </c:choose> </td> |
From: <jbo...@li...> - 2005-09-25 14:52:43
|
Author: aron.gombas Date: 2005-09-25 10:52:36 -0400 (Sun, 25 Sep 2005) New Revision: 1205 Modified: trunk/labs/kosmos/web-portlet/WEB-INF/portlet.xml Log: More logdirs added Modified: trunk/labs/kosmos/web-portlet/WEB-INF/portlet.xml =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/portlet.xml 2005-09-25 14:52:09 UTC (rev 1204) +++ trunk/labs/kosmos/web-portlet/WEB-INF/portlet.xml 2005-09-25 14:52:36 UTC (rev 1205) @@ -19,11 +19,19 @@ /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/ais, /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/cargo-m2-trunk, /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/commons-math, + /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/frifinans, + /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/gridportlets, + /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/gridsphere, + /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/gvlam, /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/jboss-3.2, + /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/jboss-remoting, /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/log4rss, /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/mobicents-dailytckrun, /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/mock-apis-trunk, - /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/openpacs + /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/openpacs, + /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/scarab-mysql, + /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/scarab-pgsql, + /!Usr/Aron/Own/midori/projects/kosmos/testdata/cc-log/weta-dfs </value> </init-param> <supports> |
From: <jbo...@li...> - 2005-09-25 14:52:18
|
Author: aron.gombas Date: 2005-09-25 10:52:09 -0400 (Sun, 25 Sep 2005) New Revision: 1204 Modified: 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: About box layout changed a bit Modified: trunk/labs/kosmos/web-portlet/pages/cc_monitoring_help.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/cc_monitoring_help.jsp 2005-09-24 16:47:20 UTC (rev 1203) +++ trunk/labs/kosmos/web-portlet/pages/cc_monitoring_help.jsp 2005-09-25 14:52:09 UTC (rev 1204) @@ -3,14 +3,14 @@ <portlet:defineObjects/> <fmt:setBundle basename="hu.midori.kosmos.portlet.cc.ccmonitoringportlet" scope="application"/> +<%@include file="includes/about.jsp"%> + <%@include file="includes/help.jsp"%> <c:set var="legend_success" value="1"/> <c:set var="legend_error" value="1"/> <%@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-24 16:47:20 UTC (rev 1203) +++ trunk/labs/kosmos/web-portlet/pages/jira_monitoring_help.jsp 2005-09-25 14:52:09 UTC (rev 1204) @@ -2,13 +2,13 @@ <portlet:defineObjects/> <fmt:setBundle basename="hu.midori.kosmos.portlet.jira.jiramonitoringportlet" scope="application"/> + +<%@include file="includes/about.jsp"%> <%@include file="includes/help.jsp"%> <c:set var="legend_warning" value="1"/> <%@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"/>"/> Modified: trunk/labs/kosmos/web-portlet/pages/sf_monitoring_help.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/sf_monitoring_help.jsp 2005-09-24 16:47:20 UTC (rev 1203) +++ trunk/labs/kosmos/web-portlet/pages/sf_monitoring_help.jsp 2005-09-25 14:52:09 UTC (rev 1204) @@ -2,14 +2,14 @@ <portlet:defineObjects/> <fmt:setBundle basename="hu.midori.kosmos.portlet.sf.sfmonitoringportlet" scope="application"/> + +<%@include file="includes/about.jsp"%> <%@include file="includes/help.jsp"%> <c:set var="legend_new" value="1"/> <c:set var="legend_old" value="1"/> <%@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"/>"/> Modified: trunk/labs/kosmos/web-portlet/pages/svn_monitoring_help.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/svn_monitoring_help.jsp 2005-09-24 16:47:20 UTC (rev 1203) +++ trunk/labs/kosmos/web-portlet/pages/svn_monitoring_help.jsp 2005-09-25 14:52:09 UTC (rev 1204) @@ -2,13 +2,13 @@ <portlet:defineObjects/> <fmt:setBundle basename="hu.midori.kosmos.portlet.svn.svnmonitoringportlet" scope="application"/> + +<%@include file="includes/about.jsp"%> <%@include file="includes/help.jsp"%> <c:set var="legend_old" value="1"/> <%@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"/>"/> |
From: <jbo...@li...> - 2005-09-24 16:47:26
|
Author: adamw Date: 2005-09-24 12:47:20 -0400 (Sat, 24 Sep 2005) New Revision: 1203 Modified: trunk/forge/portal-extensions/forge-kosmos/maven.xml Log: Build fix Modified: trunk/forge/portal-extensions/forge-kosmos/maven.xml =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/maven.xml 2005-09-24 16:16:18 UTC (rev 1202) +++ trunk/forge/portal-extensions/forge-kosmos/maven.xml 2005-09-24 16:47:20 UTC (rev 1203) @@ -13,48 +13,21 @@ </goal> <goal name="build"> - <!--<ant:exec dir="kosmos-portlet" executable="ant" failonerror="true"> - <ant:arg line="-f build-portlet.xml" /> - <ant:arg value="compile" /> - </ant:exec> - <ant:exec dir="kosmos-server" executable="ant" failonerror="true"> - <ant:arg line="-f build-server.xml" /> - <ant:arg value="compile" /> - </ant:exec>--> </goal> <goal name="deploy"> - <!--<ant:mkdir dir="${local.deploy.dir}/kosmos-portlet.war" /> - <ant:copy todir="${local.deploy.dir}/kosmos-portlet.war" overwrite="true"> - <ant:fileset dir="kosmos-portlet/dist-bin-portlet/kosmos-portlet-0.1.0RC3/kosmos-portlet.war-expanded"> - <ant:filename name="**/*" /> - </ant:fileset> - </ant:copy> - <ant:copy todir="${local.deploy.dir}/kosmos-portlet.war/WEB-INF" overwrite="true"> - <ant:fileset dir="kosmos-portlet/conf-portlet/jboss-portal"> - <ant:filename name="**/*" /> - </ant:fileset> - </ant:copy> - - <ant:mkdir dir="${local.deploy.dir}/kosmos-server.war" /> - <ant:copy todir="${local.deploy.dir}/kosmos-server.war" overwrite="true"> - <ant:fileset dir="kosmos-server/dist-bin-server/kosmos-server-0.1.0RC3/kosmos-server.war-expanded"> - <ant:filename name="**/*" /> - </ant:fileset> - </ant:copy>--> - <!-- Unzipping the jar-s --> <ant:unzip src="to-copy/kosmos-server.war" dest="target/kosmos-server.war" overwrite="true" /> <ant:unzip src="to-copy/kosmos-portlet.war" dest="target/kosmos-portlet.war" overwrite="true" /> <!-- Copying configuration files --> - <ant:copy todir="target/kosmos-server.war/WEB-INF"> - <ant:fileset dir="conf/server" flatten="true" overwrite="true"> + <ant:copy todir="target/kosmos-server.war/WEB-INF" overwrite="true"> + <ant:fileset dir="conf/server"> <ant:filename name="**/*" /> </ant:fileset> </ant:copy> - <ant:copy todir="target/kosmos-portlet.war/WEB-INF"> - <ant:fileset dir="conf/portlet" flatten="true" overwrite="true"> + <ant:copy todir="target/kosmos-portlet.war/WEB-INF" overwrite="true"> + <ant:fileset dir="conf/portlet"> <ant:filename name="**/*" /> </ant:fileset> </ant:copy> @@ -64,8 +37,8 @@ <ant:delete dir="${local.deploy.dir}/kosmos-portlet.war" /> <!-- Deploying new packages --> - <ant:copy todir="${local.deploy.dir}"> - <ant:fileset dir="target" flatten="true" overwrite="true"> + <ant:copy todir="${local.deploy.dir}" overwrite="true"> + <ant:fileset dir="target"> <ant:filename name="**/*" /> </ant:fileset> </ant:copy> |
From: <jbo...@li...> - 2005-09-24 16:16:25
|
Author: szimano Date: 2005-09-24 12:16:18 -0400 (Sat, 24 Sep 2005) New Revision: 1202 Modified: 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/AttachmentDataSource.java 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/plugins/AdminConsolePlugin.java Log: oage deleting (may be hazardous) 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-24 16:11:48 UTC (rev 1201) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-24 16:16:18 UTC (rev 1202) @@ -25,13 +25,13 @@ <class>org.jboss.wiki.plugins.FriendlyLinkPlugin</class> </plugin> <plugin> + <name>adminConsole</name> + <class>org.jboss.wiki.plugins.AdminConsolePlugin</class> + </plugin> + <plugin> <name>wikiToHtmlTranslator</name> <class>org.jboss.wiki.plugins.HTMLTranslatorParts</class> </plugin> - <plugin> - <name>adminConsole</name> - <class>org.jboss.wiki.plugins.AdminConsolePlugin</class> - </plugin> </wikiType> <wikiType> <name>diff</name> Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttachmentDataSource.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttachmentDataSource.java 2005-09-24 16:11:48 UTC (rev 1201) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttachmentDataSource.java 2005-09-24 16:16:18 UTC (rev 1202) @@ -16,6 +16,8 @@ * */ public interface AttachmentDataSource { + + public static String attTrashName = "trash/attachemnts"; /**Add atachment to a given page. * @@ -53,7 +55,7 @@ * * @param pageName Name of the page to get attachment's version from. * @param attachmentName Name of the attachment. - * @return + * @return attachment version */ public int getLastAttachmentVersion(String pageName, String attachmentName); @@ -62,7 +64,22 @@ * @param pageName Name of the page to get attachment's size from. * @param attachmentName Name of the attachment. * @param version Version of the attachment to count size for. - * @return + * @return attachment size */ public long getAttachmentSize(String pageName, String attachmentName, int version); + + /** Deletes (or moves to trash) given attachment from a given page. + * + * @param pageName Name of the page to delete attachment from. + * @param attachmentName Attachment name. + * @return true if attachemnt was deleted. False otherwise. + */ + public boolean deleteAttachment(String pageName, String attachmentName); + + /** Deletes (or moves to trash) all attachments from a given page. + * + * @param pageName Name of the page to delete attachments from. + * @return true if attachemnts were deleted. False otherwise. + */ + public boolean deleteAttachments(String pageName); } 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-24 16:11:48 UTC (rev 1201) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java 2005-09-24 16:16:18 UTC (rev 1202) @@ -38,6 +38,10 @@ public static final String propModFileName = "fileMod.properties"; + public String pathToMediaTrash; + + public String pathToAttTrash; + private String pathToMedia; private String pathToAttachments; @@ -91,6 +95,26 @@ System.err.println("Can't close input stream \n" + ioe); } } + + // create trash directory for deleted pages if it doesn't exists + + pathToMediaTrash = pathToMedia + "/" + MediaDataSource.mediaTrashName; + + File pathToTrashFile = new File(pathToMediaTrash + "/OLD"); + + if (!pathToTrashFile.exists()) { + pathToTrashFile.mkdirs(); + } + + // create trash directory for deleted attachments if it doesn't exists + + pathToAttTrash = pathToMedia + "/" + AttachmentDataSource.attTrashName; + + File pathToAttachmentsFile = new File(pathToAttTrash); + + if (!pathToAttachmentsFile.exists()) { + pathToAttachmentsFile.mkdirs(); + } } public void loadProperties(Properties fileDSProps) { @@ -373,9 +397,11 @@ } int pageMods = getPageMod(pageName); - + page = new WikiPage(pageName, author, pageContent.toString(), - i, i, new Date(pageFile.lastModified()), this, this, (pageMods & VIEWABLE) == VIEWABLE, (pageMods & EDITABLE) == EDITABLE); + i, i, new Date(pageFile.lastModified()), this, this, + (pageMods & VIEWABLE) == VIEWABLE, + (pageMods & EDITABLE) == EDITABLE); page.setLength(pageFile.length()); } @@ -738,11 +764,10 @@ if (mods != (EDITABLE + VIEWABLE)) { pageModProps.setProperty(pageName, String.valueOf(mods)); - } - else { + } else { pageModProps.remove(pageName); } - + FileOutputStream fos = null; try { @@ -758,4 +783,158 @@ } } } + + public synchronized boolean deletePage(String pageName, + boolean deleteSubpages) { + + if (pageExists(pageName)) { + // moving page file + String pageFileName = pathToMedia + "/" + pageName + ".txt"; + String pageFileTrashNameBase = pathToMediaTrash + "/" + pageName + + ".txt"; + String pageFileTrashName = pageFileTrashNameBase; + + File pageFile = new File(pageFileName); + File pageTrashFile = new File(pageFileTrashName); + +// look if page is already in trash (add i-bak) + int i = 0; + + if (pageTrashFile.exists()) { + while (pageTrashFile.exists()) { + pageFileTrashName = pageFileTrashNameBase + "-" + (i++) + + "-bak"; + pageTrashFile = new File(pageFileTrashName); + } + + } + + if (!pageFile.renameTo(pageTrashFile)) { + System.err.println("[FileDataSource]: Problems with moving " + + pageFileName + " to " + pageFileTrashName); + return false; + } + + // moving history directory + + String historyDirName = pathToMedia + "/OLD/" + pageName; + String historyTrashDirNameBase = pathToMediaTrash + "/OLD/" + pageName; + String historyTrashDirName = historyTrashDirNameBase; + + pageFile = new File(historyDirName); + pageTrashFile = new File(historyTrashDirName); + + + // look if history dir is already in trash (add i-bak) + i = 0; + + if (pageTrashFile.exists()) { + while (pageTrashFile.exists()) { + historyTrashDirName = historyTrashDirNameBase + "-" + (i++) + + "-bak"; + pageTrashFile = new File(historyTrashDirName); + } + + } + + if (!pageFile.renameTo(pageTrashFile)) { + System.err.println("[FileDataSource]: Problems with moving " + + historyDirName + " to " + historyTrashDirName); + + // return back the page history + pageFile = new File(pageFileName); + pageTrashFile = new File(pageFileTrashName); + + if (!pageTrashFile.renameTo(pageFile)) { + System.err + .println("[FileDataSource]: ERROR. I've tried moving previously moved page file from the trash, but there was some problem. This is not good and there is nothing i can do about it. The error ocured while moving " + + pageFileTrashName + " to " + pageFileName); + } + + return false; + } + + return true; + } else { + // no such page + System.err.println("There is now such page: " + pageName); + return false; + } + } + + public synchronized boolean deleteAttachment(String pageName, + String attachmentName) { + + String attName = pathToAttachments + "/" + pageName + "-att/" + + attachmentName + "-dir"; + String attTrashNameBase = pathToAttTrash + "/" + pageName + "-att/" + + attachmentName + "-dir"; + String attTrashName = attTrashNameBase; + + // moving file directory + File attFile = new File(attName); + + if (attFile.exists()) { + +// look if att dir is already in trash (add i-bak) + File attTrashFile = new File(attTrashName); + + int i = 0; + + if (attTrashFile.exists()) { + while (attTrashFile.exists()) { + attTrashName = attTrashNameBase + "-" + (i++) + "-bak"; + attTrashFile = new File(attTrashName); + } + + } + + if (!attFile.renameTo(attTrashFile)) { + System.err.println("[ATTACHMENT DS]:Problems with moving " + + attName + " to " + attTrashName); + return false; + } + + return true; + } else { + System.err.println("Page " + pageName + " has no " + attachmentName + + " attachmnet"); + return false; + } + } + + public synchronized boolean deleteAttachments(String pageName) { + String attName = pathToAttachments + "/" + pageName + "-att"; + String attTrashNameBase = pathToAttTrash + "/" + pageName + "-att"; + String attTrashName = attTrashNameBase; + + // moving file directory + File attFile = new File(attName); + + if (attFile.exists()) { +// look if att dir is already in trash (add i-bak) + File attTrashFile = new File(attTrashName); + + int i = 0; + + if (attTrashFile.exists()) { + while (attTrashFile.exists()) { + attTrashName = attTrashNameBase + "-" + (i++) + "-bak"; + attTrashFile = new File(attTrashName); + } + + } + + if (!attFile.renameTo(new File(attTrashName))) { + System.err.println("[ATTACHMENT DS]:Problems with moving " + + attName + " to " + attTrashName); + return false; + } + + return true; + } else { + System.err.println("Page " + pageName + " has no attachmnets"); + return false; + } + } } 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-24 16:11:48 UTC (rev 1201) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java 2005-09-24 16:16:18 UTC (rev 1202) @@ -19,6 +19,8 @@ public final static int EDITABLE = 100; public final static int VIEWABLE = 1; + + public static String mediaTrashName = "trash/pages"; /** * This function is executed before every save. @@ -176,4 +178,13 @@ * @param mods Sum of apropriate static variables EDITABLE and VIEWABLE */ public void setPageMod(String pageName, int mods); + + + + /**Deletes (or moves to trash) given page with or wothout optional subpages + * + * @param pageName Name of the page to delete. + * @param deleteSubpages If true - all subpages will be deleted also. + */ + public boolean deletePage(String pageName, boolean deleteSubpages); } 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-24 16:11:48 UTC (rev 1201) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-24 16:16:18 UTC (rev 1202) @@ -45,6 +45,8 @@ * </p> * */ + public static String defaultPage = "Main"; + private HashMap<String, WikiPage> pages; private HashMap<String, WikiInsidePlugin> insidePlugins; @@ -481,7 +483,7 @@ String attrib = pluginLink .substring(matcher.start(), matcher.end()); - String attribName = attrib.substring(0, attrib.indexOf("'")-1); + String attribName = attrib.substring(0, attrib.indexOf("'") - 1); String attribValue = attrib.substring(attrib.indexOf("'") + 1, attrib.lastIndexOf("'")); @@ -495,4 +497,24 @@ return "<i>INSIDE PLUGIN ERROR: There is no plugin: " + pluginName + "</i>"; } + + public boolean deletePage(String pageName, boolean deleteSubpages) { + + if (getAttachementDataSource().getAttachmentsSet( + getByName(pageName, null)).size() > 0) { + if (!getAttachementDataSource().deleteAttachments(pageName)) { + return false; + } + } + + if (getMediaDataSource().deletePage(pageName, deleteSubpages)) { + + if (pages.containsKey(pageName)) { + pages.remove(pageName); + } + + return true; + } else + return false; + } } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AdminConsolePlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AdminConsolePlugin.java 2005-09-24 16:11:48 UTC (rev 1201) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AdminConsolePlugin.java 2005-09-24 16:16:18 UTC (rev 1202) @@ -1,6 +1,7 @@ package org.jboss.wiki.plugins; import org.jboss.wiki.Credentials; +import org.jboss.wiki.WikiEngine; import org.jboss.wiki.WikiPage; import org.jboss.wiki.WikiPlugin; import org.jboss.wiki.WikiSession; @@ -9,27 +10,51 @@ @Override public WikiPage process(WikiPage wikiPage, WikiSession wikiSession) { - Credentials credentials = (Credentials) wikiSession.getAttribute("credentials"); - + Credentials credentials = (Credentials) wikiSession + .getAttribute("credentials"); + if (credentials.isAdmin()) { String actionURL = (String) wikiSession.getAttribute("actionURL"); + String errorMsg = ""; boolean editable = wikiPage.isEditable(); boolean viewable = wikiPage.isViewable(); - - if ((wikiSession.getAttribute("var1") != null) - && (wikiSession.getAttribute("var1").equals("chmod"))) { - WikiPage editingPage = wikiEngine.getByName(wikiPage.getName(), null); - - if (wikiSession.getAttribute("var2") != null) { - editingPage.setEditable(Boolean.valueOf((String) wikiSession - .getAttribute("var2"))); - editable = editingPage.isEditable(); + + if (wikiSession.getAttribute("var1") != null) { + + if (wikiSession.getAttribute("var1").equals("chmod")) { + WikiPage editingPage = wikiEngine.getByName(wikiPage + .getName(), null); + + if (wikiSession.getAttribute("var2") != null) { + editingPage.setEditable(Boolean + .valueOf((String) wikiSession + .getAttribute("var2"))); + editable = editingPage.isEditable(); + } + if (wikiSession.getAttribute("var3") != null) { + editingPage.setViewable(Boolean + .valueOf((String) wikiSession + .getAttribute("var3"))); + viewable = editingPage.isViewable(); + } } - if (wikiSession.getAttribute("var3") != null) { - editingPage.setViewable(Boolean.valueOf((String) wikiSession - .getAttribute("var3"))); - viewable = editingPage.isViewable(); + else if (wikiSession.getAttribute("var1").equals("deletePage")) { + boolean deleteSubpages = (wikiSession.getAttribute("var3") != null) ? Boolean.parseBoolean((String)wikiSession.getAttribute("var3")) : false; + + if (wikiSession.getAttribute("var2") != null) { + String nameToDelete = (String)wikiSession.getAttribute("var2"); + + if (!nameToDelete.equals(WikiEngine.defaultPage)) { + if (wikiEngine.deletePage(nameToDelete, deleteSubpages)) { + errorMsg += "Couldn't delete whole or parts of page: "+nameToDelete+" (see log for more info)"; + } + } + else { + errorMsg += "You can't delete "+WikiEngine.defaultPage+" page !"; + } + } + } } @@ -37,29 +62,46 @@ .getPageContent()); adminConsole.append("\n<hr><h3>Admin console</h3>\n"); + + if (errorMsg.length() > 0) { + adminConsole.append("<i>"+errorMsg+"</i><br />\n"); + } + + // delete page button + adminConsole.append("<a href=\"").append(actionURL) + .append("&page=Main").append( + "&var1=deletePage").append("&var2=").append( + wikiPage.getName()).append("&var3=false").append( + "\" >DELETE THIS PAGE</a><br />\n"); + + // delete page with subpages button + adminConsole.append("<a href=\"").append(actionURL) + .append("&page=Main").append(wikiPage.getName()).append( + "&var1=deletePage").append("&var2=").append( + wikiPage.getName()).append("&var3=true").append( + "\" >DELETE THIS PAGE WITH SUBPAGES</a><br />\n<br />\n"); + + // switch editable button adminConsole.append("This page ").append( - (editable) ? "is" : "isn't").append( - " editable "); + (editable) ? "is" : "isn't").append(" editable "); adminConsole.append("<a href=\"").append(actionURL) - .append("&page=").append(wikiPage.getName()).append( - "&var1=chmod").append("&var2=").append( - !editable).append("&var3=").append( - viewable).append("\" >SWITCH IT ") + .append("&page=").append( + "&var1=chmod").append("&var2=").append(!editable) + .append("&var3=").append(viewable).append("\" >SWITCH IT ") .append((editable) ? "NOT" : "").append( " EDITABLE</a><br />\n"); - + + // switch viewable button adminConsole.append("This page ").append( - (viewable) ? "is" : "isn't").append( - " viewable "); - + (viewable) ? "is" : "isn't").append(" viewable "); + adminConsole.append("<a href=\"").append(actionURL) - .append("&page=").append(wikiPage.getName()).append( - "&var1=chmod").append("&var2=").append( - editable).append("&var3=").append( - !viewable).append("\" >SWITCH IT ") - .append((viewable) ? "NOT" : "").append( - " VIEWABLE</a><br />\n"); - + .append("&page=").append(wikiPage.getName()).append( + "&var1=chmod").append("&var2=").append(editable) + .append("&var3=").append(!viewable) + .append("\" >SWITCH IT ").append((viewable) ? "NOT" : "") + .append(" VIEWABLE</a><br />\n"); + wikiPage.setPageContent(adminConsole.toString()); } return wikiPage; |
From: <jbo...@li...> - 2005-09-24 16:11:59
|
Author: adamw Date: 2005-09-24 12:11:48 -0400 (Sat, 24 Sep 2005) New Revision: 1201 Modified: trunk/forge/portal-extensions/forge-kosmos/conf/portlet/portlet.xml Log: Added all jira projects to kosmos configuration Modified: trunk/forge/portal-extensions/forge-kosmos/conf/portlet/portlet.xml =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/conf/portlet/portlet.xml 2005-09-24 15:48:02 UTC (rev 1200) +++ trunk/forge/portal-extensions/forge-kosmos/conf/portlet/portlet.xml 2005-09-24 16:11:48 UTC (rev 1201) @@ -16,7 +16,7 @@ <init-param> <name>monitored.urls</name> <value> -<!-- http://jira.jboss.com/jira/browse/JBQA, + http://jira.jboss.com/jira/browse/JBQA, http://jira.jboss.com/jira/browse/JBWIKI, http://jira.jboss.com/jira/browse/EJBTHREE, http://jira.jboss.com/jira/browse/HIBERNATE, @@ -46,7 +46,7 @@ http://jira.jboss.com/jira/browse/JBSHARP, http://jira.jboss.com/jira/browse/JBWEB, http://jira.jboss.com/jira/browse/JBXB, - http://jira.jboss.com/jira/browse/JBWS, --> + http://jira.jboss.com/jira/browse/JBWS, http://jira.jboss.com/jira/browse/KOSMOS </value> </init-param> |
From: <jbo...@li...> - 2005-09-24 15:50:30
|
Author: adamw Date: 2005-09-24 11:48:02 -0400 (Sat, 24 Sep 2005) New Revision: 1200 Added: trunk/forge/portal-extensions/forge-kosmos/conf/ trunk/forge/portal-extensions/forge-kosmos/conf/portlet/ trunk/forge/portal-extensions/forge-kosmos/conf/portlet/jboss-app.xml trunk/forge/portal-extensions/forge-kosmos/conf/portlet/kosmos-pages.xml trunk/forge/portal-extensions/forge-kosmos/conf/portlet/portlet-instances.xml trunk/forge/portal-extensions/forge-kosmos/conf/portlet/portlet.xml trunk/forge/portal-extensions/forge-kosmos/conf/server/ trunk/forge/portal-extensions/forge-kosmos/conf/server/web.xml trunk/forge/portal-extensions/forge-kosmos/to-copy/ trunk/forge/portal-extensions/forge-kosmos/to-copy/kosmos-portlet.war trunk/forge/portal-extensions/forge-kosmos/to-copy/kosmos-server.war Removed: trunk/forge/portal-extensions/forge-kosmos/changes trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/ trunk/forge/portal-extensions/forge-kosmos/kosmos-server/ Modified: trunk/forge/portal-extensions/forge-kosmos/ trunk/forge/portal-extensions/forge-kosmos/maven.xml Log: New Kosmos version & build Property changes on: trunk/forge/portal-extensions/forge-kosmos ___________________________________________________________________ Name: svn:ignore + target Deleted: trunk/forge/portal-extensions/forge-kosmos/changes =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/changes 2005-09-24 13:42:22 UTC (rev 1199) +++ trunk/forge/portal-extensions/forge-kosmos/changes 2005-09-24 15:48:02 UTC (rev 1200) @@ -1,4 +0,0 @@ -Changes are in: -- kosmos-server/src/java/hu/midori/kosmos/server/AbstractCosmosService.java -- kosmos-server/src/java/hu/midori/kosmos/server/util/ChartUrils.java -- svn jsps - added a "back" from help mode, commented out "LAST 8 MODIFICATIONS HERE" Added: trunk/forge/portal-extensions/forge-kosmos/conf/portlet/jboss-app.xml =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/conf/portlet/jboss-app.xml 2005-09-24 13:42:22 UTC (rev 1199) +++ trunk/forge/portal-extensions/forge-kosmos/conf/portlet/jboss-app.xml 2005-09-24 15:48:02 UTC (rev 1200) @@ -0,0 +1,3 @@ +<jboss-app> + <app-name>kosmos-portal</app-name> +</jboss-app> \ No newline at end of file Added: trunk/forge/portal-extensions/forge-kosmos/conf/portlet/kosmos-pages.xml =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/conf/portlet/kosmos-pages.xml 2005-09-24 13:42:22 UTC (rev 1199) +++ trunk/forge/portal-extensions/forge-kosmos/conf/portlet/kosmos-pages.xml 2005-09-24 15:48:02 UTC (rev 1200) @@ -0,0 +1,56 @@ +<pages> + <portal-name>default</portal-name> + <page> + <page-name>kosmos-jira</page-name> + <window> + <window-name>NavigationPortletWindowDefaultKosmosJira</window-name> + <instance-ref>navigation.NavigationPortlet.NavigationPortletInstance</instance-ref> + <region>left</region> + <height>0</height> + <window-state>normal</window-state> + </window> + + <window> + <window-name>AdsPortletWindowDefaultKosmosJira</window-name> + <instance-ref>ads.AdsPortlet.AdsPortletInstance</instance-ref> + <region>left</region> + <height>2</height> + <window-state>normal</window-state> + </window> + + <window> + <window-name>JBossJiraMonitoring</window-name> + <instance-ref>kosmos-portal.JBossJiraMonitoringPortlet.JBossJiraMonitoringPortletInstance</instance-ref> + <default>false</default> + <region>center</region> + <height>0</height> + </window> + </page> + + <page> + <page-name>kosmos-svn</page-name> + <window> + <window-name>NavigationPortletWindowDefaultKosmosSvn</window-name> + <instance-ref>navigation.NavigationPortlet.NavigationPortletInstance</instance-ref> + <region>left</region> + <height>0</height> + <window-state>normal</window-state> + </window> + + <window> + <window-name>AdsPortletWindowDefaultKosmosSvn</window-name> + <instance-ref>ads.AdsPortlet.AdsPortletInstance</instance-ref> + <region>left</region> + <height>2</height> + <window-state>normal</window-state> + </window> + + <window> + <window-name>JBossSvnMonitoringPortlet</window-name> + <instance-ref>kosmos-portal.JBossSvnMonitoringPortlet.JBossSvnMonitoringPortletInstance</instance-ref> + <default>false</default> + <region>center</region> + <height>0</height> + </window> + </page> +</pages> Added: trunk/forge/portal-extensions/forge-kosmos/conf/portlet/portlet-instances.xml =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/conf/portlet/portlet-instances.xml 2005-09-24 13:42:22 UTC (rev 1199) +++ trunk/forge/portal-extensions/forge-kosmos/conf/portlet/portlet-instances.xml 2005-09-24 15:48:02 UTC (rev 1200) @@ -0,0 +1,11 @@ +<?xml version="1.0" standalone="yes"?> +<instances> + <instance> + <instance-name>JBossJiraMonitoringPortletInstance</instance-name> + <component-ref>JBossJiraMonitoringPortlet</component-ref> + </instance> + <instance> + <instance-name>JBossSvnMonitoringPortletInstance</instance-name> + <component-ref>JBossSvnMonitoringPortlet</component-ref> + </instance> +</instances> Added: trunk/forge/portal-extensions/forge-kosmos/conf/portlet/portlet.xml =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/conf/portlet/portlet.xml 2005-09-24 13:42:22 UTC (rev 1199) +++ trunk/forge/portal-extensions/forge-kosmos/conf/portlet/portlet.xml 2005-09-24 15:48:02 UTC (rev 1200) @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="UTF-8"?> +<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0"> + <portlet> + <portlet-name>JBossJiraMonitoringPortlet</portlet-name> + <portlet-class>hu.midori.kosmos.portlet.jira.JiraMonitoringPortlet</portlet-class> + <init-param> + <name>monitored.resource</name> + <value>JBoss JIRA</value> + </init-param> + <init-param> + <name>service.url</name> + <value>http://localhost:8080/kosmos-server/kosmos-services/jira-service</value> + </init-param> + <init-param> + <name>monitored.urls</name> + <value> +<!-- http://jira.jboss.com/jira/browse/JBQA, + http://jira.jboss.com/jira/browse/JBWIKI, + http://jira.jboss.com/jira/browse/EJBTHREE, + http://jira.jboss.com/jira/browse/HIBERNATE, + http://jira.jboss.com/jira/browse/JBAOP, + http://jira.jboss.com/jira/browse/JBAS, + http://jira.jboss.com/jira/browse/JBIDE, + http://jira.jboss.com/jira/browse/JBMESSAGING, + http://jira.jboss.com/jira/browse/JGRP, + http://jira.jboss.com/jira/browse/JBTPL, + http://jira.jboss.com/jira/browse/JBDOCS, + http://jira.jboss.com/jira/browse/JASSIST, + http://jira.jboss.com/jira/browse/JBADMCON, + http://jira.jboss.com/jira/browse/JBBENCH, + http://jira.jboss.com/jira/browse/JBBUILD, + http://jira.jboss.com/jira/browse/JBCACHE, + http://jira.jboss.com/jira/browse/JBCLUSTER, + http://jira.jboss.com/jira/browse/JBINSTALL, + http://jira.jboss.com/jira/browse/JBPM, + http://jira.jboss.com/jira/browse/JBLAB, + http://jira.jboss.com/jira/browse/JBMAIL, + http://jira.jboss.com/jira/browse/JBMICROCONT, + http://jira.jboss.com/jira/browse/JBPORTAL, + http://jira.jboss.com/jira/browse/JBPROFILER, + http://jira.jboss.com/jira/browse/JBREM, + http://jira.jboss.com/jira/browse/JBSEAM, + http://jira.jboss.com/jira/browse/JBSER, + http://jira.jboss.com/jira/browse/JBSHARP, + http://jira.jboss.com/jira/browse/JBWEB, + http://jira.jboss.com/jira/browse/JBXB, + http://jira.jboss.com/jira/browse/JBWS, --> + http://jira.jboss.com/jira/browse/KOSMOS + </value> + </init-param> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>HELP</portlet-mode> + <portlet-mode>VIEW</portlet-mode> + </supports> + <supported-locale>en</supported-locale> + <supported-locale>hu</supported-locale> + <resource-bundle>hu.midori.kosmos.portlet.jira.jiramonitoringportlet</resource-bundle> + <portlet-info> + <title>JIRA Monitoring</title> + </portlet-info> + </portlet> + + <portlet> + <portlet-name>JBossSvnMonitoringPortlet</portlet-name> + <portlet-class>hu.midori.kosmos.portlet.svn.SvnMonitoringPortlet</portlet-class> + <init-param> + <name>monitored.resource</name> + <value>JBoss Labs Subversion</value> + </init-param> + <init-param> + <name>service.url</name> + <value>http://localhost:8080/kosmos-server/kosmos-services/svn-service</value> + </init-param> + <init-param> + <name>monitored.urls</name> + <value> + http://anonsvn.labs.jboss.com/trunk/labs/demo/, + http://anonsvn.labs.jboss.com/trunk/labs/jbossprofiler/, + http://anonsvn.labs.jboss.com/trunk/labs/jbossweb/, + http://anonsvn.labs.jboss.com/trunk/labs/jrunit/, + http://anonsvn.labs.jboss.com/trunk/labs/kosmos/, + http://anonsvn.labs.jboss.com/trunk/labs/portletswap/, + http://anonsvn.labs.jboss.com/trunk/labs/reportingservices/, + http://anonsvn.labs.jboss.com/trunk/forge/portal-extensions/ + </value> + </init-param> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>HELP</portlet-mode> + <portlet-mode>VIEW</portlet-mode> + </supports> + <supported-locale>en</supported-locale> + <supported-locale>hu</supported-locale> + <resource-bundle>hu.midori.kosmos.portlet.svn.svnmonitoringportlet</resource-bundle> + <portlet-info> + <title>Subversion Monitoring</title> + </portlet-info> + </portlet> +</portlet-app> Added: trunk/forge/portal-extensions/forge-kosmos/conf/server/web.xml =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/conf/server/web.xml 2005-09-24 13:42:22 UTC (rev 1199) +++ trunk/forge/portal-extensions/forge-kosmos/conf/server/web.xml 2005-09-24 15:48:02 UTC (rev 1200) @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<!DOCTYPE web-app + PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" + "http://java.sun.com/dtd/web-app_2_3.dtd"> + +<web-app> + <display-name>Kosmos services servlet</display-name> + <description>Server component of Kosmos</description> + + <context-param> + <param-name>webdav.url</param-name> + <param-value>https://labs-stats:jbo...@cm.../trunk/forge/portal-content/kosmos/images</param-value> + </context-param> + <context-param> + <param-name>webdav.user</param-name> + <param-value>labs-stats</param-value> + </context-param> + <context-param> + <param-name>webdav.password</param-name> + <param-value>jbossforgeadmin</param-value> + </context-param> + <context-param> + <param-name>webdav.clientUrl</param-name> + <param-value>/file-access/kosmos/images</param-value> + </context-param> + + <servlet> + <servlet-name>kosmos-services</servlet-name> + <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>kosmos-services</servlet-name> + <url-pattern>/kosmos-services/*</url-pattern> + </servlet-mapping> +</web-app> Modified: trunk/forge/portal-extensions/forge-kosmos/maven.xml =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/maven.xml 2005-09-24 13:42:22 UTC (rev 1199) +++ trunk/forge/portal-extensions/forge-kosmos/maven.xml 2005-09-24 15:48:02 UTC (rev 1200) @@ -9,21 +9,22 @@ </goal> <goal name="clean"> + <attainGoal name="prj-clean" /> </goal> <goal name="build"> - <ant:exec dir="kosmos-portlet" executable="ant" failonerror="true"> + <!--<ant:exec dir="kosmos-portlet" executable="ant" failonerror="true"> <ant:arg line="-f build-portlet.xml" /> <ant:arg value="compile" /> </ant:exec> <ant:exec dir="kosmos-server" executable="ant" failonerror="true"> <ant:arg line="-f build-server.xml" /> <ant:arg value="compile" /> - </ant:exec> + </ant:exec>--> </goal> <goal name="deploy"> - <ant:mkdir dir="${local.deploy.dir}/kosmos-portlet.war" /> + <!--<ant:mkdir dir="${local.deploy.dir}/kosmos-portlet.war" /> <ant:copy todir="${local.deploy.dir}/kosmos-portlet.war" overwrite="true"> <ant:fileset dir="kosmos-portlet/dist-bin-portlet/kosmos-portlet-0.1.0RC3/kosmos-portlet.war-expanded"> <ant:filename name="**/*" /> @@ -40,6 +41,33 @@ <ant:fileset dir="kosmos-server/dist-bin-server/kosmos-server-0.1.0RC3/kosmos-server.war-expanded"> <ant:filename name="**/*" /> </ant:fileset> + </ant:copy>--> + + <!-- Unzipping the jar-s --> + <ant:unzip src="to-copy/kosmos-server.war" dest="target/kosmos-server.war" overwrite="true" /> + <ant:unzip src="to-copy/kosmos-portlet.war" dest="target/kosmos-portlet.war" overwrite="true" /> + + <!-- Copying configuration files --> + <ant:copy todir="target/kosmos-server.war/WEB-INF"> + <ant:fileset dir="conf/server" flatten="true" overwrite="true"> + <ant:filename name="**/*" /> + </ant:fileset> </ant:copy> + <ant:copy todir="target/kosmos-portlet.war/WEB-INF"> + <ant:fileset dir="conf/portlet" flatten="true" overwrite="true"> + <ant:filename name="**/*" /> + </ant:fileset> + </ant:copy> + + <!-- Deleting old deployment --> + <ant:delete dir="${local.deploy.dir}/kosmos-server.war" /> + <ant:delete dir="${local.deploy.dir}/kosmos-portlet.war" /> + + <!-- Deploying new packages --> + <ant:copy todir="${local.deploy.dir}"> + <ant:fileset dir="target" flatten="true" overwrite="true"> + <ant:filename name="**/*" /> + </ant:fileset> + </ant:copy> </goal> </project> Added: trunk/forge/portal-extensions/forge-kosmos/to-copy/kosmos-portlet.war =================================================================== (Binary files differ) Property changes on: trunk/forge/portal-extensions/forge-kosmos/to-copy/kosmos-portlet.war ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/forge/portal-extensions/forge-kosmos/to-copy/kosmos-server.war =================================================================== (Binary files differ) Property changes on: trunk/forge/portal-extensions/forge-kosmos/to-copy/kosmos-server.war ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <jbo...@li...> - 2005-09-24 13:42:36
|
Author: adamw Date: 2005-09-24 09:42:22 -0400 (Sat, 24 Sep 2005) New Revision: 1199 Modified: trunk/forge/portal-extensions/shotoku/maven.xml trunk/forge/portal-extensions/shotoku/project.properties trunk/forge/portal-extensions/shotoku/shotoku-base/src/etc/shotoku.xml trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/maven.xml trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/etc/repositories.xml trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java Log: First shotoku functionalities Modified: trunk/forge/portal-extensions/shotoku/maven.xml =================================================================== --- trunk/forge/portal-extensions/shotoku/maven.xml 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/maven.xml 2005-09-24 13:42:22 UTC (rev 1199) @@ -3,22 +3,36 @@ Distributable under LGPL license. See terms of license at gnu.org. --> -<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util"> - <!-- Default war-project goals --> - +<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util" xmlns:maven="jelly:maven"> <goal name="all"> + <attainGoal name="clean" /> <attainGoal name="build" /> <attainGoal name="deploy" /> </goal> + <goal name="shotoku-all-projects"> + <maven:reactor includes="shotoku-base/project.xml" excludes="" basedir="." + banner="Shotoku base" + goals="${goal}" ignoreFailures="false" /> + <maven:reactor includes="shotoku-svn/project.xml" excludes="" basedir="." + banner="Shotoku svn" + goals="${goal}" ignoreFailures="false" /> + <maven:reactor includes="shotoku-svn-service/project.xml" excludes="" basedir="." + banner="Shotoku svn service" + goals="${goal}" ignoreFailures="false" /> + <maven:reactor includes="shotoku-test/project.xml" excludes="" basedir="." + banner="Shotoku test" + goals="${goal}" ignoreFailures="false" /> + </goal> + <goal name="build"> <j:set var="goal" value="build" /> - <attainGoal name="multiproject:goal" /> + <attainGoal name="shotoku-all-projects" /> </goal> <goal name="deploy"> <j:set var="goal" value="deploy" /> - <attainGoal name="multiproject:goal" /> + <attainGoal name="shotoku-all-projects" /> </goal> <goal name="clean"> @@ -26,6 +40,7 @@ <ant:delete dir="shotoku-base/target" /> <ant:delete dir="shotoku-svn/target" /> <ant:delete dir="shotoku-svn-service/target" /> - <ant:delete dir="${local.deploy.dir}/${shotoku.ear.dir}" /> + <ant:delete dir="shotoku-test/target" /> + <ant:delete dir="${local.deploy.dir}/shotoku.ear" /> </goal> </project> Modified: trunk/forge/portal-extensions/shotoku/project.properties =================================================================== --- trunk/forge/portal-extensions/shotoku/project.properties 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/project.properties 2005-09-24 13:42:22 UTC (rev 1199) @@ -2,4 +2,4 @@ maven.junit.fork=yes maven.war.src=${basedir}/src/web -maven.multiproject.includes=shotoku-base/project.xml,shotoku-svn/project.xml,shotoku-svn-service/project.xml +maven.multiproject.includes=shotoku-base/project.xml,shotoku-svn/project.xml,shotoku-svn-service/project.xml,shotoku-test/project.xml Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/etc/shotoku.xml =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/etc/shotoku.xml 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/etc/shotoku.xml 2005-09-24 13:42:22 UTC (rev 1199) @@ -4,5 +4,5 @@ <default-id id="default" /> <content-manager id="default" - implementation="SvnContentManager" /> + implementation="org.jboss.shotoku.svn.SvnContentManager" /> </content-managers> \ No newline at end of file Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -4,7 +4,6 @@ import java.util.HashMap; import java.util.Map; -import org.apache.log4j.BasicConfigurator; import org.apache.log4j.Logger; import org.apache.xerces.parsers.DOMParser; import org.jboss.shotoku.search.SearchParameters; @@ -63,9 +62,6 @@ private static Map<String, Constructor> contentManagers; static { - // Configuring the logger. - BasicConfigurator.configure(); - contentManagers = new HashMap<String, Constructor>(); // Loading configuration file. @@ -85,7 +81,7 @@ if (n.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) { if ("default-id".equals(n.getNodeName())) { // Overriding the default content manager id. - defaultId = Tools.unmarshallText(n); + defaultId = Tools.getAttributeValue(n, "id"); log.info("Set default id to: " + defaultId); } else if ("content-manager".equals(n.getNodeName())) { @@ -112,6 +108,15 @@ } /** + * Gets a content manager with a default id and an empty prefix. + * @return A ""-prefixed, default content manager, or null, if a default + * content manager is not registered. + */ + public static ContentManager getContentManager() { + return getContentManager(""); + } + + /** * Gets a content manager with a default id and the given prefix. * @param prefix Prefix for the new content manager (all paths will * have this prepended). Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,7 +1,43 @@ package org.jboss.shotoku.svn; +import java.io.File; +import java.util.HashMap; +import java.util.Map; + import org.jboss.shotoku.AbstractResource; public abstract class AbstractSvnResource implements AbstractResource { - + private Map<String, String> modifiedProperties; + + protected SvnService service; + + protected String id; + protected String fullPath; + protected File file; + + public AbstractSvnResource(String id, String fullPath, File file) { + this.file = file; + this.fullPath = fullPath; + this.id = id; + + modifiedProperties = new HashMap<String, String>(); + service = Tools.getService(); + } + + public String getProperty(String name) { + return service.getProperty(id, fullPath, name); + } + + public void setProperty(String name, String value) { + modifiedProperties.put(name, value); + } + + protected boolean save() { + for (String name : modifiedProperties.keySet()) { + service.setProperty(id, fullPath, name, + modifiedProperties.get(name)); + } + + return modifiedProperties.size() > 1; + } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,33 +1,64 @@ package org.jboss.shotoku.svn; +import java.io.File; + import org.jboss.shotoku.ContentManager; import org.jboss.shotoku.Directory; import org.jboss.shotoku.Node; import org.jboss.shotoku.NodeList; +import org.jboss.shotoku.exceptions.NodeDoesNotExist; import org.jboss.shotoku.search.SearchParameters; public class SvnContentManager extends ContentManager { + private String prefix; + private String id; + private SvnService service; + public SvnContentManager(String id, String prefix) { super(id, prefix); + + this.prefix = prefix; + this.id = id; + + service = Tools.getService(); } + + private String getPrefixedPath(String path) { + return prefix + '/' + path; + } + + private File getFileForPath(String path) { + return new File( + service.getFileSystemPath(id, getPrefixedPath(path))); + } @Override public Directory getRootDirectory() { - return null; + return getDirectory(""); } @Override - public Node getNode(String arg0) { - return null; + public Node getNode(String path) { + File file = getFileForPath(path); + + if (!file.isFile()) + throw new NodeDoesNotExist(); + + return new SvnHeadNode(id, getPrefixedPath(path), file); } @Override - public Directory getDirectory(String arg0) { - return null; + public Directory getDirectory(String path) { + File file = getFileForPath(path); + + if (!file.isFile()) + throw new NodeDoesNotExist(); + + return new SvnDirectory(id, getPrefixedPath(path), file); } @Override - public NodeList search(SearchParameters arg0) { - return null; + public NodeList search(SearchParameters parameters) { + throw new RuntimeException("Operation not yet implemented"); } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,5 +1,6 @@ package org.jboss.shotoku.svn; +import java.io.File; import java.util.List; import org.jboss.shotoku.Directory; @@ -7,50 +8,47 @@ import org.jboss.shotoku.NodeList; public class SvnDirectory extends AbstractSvnResource implements Directory { + public SvnDirectory(String id, String fullPath, File file) { + super(id, fullPath, file); + } + public NodeList getNodes() { - return null; + throw new RuntimeException("Operation not yet implemented"); } public List<Directory> getDirectories() { - return null; + throw new RuntimeException("Operation not yet implemented"); } - public Node newNode(String arg0) { - return null; + public Node newNode(String name) { + throw new RuntimeException("Operation not yet implemented"); } - public Directory newDirectory(String arg0) { - return null; + public Directory newDirectory(String name) { + throw new RuntimeException("Operation not yet implemented"); } - public boolean hasIndex(String arg0) { - return false; + public boolean hasIndex(String propertyName) { + throw new RuntimeException("Operation not yet implemented"); } - public void setIndex(String arg0, boolean arg1) { - + public void setIndex(String propertyName, boolean index) { + throw new RuntimeException("Operation not yet implemented"); } - public String getProperty(String arg0) { - return null; - } - - public void setProperty(String arg0, String arg1) { - } - public Directory getParent() { - return null; + throw new RuntimeException("Operation not yet implemented"); } - public void save(String arg0) { - + public void save(String logMessage) { + throw new RuntimeException("Operation not yet implemented"); } public String getLogMessage() { - return null; + throw new RuntimeException("Operation not yet implemented"); } public void delete() { - + throw new RuntimeException("Operation not yet implemented"); } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,65 +1,15 @@ package org.jboss.shotoku.svn; -import java.io.InputStream; +import java.io.File; -import org.jboss.shotoku.Directory; -import org.jboss.shotoku.History; import org.jboss.shotoku.Node; -public class SvnNode extends AbstractSvnResource implements Node { - public String getContent() { - return null; +public abstract class SvnNode extends AbstractSvnResource implements Node { + public SvnNode(String id, String fullPath, File file) { + super(id, fullPath, file); } - - public void setContent(String arg0) { - - } - - public History getHistory() { - return null; - } - - public int getRevisionNumber() { - return 0; - } - + public void copyToFile(String arg0) { - + throw new RuntimeException("Operation not yet implemented"); } - - public InputStream getContentInputStream() { - return null; - } - - public long getLength() { - return 0; - } - - public long getLastModfication() { - return 0; - } - - public String getProperty(String arg0) { - return null; - } - - public void setProperty(String arg0, String arg1) { - - } - - public Directory getParent() { - return null; - } - - public void save(String arg0) { - - } - - public String getLogMessage() { - return null; - } - - public void delete() { - - } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,12 +1,7 @@ package org.jboss.shotoku.svn; -import javax.management.MalformedObjectNameException; - -import org.jboss.mx.util.MBeanProxyExt; -import org.jboss.mx.util.MBeanServerLocator; - -public abstract class SvnService { - public abstract void commit(String id, String path); +public abstract interface SvnService { + public abstract void commit(String id, String path, String logMessage); public abstract void setProperty(String id, String path, String name, String value); public abstract String getProperty(String id, String path, String name); @@ -15,26 +10,8 @@ public abstract String getLogMessage(String id, String revision); public abstract int getRevisionCount(String id, String path); public abstract void delete(String id, String path); + public abstract void add(String id, String path); + public abstract String getFileSystemPath(String id, String path); public final static String SVN_SERVICE_NAME = "shotoku:service=svn"; - - /* - * Getting an instance of the service. - */ - - private static SvnService instance; - - public static SvnService getInstance() { - try { - if (instance == null) - instance = (SvnService) MBeanProxyExt.create( - SvnService.class, - SVN_SERVICE_NAME, - MBeanServerLocator.locate()); - - return instance; - } catch (MalformedObjectNameException e) { - throw new RuntimeException(e); - } - } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/maven.xml =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/maven.xml 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/maven.xml 2005-09-24 13:42:22 UTC (rev 1199) @@ -23,6 +23,12 @@ <ant:copy todir="target/${shotoku.ear.dir}" overwrite="true" file="${maven.repo.local}/shotoku/jars/shotoku-base.jar" /> + <ant:copy + todir="target/${shotoku.ear.dir}" overwrite="true"> + <ant:fileset dir="${maven.repo.local}/tmate/jars"> + <ant:filename name="*.jar" /> + </ant:fileset> + </ant:copy> <ant:copy todir="target/${shotoku.ear.dir}"> <ant:fileset dir="src/app" flatten="true" overwrite="true"> <ant:filename name="**" /> @@ -32,7 +38,7 @@ <!-- Copying the ear to the deploy directory. --> <ant:copy todir="${local.deploy.dir}"> <ant:fileset dir="target" flatten="true" overwrite="true"> - <ant:filename name="**" /> + <ant:filename name="${shotoku.ear.dir}/**" /> </ant:fileset> </ant:copy> </goal> Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/etc/repositories.xml =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/etc/repositories.xml 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/etc/repositories.xml 2005-09-24 13:42:22 UTC (rev 1199) @@ -6,5 +6,5 @@ url="https://cms.labs.jboss.com/trunk/forge/portal-content" username="jbf...@jb..." password="rO@B5oPfff" - localpath="/home/adamw/jboss/content/trunk/forge/portal-contet" /> + localpath="/home/adamw/jboss/content/trunk/forge/portal-content" /> </repositories> \ No newline at end of file Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,20 +1,28 @@ package org.jboss.shotoku.svn.service; import java.io.File; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import org.apache.log4j.Logger; import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.core.SVNURL; import org.tmatesoft.svn.core.wc.ISVNOptions; import org.tmatesoft.svn.core.wc.SVNClientManager; +import org.tmatesoft.svn.core.wc.SVNCommitClient; import org.tmatesoft.svn.core.wc.SVNRevision; import org.tmatesoft.svn.core.wc.SVNUpdateClient; import org.tmatesoft.svn.core.wc.SVNWCUtil; public class SvnRepository { + private static final Logger log = Logger.getLogger(SvnRepository.class); + private SVNClientManager ourClientManager; private String url; private String localpath; private File wc; + private Set<String[]> toCommit; public SvnRepository(String username, String password, String url, String localpath) { @@ -24,8 +32,9 @@ this.url = url; this.localpath = localpath; - + wc = new File(localpath); + toCommit = Collections.synchronizedSet(new HashSet<String[]>()); } private void tryCleanup() { @@ -59,4 +68,38 @@ tryCleanup(); } } + + public void addToCommit(String path, String logMessage) { + toCommit.add(new String[] { path, logMessage }); + } + + public void commit() { + String[][] allToCommit; + + synchronized (toCommit) { + allToCommit = toCommit.toArray(new String[0][0]); + toCommit.clear(); + } + + for (String[] oneToCommit : allToCommit) { + SVNCommitClient commitClient = ourClientManager.getCommitClient(); + try { + commitClient.doCommit( + new File[] { new File(getFileSystemPath(oneToCommit[0])) }, + false, oneToCommit[1], true, false); + } catch (SVNException e) { + tryCleanup(); + log.warn("Commiting of " + oneToCommit[0] + " failed", e); + } + } + } + + public String getFileSystemPath(String path) { + return replaceSeparators(localpath + '/' + path); + } + + private String replaceSeparators(String path) { + return '/' == File.separatorChar ? + path : path.replace('/', File.separatorChar); + } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,9 +1,11 @@ package org.jboss.shotoku.svn.service; import java.util.HashMap; + import java.util.Map; import javax.annotation.EJB; +import javax.ejb.Local; import org.apache.log4j.Logger; import org.apache.xerces.parsers.DOMParser; @@ -17,7 +19,8 @@ import org.xml.sax.InputSource; @Service(objectName=SvnService.SVN_SERVICE_NAME) -public class SvnServiceImpl extends SvnService { +@Local(SvnServiceLocal.class) +public class SvnServiceImpl implements SvnServiceManagement { private static final Logger log = Logger.getLogger(SvnServiceImpl.class); /** @@ -28,12 +31,12 @@ private long timerInterval; @EJB - private SvnServiceTimer timer; + private SvnServiceTimerLocal timer; private Map<String, SvnRepository> repositories; /* - * Service lifecycle methods. + * Service lifecycle management. */ public void create() throws Exception { @@ -72,7 +75,7 @@ url, Tools.getAttributeValue(n, "localpath"))); - log.info("Added svn repository: " + id + ": " + url); + log.info("Added svn repository: " + id + ", " + url); } } } catch (Exception e) { @@ -106,46 +109,50 @@ return timerInterval; } - void update() { - + public void update() { + for (SvnRepository repo : repositories.values()) { + repo.update(); + repo.commit(); + } } /* * SvnService implementation. */ - @Override - public void commit(String id, String path) { - + public void commit(String id, String path, String logMessage) { + repositories.get(id).addToCommit(path, logMessage); } - @Override - public void setProperty(String id, String arg1, String arg2, String arg3) { + public void setProperty(String id, String path, String name, String value) { } - @Override - public String getProperty(String id, String arg0, String arg1) { + public String getProperty(String id, String path, String name) { return null; } - @Override - public String getNodeAtRevision(String id, String arg0, int arg1) { + public String getNodeAtRevision(String id, String path, int revision) { return null; } - @Override - public String getLogMessage(String id, String arg0) { + public String getLogMessage(String id, String path) { return null; } - @Override - public int getRevisionCount(String id, String arg0) { + public int getRevisionCount(String id, String path) { return 0; } - @Override - public void delete(String id, String arg0) { + public void delete(String id, String path) { } + + public void add(String id, String path) { + + } + + public String getFileSystemPath(String id, String path) { + return repositories.get(id).getFileSystemPath(path); + } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -10,6 +10,7 @@ import javax.ejb.Timer; import javax.management.MalformedObjectNameException; +import org.apache.log4j.Logger; import org.jboss.mx.util.MBeanProxyExt; import org.jboss.mx.util.MBeanServerLocator; import org.jboss.shotoku.svn.SvnService; @@ -17,6 +18,7 @@ @Stateless @Local(SvnServiceTimerLocal.class) public class SvnServiceTimer { + private static final Logger log = Logger.getLogger(SvnServiceTimer.class); private @Resource SessionContext ctx; public void scheduleTimer(long interval) { @@ -27,13 +29,15 @@ @Timeout public void timeoutHandler(Timer timer) { try { - SvnServiceImpl ssi = - ((SvnServiceImpl) MBeanProxyExt.create( - SvnServiceImpl.class, + SvnServiceLocal ssi = + ((SvnServiceLocal) MBeanProxyExt.create( + SvnServiceLocal.class, SvnService.SVN_SERVICE_NAME, MBeanServerLocator.locate())); + log.info("Updating svn service ..."); ssi.update(); + log.info("Done updating svn service."); scheduleTimer(ssi.getTimerInterval()); } catch (MalformedObjectNameException e) { |
From: <jbo...@li...> - 2005-09-24 12:36:36
|
Author: mla...@jb... Date: 2005-09-24 08:36:19 -0400 (Sat, 24 Sep 2005) New Revision: 1198 Modified: trunk/labs/jbossweb/xdocs/news/changelog.xml Log: Update changelog Modified: trunk/labs/jbossweb/xdocs/news/changelog.xml =================================================================== --- trunk/labs/jbossweb/xdocs/news/changelog.xml 2005-09-24 12:29:19 UTC (rev 1197) +++ trunk/labs/jbossweb/xdocs/news/changelog.xml 2005-09-24 12:36:19 UTC (rev 1198) @@ -13,9 +13,27 @@ <body> -<section name="JBossWeb 4.x"> +<section name="JBossWeb 1.0"> + <subsection name="General"> + <changelog> + <update> + Added basic ant build script. (remy) + </update> + </changelog> + </subsection> + <subsection name="Native"> + <changelog> + <update> + Added native MSC nmake build script. They allow command line building + for various targets, both for APR and Tomcat Native. (mturk) + </update> + </changelog> + </subsection> <subsection name="Documentation"> <changelog> + <docs> + Added basic documentation. Lots to follow. (mturk) + </docs> <update> Added documentation repository and build scripts. (mturk) </update> |
From: <jbo...@li...> - 2005-09-24 12:29:32
|
Author: mla...@jb... Date: 2005-09-24 08:29:19 -0400 (Sat, 24 Sep 2005) New Revision: 1197 Added: trunk/labs/jbossweb/xdocs/news/changelog.xml Modified: trunk/labs/jbossweb/xdocs/news/project.xml trunk/labs/jbossweb/xdocs/project.xml trunk/labs/jbossweb/xdocs/style.xsl Log: Added changelog Added: trunk/labs/jbossweb/xdocs/news/changelog.xml =================================================================== --- trunk/labs/jbossweb/xdocs/news/changelog.xml 2005-09-24 12:17:13 UTC (rev 1196) +++ trunk/labs/jbossweb/xdocs/news/changelog.xml 2005-09-24 12:29:19 UTC (rev 1197) @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="changelog.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>Changelog</title> + </properties> + +<body> + +<section name="JBossWeb 4.x"> + <subsection name="Documentation"> + <changelog> + <update> + Added documentation repository and build scripts. (mturk) + </update> + </changelog> + </subsection> +</section> +</body> +</document> Modified: trunk/labs/jbossweb/xdocs/news/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/news/project.xml 2005-09-24 12:17:13 UTC (rev 1196) +++ trunk/labs/jbossweb/xdocs/news/project.xml 2005-09-24 12:29:19 UTC (rev 1197) @@ -6,6 +6,7 @@ <menu name="News"> <item name="2005" href="2005.html"/> <item name="Roadmap" href="roadmap.html"/> + <item name="Changelog" href="changelog.html"/> </menu> <menu name="Links"> <item name="Documentation Home" href="../index.html"/> Modified: trunk/labs/jbossweb/xdocs/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/project.xml 2005-09-24 12:17:13 UTC (rev 1196) +++ trunk/labs/jbossweb/xdocs/project.xml 2005-09-24 12:29:19 UTC (rev 1197) @@ -25,6 +25,7 @@ <menu name="News"> <item name="News & Status" href="news/2005.html"/> <item name="Roadmap" href="news/roadmap.html"/> + <item name="Changelog" href="news/changelog.html"/> </menu> </body> </project> Modified: trunk/labs/jbossweb/xdocs/style.xsl =================================================================== --- trunk/labs/jbossweb/xdocs/style.xsl 2005-09-24 12:17:13 UTC (rev 1196) +++ trunk/labs/jbossweb/xdocs/style.xsl 2005-09-24 12:29:19 UTC (rev 1197) @@ -17,7 +17,7 @@ <xsl:param name="void-image" select="'/images/void.gif'"/> <xsl:param name="project-menu" select="'menu'"/> <xsl:param name="standalone" select="''"/> - <xsl:param name="buglink" select="'http://jira.jboss.com/jira/browse/'"/> + <xsl:param name="buglink" select="'http://jira.jboss.com/jira/browse/JBWEB-'"/> <xsl:param name="home-site" select="'http://labs.jboss.com/portal/index.html?ctrl:id=page.default.info&project=jbossweb'"/> <!-- Process an entire document into an HTML page --> <xsl:template match="document"> @@ -42,10 +42,8 @@ </head> <body> <table border="0" width="100%" cellspacing="4"> - <xsl:comment>PAGE HEADER</xsl:comment> <tr><td colspan="2"> - <xsl:comment>JBOSS LOGO</xsl:comment> <xsl:variable name="alt"> <xsl:value-of select="$home-name"/> @@ -75,7 +73,6 @@ <img src="{$src}" align="right" alt="{$alt}" border="0"/> </a> </xsl:if> - </td></tr> <xsl:comment>HEADER SEPARATOR</xsl:comment> |
From: <jbo...@li...> - 2005-09-24 12:17:23
|
Author: mla...@jb... Date: 2005-09-24 08:17:13 -0400 (Sat, 24 Sep 2005) New Revision: 1196 Modified: trunk/labs/jbossweb/xdocs/news/roadmap.xml trunk/labs/jbossweb/xdocs/style.xsl Log: Fix status section Modified: trunk/labs/jbossweb/xdocs/news/roadmap.xml =================================================================== --- trunk/labs/jbossweb/xdocs/news/roadmap.xml 2005-09-24 11:57:38 UTC (rev 1195) +++ trunk/labs/jbossweb/xdocs/news/roadmap.xml 2005-09-24 12:17:13 UTC (rev 1196) @@ -34,13 +34,13 @@ <item priority="block" estimate="Sep 2005" progress="1" owner="mturk"> CGI module </item> - <item priority="hi" estimate="Oct 2005" progress="0" owner="mturk"> + <item priority="hi" estimate="Oct 2005" owner="mturk"> PHP Module </item> - <item priority="low" estimate="Oct 2005" progress="0" owner="mturk"> + <item priority="low" estimate="Oct 2005" owner="mturk"> .NET Module </item> - <item priority="hi" estimate="Q4 2005" progress="0" owner="remm"> + <item priority="hi" estimate="Q4 2005" owner="remm"> Build URL Rewrite module. </item> </status> Modified: trunk/labs/jbossweb/xdocs/style.xsl =================================================================== --- trunk/labs/jbossweb/xdocs/style.xsl 2005-09-24 11:57:38 UTC (rev 1195) +++ trunk/labs/jbossweb/xdocs/style.xsl 2005-09-24 12:17:13 UTC (rev 1196) @@ -495,8 +495,9 @@ <td align="left" valign="top"> <xsl:choose> <xsl:when test="@progress != ''"> + <xsl:variable name="rank"><xsl:value-of select="@progress"/></xsl:variable> <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/rank<xsl:value-of select="@progress"/>.gif</xsl:variable> - <img alt="0%" class="icon" src="{$src}"/> + <img alt="{$rank}0%" class="icon" src="{$src}"/> </xsl:when> <xsl:otherwise> <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/rank0.gif</xsl:variable> |
From: <jbo...@li...> - 2005-09-24 11:57:56
|
Author: mla...@jb... Date: 2005-09-24 07:57:38 -0400 (Sat, 24 Sep 2005) New Revision: 1195 Added: trunk/labs/jbossweb/xdocs/images/downg.gif trunk/labs/jbossweb/xdocs/images/downr.gif trunk/labs/jbossweb/xdocs/images/no.gif trunk/labs/jbossweb/xdocs/images/rank10.gif trunk/labs/jbossweb/xdocs/images/rank7.gif trunk/labs/jbossweb/xdocs/images/rank8.gif trunk/labs/jbossweb/xdocs/images/rank9.gif trunk/labs/jbossweb/xdocs/images/upg.gif trunk/labs/jbossweb/xdocs/images/upr.gif Removed: trunk/labs/jbossweb/xdocs/images/downs.gif trunk/labs/jbossweb/xdocs/images/downsl.gif trunk/labs/jbossweb/xdocs/images/ups.gif Modified: trunk/labs/jbossweb/xdocs/images/rank0.gif trunk/labs/jbossweb/xdocs/images/rank1.gif trunk/labs/jbossweb/xdocs/images/rank2.gif trunk/labs/jbossweb/xdocs/images/rank3.gif trunk/labs/jbossweb/xdocs/images/rank4.gif trunk/labs/jbossweb/xdocs/images/rank5.gif trunk/labs/jbossweb/xdocs/images/rank6.gif trunk/labs/jbossweb/xdocs/news/roadmap.xml trunk/labs/jbossweb/xdocs/style.xsl Log: Change rank and status images Added: trunk/labs/jbossweb/xdocs/images/downg.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/images/downg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossweb/xdocs/images/downr.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/images/downr.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/labs/jbossweb/xdocs/images/downs.gif =================================================================== (Binary files differ) Deleted: trunk/labs/jbossweb/xdocs/images/downsl.gif =================================================================== (Binary files differ) Added: trunk/labs/jbossweb/xdocs/images/no.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/images/no.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/labs/jbossweb/xdocs/images/rank0.gif =================================================================== (Binary files differ) Modified: trunk/labs/jbossweb/xdocs/images/rank1.gif =================================================================== (Binary files differ) Added: trunk/labs/jbossweb/xdocs/images/rank10.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/images/rank10.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/labs/jbossweb/xdocs/images/rank2.gif =================================================================== (Binary files differ) Modified: trunk/labs/jbossweb/xdocs/images/rank3.gif =================================================================== (Binary files differ) Modified: trunk/labs/jbossweb/xdocs/images/rank4.gif =================================================================== (Binary files differ) Modified: trunk/labs/jbossweb/xdocs/images/rank5.gif =================================================================== (Binary files differ) Modified: trunk/labs/jbossweb/xdocs/images/rank6.gif =================================================================== (Binary files differ) Added: trunk/labs/jbossweb/xdocs/images/rank7.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/images/rank7.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossweb/xdocs/images/rank8.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/images/rank8.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossweb/xdocs/images/rank9.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/images/rank9.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossweb/xdocs/images/upg.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/images/upg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossweb/xdocs/images/upr.gif =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossweb/xdocs/images/upr.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/labs/jbossweb/xdocs/images/ups.gif =================================================================== (Binary files differ) Modified: trunk/labs/jbossweb/xdocs/news/roadmap.xml =================================================================== --- trunk/labs/jbossweb/xdocs/news/roadmap.xml 2005-09-24 11:19:46 UTC (rev 1194) +++ trunk/labs/jbossweb/xdocs/news/roadmap.xml 2005-09-24 11:57:38 UTC (rev 1195) @@ -27,7 +27,9 @@ Build documentation build system using simple xdocs templates. </item> <item priority="block" estimate="Sep 2005" progress="5" owner="mturk"> - Create Native build scripts and integrate them with ant build system + Create Native build scripts and integrate them with ant build system. + Build procedure should procuce a .tar.gz package, zip package, and + give preparation for the InstallShield setup packages. </item> <item priority="block" estimate="Sep 2005" progress="1" owner="mturk"> CGI module @@ -35,7 +37,7 @@ <item priority="hi" estimate="Oct 2005" progress="0" owner="mturk"> PHP Module </item> - <item priority="hi" estimate="Oct 2005" progress="0" owner="mturk"> + <item priority="low" estimate="Oct 2005" progress="0" owner="mturk"> .NET Module </item> <item priority="hi" estimate="Q4 2005" progress="0" owner="remm"> Modified: trunk/labs/jbossweb/xdocs/style.xsl =================================================================== --- trunk/labs/jbossweb/xdocs/style.xsl 2005-09-24 11:19:46 UTC (rev 1194) +++ trunk/labs/jbossweb/xdocs/style.xsl 2005-09-24 11:57:38 UTC (rev 1195) @@ -461,14 +461,14 @@ </th> <xsl:for-each select="item"> <tr> - <td align="left" valign="center"> + <td align="left" valign="top"> <xsl:choose> <xsl:when test="@priority = 'hi'"> - <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/ups.gif</xsl:variable> + <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/upr.gif</xsl:variable> <img alt="High" class="icon" src="{$src}"/> </xsl:when> <xsl:when test="@priority = 'low'"> - <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/downs.gif</xsl:variable> + <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/downg.gif</xsl:variable> <img alt="Low" class="icon" src="{$src}"/> </xsl:when> <xsl:when test="@priority = 'done'"> @@ -492,46 +492,26 @@ </xsl:otherwise> </xsl:choose> </td> - <td align="left" valign="center"> + <td align="left" valign="top"> <xsl:choose> - <xsl:when test="@progress = '1'"> - <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/rank1.gif</xsl:variable> - <img alt="10%" class="icon" src="{$src}"/> - </xsl:when> - <xsl:when test="@progress = '2'"> - <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/rank2.gif</xsl:variable> - <img alt="20%" class="icon" src="{$src}"/> - </xsl:when> - <xsl:when test="@progress = '3'"> - <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/rank3.gif</xsl:variable> - <img alt="30%" class="icon" src="{$src}"/> - </xsl:when> - <xsl:when test="@progress = '4'"> - <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/rank4.gif</xsl:variable> - <img alt="55%" class="icon" src="{$src}"/> - </xsl:when> - <xsl:when test="@progress = '5'"> - <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/rank5.gif</xsl:variable> - <img alt="75%" class="icon" src="{$src}"/> - </xsl:when> - <xsl:when test="@progress = '6'"> - <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/rank6.gif</xsl:variable> - <img alt="100%" class="icon" src="{$src}"/> - </xsl:when> - <xsl:otherwise> + <xsl:when test="@progress != ''"> + <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/rank<xsl:value-of select="@progress"/>.gif</xsl:variable> + <img alt="0%" class="icon" src="{$src}"/> + </xsl:when> + <xsl:otherwise> <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/rank0.gif</xsl:variable> <img alt="0%" class="icon" src="{$src}"/> - </xsl:otherwise> + </xsl:otherwise> </xsl:choose> </td> - <td align="left" valign="center"> + <td align="left" valign="top"> <xsl:value-of select="@estimate"/> </td> - <td align="left" valign="center"> + <td align="left" valign="top"> <xsl:apply-templates/> </td> - <td align="left" valign="center"> + <td align="left" valign="top"> <xsl:value-of select="@owner"/> </td> </tr> |
From: <jbo...@li...> - 2005-09-24 11:19:52
|
Author: szimano Date: 2005-09-24 07:19:46 -0400 (Sat, 24 Sep 2005) New Revision: 1194 Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties.sample Removed: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties Modified: trunk/forge/portal-extensions/jbosswiki/maven.xml Log: filedatasource props sample Modified: trunk/forge/portal-extensions/jbosswiki/maven.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/maven.xml 2005-09-24 08:50:39 UTC (rev 1193) +++ trunk/forge/portal-extensions/jbosswiki/maven.xml 2005-09-24 11:19:46 UTC (rev 1194) @@ -81,4 +81,9 @@ <attainGoal name="wiki:all" /> </goal> + <goal name="help"> + <echo> + First make file wiki-common/src/etc/org/jboss/wiki/filedatasource.properties (see the .sample file), then run maven all + </echo> + </goal> </project> Deleted: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties 2005-09-24 08:50:39 UTC (rev 1193) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties 2005-09-24 11:19:46 UTC (rev 1194) @@ -1,7 +0,0 @@ -# FileDataSource configuration file - -# pathToMedia - points, where JSPWiki file structure is situated -pathToMedia = /usr/local/forge/wiki - -# pathToAttachements - points, where JSPWiki attachemets are situated -pathToAttachements = /usr/local/forge/wiki \ No newline at end of file Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties.sample =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties.sample 2005-09-24 08:50:39 UTC (rev 1193) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/filedatasource.properties.sample 2005-09-24 11:19:46 UTC (rev 1194) @@ -0,0 +1,7 @@ +# FileDataSource configuration file + +# pathToMedia - points, where JSPWiki file structure is situated +pathToMedia = + +# pathToAttachements - points, where JSPWiki attachemets are situated +pathToAttachements = |