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-12-28 06:24:47
|
Author: mic...@jb... Date: 2005-12-28 01:24:42 -0500 (Wed, 28 Dec 2005) New Revision: 1944 Removed: trunk/labs/jbossrules/drools-repository/repotest/jaas.config trunk/labs/jbossrules/drools-repository/repotest/repository.xml Log: Deleted: trunk/labs/jbossrules/drools-repository/repotest/jaas.config =================================================================== --- trunk/labs/jbossrules/drools-repository/repotest/jaas.config 2005-12-28 05:15:43 UTC (rev 1943) +++ trunk/labs/jbossrules/drools-repository/repotest/jaas.config 2005-12-28 06:24:42 UTC (rev 1944) @@ -1,3 +0,0 @@ -Jackrabbit { - org.apache.jackrabbit.core.security.SimpleLoginModule required anonymousId="anonymous"; -}; \ No newline at end of file Deleted: trunk/labs/jbossrules/drools-repository/repotest/repository.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/repotest/repository.xml 2005-12-28 05:15:43 UTC (rev 1943) +++ trunk/labs/jbossrules/drools-repository/repotest/repository.xml 2005-12-28 06:24:42 UTC (rev 1944) @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<Repository> - <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> - <param name="path" value="${rep.home}/repository"/> - </FileSystem> - <Security appName="Jackrabbit"> - <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager"/> - </Security> - <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" /> - <Workspace name="${wsp.name}"> - <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> - <param name="path" value="${wsp.home}"/> - </FileSystem> - <PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" /> - <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> - <param name="path" value="${wsp.home}/index"/> - </SearchIndex> - </Workspace> - <Versioning rootPath="${rep.home}/versions"> - <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> - <param name="path" value="${rep.home}/versions"/> - </FileSystem> - <PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" /> - </Versioning> -</Repository> \ No newline at end of file |
Author: mic...@jb... Date: 2005-12-28 00:15:43 -0500 (Wed, 28 Dec 2005) New Revision: 1943 Removed: trunk/labs/jbossrules/drools-repository/conf/jaas.config trunk/labs/jbossrules/drools-repository/conf/repository.xml trunk/labs/jbossrules/drools-repository/doc/RepositorySpec.odt trunk/labs/jbossrules/drools-repository/doc/model.vsd trunk/labs/jbossrules/drools-repository/lib/commons-collections-3.1.jar trunk/labs/jbossrules/drools-repository/lib/concurrent-1.3.4.jar trunk/labs/jbossrules/drools-repository/lib/derby-10.1.1.0.jar trunk/labs/jbossrules/drools-repository/lib/geronimo-spec-jta-1.0-M1.jar trunk/labs/jbossrules/drools-repository/lib/jackrabbit-1.0-SNAPSHOT.jar trunk/labs/jbossrules/drools-repository/lib/jcr-1.0.jar trunk/labs/jbossrules/drools-repository/lib/junit-3.8.1.jar trunk/labs/jbossrules/drools-repository/lib/log4j-1.2.8.jar trunk/labs/jbossrules/drools-repository/lib/lucene-1.4.3.jar trunk/labs/jbossrules/drools-repository/lib/xercesImpl-2.6.2.jar trunk/labs/jbossrules/drools-repository/lib/xmlParserAPIs-2.0.2.jar trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DublinCore.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleDefinition.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryServiceFactory.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RuleRepositoryException.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java Log: Deleted: trunk/labs/jbossrules/drools-repository/conf/jaas.config =================================================================== --- trunk/labs/jbossrules/drools-repository/conf/jaas.config 2005-12-28 02:07:48 UTC (rev 1942) +++ trunk/labs/jbossrules/drools-repository/conf/jaas.config 2005-12-28 05:15:43 UTC (rev 1943) @@ -1,3 +0,0 @@ -Jackrabbit { - org.apache.jackrabbit.core.security.SimpleLoginModule required anonymousId="anonymous"; -}; \ No newline at end of file Deleted: trunk/labs/jbossrules/drools-repository/conf/repository.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/conf/repository.xml 2005-12-28 02:07:48 UTC (rev 1942) +++ trunk/labs/jbossrules/drools-repository/conf/repository.xml 2005-12-28 05:15:43 UTC (rev 1943) @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<Repository> - <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> - <param name="path" value="${rep.home}/repository"/> - </FileSystem> - <Security appName="Jackrabbit"> - <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager"/> - </Security> - <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" /> - <Workspace name="${wsp.name}"> - <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> - <param name="path" value="${wsp.home}"/> - </FileSystem> - <PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" /> - <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> - <param name="path" value="${wsp.home}/index"/> - </SearchIndex> - </Workspace> - <Versioning rootPath="${rep.home}/versions"> - <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> - <param name="path" value="${rep.home}/versions"/> - </FileSystem> - <PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" /> - </Versioning> -</Repository> \ No newline at end of file Deleted: trunk/labs/jbossrules/drools-repository/doc/RepositorySpec.odt =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/doc/model.vsd =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/lib/commons-collections-3.1.jar =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/lib/concurrent-1.3.4.jar =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/lib/derby-10.1.1.0.jar =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/lib/geronimo-spec-jta-1.0-M1.jar =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/lib/jackrabbit-1.0-SNAPSHOT.jar =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/lib/jcr-1.0.jar =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/lib/junit-3.8.1.jar =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/lib/log4j-1.2.8.jar =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/lib/lucene-1.4.3.jar =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/lib/xercesImpl-2.6.2.jar =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/lib/xmlParserAPIs-2.0.2.jar =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java 2005-12-28 02:07:48 UTC (rev 1942) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java 2005-12-28 05:15:43 UTC (rev 1943) @@ -1,32 +0,0 @@ -package org.drools.metamodel; - -/** - * This represents the content for a ruleset which is managed as one unit. - * @author <a href="mailto:mic...@gm..."> Michael Neale</a> - * - */ -public class DRLSourceFile -{ - - private String content; - private String name; - - public DRLSourceFile(String content, String name) { - this.name = name; - this.content = content; - - } - - public String getContent() - { - return content; - } - - public void setContent(String content) - { - this.content = content; - } - - - -} Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DublinCore.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DublinCore.java 2005-12-28 02:07:48 UTC (rev 1942) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DublinCore.java 2005-12-28 05:15:43 UTC (rev 1943) @@ -1,155 +0,0 @@ -package org.drools.metamodel; - -/** - * This is based on the <a href="http://dublincore.org/documents/dces/"> Dublin - * Core</a> specification, plus a little bit more, and a little bit less. Not - * all of these fields will be used. - */ -public class DublinCore -{ - - private String title; - private String creator; - private String subject; - private String description; - private String publisher; - private String contributor; - private java.util.Date dateCreated; - private String format; - private String source; - private String language; - private String relation; - private String coverage; - private String rights; - - public String getContributor() - { - return contributor; - } - - public void setContributor(String contributor) - { - this.contributor = contributor; - } - - public String getCoverage() - { - return coverage; - } - - public void setCoverage(String coverage) - { - this.coverage = coverage; - } - - public String getCreator() - { - return creator; - } - - public void setCreator(String creator) - { - this.creator = creator; - } - - public java.util.Date getDateCreated() - { - return dateCreated; - } - - public void setDateCreated(java.util.Date dateCreated) - { - this.dateCreated = dateCreated; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public String getFormat() - { - return format; - } - - public void setFormat(String format) - { - this.format = format; - } - - public String getLanguage() - { - return language; - } - - public void setLanguage(String language) - { - this.language = language; - } - - public String getName() - { - return title; - } - - public void setName(String name) - { - this.title = name; - } - - public String getPublisher() - { - return publisher; - } - - public void setPublisher(String publisher) - { - this.publisher = publisher; - } - - public String getRelation() - { - return relation; - } - - public void setRelation(String relation) - { - this.relation = relation; - } - - public String getRights() - { - return rights; - } - - public void setRights(String rights) - { - this.rights = rights; - } - - public String getSource() - { - return source; - } - - public void setSource(String source) - { - this.source = source; - } - - public String getSubject() - { - return subject; - } - - public void setSubject(String subject) - { - this.subject = subject; - } - -} Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleDefinition.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleDefinition.java 2005-12-28 02:07:48 UTC (rev 1942) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleDefinition.java 2005-12-28 05:15:43 UTC (rev 1943) @@ -1,45 +0,0 @@ -package org.drools.metamodel; - -public class RuleDefinition -{ - private String ruleName; - private String fragment; - - - public String getFragment() - { - return fragment; - } - - public RuleDefinition(String ruleName, - String fragment){ - super( ); - // TODO Auto-generated constructor stub - this.ruleName = ruleName; - this.fragment = fragment; - - } - - public void setFragment(String fragment) - { - this.fragment = fragment; - } - - - - - public String getRuleName() - { - return ruleName; - } - - public void setRuleName(String ruleName) - { - this.ruleName = ruleName; - } - - public RuleDefinition() {} - - - -} Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java 2005-12-28 02:07:48 UTC (rev 1942) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java 2005-12-28 05:15:43 UTC (rev 1943) @@ -1,133 +0,0 @@ -package org.drools.repo; - -import java.util.List; -import java.util.Properties; - -import org.drools.metamodel.RuleDefinition; - - - -public interface RepositoryService -{ - /** - * Nodes are represented with a "drools:..." prefix to prevent namespace collisions for people - * using a shared repository (shared with a CMS for instance). - */ - public static final String RULE_NAMESPACE_PREFIX = "drools"; - public static final String RULE_NAMESPACE = "http://www.drools.org/repo"; - - - /** - * This will mark the asset as checked out by the current user. - * - * The idea is to prevent anyone else working on it at the same time. - * Assets needs to be checked out, so when they are checked in their versions are updated. - * This may also lock the asset, not sure... - * Can provide seperate explicit lock methods if needed. - */ -// public RuleSetFile checkoutFile(String ruleBaseName, String ruleSetName); -// public RuleSetConfig checkoutRuleSetConfig(String ruleBaseName, String ruleSetName); -// public Rule checkoutRule(String ruleBaseName, String ruleSetName, String ruleName); - - - /** - * These methods add brand new assets to the repository. - * Exceptions thrown if you don't fill out the right stuff etc. - * The names must be unique of course, or exceptions will be thrown. - */ -// public RuleSetFile addNewFile(String ruleBaseName, RuleSetFile file); -// public RuleSet addNewRuleSet(String ruleBaseName, RuleSet ruleSet); -// public Rule addNewRule(String ruleBaseName, String ruleSetName, Rule rule); - - -// /** -// * This method updates the asset in the repository, and -// * increment the version number etc. -// * If someone else beat you to it, it will chuck a wobbly. Whereby you -// * can tell the poor user, they are going to have to find out who it was, -// * and throw a phone at their heads, russle crowe style. -// * Of course, with checkouts, it should stop anyone else checking it out. -// */ -// public VersionInfo checkin(Asset asset, String comment); -// -// /** -// * This will change the status flag on the latest version of the asset. -// * It will make sure that your version is up to date before allowing it. -// */ -// public VersionInfo changeStatus(Asset asset, String newStatus); -// -// -// /** -// * Returns a list of rulebase names in the repository. -// */ -// public List listRuleBaseName(); -// -// -// /** -// * This returns a list of rule-set names for a given rulebase. -// */ -// public List listRuleSetNames(String ruleBase); -// -// -// /** -// * This will deeply load the whole RuleSet. -// */ -// public RuleSet retrieveRuleSet(String ruleBaseName, String ruleSetName); - -// -// /** -// * This will load a RuleSetFile. -// */ -// public RuleSetFile retrieveRuleSetFile(String ruleBaseName, String ruleSetName); - - -// /** -// * Haven't really defined how to search for things, -// * but will be on most fields. -// * Can return a list of assets that match, which could be rules, rulesets etc... -// * Probably need some canned queries, as well as some XPath ones. -// * Can do things like search for rules modified on a certain date, in various states etc. -// * TODO: get a list of basic functionality to support. -// */ -// public List searchRules(Properties searchProperties); - - - - /** - * Sets up a virgin repository. Only needs to be called once. - */ - public void createNewRepo(); - - /** - * This will add a new rule to the repository. - * If it already exists, and exception will be thrown. - * You need to explicitly checkin a new version of a rule. This - * method is only for adding a brand new rule. - * - * The RuleBase and RuleSet will be implicitly created if they don't already exist. - */ - public RuleDefinition addNewRule(String ruleBase, String ruleSet, RuleDefinition rule); - - /** - * This will permanently delete a rule. - * Only use when you really don't want it anymore. - */ - public void removeRule(String ruleBase, String ruleSet, String ruleName); - - /** Retrieve a rule */ - public RuleDefinition retrieveRule(String ruleBase, String ruleSet, String ruleName); - - - /** - * This will remove a ruleset, and all the contained rules. - */ - public void removeRuleSet(String ruleBase, String ruleSet); - - /** - * Applies changes that were made. - * Some actions have implicit saves, but it is best to - */ - public void save(); - - -} Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryServiceFactory.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryServiceFactory.java 2005-12-28 02:07:48 UTC (rev 1942) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryServiceFactory.java 2005-12-28 05:15:43 UTC (rev 1943) @@ -1,31 +0,0 @@ -package org.drools.repo; - -import javax.jcr.RepositoryException; -import javax.naming.NamingException; - -import org.drools.repo.jcr.JCRSessionUtil; -import org.drools.repo.jcr.RepositoryServiceImpl; - -public class RepositoryServiceFactory -{ - - public static RepositoryService getRepositoryService() { - JCRSessionUtil factory = new JCRSessionUtil(); - RepositoryService service = null; - try - { - service = new RepositoryServiceImpl(factory.getSession()); - } - catch ( NamingException e ) - { - throw new RuleRepositoryException(e); - } - catch ( RepositoryException e ) - { - throw new RuleRepositoryException(e); - } - return service; - } - - -} Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RuleRepositoryException.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RuleRepositoryException.java 2005-12-28 02:07:48 UTC (rev 1942) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RuleRepositoryException.java 2005-12-28 05:15:43 UTC (rev 1943) @@ -1,17 +0,0 @@ -package org.drools.repo; - -public class RuleRepositoryException extends RuntimeException -{ - public RuleRepositoryException(Throwable cause) { - super(cause); - } - - public RuleRepositoryException(String message, Throwable cause) { - super(message, cause); - } - - public RuleRepositoryException(String message) { - super(message); - } - -} Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java 2005-12-28 02:07:48 UTC (rev 1942) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java 2005-12-28 05:15:43 UTC (rev 1943) @@ -1,73 +0,0 @@ -package org.drools.repo.jcr; - -import java.util.Hashtable; - -import javax.jcr.Repository; -import javax.jcr.RepositoryException; -import javax.jcr.Session; -import javax.jcr.SimpleCredentials; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; - -import org.apache.jackrabbit.core.jndi.RegistryHelper; - -/** - * This is a dirty hack of a class while I get the hang of using JCR in and - * outside of containers. - * @author <a href="mailto:mic...@gm..."> Michael Neale</a> - * - */ -public class JCRSessionUtil -{ - - public static final String REPO_JNDI_NAME = "repo"; - - /** - * At the moment this is all hard coded to be un-authenticated and local - * It is looking for a jaas.config, as well as the repository.xml to setup the repository. - * @return - * @throws NamingException - * @throws RepositoryException - */ - public Session getSession() throws NamingException, RepositoryException { - - - System.setProperty("java.security.auth.login.config", "c:/jaas.config"); - String configFile = "conf/repository.xml"; - String repHomeDir = "drools-repository"; - - Hashtable env = new Hashtable( ); - env.put( Context.INITIAL_CONTEXT_FACTORY, - "org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory" ); - env.put( Context.PROVIDER_URL, - "localhost" ); - - InitialContext ctx = new InitialContext( env ); - - registerNewRepoInJNDI( configFile, - repHomeDir, - ctx ); - Repository r = (Repository) ctx.lookup( REPO_JNDI_NAME ); - - Session session = r.login( new SimpleCredentials( "userid", - "".toCharArray( ) ), - null ); - return session; - - } - - private void registerNewRepoInJNDI(String configFile, - String repHomeDir, - InitialContext ctx) throws NamingException, - RepositoryException - { - //configure repo, if its not already - RegistryHelper.registerRepository( ctx, - REPO_JNDI_NAME, - configFile, - repHomeDir, - true ); - } - -} Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java 2005-12-28 02:07:48 UTC (rev 1942) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java 2005-12-28 05:15:43 UTC (rev 1943) @@ -1,296 +0,0 @@ -package org.drools.repo.jcr; - -import java.util.ArrayList; -import java.util.List; - -import javax.jcr.ItemExistsException; -import javax.jcr.NamespaceRegistry; -import javax.jcr.Node; -import javax.jcr.NodeIterator; -import javax.jcr.PathNotFoundException; -import javax.jcr.RepositoryException; -import javax.jcr.Session; -import javax.jcr.lock.LockException; -import javax.jcr.nodetype.ConstraintViolationException; -import javax.jcr.version.VersionException; - -import org.drools.metamodel.DRLSourceFile; -import org.drools.metamodel.RuleDefinition; -import org.drools.repo.RepositoryService; -import org.drools.repo.RuleRepositoryException; - -public class RepositoryServiceImpl - implements - RepositoryService { - private Session session; - - public RepositoryServiceImpl(Session session){ - this.session = session; - - } - - public void createNamespace(){ - try { - NamespaceRegistry reg = this.session.getWorkspace( ).getNamespaceRegistry( ); - if ( nameSpaceExists( reg ) ) { - return; - } - else { - log( "Registering new Namespace" ); - reg.registerNamespace( RepositoryService.RULE_NAMESPACE_PREFIX, - RepositoryService.RULE_NAMESPACE ); - } - } - catch ( RepositoryException e ) { - throw new RuleRepositoryException( e ); - } - - } - - /** - * This will create a brand new repository. All rules are stored in the - * drools:repository node. - */ - public void createNewRepo(){ - createNamespace( ); - createRuleRepoNode( ); - } - - /** - * This creates the root drools repository node, if it doesn't already - * exist. - * - */ - private void createRuleRepoNode(){ - try { - Node rn = this.session.getRootNode( ); - if ( !rn.hasNode( nodeNameOf( "repository" ) ) ) { - this.session.getRootNode( ).addNode( nodeNameOf( "repository" ) ); - } - } - catch ( Exception e ) { - throw new RuleRepositoryException( "Unable to create new repository root node.", - e ); - } - } - - private String nodeNameOf(String string){ - return RepositoryService.RULE_NAMESPACE_PREFIX + ":" + string; - } - - private void log(String string){ - System.out.println( "REPO:" + string ); - } - - private boolean nameSpaceExists(NamespaceRegistry registry) throws RepositoryException{ - String[] uris = registry.getURIs( ); - for ( int i = 0; i < uris.length; i++ ) { - if ( uris[i].equals( RepositoryService.RULE_NAMESPACE ) ) { - log( "Name space already exists." ); - return true; - } - } - return false; - - } - - public void xxxxsaveNewRuleset(String name, - String content){ - Node repo = getRepository( ); - try { - Node ruleset = repo.addNode( nodeNameOf( "ruleset" ) ); - ruleset.setProperty( "content", - content ); - ruleset.setProperty( "ruleset-name", - name ); - session.save( ); - } - catch ( Exception e ) { - throw new RuleRepositoryException( "Unable to add a new Ruleset called: " + name, - e ); - } - } - - private Node getRepository(){ - try { - return session.getRootNode( ).getNode( nodeNameOf( "repository" ) ); - } - catch ( PathNotFoundException e ) { - throw new RuleRepositoryException( "Unable to find repository root node. Repository may not have been setup correctly.", - e ); - } - catch ( RepositoryException e ) { - throw new RuleRepositoryException( e ); - } - } - - public List xxxxfindAllRuleSetDRL(){ - List rulesets = new ArrayList( ); - Node repo = getRepository( ); - try { - NodeIterator nodeIt = repo.getNodes( ); - while ( nodeIt.hasNext( ) ) { - Node rulesetNode = nodeIt.nextNode( ); - String content = rulesetNode.getProperty( "content" ).getString( ); - String name = rulesetNode.getProperty( "ruleset-name" ).getString( ); - DRLSourceFile drl = new DRLSourceFile( content, - name ); - rulesets.add( drl ); - } - } - catch ( RepositoryException e ) { - throw new RuleRepositoryException( "Unable to list rulesets.", - e ); - } - return rulesets; - } - - public void xxxxeraseAllRuleSetDRL(){ - - Node repo = this.getRepository( ); - NodeIterator it; - try { - it = repo.getNodes( ); - while ( it.hasNext( ) ) { - it.nextNode( ).remove( ); - } - session.save( ); - } - catch ( RepositoryException e ) { - throw new RuleRepositoryException( "Unable to delete DRL nodes.", - e ); - } - } - - public RuleDefinition addNewRule(String ruleBase, - String ruleSet, - RuleDefinition rule){ - try { - Node ruleSetNode = getOrCreateRuleSetNode( ruleBase, - ruleSet ); - if ( ruleSetNode.hasNode( nodeNameOf( rule.getRuleName( ) ) ) ) { - throw new RuleRepositoryException( "Rule with that name [" + rule.getRuleName( ) - + "] already exists in ruleset [" - + ruleSet + "]" ); - } - Node newRuleNode = ruleSetNode.addNode( nodeNameOf( rule.getRuleName( ) ) ); - newRuleNode.setProperty( nodeNameOf( "fragment" ), - rule.getFragment( ) ); - - - } - catch ( PathNotFoundException e ) { - throw new RuleRepositoryException( "Not able to locate ruleset or base to store rule.", - e ); - } - catch ( RepositoryException e ) { - throw new RuleRepositoryException( e ); - } - - return rule; - } - - private Node getOrCreateRuleSetNode(String ruleBase, - String ruleSet) throws PathNotFoundException, - ItemExistsException, - VersionException, - ConstraintViolationException, - LockException, - RepositoryException{ - Node ruleBaseNode = getOrCreateRuleBaseNode( ruleBase ); - if ( ruleBaseNode.hasNode( nodeNameOf( ruleSet ) ) ) { - return ruleBaseNode.getNode( nodeNameOf( ruleSet ) ); - } - else { - return ruleBaseNode.addNode( nodeNameOf( ruleSet ) ); - } - } - - private Node getOrCreateRuleBaseNode(String ruleBase) throws PathNotFoundException, - ItemExistsException, - VersionException, - ConstraintViolationException, - LockException, - RepositoryException{ - Node repo = getRepository( ); - String nodeName = nodeNameOf( ruleBase ); - if ( repo.hasNode( nodeName ) ) { - return repo.getNode( nodeName ); - } - else { - return repo.addNode( nodeName ); - } - } - - public void save(){ - try { - session.save( ); - } - catch ( Exception e ) { - throw new RuleRepositoryException( "Unable to save the session.", - e ); - } - } - - public void removeRule(String ruleBase, - String ruleSet, - String ruleName){ - try { - String path = calcPath( new String[]{ruleBase, ruleSet, ruleName} ); - Node ruleNode = getRepository( ).getNode( path ); - ruleNode.remove( ); - } - catch ( PathNotFoundException e ) { - throw new RuleRepositoryException( "Unable to find rule to remove.", - e ); - } - catch ( RepositoryException e ) { - throw new RuleRepositoryException( e ); - } - - } - - public void removeRuleSet(String ruleBase, - String ruleSet){ - String[] path = new String[] {ruleBase, ruleSet}; - try { - getRepository().getNode(calcPath(path)).remove(); - } - catch ( Exception e ) { - throw new RuleRepositoryException("Unable to remove the ruleset [" + ruleSet + "]", e); - } - } - - /** - * convert a list of names to a path to retrieve. - */ - String calcPath(String[] names){ - StringBuffer buf = new StringBuffer( ); - for ( int i = 0; i < names.length; i++ ) { - buf.append( nodeNameOf( names[i] ) ); - if ( i != names.length - 1 ) { - buf.append( '/' ); - } - } - return buf.toString( ); - } - - public RuleDefinition retrieveRule(String ruleBase, - String ruleSet, - String ruleName){ - try { - Node ruleNode = getRepository().getNode(calcPath(new String[] {ruleBase, ruleSet, ruleName})); - RuleDefinition rule = new RuleDefinition(); - rule.setFragment(ruleNode.getProperty(nodeNameOf("fragment")).getString()); - - return rule; - } - catch ( PathNotFoundException e ) { - throw new RuleRepositoryException("Rule does not exist.", e); - } - catch ( RepositoryException e ) { - throw new RuleRepositoryException(e); - } - } - -} Deleted: trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java 2005-12-28 02:07:48 UTC (rev 1942) +++ trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java 2005-12-28 05:15:43 UTC (rev 1943) @@ -1,111 +0,0 @@ -package org.drools.repo.jcr; - -import junit.framework.TestCase; - -import org.drools.metamodel.RuleDefinition; -import org.drools.repo.RepositoryService; -import org.drools.repo.RepositoryServiceFactory; - -public class RepositoryServiceImplTest extends TestCase -{ - - private static RepositoryServiceImpl instance; - private long startTime; - - - - - - public void testAddRemoveNewRuleAndRuleSet() { - - RuleDefinition rule = new RuleDefinition("nami", "rule blah {}"); - - getRepo().addNewRule("rb", "rs", rule); - getRepo().save(); - RuleDefinition rule2 = getRepo().retrieveRule("rb", "rs", "nami"); - getRepo().removeRule("rb", "rs", rule.getRuleName()); - getRepo().removeRuleSet("rb", "rs"); - - assertEquals(rule.getFragment(), rule2.getFragment()); - getRepo().save(); - - } - - public void testLargeNumberOfRules() { - startTimer(); - //setup 5000 rules in ruleset 1 - RepositoryService repo = getRepo(); - for (int i = 0; i < 5000; i ++) { - RuleDefinition rule = new RuleDefinition("rule" + i, "MyRule_" + i); - repo.addNewRule("rulebase", "ruleset1", rule); - if (i % 10 == 0) repo.save(); - } - System.out.println("Time for first 5000: " + lapTime()); - repo.save(); - - //ruleset2 - for (int i = 0; i < 5000; i ++) { - RuleDefinition rule = new RuleDefinition("rule" + i, "MyRule_" + i); - repo.addNewRule("rulebase", "ruleset2", rule); - if (i % 10 == 0) repo.save(); - } - System.out.println("Time for second 5000: " + lapTime()); - - repo.save(); - //rulebase2 - for (int i = 0; i < 5000; i ++) { - RuleDefinition rule = new RuleDefinition("rule" + i, "MyRule_" + i); - repo.addNewRule("rulebase2", "ruleset", rule); - if (i % 10 == 0) repo.save(); - } - System.out.println("Time for third 5000: " + lapTime()); - repo.save(); - - startTimer(); - - RuleDefinition rule1 = repo.retrieveRule("rulebase", "ruleset1", "rule1000"); - System.out.println("Retrieve 1 :" + lapTime()); - RuleDefinition rule2 = repo.retrieveRule("rulebase", "ruleset2", "rule1000"); - System.out.println("Retrieve 2 :" + lapTime()); - RuleDefinition rule3 = repo.retrieveRule("rulebase2", "ruleset", "rule1000"); - System.out.println("Retrieve 3 :" + lapTime()); - - repo.removeRuleSet("rulebase", "ruleset1"); - repo.removeRuleSet("rulebase", "ruleset2"); - repo.removeRuleSet("rulebase2", "ruleset"); - repo.save(); - System.out.println("Remove all:" + lapTime()); - - assertEquals("MyRule_1000", rule1.getFragment()); - assertEquals("MyRule_1000", rule2.getFragment()); - assertEquals("MyRule_1000", rule3.getFragment()); - - - } - - private long lapTime(){ - long elapsed = System.currentTimeMillis() - startTime; - startTime = System.currentTimeMillis(); - return elapsed; - } - - private void startTimer(){ - this.startTime = System.currentTimeMillis(); - - } - - public void testCalcPath() { - String result = getRepo().calcPath(new String[] {"one", "two", "three"}); - assertEquals("drools:one/drools:two/drools:three", result); - } - - private RepositoryServiceImpl getRepo() { - if (instance == null) { - instance = (RepositoryServiceImpl) RepositoryServiceFactory.getRepositoryService( ); - instance.createNewRepo( ); - instance.save(); - } - return instance; - } - -} |
From: <jbo...@li...> - 2005-12-28 02:07:53
|
Author: mar...@jb... Date: 2005-12-27 21:07:48 -0500 (Tue, 27 Dec 2005) New Revision: 1942 Added: trunk/labs/jbossrules/drools-core/src/test/Resources/ trunk/labs/jbossrules/drools-core/src/test/Resources/correct_processTree1.dat trunk/labs/jbossrules/drools-core/src/test/Resources/correct_transform1.dat Removed: trunk/labs/jbossrules/drools-core/src/test/java/org/drools/rule/correct_processTree1.dat trunk/labs/jbossrules/drools-core/src/test/java/org/drools/rule/correct_transform1.dat Modified: trunk/labs/jbossrules/drools-core/src/test/java/org/drools/rule/LogicTransformerTest.java Log: -moved dat resources to test/resources to make it work with maven build Added: trunk/labs/jbossrules/drools-core/src/test/Resources/correct_processTree1.dat =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-core/src/test/Resources/correct_processTree1.dat ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-core/src/test/Resources/correct_transform1.dat =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-core/src/test/Resources/correct_transform1.dat ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/labs/jbossrules/drools-core/src/test/java/org/drools/rule/LogicTransformerTest.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/test/java/org/drools/rule/LogicTransformerTest.java 2005-12-28 01:47:01 UTC (rev 1941) +++ trunk/labs/jbossrules/drools-core/src/test/java/org/drools/rule/LogicTransformerTest.java 2005-12-28 02:07:48 UTC (rev 1942) @@ -408,9 +408,8 @@ // Uncomment this when you need to output a new known correct tree // result // writeTree(root, "correct_processTree1.dat"); + ObjectInputStream ois = new ObjectInputStream( this.getClass().getResourceAsStream( "/correct_processTree1.dat" ) ); - ObjectInputStream ois = new ObjectInputStream( this.getClass().getResourceAsStream( "correct_processTree1.dat" ) ); - And correctResultRoot = (And) ois.readObject(); // Make sure they are equal @@ -580,7 +579,7 @@ // Get known correct tree // The binary stream was created from a handchecked correct output - ObjectInputStream ois = new ObjectInputStream( this.getClass().getResourceAsStream( "correct_transform1.dat" ) ); + ObjectInputStream ois = new ObjectInputStream( this.getClass().getResourceAsStream( "/correct_transform1.dat" ) ); And[] correctResultAnds = (And[]) ois.readObject(); for ( int j = 0; j < ands.length; j++ ) { Deleted: trunk/labs/jbossrules/drools-core/src/test/java/org/drools/rule/correct_processTree1.dat =================================================================== (Binary files differ) Deleted: trunk/labs/jbossrules/drools-core/src/test/java/org/drools/rule/correct_transform1.dat =================================================================== (Binary files differ) |
From: <jbo...@li...> - 2005-12-28 01:47:10
|
Author: mar...@jb... Date: 2005-12-27 20:47:01 -0500 (Tue, 27 Dec 2005) New Revision: 1941 Modified: trunk/labs/jbossrules/drools-core/src/test/java/org/drools/rule/correct_processTree1.dat Log: -Added updated transformer test result Modified: trunk/labs/jbossrules/drools-core/src/test/java/org/drools/rule/correct_processTree1.dat =================================================================== (Binary files differ) |
From: <jbo...@li...> - 2005-12-28 01:18:24
|
Author: mar...@jb... Date: 2005-12-27 20:18:15 -0500 (Tue, 27 Dec 2005) New Revision: 1940 Modified: trunk/labs/jbossrules/pom.xml Log: JBRULES-4 -Continuum says its missing junit, so added it to parent POM. I'm told this shouldn't be necessary though. Modified: trunk/labs/jbossrules/pom.xml =================================================================== --- trunk/labs/jbossrules/pom.xml 2005-12-28 00:44:05 UTC (rev 1939) +++ trunk/labs/jbossrules/pom.xml 2005-12-28 01:18:15 UTC (rev 1940) @@ -191,6 +191,15 @@ <url>http://www.codehaus.org/</url> </organization> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <build> </build> |
From: <jbo...@li...> - 2005-12-28 00:44:10
|
Author: mar...@jb... Date: 2005-12-27 19:44:05 -0500 (Tue, 27 Dec 2005) New Revision: 1939 Modified: trunk/labs/jbossrules/pom.xml Log: JBRULES-4 -Setting up POM for continuum Modified: trunk/labs/jbossrules/pom.xml =================================================================== --- trunk/labs/jbossrules/pom.xml 2005-12-28 00:06:15 UTC (rev 1938) +++ trunk/labs/jbossrules/pom.xml 2005-12-28 00:44:05 UTC (rev 1939) @@ -12,6 +12,7 @@ </issueManagement> <ciManagement> + <system>continuum</system> <notifiers> <notifier> <address>de...@dr...</address> @@ -178,14 +179,13 @@ </developer> </developers> -<!-- + <scm> - <connection>scm:svn:http://svn.apache.org/repos/asf/maven/scm/trunk/</connection> - <developerConnection>scm:svn:http://svn.apache.org/repos/asf/maven/scm/trunk/</developerConnection> - <url>http://svn.apache.org/viewcvs.cgi/maven/scm/</url> + <connection>scm:svn:http://anonsvn.labs.jboss.com/trunk/labs/jbossrules/</connection> + <url>http://anonsvn.labs.jboss.com/trunk/labs/jbossrules/</url> </scm> ---> + <organization> <name>Codehaus</name> <url>http://www.codehaus.org/</url> |
From: <jbo...@li...> - 2005-12-28 00:06:19
|
Author: mic...@jb... Date: 2005-12-27 19:06:15 -0500 (Tue, 27 Dec 2005) New Revision: 1938 Removed: trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jackrabbit/ Log: more JCR work |
Author: mic...@jb... Date: 2005-12-27 19:04:40 -0500 (Tue, 27 Dec 2005) New Revision: 1937 Added: trunk/labs/jbossrules/drools-repository/conf/ trunk/labs/jbossrules/drools-repository/conf/jaas.config trunk/labs/jbossrules/drools-repository/conf/repository.xml trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DublinCore.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleDefinition.java Removed: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Asset.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Rule.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleBase.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSet.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetConfig.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetFile.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/VersionInfo.java Modified: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java Log: more JCR work Added: trunk/labs/jbossrules/drools-repository/conf/jaas.config =================================================================== --- trunk/labs/jbossrules/drools-repository/conf/jaas.config 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/conf/jaas.config 2005-12-28 00:04:40 UTC (rev 1937) @@ -0,0 +1,3 @@ +Jackrabbit { + org.apache.jackrabbit.core.security.SimpleLoginModule required anonymousId="anonymous"; +}; \ No newline at end of file Property changes on: trunk/labs/jbossrules/drools-repository/conf/jaas.config ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/conf/repository.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/conf/repository.xml 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/conf/repository.xml 2005-12-28 00:04:40 UTC (rev 1937) @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<Repository> + <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> + <param name="path" value="${rep.home}/repository"/> + </FileSystem> + <Security appName="Jackrabbit"> + <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager"/> + </Security> + <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" /> + <Workspace name="${wsp.name}"> + <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> + <param name="path" value="${wsp.home}"/> + </FileSystem> + <PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" /> + <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> + <param name="path" value="${wsp.home}/index"/> + </SearchIndex> + </Workspace> + <Versioning rootPath="${rep.home}/versions"> + <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> + <param name="path" value="${rep.home}/versions"/> + </FileSystem> + <PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" /> + </Versioning> +</Repository> \ No newline at end of file Property changes on: trunk/labs/jbossrules/drools-repository/conf/repository.xml ___________________________________________________________________ Name: svn:eol-style + native Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Asset.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Asset.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Asset.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -1,32 +0,0 @@ -package org.drools.metamodel; - -import java.io.Serializable; - -/** - * This is the superclass for all metamodel repository classes. - * They are all assets. Some just have more assets then others. - * @author <a href="mailto:mic...@gm..."> Michael Neale</a> - */ -public class Asset implements Serializable -{ - /* - * This is based on the <a href="http://dublincore.org/documents/dces/"> Dublin Core</a> - * specification, plus a little bit more, and a little bit less. Not all of these fields will be used. - */ - public String name; - public String creator; - public String subject; - public String description; - public String publisher; - public String contributor; - public java.util.Date dateCreated; - public String format; - public String source; - public String language; - public String relation; - public String coverage; - public String rights; - - - -} Modified: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -5,14 +5,14 @@ * @author <a href="mailto:mic...@gm..."> Michael Neale</a> * */ -public class DRLSourceFile extends RuleSetFile +public class DRLSourceFile { private String content; + private String name; - public DRLSourceFile(String content, String name) { - super.name = name; + this.name = name; this.content = content; } Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DublinCore.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DublinCore.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DublinCore.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -0,0 +1,155 @@ +package org.drools.metamodel; + +/** + * This is based on the <a href="http://dublincore.org/documents/dces/"> Dublin + * Core</a> specification, plus a little bit more, and a little bit less. Not + * all of these fields will be used. + */ +public class DublinCore +{ + + private String title; + private String creator; + private String subject; + private String description; + private String publisher; + private String contributor; + private java.util.Date dateCreated; + private String format; + private String source; + private String language; + private String relation; + private String coverage; + private String rights; + + public String getContributor() + { + return contributor; + } + + public void setContributor(String contributor) + { + this.contributor = contributor; + } + + public String getCoverage() + { + return coverage; + } + + public void setCoverage(String coverage) + { + this.coverage = coverage; + } + + public String getCreator() + { + return creator; + } + + public void setCreator(String creator) + { + this.creator = creator; + } + + public java.util.Date getDateCreated() + { + return dateCreated; + } + + public void setDateCreated(java.util.Date dateCreated) + { + this.dateCreated = dateCreated; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public String getFormat() + { + return format; + } + + public void setFormat(String format) + { + this.format = format; + } + + public String getLanguage() + { + return language; + } + + public void setLanguage(String language) + { + this.language = language; + } + + public String getName() + { + return title; + } + + public void setName(String name) + { + this.title = name; + } + + public String getPublisher() + { + return publisher; + } + + public void setPublisher(String publisher) + { + this.publisher = publisher; + } + + public String getRelation() + { + return relation; + } + + public void setRelation(String relation) + { + this.relation = relation; + } + + public String getRights() + { + return rights; + } + + public void setRights(String rights) + { + this.rights = rights; + } + + public String getSource() + { + return source; + } + + public void setSource(String source) + { + this.source = source; + } + + public String getSubject() + { + return subject; + } + + public void setSubject(String subject) + { + this.subject = subject; + } + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DublinCore.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Rule.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Rule.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Rule.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -1,10 +0,0 @@ -package org.drools.metamodel; - -import java.util.Properties; - -public class Rule extends Asset -{ - private Properties properties; - private VersionInfo versionInfo; - private String fragment; -} Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleBase.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleBase.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleBase.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -1,38 +0,0 @@ -package org.drools.metamodel; - -import java.util.ArrayList; -import java.util.Collection; - -/** - * A rulebase view of the repository. - * - * @author <a href="mailto:mic...@gm..."> Michael Neale</a> - * - */ -public class RuleBase extends Asset -{ - - protected Collection ruleSets; - protected Collection ruleSetFiles; - - public RuleBase(String name) { - super.name = name; - ruleSets = new ArrayList(); - ruleSetFiles = new ArrayList(); - } - - public void addRuleSet(RuleSet rs) { - ruleSets.add(rs); - } - - public void addRuleSetFile(RuleSetFile rs) { - ruleSetFiles.add(rs); - } - - - - - - - -} Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleDefinition.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleDefinition.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleDefinition.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -0,0 +1,45 @@ +package org.drools.metamodel; + +public class RuleDefinition +{ + private String ruleName; + private String fragment; + + + public String getFragment() + { + return fragment; + } + + public RuleDefinition(String ruleName, + String fragment){ + super( ); + // TODO Auto-generated constructor stub + this.ruleName = ruleName; + this.fragment = fragment; + + } + + public void setFragment(String fragment) + { + this.fragment = fragment; + } + + + + + public String getRuleName() + { + return ruleName; + } + + public void setRuleName(String ruleName) + { + this.ruleName = ruleName; + } + + public RuleDefinition() {} + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleDefinition.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSet.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSet.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSet.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -1,12 +0,0 @@ -package org.drools.metamodel; - -import java.util.List; - -public class RuleSet extends Asset -{ - private RuleSetConfig config; - private List rules; - - - -} Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetConfig.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetConfig.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetConfig.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -1,16 +0,0 @@ -package org.drools.metamodel; - -import java.util.Properties; - -public class RuleSetConfig extends Asset -{ - private Properties imports; - private String functions; - private Properties applicationData; - private VersionInfo versionInfo; - - - - - -} Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetFile.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetFile.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetFile.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -1,11 +0,0 @@ -package org.drools.metamodel; - -public class RuleSetFile extends Asset -{ - - private VersionInfo versionInfo; - - - - -} Deleted: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/VersionInfo.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/VersionInfo.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/VersionInfo.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -1,43 +0,0 @@ -package org.drools.metamodel; - -/** - * This represents some information about the version, as it was checked in. - * @author <a href="mailto:mic...@gm..."> Michael Neale</a> - */ -public class VersionInfo extends Asset -{ - private String comment; - private long versionNumber; - private String status; - - public VersionInfo(String comment, long versionNumber, String status) { - this.comment = comment; - this.versionNumber = versionNumber; - this.status = status; - } - - public VersionInfo nextVersion(String comment) { - return new VersionInfo(comment, versionNumber + 1, this.status); - } - public VersionInfo nextVersion(String comment, String newStatus) { - return new VersionInfo(comment, versionNumber + 1, newStatus); - } - - - - public String getComment() - { - return comment; - } - public String getStatus() - { - return status; - } - public long getVersionNumber() - { - return versionNumber; - } - - - -} Modified: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -3,15 +3,10 @@ import java.util.List; import java.util.Properties; -import org.drools.metamodel.Asset; -import org.drools.metamodel.Rule; -import org.drools.metamodel.RuleBase; -import org.drools.metamodel.RuleSet; -import org.drools.metamodel.RuleSetConfig; -import org.drools.metamodel.RuleSetFile; -import org.drools.metamodel.VersionInfo; +import org.drools.metamodel.RuleDefinition; + public interface RepositoryService { /** @@ -30,9 +25,9 @@ * This may also lock the asset, not sure... * Can provide seperate explicit lock methods if needed. */ - public RuleSetFile checkoutFile(String ruleBaseName, String ruleSetName); - public RuleSetConfig checkoutRuleSetConfig(String ruleBaseName, String ruleSetName); - public Rule checkoutRule(String ruleBaseName, String ruleSetName, String ruleName); +// public RuleSetFile checkoutFile(String ruleBaseName, String ruleSetName); +// public RuleSetConfig checkoutRuleSetConfig(String ruleBaseName, String ruleSetName); +// public Rule checkoutRule(String ruleBaseName, String ruleSetName, String ruleName); /** @@ -40,72 +35,99 @@ * Exceptions thrown if you don't fill out the right stuff etc. * The names must be unique of course, or exceptions will be thrown. */ - public RuleSetFile addNewFile(String ruleBaseName, RuleSetFile file); - public RuleSet addNewRuleSet(String ruleBaseName, RuleSet ruleSet); - public Rule addNewRule(String ruleBaseName, String ruleSetName, Rule rule); +// public RuleSetFile addNewFile(String ruleBaseName, RuleSetFile file); +// public RuleSet addNewRuleSet(String ruleBaseName, RuleSet ruleSet); +// public Rule addNewRule(String ruleBaseName, String ruleSetName, Rule rule); - /** - * This method updates the asset in the repository, and - * increment the version number etc. - * If someone else beat you to it, it will chuck a wobbly. Whereby you - * can tell the poor user, they are going to have to find out who it was, - * and throw a phone at their heads, russle crowe style. - * Of course, with checkouts, it should stop anyone else checking it out. - */ - public VersionInfo checkin(Asset asset, String comment); +// /** +// * This method updates the asset in the repository, and +// * increment the version number etc. +// * If someone else beat you to it, it will chuck a wobbly. Whereby you +// * can tell the poor user, they are going to have to find out who it was, +// * and throw a phone at their heads, russle crowe style. +// * Of course, with checkouts, it should stop anyone else checking it out. +// */ +// public VersionInfo checkin(Asset asset, String comment); +// +// /** +// * This will change the status flag on the latest version of the asset. +// * It will make sure that your version is up to date before allowing it. +// */ +// public VersionInfo changeStatus(Asset asset, String newStatus); +// +// +// /** +// * Returns a list of rulebase names in the repository. +// */ +// public List listRuleBaseName(); +// +// +// /** +// * This returns a list of rule-set names for a given rulebase. +// */ +// public List listRuleSetNames(String ruleBase); +// +// +// /** +// * This will deeply load the whole RuleSet. +// */ +// public RuleSet retrieveRuleSet(String ruleBaseName, String ruleSetName); - /** - * This will change the status flag on the latest version of the asset. - * It will make sure that your version is up to date before allowing it. - */ - public VersionInfo changeStatus(Asset asset, String newStatus); +// +// /** +// * This will load a RuleSetFile. +// */ +// public RuleSetFile retrieveRuleSetFile(String ruleBaseName, String ruleSetName); - /** - * Returns a list of rulebase names in the repository. - */ - public List listRuleBaseName(); +// /** +// * Haven't really defined how to search for things, +// * but will be on most fields. +// * Can return a list of assets that match, which could be rules, rulesets etc... +// * Probably need some canned queries, as well as some XPath ones. +// * Can do things like search for rules modified on a certain date, in various states etc. +// * TODO: get a list of basic functionality to support. +// */ +// public List searchRules(Properties searchProperties); + /** - * This returns a list of rule-set names for a given rulebase. + * Sets up a virgin repository. Only needs to be called once. */ - public List listRuleSetNames(String ruleBase); - - + public void createNewRepo(); + /** - * This will deeply load the whole RuleSet. + * This will add a new rule to the repository. + * If it already exists, and exception will be thrown. + * You need to explicitly checkin a new version of a rule. This + * method is only for adding a brand new rule. + * + * The RuleBase and RuleSet will be implicitly created if they don't already exist. */ - public RuleSet retrieveRuleSet(String ruleBaseName, String ruleSetName); + public RuleDefinition addNewRule(String ruleBase, String ruleSet, RuleDefinition rule); - - /** - * This will load a RuleSetFile. + /** + * This will permanently delete a rule. + * Only use when you really don't want it anymore. */ - public RuleSetFile retrieveRuleSetFile(String ruleBaseName, String ruleSetName); + public void removeRule(String ruleBase, String ruleSet, String ruleName); + /** Retrieve a rule */ + public RuleDefinition retrieveRule(String ruleBase, String ruleSet, String ruleName); + /** - * Haven't really defined how to search for things, - * but will be on most fields. - * Can return a list of assets that match, which could be rules, rulesets etc... - * Probably need some canned queries, as well as some XPath ones. - * Can do things like search for rules modified on a certain date, in various states etc. - * TODO: get a list of basic functionality to support. + * This will remove a ruleset, and all the contained rules. */ - public List searchRules(Properties searchProperties); + public void removeRuleSet(String ruleBase, String ruleSet); - - /** - * Sets up a virgin repository. Only needs to be called once. + * Applies changes that were made. + * Some actions have implicit saves, but it is best to */ - public void createNewRepo(); - - - - + public void save(); } Modified: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -21,11 +21,21 @@ public class JCRSessionUtil { + public static final String REPO_JNDI_NAME = "repo"; + + /** + * At the moment this is all hard coded to be un-authenticated and local + * It is looking for a jaas.config, as well as the repository.xml to setup the repository. + * @return + * @throws NamingException + * @throws RepositoryException + */ public Session getSession() throws NamingException, RepositoryException { + System.setProperty("java.security.auth.login.config", "c:/jaas.config"); - String configFile = "repotest/repository.xml"; - String repHomeDir = "repotest"; + String configFile = "conf/repository.xml"; + String repHomeDir = "drools-repository"; Hashtable env = new Hashtable( ); env.put( Context.INITIAL_CONTEXT_FACTORY, @@ -35,13 +45,10 @@ InitialContext ctx = new InitialContext( env ); - //configure repo, if its not already - RegistryHelper.registerRepository( ctx, - "repo", - configFile, - repHomeDir, - true ); - Repository r = (Repository) ctx.lookup( "repo" ); + registerNewRepoInJNDI( configFile, + repHomeDir, + ctx ); + Repository r = (Repository) ctx.lookup( REPO_JNDI_NAME ); Session session = r.login( new SimpleCredentials( "userid", "".toCharArray( ) ), @@ -49,5 +56,18 @@ return session; } + + private void registerNewRepoInJNDI(String configFile, + String repHomeDir, + InitialContext ctx) throws NamingException, + RepositoryException + { + //configure repo, if its not already + RegistryHelper.registerRepository( ctx, + REPO_JNDI_NAME, + configFile, + repHomeDir, + true ); + } } Modified: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -2,102 +2,90 @@ import java.util.ArrayList; import java.util.List; -import java.util.Properties; +import javax.jcr.ItemExistsException; import javax.jcr.NamespaceRegistry; import javax.jcr.Node; import javax.jcr.NodeIterator; import javax.jcr.PathNotFoundException; import javax.jcr.RepositoryException; import javax.jcr.Session; +import javax.jcr.lock.LockException; +import javax.jcr.nodetype.ConstraintViolationException; +import javax.jcr.version.VersionException; -import org.drools.metamodel.Asset; import org.drools.metamodel.DRLSourceFile; -import org.drools.metamodel.Rule; -import org.drools.metamodel.RuleSet; -import org.drools.metamodel.RuleSetConfig; -import org.drools.metamodel.RuleSetFile; -import org.drools.metamodel.VersionInfo; +import org.drools.metamodel.RuleDefinition; import org.drools.repo.RepositoryService; import org.drools.repo.RuleRepositoryException; public class RepositoryServiceImpl implements - RepositoryService -{ + RepositoryService { private Session session; - public RepositoryServiceImpl(Session session) - { + public RepositoryServiceImpl(Session session){ this.session = session; } - public void createNamespace() - { - try - { + public void createNamespace(){ + try { NamespaceRegistry reg = this.session.getWorkspace( ).getNamespaceRegistry( ); - if ( nameSpaceExists( reg ) ) - { + if ( nameSpaceExists( reg ) ) { return; } - else - { + else { log( "Registering new Namespace" ); reg.registerNamespace( RepositoryService.RULE_NAMESPACE_PREFIX, RepositoryService.RULE_NAMESPACE ); } } - catch ( RepositoryException e ) - { + catch ( RepositoryException e ) { throw new RuleRepositoryException( e ); } } - public void createNewRepo() - { + /** + * This will create a brand new repository. All rules are stored in the + * drools:repository node. + */ + public void createNewRepo(){ createNamespace( ); createRuleRepoNode( ); - - } - private void createRuleRepoNode() - { - try - { + /** + * This creates the root drools repository node, if it doesn't already + * exist. + * + */ + private void createRuleRepoNode(){ + try { Node rn = this.session.getRootNode( ); - if ( !rn.hasNode( nodeNameOf( "repository" ) ) ) - { + if ( !rn.hasNode( nodeNameOf( "repository" ) ) ) { this.session.getRootNode( ).addNode( nodeNameOf( "repository" ) ); } } - catch ( Exception e ) - { + catch ( Exception e ) { throw new RuleRepositoryException( "Unable to create new repository root node.", e ); } } - private String nodeNameOf(String string) - { + private String nodeNameOf(String string){ return RepositoryService.RULE_NAMESPACE_PREFIX + ":" + string; } - private void log(String string) - { + private void log(String string){ System.out.println( "REPO:" + string ); } - private boolean nameSpaceExists(NamespaceRegistry registry) throws RepositoryException - { + private boolean nameSpaceExists(NamespaceRegistry registry) throws RepositoryException{ String[] uris = registry.getURIs( ); - for ( int i = 0; i < uris.length; i++ ) - { - if ( uris[i].equals( RepositoryService.RULE_NAMESPACE ) ) - { + for ( int i = 0; i < uris.length; i++ ) { + if ( uris[i].equals( RepositoryService.RULE_NAMESPACE ) ) { log( "Name space already exists." ); return true; } @@ -107,189 +95,202 @@ } public void xxxxsaveNewRuleset(String name, - String content) - { + String content){ Node repo = getRepository( ); - try - { - Node ruleset = repo.addNode(nodeNameOf("ruleset")); - ruleset.setProperty("content", content); - ruleset.setProperty("ruleset-name", name); - save(); + try { + Node ruleset = repo.addNode( nodeNameOf( "ruleset" ) ); + ruleset.setProperty( "content", + content ); + ruleset.setProperty( "ruleset-name", + name ); + session.save( ); } catch ( Exception e ) { - throw new RuleRepositoryException("Unable to add a new Ruleset called: " + name, e); + throw new RuleRepositoryException( "Unable to add a new Ruleset called: " + name, + e ); } } - private Node getRepository() - { - try - { - return session.getRootNode().getNode(nodeNameOf("repository")); + private Node getRepository(){ + try { + return session.getRootNode( ).getNode( nodeNameOf( "repository" ) ); } - catch ( PathNotFoundException e ) - { - throw new RuleRepositoryException("Unable to find repository root node. Repository may not have been setup correctly.", e); + catch ( PathNotFoundException e ) { + throw new RuleRepositoryException( "Unable to find repository root node. Repository may not have been setup correctly.", + e ); } - catch ( RepositoryException e ) - { - throw new RuleRepositoryException(e); + catch ( RepositoryException e ) { + throw new RuleRepositoryException( e ); } } - public List xxxxfindAllRuleSetDRL() - { - List rulesets = new ArrayList(); - Node repo = getRepository(); - try - { - NodeIterator nodeIt = repo.getNodes(); - while(nodeIt.hasNext()) { - Node rulesetNode = nodeIt.nextNode(); - String content = rulesetNode.getProperty("content").getString(); - String name = rulesetNode.getProperty("ruleset-name").getString(); - DRLSourceFile drl = new DRLSourceFile(content, name); - rulesets.add(drl); - } + public List xxxxfindAllRuleSetDRL(){ + List rulesets = new ArrayList( ); + Node repo = getRepository( ); + try { + NodeIterator nodeIt = repo.getNodes( ); + while ( nodeIt.hasNext( ) ) { + Node rulesetNode = nodeIt.nextNode( ); + String content = rulesetNode.getProperty( "content" ).getString( ); + String name = rulesetNode.getProperty( "ruleset-name" ).getString( ); + DRLSourceFile drl = new DRLSourceFile( content, + name ); + rulesets.add( drl ); + } } - catch ( RepositoryException e ) - { - throw new RuleRepositoryException("Unable to list rulesets.", e); + catch ( RepositoryException e ) { + throw new RuleRepositoryException( "Unable to list rulesets.", + e ); } return rulesets; } - - public void save() { - try - { - session.save( ); - } - catch ( Exception e ) - { - throw new RuleRepositoryException( "Unable to save session.", - e ); - } - } - public void xxxxeraseAllRuleSetDRL() - { - - Node repo = this.getRepository(); + public void xxxxeraseAllRuleSetDRL(){ + + Node repo = this.getRepository( ); NodeIterator it; - try - { - it = repo.getNodes(); - while (it.hasNext()) { - it.nextNode().remove(); + try { + it = repo.getNodes( ); + while ( it.hasNext( ) ) { + it.nextNode( ).remove( ); } - save(); + session.save( ); } - catch ( RepositoryException e ) - { - throw new RuleRepositoryException("Unable to delete DRL nodes.", e); + catch ( RepositoryException e ) { + throw new RuleRepositoryException( "Unable to delete DRL nodes.", + e ); } } + public RuleDefinition addNewRule(String ruleBase, + String ruleSet, + RuleDefinition rule){ + try { + Node ruleSetNode = getOrCreateRuleSetNode( ruleBase, + ruleSet ); + if ( ruleSetNode.hasNode( nodeNameOf( rule.getRuleName( ) ) ) ) { + throw new RuleRepositoryException( "Rule with that name [" + rule.getRuleName( ) + + "] already exists in ruleset [" + + ruleSet + "]" ); + } + Node newRuleNode = ruleSetNode.addNode( nodeNameOf( rule.getRuleName( ) ) ); + newRuleNode.setProperty( nodeNameOf( "fragment" ), + rule.getFragment( ) ); - public RuleSetFile addNewRulesetFile(RuleSetFile file, - String initialComment) - { - // TODO Auto-generated method stub - return null; - } + } + catch ( PathNotFoundException e ) { + throw new RuleRepositoryException( "Not able to locate ruleset or base to store rule.", + e ); + } + catch ( RepositoryException e ) { + throw new RuleRepositoryException( e ); + } - public RuleSetFile checkoutFile(String ruleBaseName, - String ruleSetName) - { - // TODO Auto-generated method stub - return null; + return rule; } - public RuleSetConfig checkoutRuleSetConfig(String ruleBaseName, - String ruleSetName) - { - // TODO Auto-generated method stub - return null; + private Node getOrCreateRuleSetNode(String ruleBase, + String ruleSet) throws PathNotFoundException, + ItemExistsException, + VersionException, + ConstraintViolationException, + LockException, + RepositoryException{ + Node ruleBaseNode = getOrCreateRuleBaseNode( ruleBase ); + if ( ruleBaseNode.hasNode( nodeNameOf( ruleSet ) ) ) { + return ruleBaseNode.getNode( nodeNameOf( ruleSet ) ); + } + else { + return ruleBaseNode.addNode( nodeNameOf( ruleSet ) ); + } } - public Rule checkoutRule(String ruleBaseName, - String ruleSetName, - String ruleName) - { - // TODO Auto-generated method stub - return null; + private Node getOrCreateRuleBaseNode(String ruleBase) throws PathNotFoundException, + ItemExistsException, + VersionException, + ConstraintViolationException, + LockException, + RepositoryException{ + Node repo = getRepository( ); + String nodeName = nodeNameOf( ruleBase ); + if ( repo.hasNode( nodeName ) ) { + return repo.getNode( nodeName ); + } + else { + return repo.addNode( nodeName ); + } } - public RuleSetFile addNewFile(String ruleBaseName, - RuleSetFile file) - { - // TODO Auto-generated method stub - return null; + public void save(){ + try { + session.save( ); + } + catch ( Exception e ) { + throw new RuleRepositoryException( "Unable to save the session.", + e ); + } } - public RuleSet addNewRuleSet(String ruleBaseName, - RuleSet ruleSet) - { - // TODO Auto-generated method stub - return null; - } + public void removeRule(String ruleBase, + String ruleSet, + String ruleName){ + try { + String path = calcPath( new String[]{ruleBase, ruleSet, ruleName} ); + Node ruleNode = getRepository( ).getNode( path ); + ruleNode.remove( ); + } + catch ( PathNotFoundException e ) { + throw new RuleRepositoryException( "Unable to find rule to remove.", + e ); + } + catch ( RepositoryException e ) { + throw new RuleRepositoryException( e ); + } - public Rule addNewRule(String ruleBaseName, - String ruleSetName, - Rule rule) - { - // TODO Auto-generated method stub - return null; } - public VersionInfo checkin(Asset asset, - String comment) - { - // TODO Auto-generated method stub - return null; + public void removeRuleSet(String ruleBase, + String ruleSet){ + String[] path = new String[] {ruleBase, ruleSet}; + try { + getRepository().getNode(calcPath(path)).remove(); + } + catch ( Exception e ) { + throw new RuleRepositoryException("Unable to remove the ruleset [" + ruleSet + "]", e); + } } - public VersionInfo changeStatus(Asset asset, - String newStatus) - { - // TODO Auto-generated method stub - return null; + /** + * convert a list of names to a path to retrieve. + */ + String calcPath(String[] names){ + StringBuffer buf = new StringBuffer( ); + for ( int i = 0; i < names.length; i++ ) { + buf.append( nodeNameOf( names[i] ) ); + if ( i != names.length - 1 ) { + buf.append( '/' ); + } + } + return buf.toString( ); } - public List listRuleBaseName() - { - // TODO Auto-generated method stub - return null; - } + public RuleDefinition retrieveRule(String ruleBase, + String ruleSet, + String ruleName){ + try { + Node ruleNode = getRepository().getNode(calcPath(new String[] {ruleBase, ruleSet, ruleName})); + RuleDefinition rule = new RuleDefinition(); + rule.setFragment(ruleNode.getProperty(nodeNameOf("fragment")).getString()); - public List listRuleSetNames(String ruleBase) - { - // TODO Auto-generated method stub - return null; + return rule; + } + catch ( PathNotFoundException e ) { + throw new RuleRepositoryException("Rule does not exist.", e); + } + catch ( RepositoryException e ) { + throw new RuleRepositoryException(e); + } } - public RuleSet retrieveRuleSet(String ruleBaseName, - String ruleSetName) - { - // TODO Auto-generated method stub - return null; - } - - public RuleSetFile retrieveRuleSetFile(String ruleBaseName, - String ruleSetName) - { - // TODO Auto-generated method stub - return null; - } - - public List searchRules(Properties searchProperties) - { - // TODO Auto-generated method stub - return null; - } - - - } Modified: trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java 2005-12-27 23:35:21 UTC (rev 1936) +++ trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java 2005-12-28 00:04:40 UTC (rev 1937) @@ -1,31 +1,111 @@ package org.drools.repo.jcr; -import java.util.List; - import junit.framework.TestCase; +import org.drools.metamodel.RuleDefinition; +import org.drools.repo.RepositoryService; import org.drools.repo.RepositoryServiceFactory; public class RepositoryServiceImplTest extends TestCase { + private static RepositoryServiceImpl instance; + private long startTime; - public void testCreateNewAndDelete() { - RepositoryServiceImpl repo = (RepositoryServiceImpl) RepositoryServiceFactory.getRepositoryService(); - repo.createNewRepo(); + + + + + public void testAddRemoveNewRuleAndRuleSet() { - repo.xxxxeraseAllRuleSetDRL(); + RuleDefinition rule = new RuleDefinition("nami", "rule blah {}"); + + getRepo().addNewRule("rb", "rs", rule); + getRepo().save(); + RuleDefinition rule2 = getRepo().retrieveRule("rb", "rs", "nami"); + getRepo().removeRule("rb", "rs", rule.getRuleName()); + getRepo().removeRuleSet("rb", "rs"); - repo.xxxxsaveNewRuleset("My Ruleset", "vkahijkhfhdsjkfhdsh"); + assertEquals(rule.getFragment(), rule2.getFragment()); + getRepo().save(); - List rulesets = repo.xxxxfindAllRuleSetDRL(); - - System.out.println(rulesets.size()); + } + + public void testLargeNumberOfRules() { + startTimer(); + //setup 5000 rules in ruleset 1 + RepositoryService repo = getRepo(); + for (int i = 0; i < 5000; i ++) { + RuleDefinition rule = new RuleDefinition("rule" + i, "MyRule_" + i); + repo.addNewRule("rulebase", "ruleset1", rule); + if (i % 10 == 0) repo.save(); + } + System.out.println("Time for first 5000: " + lapTime()); + repo.save(); + + //ruleset2 + for (int i = 0; i < 5000; i ++) { + RuleDefinition rule = new RuleDefinition("rule" + i, "MyRule_" + i); + repo.addNewRule("rulebase", "ruleset2", rule); + if (i % 10 == 0) repo.save(); + } + System.out.println("Time for second 5000: " + lapTime()); + repo.save(); + //rulebase2 + for (int i = 0; i < 5000; i ++) { + RuleDefinition rule = new RuleDefinition("rule" + i, "MyRule_" + i); + repo.addNewRule("rulebase2", "ruleset", rule); + if (i % 10 == 0) repo.save(); + } + System.out.println("Time for third 5000: " + lapTime()); + repo.save(); + startTimer(); + + RuleDefinition rule1 = repo.retrieveRule("rulebase", "ruleset1", "rule1000"); + System.out.println("Retrieve 1 :" + lapTime()); + RuleDefinition rule2 = repo.retrieveRule("rulebase", "ruleset2", "rule1000"); + System.out.println("Retrieve 2 :" + lapTime()); + RuleDefinition rule3 = repo.retrieveRule("rulebase2", "ruleset", "rule1000"); + System.out.println("Retrieve 3 :" + lapTime()); + + repo.removeRuleSet("rulebase", "ruleset1"); + repo.removeRuleSet("rulebase", "ruleset2"); + repo.removeRuleSet("rulebase2", "ruleset"); + repo.save(); + System.out.println("Remove all:" + lapTime()); + + assertEquals("MyRule_1000", rule1.getFragment()); + assertEquals("MyRule_1000", rule2.getFragment()); + assertEquals("MyRule_1000", rule3.getFragment()); + + } + + private long lapTime(){ + long elapsed = System.currentTimeMillis() - startTime; + startTime = System.currentTimeMillis(); + return elapsed; + } + private void startTimer(){ + this.startTime = System.currentTimeMillis(); + + } + + public void testCalcPath() { + String result = getRepo().calcPath(new String[] {"one", "two", "three"}); + assertEquals("drools:one/drools:two/drools:three", result); + } - - + private RepositoryServiceImpl getRepo() { + if (instance == null) { + instance = (RepositoryServiceImpl) RepositoryServiceFactory.getRepositoryService( ); + instance.createNewRepo( ); + instance.save(); + } + return instance; + } + } |
From: <jbo...@li...> - 2005-12-27 23:35:28
|
Author: mar...@jb... Date: 2005-12-27 18:35:21 -0500 (Tue, 27 Dec 2005) New Revision: 1936 Added: trunk/labs/jbossrules/eclipse-code-style.xml Log: JBRULES-12 -Added eclipse formatting xml file Added: trunk/labs/jbossrules/eclipse-code-style.xml =================================================================== --- trunk/labs/jbossrules/eclipse-code-style.xml 2005-12-27 23:32:11 UTC (rev 1935) +++ trunk/labs/jbossrules/eclipse-code-style.xml 2005-12-27 23:35:21 UTC (rev 1936) @@ -0,0 +1,249 @@ +<?xml version="1.0" encoding="UTF-8"?> +<profiles version="9"> +<profile name="codehaus" version="9"> +<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="83"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="17"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="83"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="83"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="83"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="4"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="83"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="83"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="17"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="53"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="83"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="83"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/> +<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="250"/> +<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/> +<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/> +<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/> +</profile> +</profiles> |
From: <jbo...@li...> - 2005-12-27 17:31:05
|
Author: aron.gombas Date: 2005-12-27 12:30:40 -0500 (Tue, 27 Dec 2005) New Revision: 1934 Added: trunk/labs/kosmos/deploy-server-tomcat-liferay-portal.xml Modified: trunk/labs/kosmos/build-distro.xml trunk/labs/kosmos/deploy-portlet-liferay-portal.xml trunk/labs/kosmos/deploy-server-tomcat.xml Log: Separate deploy script for Liferay Tomcat Modified: trunk/labs/kosmos/build-distro.xml =================================================================== --- trunk/labs/kosmos/build-distro.xml 2005-12-27 09:44:37 UTC (rev 1933) +++ trunk/labs/kosmos/build-distro.xml 2005-12-27 17:30:40 UTC (rev 1934) @@ -9,8 +9,6 @@ <!-- $Id$ --> <project basedir="." default="dist" name="Kosmos Distro"> <description>Kosmos Distro build-file</description> - -<!-- TODO kitakarit es valtozokat hasznal --> <!-- read basic properties --> <property environment="env"/> @@ -156,7 +154,6 @@ <mkdir dir="${dist-bin-exo.dir}"/> <!-- deploy --> - <!-- TODO set CATALINA_HOME --> <ant antfile="${dist-bin.dir}/portlet/deploy-portlet-exo.xml" dir="${dist-bin.dir}/portlet"/> <ant antfile="${dist-bin.dir}/server/deploy-server-tomcat.xml" dir="${dist-bin.dir}/server"/> @@ -182,7 +179,6 @@ <mkdir dir="${dist-bin-gridsphere.dir}"/> <!-- deploy --> - <!-- TODO set CATALINA_HOME --> <ant antfile="${dist-bin.dir}/portlet/deploy-portlet-gridsphere.xml" dir="${dist-bin.dir}/portlet"/> <ant antfile="${dist-bin.dir}/server/deploy-server-tomcat.xml" dir="${dist-bin.dir}/server"/> @@ -234,9 +230,8 @@ <mkdir dir="${dist-bin-liferay-portal.dir}"/> <!-- deploy --> - <!-- TODO set CATALINA_HOME --> <ant antfile="${dist-bin.dir}/portlet/deploy-portlet-liferay-portal.xml" dir="${dist-bin.dir}/portlet"/> - <ant antfile="${dist-bin.dir}/server/deploy-server-tomcat.xml" dir="${dist-bin.dir}/server"/> + <ant antfile="${dist-bin.dir}/server/deploy-server-tomcat-liferay-portal.xml" dir="${dist-bin.dir}/server"/> <!-- copy all webapps --> <copy todir="${dist-bin-liferay-portal.dir}/webapps"> Modified: trunk/labs/kosmos/deploy-portlet-liferay-portal.xml =================================================================== --- trunk/labs/kosmos/deploy-portlet-liferay-portal.xml 2005-12-27 09:44:37 UTC (rev 1933) +++ trunk/labs/kosmos/deploy-portlet-liferay-portal.xml 2005-12-27 17:30:40 UTC (rev 1934) @@ -3,13 +3,11 @@ <!-- $Id$ --> <project basedir="." default="build" name="Kosmos Portlet on Liferay Portal"> <description>Kosmos Portlet Module deploy-file</description> - -<!-- TODO this script needs serious cleaning up --> <property environment="env"/> <property name="module.name" value="portlet"/> <property name="container.name" value="liferay-portal"/> - <property name="temp.dir" value="tmp"/> + <property name="temp.dir" value="temp"/> <!-- the following properties need to be customized to your environment --> <!-- for JBoss AS: <property name="container.dir" value="${env.JBOSS_HOME}/server/default" /> --> @@ -23,7 +21,7 @@ <target name="build" > <!-- unpack --> <mkdir dir="${temp.dir}"/> - <unzip src="kosmos-portlet.war" dest="${temp.dir}"/> + <unzip src="kosmos-${module.name}.war" dest="${temp.dir}"/> <!-- prepare dependencies --> <copy todir="${temp.dir}/WEB-INF"> @@ -38,7 +36,7 @@ <fileset dir="${temp.dir}/WEB-INF/lib" includes="commons-logging-1.0.4.jar"/> </delete> <copy todir="${temp.dir}/WEB-INF/lib"> - <fileset dir="../etc" includes="commons-logging-1.0.3.jar"/><!-- TODO fix reference and this should be done for the server, too --> + <fileset dir="../etc" includes="commons-logging-1.0.3.jar"/> <fileset dir="${liferay.home}/WEB-INF/lib" includes="util-taglib.jar"/> </copy> @@ -66,7 +64,8 @@ </replace> <!-- repack --> - <zip destfile="conf/${container.name}/kosmos-portlet.war" basedir="${temp.dir}"/> + <zip destfile="conf/${container.name}/kosmos-${module.name}.war" basedir="${temp.dir}"/> + <delete dir="${temp.dir}"/> <!-- prepare container --> <delete> Added: trunk/labs/kosmos/deploy-server-tomcat-liferay-portal.xml =================================================================== --- trunk/labs/kosmos/deploy-server-tomcat-liferay-portal.xml 2005-12-27 09:44:37 UTC (rev 1933) +++ trunk/labs/kosmos/deploy-server-tomcat-liferay-portal.xml 2005-12-27 17:30:40 UTC (rev 1934) @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Kosmos Server deploy-script for Liferay Portal's Apache Tomcat --> +<!-- $Id$ --> +<project basedir="." default="build" name="Kosmos Server on Liferay Portal's Apache Tomcat"> + <description>Kosmos Server Module deploy-file</description> + + <property environment="env"/> + <property name="module.name" value="server"/> + <property name="container.name" value="liferay-portal-tomcat"/> + <property name="container.dir" value="\Java\liferay-portal-pro-3.6.1-tomcat\webapps\kosmos-${module.name}"/><!-- TODO why hardwired? --> + <property name="temp.dir" value="temp"/> + + <target name="build" > + <!-- unpack --> + <mkdir dir="${temp.dir}"/> + <unzip src="kosmos-${module.name}.war" dest="${temp.dir}"/> + + <!-- prepare dependencies --> + <delete> + <fileset dir="${temp.dir}/WEB-INF/lib" includes="commons-logging-1.0.4.jar"/> + </delete> + <copy todir="${temp.dir}/WEB-INF/lib"> + <fileset dir="../etc" includes="commons-logging-1.0.3.jar"/> + </copy> + + <!-- repack --> + <zip destfile="conf/${container.name}/kosmos-${module.name}.war" basedir="${temp.dir}"/> + <delete dir="${temp.dir}"/> + + <!-- deploy the repacked war --> + <delete dir="${container.dir}"/> + <mkdir dir="${container.dir}"/> + <unzip src="conf/${container.name}/kosmos-${module.name}.war" dest="${container.dir}"/> + </target> +</project> Modified: trunk/labs/kosmos/deploy-server-tomcat.xml =================================================================== --- trunk/labs/kosmos/deploy-server-tomcat.xml 2005-12-27 09:44:37 UTC (rev 1933) +++ trunk/labs/kosmos/deploy-server-tomcat.xml 2005-12-27 17:30:40 UTC (rev 1934) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Kosmos Portlet deploy-script for JBoss Portal --> +<!-- Kosmos Server deploy-script for Apache Tomcat --> <!-- $Id$ --> -<project basedir="." default="redeploy" name="Kosmos Portlet on JBoss Portal"> +<project basedir="." default="redeploy" name="Kosmos Server on Apache Tomcat"> <description>Kosmos Server Module deploy-file</description> <property name="module.name" value="server"/> |
From: <jbo...@li...> - 2005-12-27 09:45:46
|
Author: aron.gombas Date: 2005-12-27 04:44:37 -0500 (Tue, 27 Dec 2005) New Revision: 1933 Modified: trunk/labs/kosmos/build-distro.xml trunk/labs/kosmos/build/build.xml trunk/labs/kosmos/build/deploy.xml Log: 2005 -> 2005-2006 replaced Modified: trunk/labs/kosmos/build/build.xml =================================================================== --- trunk/labs/kosmos/build/build.xml 2005-12-25 18:37:44 UTC (rev 1932) +++ trunk/labs/kosmos/build/build.xml 2005-12-27 09:44:37 UTC (rev 1933) @@ -50,7 +50,7 @@ <target name="init"> <echo message="============================================================"/> <echo message="${project.name} - ${module.name} ${project.version}"/> - <echo message="Copyright 2005 (C) Midori"/> + <echo message="Copyright 2005-2006 (C) Midori"/> <echo message="============================================================"/> <tstamp> <format pattern="dd/MMM/yy HH:mm:ss" property="build.date"/> Modified: trunk/labs/kosmos/build/deploy.xml =================================================================== --- trunk/labs/kosmos/build/deploy.xml 2005-12-25 18:37:44 UTC (rev 1932) +++ trunk/labs/kosmos/build/deploy.xml 2005-12-27 09:44:37 UTC (rev 1933) @@ -25,7 +25,7 @@ <target name="init"> <echo message="============================================================"/> <echo message="${project.name} - ${module.name} ${project.version}"/> - <echo message="Copyright 2005 (C) Midori"/> + <echo message="Copyright 2005-2006 (C) Midori"/> <echo message="============================================================"/> </target> Modified: trunk/labs/kosmos/build-distro.xml =================================================================== --- trunk/labs/kosmos/build-distro.xml 2005-12-25 18:37:44 UTC (rev 1932) +++ trunk/labs/kosmos/build-distro.xml 2005-12-27 09:44:37 UTC (rev 1933) @@ -48,7 +48,7 @@ <target name="init"> <echo message="============================================================"/> <echo message="${project.name} distribution - ${project.version}"/> - <echo message="Copyright 2005 (C) Midori"/> + <echo message="Copyright 2005-2006 (C) Midori"/> <echo message="============================================================"/> </target> |
From: <jbo...@li...> - 2005-12-25 18:38:07
|
Author: aron.gombas Date: 2005-12-25 13:37:44 -0500 (Sun, 25 Dec 2005) New Revision: 1932 Added: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnRepositoryContentStats.java trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnRepositoryLogStats.java Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/jira/JiraServiceImpl.java trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java Log: SVN "stat" classes factored out from inner classes 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-12-25 00:35:09 UTC (rev 1931) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/jira/JiraServiceImpl.java 2005-12-25 18:37:44 UTC (rev 1932) @@ -78,10 +78,11 @@ try { // download database info connect(url); + Document dom = ScrapingUtils.downloadHtmlDom(new URL(ScrapingUtils.removeUserInfoFromUrl(url))); + disconnect(url); - // TODO review these queries // TODO restructure all the services code // run XQueries Added: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnRepositoryContentStats.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnRepositoryContentStats.java 2005-12-25 00:35:09 UTC (rev 1931) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnRepositoryContentStats.java 2005-12-25 18:37:44 UTC (rev 1932) @@ -0,0 +1,24 @@ +/* + * Kosmos. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package hu.midori.kosmos.server.svn; + +import java.util.List; +import java.util.Map; + +/** Wraps the stats retrieved from the log of a SVN repository. */ +class SvnRepositoryContentStats {// TODO rewrite as bean + /** No of dirs. */ + public int dirs; + /** No of files. */ + public int files; + /** Total filesize. */ + public int totalSize; + + /* No of files per file-type. */ + public List<Map.Entry<String,Integer>> filesPerFileType; + public String filesPerFileTypeChartUrl; +} \ No newline at end of file Added: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnRepositoryLogStats.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnRepositoryLogStats.java 2005-12-25 00:35:09 UTC (rev 1931) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnRepositoryLogStats.java 2005-12-25 18:37:44 UTC (rev 1932) @@ -0,0 +1,77 @@ +/* + * Kosmos. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package hu.midori.kosmos.server.svn; + +import hu.midori.kosmos.model.ScmRepositoryChange; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.jfree.data.time.TimeSeries; +import org.jfree.data.time.Week; + +/** Wraps the stats retrieved from the content of a SVN repository. */ +class SvnRepositoryLogStats {// TODO rewrite as bean + public Date createdDate; + /** Full history of the commits in reversed order. */ + public List<ScmRepositoryChange> commits = new ArrayList<ScmRepositoryChange>(); + + /* No of commits over a certain period. */ + public int commitsTotal; + public int commitsToday; + public int commitsLast7Days; + public int commitsLast31Days; + + /* Author of commits over a certain period. */ + public Set<String> committersTotal = new HashSet<String>(); + public Set<String> committersToday = new HashSet<String>(); + public Set<String> committersLast7Days = new HashSet<String>(); + public Set<String> committersLast31Days = new HashSet<String>(); + + /* No of repository entries per week. */ + public TimeSeries repoEntriesPerWeek = new TimeSeries("", Week.class); + public String repoEntriesPerWeekChartUrl; + + /* No of commits per author. */ + public List<Map.Entry<String,Integer>> commitsPerAuthor; + public String commitsPerAuthorChartUrl; + + /* No of commits per file. */ + public List<Map.Entry<String,Integer>> commitsPerFile; + public String commitsPerFileChartUrl; + + /* No of commits per week. */ + public TimeSeries commitsPerWeek = new TimeSeries("", Week.class); + public String commitsPerWeekChartUrl; + + /** Must be called to validate its content, after the processing was done. */ + public void validate() { + // revert history + Collections.reverse(commits); + + // cummulate files-per-week values + for(int i = 1; i < repoEntriesPerWeek.getItemCount(); i++) + repoEntriesPerWeek.update(i, repoEntriesPerWeek.getValue(i).intValue() + repoEntriesPerWeek.getValue(i - 1).intValue()); + + // add files-per-week value for the current week even if no activity + Week currentWeek = new Week(new Date()); + if(repoEntriesPerWeek.getDataItem(currentWeek) == null) + repoEntriesPerWeek.add(currentWeek, repoEntriesPerWeek.getValue(repoEntriesPerWeek.getItemCount() - 1)); + + // assert calculations + int calculatedCommitsTotal = 0; + for(int i = 0; i < commitsPerWeek.getItemCount(); i++) // FIXME these kind of counting should be rather done with a commons Bag + calculatedCommitsTotal += commitsPerWeek.getDataItem(i).getValue().intValue(); + if(calculatedCommitsTotal != commitsTotal) + throw new IllegalStateException(String.format("Calculated commits (%d) does not equal statistical commits (%d)", calculatedCommitsTotal, commitsTotal)); + } +} \ No newline at end of file Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java 2005-12-25 00:35:09 UTC (rev 1931) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java 2005-12-25 18:37:44 UTC (rev 1932) @@ -21,19 +21,15 @@ import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.Date; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.TreeMap; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.jfree.data.time.TimeSeries; import org.jfree.data.time.TimeSeriesDataItem; import org.jfree.data.time.Week; import org.tmatesoft.svn.core.SVNDirEntry; @@ -166,63 +162,6 @@ // do nothing } - /** Wraps the stats retrieved from the content of a SVN repository. */ - private class SvnRepositoryLogStats {// TODO rewrite as bean - public Date createdDate; - /** Full history of the commits in reversed order. */ - public List<ScmRepositoryChange> commits = new ArrayList<ScmRepositoryChange>(); - - /* No of commits over a certain period. */ - public int commitsTotal; - public int commitsToday; - public int commitsLast7Days; - public int commitsLast31Days; - - /* Author of commits over a certain period. */ - public Set<String> committersTotal = new HashSet<String>(); - public Set<String> committersToday = new HashSet<String>(); - public Set<String> committersLast7Days = new HashSet<String>(); - public Set<String> committersLast31Days = new HashSet<String>(); - - /* No of repository entries per week. */ - public TimeSeries repoEntriesPerWeek = new TimeSeries("", Week.class); - public String repoEntriesPerWeekChartUrl; - - /* No of commits per author. */ - public List<Map.Entry<String,Integer>> commitsPerAuthor; - public String commitsPerAuthorChartUrl; - - /* No of commits per file. */ - public List<Map.Entry<String,Integer>> commitsPerFile; - public String commitsPerFileChartUrl; - - /* No of commits per week. */ - public TimeSeries commitsPerWeek = new TimeSeries("", Week.class); - public String commitsPerWeekChartUrl; - - /** Must be called to validate its content, after the processing was done. */ - public void validate() { - // revert history - Collections.reverse(commits); - - // cummulate files-per-week values - for(int i = 1; i < repoEntriesPerWeek.getItemCount(); i++) - repoEntriesPerWeek.update(i, repoEntriesPerWeek.getValue(i).intValue() + repoEntriesPerWeek.getValue(i - 1).intValue()); - - // add files-per-week value for the current week even if no activity - Week currentWeek = new Week(new Date()); - if(repoEntriesPerWeek.getDataItem(currentWeek) == null) - repoEntriesPerWeek.add(currentWeek, repoEntriesPerWeek.getValue(repoEntriesPerWeek.getItemCount() - 1)); - - // assert calculations - int calculatedCommitsTotal = 0; - for(int i = 0; i < commitsPerWeek.getItemCount(); i++) // FIXME these kind of counting should be rather done with a commons Bag - calculatedCommitsTotal += commitsPerWeek.getDataItem(i).getValue().intValue(); - if(calculatedCommitsTotal != commitsTotal) - throw new IllegalStateException(String.format("Calculated commits (%d) does not equal statistical commits (%d)", calculatedCommitsTotal, commitsTotal)); - } - } - /** Analyzes the log of the repo and returns its stats. */ @SuppressWarnings("unchecked") protected SvnRepositoryLogStats analyzeLog(SVNRepository repository) throws SVNException { @@ -325,20 +264,6 @@ return stats; } - /** Wraps the stats retrieved from the log of a SVN repository. */ - private class SvnRepositoryContentStats { - /** No of dirs. */ - public int dirs; - /** No of files. */ - public int files; - /** Total filesize. */ - public int totalSize; - - /* No of files per file-type. */ - public List<Map.Entry<String,Integer>> filesPerFileType; - public String filesPerFileTypeChartUrl; - } - /** Analyzes the repository content and returns its stats. */ @SuppressWarnings("unchecked") protected SvnRepositoryContentStats analyzeContent(SVNRepository repository) throws SVNException { |
From: <jbo...@li...> - 2005-12-25 00:35:13
|
Author: unibrew Date: 2005-12-24 19:35:09 -0500 (Sat, 24 Dec 2005) New Revision: 1931 Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Counter.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCounterDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDescriptor.java Log: [JBLAB-581] DownloadCounters have now possibility to hide them. Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Counter.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Counter.java 2005-12-25 00:33:18 UTC (rev 1930) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Counter.java 2005-12-25 00:35:09 UTC (rev 1931) @@ -44,6 +44,11 @@ private String projectId; /** + * The information whether counter should be visible on portlet or not. + */ + private Boolean visible; + + /** * Main constructor simply initiates values. * * @param value @@ -51,9 +56,10 @@ * @param projectId * Name of project for this counter. */ - Counter (long value,String projectId) { + Counter (long value,String projectId,Boolean visible) { this.value=value; this.projectId=projectId; + this.visible = visible; } /** @@ -81,6 +87,23 @@ } /** + * Method returns information if counter is visible. + * @return + * Visibility status of the counter. + */ + public Boolean getVisible() { + return visible; + } + + /** + * Method sets visibility of the counter. + * @param visible + */ + public void setVisible(Boolean visible) { + this.visible = visible; + } + + /** * Overrided method returns String containing value of the counter. */ public String toString () { Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCounterDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCounterDescriptor.java 2005-12-25 00:33:18 UTC (rev 1930) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCounterDescriptor.java 2005-12-25 00:35:09 UTC (rev 1931) @@ -25,8 +25,10 @@ import java.io.IOException; import java.io.InputStream; +import java.util.Hashtable; import java.util.LinkedList; import java.util.List; +import java.util.Map; import org.apache.xerces.parsers.DOMParser; import org.jboss.forge.common.XmlTools; @@ -49,7 +51,7 @@ /** * This variable contains all links, which need to be tracked, collected from xml descriptor. */ - private List<String> links; + private Map<String,Boolean> links; /** * Name of tag in counter.xml containing counter link. @@ -62,6 +64,21 @@ public static final String COUNTER = "counter"; /** + * This variable contains name of the visibility attribute. + */ + public static final String VISIBILITY = "visible"; + + /** + * This variable contains value for attributes which means TRUE. + */ + public static final String TRUE = "true"; + + /** + * This variable contains value for attributes which means FALSE. + */ + public static final String FALSE = "false"; + + /** * Main DownloadCounterDescriptor constructor which parses the xml descriptor for a project * and collects data from it. * @@ -86,7 +103,7 @@ NodeList nodes = doc.getDocumentElement().getChildNodes(); // Parsing and gettting download links which are requested to be tracked by download counter. - links = new LinkedList<String>(); + links = new Hashtable<String,Boolean>(); for (int i = 0; i < nodes.getLength(); i++) { n = nodes.item(i); if (n.getNodeType() == Node.ELEMENT_NODE) { @@ -95,10 +112,16 @@ for (int j=0;j< counterProps.getLength() ; j++) { property = counterProps.item(j); if (property.getNodeType()== Node.ELEMENT_NODE){ + String visibilityAtt = XmlTools.getAttributeValue(property,VISIBILITY); + boolean visibility = true; + if (visibilityAtt!=null && visibilityAtt.equals(FALSE)) { + visibility = false; + } if (property.getNodeName().equals(LINK) && XmlTools.unmarshallText(property) != null && !XmlTools.unmarshallText(property).trim().equals("")) { - links.add(XmlTools.unmarshallText(property).trim()); + links.put(XmlTools.unmarshallText(property).trim(),visibility); } + } } } @@ -112,7 +135,7 @@ * @return * List<String> of download links. */ - public List<String> getLinks () { + public Map<String,Boolean> getLinks () { return links; } Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDescriptor.java 2005-12-25 00:33:18 UTC (rev 1930) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDescriptor.java 2005-12-25 00:35:09 UTC (rev 1931) @@ -71,8 +71,23 @@ * Name of tag in counters.xml containing project id. */ public static final String ID = "id"; + + /** + * This variable contains name of the visibility attribute. + */ + public static final String VISIBILITY = "visible"; /** + * This variable contains value for attributes which means TRUE. + */ + public static final String TRUE = "true"; + + /** + * This variable contains value for attributes which means FALSE. + */ + public static final String FALSE = "false"; + + /** * This Map contains all counters for the portal. */ private Map<String,Counter> downloadCounters; @@ -212,19 +227,20 @@ new DownloadCounterDescriptor(counters.get(projectId)); // Getting list of links which are now tracked by downloadCounters. - List<String> xmlProjectLinks = getProjectLinks(projectId); + Map<String,Boolean> xmlProjectLinks = getProjectLinks(projectId); // Getting the list of links from download counter descriptor. - List<String> links = counterDesc.getLinks(); + Map<String,Boolean> links = counterDesc.getLinks(); // This list will be used for collecting links which must be // removed from downloadCounters. List<String> linksToDelete = new LinkedList<String>(); // Searching for links to remove and links which are already tracked. - for (String link:xmlProjectLinks) { - if (links.contains(link)) { - links.remove(link); + for (String link:xmlProjectLinks.keySet()) { + if (links.keySet().contains(link)) { + setCounterVisibility (link,links.get(link)); + links.keySet().remove(link); } else { linksToDelete.add(link); } @@ -262,6 +278,18 @@ } /** + * Method sets visibility for counter in downloadCounters Map as requested + * in <code>visibility</code> parameter. + * @param link + * The link to the counter. + * @param visibility + * Visibility which counter should have. + */ + private synchronized void setCounterVisibility (String link, Boolean visibility) { + downloadCounters.get(link).setVisible(visibility); + } + + /** * Method adds links which are wished to be tracked. * * @param links @@ -269,10 +297,10 @@ * @param projectId * Project id name for which the links are added. */ - private synchronized void addLinksForCounting (List<String> links,String projectId) { + private synchronized void addLinksForCounting (Map<String,Boolean> links,String projectId) { // Adding new download links for tracking. - for (String link:links) { - downloadCounters.put(link,new Counter(0,projectId)); + for (String link:links.keySet()) { + downloadCounters.put(link,new Counter(0,projectId,links.get(link))); } } @@ -305,11 +333,11 @@ * Id of a project for which the links will be searched. * @return List<String> Containing tracked links. */ - private synchronized List<String> getProjectLinks (String projectId) { - List<String> links = new LinkedList<String>(); + private synchronized Map<String,Boolean> getProjectLinks (String projectId) { + Map<String,Boolean> links = new Hashtable<String,Boolean>(); for (String link:downloadCounters.keySet()) { if (downloadCounters.get(link).getProjectId().equals(projectId)) { - links.add(new String(link)); + links.put(new String(link),downloadCounters.get(link).getVisible()); } } return links; @@ -324,10 +352,12 @@ * Map<String,Long> containing link:value pairs. */ public synchronized Map<String,Long> getValuesForPortlet (String projectId) { - List<String> links = getProjectLinks(projectId); + Map<String,Boolean> links = getProjectLinks(projectId); Map<String,Long> values = new Hashtable<String,Long>(links.size()); - for (String link : links) { - values.put(link,downloadCounters.get(link).getValue()); + for (String link : links.keySet()) { + if (links.get(link)) { + values.put(link,downloadCounters.get(link).getValue()); + } } return values; } @@ -384,6 +414,9 @@ for (String link:keys) { temporary = downloadCounters.get(link); Node newCounter = doc.createElement(COUNTER); + Node counterVisibility = doc.createAttribute(VISIBILITY); + counterVisibility.appendChild(doc.createTextNode(temporary.getVisible().toString())); + newCounter.getAttributes().setNamedItem(counterVisibility); Node newLink = doc.createElement(LINK); Node newLinkText = doc.createTextNode(link); @@ -472,11 +505,16 @@ String tempLink = null; String tempValue = null; String tempId = null; + boolean visibility = true; for (int j=0;j< counterProps.getLength() ; j++) { property = counterProps.item(j); if (property.getNodeType()== Node.ELEMENT_NODE){ String nodeTextCnt = XmlTools.unmarshallText(property); if (property.getNodeName().equals(LINK) && nodeTextCnt != null && !nodeTextCnt.trim().equals("")) { + String visibilityAtt = XmlTools.getAttributeValue(property,VISIBILITY); + if (visibilityAtt!=null && visibilityAtt.equals(FALSE)) { + visibility = false; + } tempLink = nodeTextCnt.trim(); } else if (property.getNodeName().equals(VALUE) && nodeTextCnt !=null && !nodeTextCnt.trim().equals("")) { tempValue = nodeTextCnt.trim(); @@ -486,7 +524,7 @@ } } if (tempLink!=null && tempValue!=null && tempId!=null) { - values.put(tempLink,new Counter(Long.valueOf(tempValue),tempId)); + values.put(tempLink,new Counter(Long.valueOf(tempValue),tempId,visibility)); } } } |
From: <jbo...@li...> - 2005-12-25 00:33:24
|
Author: unibrew Date: 2005-12-24 19:33:18 -0500 (Sat, 24 Dec 2005) New Revision: 1930 Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollTools.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsDescriptor.java trunk/forge/portal-extensions/polls/src/java/org/jboss/forge/polls/PollsPortlet.java Log: [JBLAB-407] PollsPortlet can work now as RandomPollPortlet too. Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollTools.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollTools.java 2005-12-25 00:30:23 UTC (rev 1929) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollTools.java 2005-12-25 00:33:18 UTC (rev 1930) @@ -26,6 +26,7 @@ import java.io.File; import java.util.Collection; import java.util.HashSet; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; @@ -56,6 +57,17 @@ public static final String ERROR_PARAMETER_NAME = "error"; /** + * Name of the request parameter which contains pollId. + */ + public static final String POLLID_PARAMETER_NAME = "pollId"; + + + /** + * Name of the request parameter which contains projectId. + */ + public static final String PROJECTID_PARAMETER_NAME = "projectId"; + + /** * Value of request parameter for false. */ public static final String FALSE = "false"; @@ -91,6 +103,17 @@ public static final String POLLS_DETAILS_JSP="polls_details.jsp"; /** + * Variable describes type for creating the context - one poll only should be included. + */ + public static final boolean ONE_TYPE = true; + + /** + * Variable describes type for creating the context - all poll's for project should be included. + */ + public static final boolean ALL_TYPE = false; + + + /** * Private constructor made in order to prevent from creating * PollTools object. */ @@ -187,6 +210,36 @@ } /** + * This method returns one of the projectId names which have defined polls. + * @param portalName + * Portal name. + * @param cm + * ContentManager object. + * @return + * Random projectId name. + */ + public static String getRandomDefinedProjectId (String portalName,ContentManager cm) { + List<String> projectIds = getDesc(portalName,cm).getTrackedProjectIds(); + return projectIds.get((int)(Math.random()*projectIds.size())); + } + + /** + * This method returns one of the Polls for specified projectId name. + * @param projectId + * Project id name for which the random Poll is requested. + * @param portalName + * Portal name. + * @param cm + * ContentManager object. + * @return + * Random pollId name. + */ + public static String getRandomPollForProjectId (String projectId,String portalName, ContentManager cm) { + List<Poll> polls = getDesc(portalName,cm).getPollsInfoForProject(projectId); + return polls.get((int)(Math.random()*polls.size())).getPollId(); + } + + /** * This method produces conten context for JSP view file showing * information about voting. * @param portalName @@ -197,11 +250,13 @@ * ContentManager object used for access to cms. * @param response * JBossRenderResponse object which is used for creating urls. + * @param pollIdSpecified + * The poll identification number specified if only one poll should be displayed. * @return * Content context for information JSP page. */ public static DelegateContext getInfoContext (final String portalName,final String projectId, - ContentManager cm,JBossRenderResponse response) { + ContentManager cm,JBossRenderResponse response, String pollIdSpecified) { // If the projectId is null method returns empty DelegateContext object. if (projectId==null) { @@ -227,6 +282,16 @@ // Getting the polls for given projectId. Map<String,Poll> values = desc.getPollsStatsForProject(projectId); + if (pollIdSpecified!=null) { + Set<String> retaininingPoll = new HashSet<String>(1); + retaininingPoll.add(pollIdSpecified); + values.keySet().retainAll(retaininingPoll); + } + + for (String elo : values.keySet()) { + System.out.println ("ZOSTAŁO: "+elo); + } + // Filling the context for portlet. /** * Context structure: @@ -250,8 +315,9 @@ temporary = values.get(pollId); poll.put("question",temporary.getQuestion()); poll.put("renderUrl",url.toString()); - url.setParameter("pollId",pollId); - url.setParameter("details","true"); + url.setParameter(POLLID_PARAMETER_NAME,pollId); + url.setParameter(DETAILED_VIEW_REQUEST,TRUE); + url.setParameter(PROJECTID_PARAMETER_NAME,projectId); poll.put("renderUrlDetailed",url.toString()); for (String tempAnswer : temporary.getAnswers()) { @@ -333,6 +399,8 @@ PortletURL url = response.createRenderURL(); poll.put("renderUrlVoting",url.toString()); url.setParameter(VOTED_PARAMETER_NAME,TRUE); + url.setParameter(POLLID_PARAMETER_NAME,pollId); + url.setParameter(PROJECTID_PARAMETER_NAME,projectId); poll.put("renderUrlInfo",url.toString()); for (String answer : answers) { @@ -366,7 +434,7 @@ * Content context for detailed information JSP page. */ public static DelegateContext getVotingContext (String portalName, String projectId, - String error, ContentManager cm,JBossRenderResponse response) { + String error, ContentManager cm,JBossRenderResponse response, String pollIdSpecified) { // If the projectId is null method returns empty DelegateContext object. if (projectId==null) { @@ -389,8 +457,15 @@ return ctx; } - List<Poll> pollDesc = desc.getPollsInfoForProject(projectId); + List<Poll> pollDesc=null; + if (pollIdSpecified!=null && !pollIdSpecified.equals("")) { + pollDesc = new LinkedList<Poll>(); + pollDesc.add(desc.getPoll(projectId,pollIdSpecified)); + } else { + pollDesc = desc.getPollsInfoForProject(projectId); + } + // Filling the context for portlet. /** * Context structure: Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsDescriptor.java 2005-12-25 00:30:23 UTC (rev 1929) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsDescriptor.java 2005-12-25 00:33:18 UTC (rev 1930) @@ -342,6 +342,19 @@ } /** + * Method produces copy of all projectId names which have defined Polls. + * @return + * List<String> of all projectId names. + */ + public synchronized List<String> getTrackedProjectIds() { + List<String> copy = new ArrayList<String>(polls.size()); + for ( String projectId : polls.keySet()){ + copy.add(projectId); + } + return copy; + } + + /** * Method simply returns Poll object for specified <code>projectId</code> * and <code>pollId</code> * @param projectId Modified: trunk/forge/portal-extensions/polls/src/java/org/jboss/forge/polls/PollsPortlet.java =================================================================== --- trunk/forge/portal-extensions/polls/src/java/org/jboss/forge/polls/PollsPortlet.java 2005-12-25 00:30:23 UTC (rev 1929) +++ trunk/forge/portal-extensions/polls/src/java/org/jboss/forge/polls/PollsPortlet.java 2005-12-25 00:33:18 UTC (rev 1930) @@ -25,6 +25,7 @@ import java.io.IOException; +import javax.portlet.PortletConfig; import javax.portlet.PortletException; import javax.portlet.PortletRequestDispatcher; import javax.portlet.PortletSession; @@ -74,9 +75,9 @@ // Getting name of the project on which the download counter is used. String projectId = ProjectsHelper.getSelectedProjectId(request); - + ProjectsHelper.prepareRequest(request); - + // Getting User from request. User user = request.getUser(); if (user!=null) { @@ -92,27 +93,66 @@ // Adding eventuall errors information to the context. String errorReq = request.getParameter (PollTools.ERROR_PARAMETER_NAME); + // Checking whether user has requested to view detailed scores for poll. + String detailedReq = request.getParameter(PollTools.DETAILED_VIEW_REQUEST); + + // This variable contains manually requested pollId to render its voting view only. + String pollIdSpecified=null; + + // It is used if an instance have defined preference in instance descriptor. + Object modeFormPref = request.getPreferences().getValue("random",null); + System.out.println ("REQUESTED: "+modeFormPref); + if (modeFormPref!=null && modeFormPref.equals("all") && + (detailedReq!=null && detailedReq.compareTo(PollTools.TRUE)==0)==false && + (voted!=null && voted.compareTo(PollTools.TRUE)==0)==false ) { + projectId = PollTools.getRandomDefinedProjectId(portalName,contentManager); + pollIdSpecified = PollTools.getRandomPollForProjectId(projectId,portalName,contentManager); + } + DelegateContext pollContext=null; PortletRequestDispatcher rd = null; // If user has voted information page with scores will be displayed. if (voted!=null && voted.compareTo(PollTools.TRUE)==0) { System.out.println ("USER VOTED"); + + // Getting pollId about which user wants to see information. + String pollId = request.getParameter(PollTools.POLLID_PARAMETER_NAME); + + // Getting projectId from request in order to check whether it was forced. + String tempProjectId = request.getParameter(PollTools.PROJECTID_PARAMETER_NAME); + if (tempProjectId!=null && !tempProjectId.equals("")) { + projectId = tempProjectId; + } + + System.out.println("POLLID: "+pollId); + System.out.println("PROJECTID: "+projectId); + System.out.println("------------------"); + // Getting the poll context for scores information page. - pollContext = PollTools.getInfoContext(portalName,projectId,contentManager,response); + pollContext = PollTools.getInfoContext(portalName,projectId,contentManager,response,pollId); rd = getPortletContext().getRequestDispatcher( ForgeHelper.createRepoAccessPath(portalName, PollTools .getInfoJsp())); // If user has requested detailed information about voting on specified poll. - } else if (request.getParameter(PollTools.DETAILED_VIEW_REQUEST)!=null && - request.getParameter(PollTools.DETAILED_VIEW_REQUEST).compareTo(PollTools.TRUE)==0 ) { + } else if (detailedReq!=null && detailedReq.compareTo(PollTools.TRUE)==0 ) { System.out.println ("DETAILED VIEW"); // Getting pollId about which user wants to see detailed information. - String pollId = request.getParameter("pollId"); + String pollId = request.getParameter(PollTools.POLLID_PARAMETER_NAME); + // Getting projectId from request in order to check whether it was forced. + String tempProjectId = request.getParameter(PollTools.PROJECTID_PARAMETER_NAME); + if (tempProjectId!=null && !tempProjectId.equals("")) { + projectId = tempProjectId; + } + + System.out.println ("POLLID: "+pollId); + System.out.println ("PROJECTID: "+projectId); + System.out.println ("-------------------"); + // Getting the poll context for detailed voting information on specified poll. pollContext = PollTools.getDetailsContext(portalName,projectId,pollId,contentManager,response); rd = getPortletContext().getRequestDispatcher( @@ -124,7 +164,7 @@ System.out.println ("USER HAVEN'T VOTED"); // Getting the poll voting context. - pollContext = PollTools.getVotingContext(portalName,projectId,errorReq,contentManager,response); + pollContext = PollTools.getVotingContext(portalName,projectId,errorReq,contentManager,response,pollIdSpecified); rd = getPortletContext().getRequestDispatcher( ForgeHelper.createRepoAccessPath(portalName, PollTools .getVotingJsp())); @@ -167,6 +207,8 @@ if (PollTools.getDesc(portalName,contentManager).vote(vote,pollId,userId,projectId)) { // Adding parameter to url which tells doView to render scores information page. response.setRenderParameter(PollTools.VOTED_PARAMETER_NAME,PollTools.TRUE); + response.setRenderParameter(PollTools.POLLID_PARAMETER_NAME,pollId); + response.setRenderParameter(PollTools.PROJECTID_PARAMETER_NAME,projectId); System.out.println ("ZAGŁOSOWANO"); } else { response.setRenderParameter(PollTools.ERROR_PARAMETER_NAME,"You have already voted on that poll"); @@ -177,5 +219,6 @@ response.setRenderParameter(PollTools.ERROR_PARAMETER_NAME,"You haven't given your vote."); } } + } |
From: <jbo...@li...> - 2005-12-25 00:30:28
|
Author: unibrew Date: 2005-12-24 19:30:23 -0500 (Sat, 24 Dec 2005) New Revision: 1929 Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/WeightedScorePlugin.java Log: [JBLAB-580] Weighted scoring plugin for JEMS Matrix implemented. Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/WeightedScorePlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/WeightedScorePlugin.java 2005-12-24 21:09:46 UTC (rev 1928) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/WeightedScorePlugin.java 2005-12-25 00:30:23 UTC (rev 1929) @@ -22,26 +22,58 @@ package org.jboss.forge.status.plugins; +import java.util.Hashtable; import java.util.Iterator; +import java.util.Map; +import org.jboss.forge.common.XmlTools; +import org.jboss.logging.Logger; +import org.w3c.dom.Node; + + + + /** * @author Pawel Wrzeszcz */ public class WeightedScorePlugin extends ScorePlugin { + private Map<String,Integer> properties; + public WeightedScorePlugin() { super(); } + + + @Override + public void init(String id, Node propertiesNode) throws InvalidPluginPropertiesException { + super.init(id, propertiesNode); + Map<String,String> props = XmlTools.getMapFromNodeElements(propertiesNode); + properties = new Hashtable<String,Integer>(props.size()); + for (String key : props.keySet()) { + try { + Integer value = Integer.parseInt(props.get(key)); + properties.put(key,value); + } catch (NumberFormatException e) { + Logger log = Logger.getLogger(this.getClass()); + log.error("[STATUS] Incorrect weight format in xml descriptor: "+props.get(key)); + } + } + } + + + public long getValue(String projectId) { int total = 0; - for (Iterator iter = plugins.values().iterator(); iter.hasNext();) { - Plugin plugin = (Plugin) iter.next(); - - total += plugin.getValue(projectId); // TODO weights + for (String pluginName : plugins.keySet()) { + Plugin plugin = plugins.get(pluginName); + if (properties.containsKey(pluginName)) { + total += plugin.getValue(projectId)*properties.get(pluginName); + } } return total; |
From: <jbo...@li...> - 2005-12-23 08:03:34
|
Author: mic...@jb... Date: 2005-12-23 02:55:06 -0500 (Fri, 23 Dec 2005) New Revision: 1927 Added: trunk/labs/jbossrules/drools-repository/doc/ trunk/labs/jbossrules/drools-repository/doc/RepositorySpec.odt trunk/labs/jbossrules/drools-repository/doc/model.vsd trunk/labs/jbossrules/drools-repository/lib/ trunk/labs/jbossrules/drools-repository/lib/commons-collections-3.1.jar trunk/labs/jbossrules/drools-repository/lib/concurrent-1.3.4.jar trunk/labs/jbossrules/drools-repository/lib/derby-10.1.1.0.jar trunk/labs/jbossrules/drools-repository/lib/geronimo-spec-jta-1.0-M1.jar trunk/labs/jbossrules/drools-repository/lib/jackrabbit-1.0-SNAPSHOT.jar trunk/labs/jbossrules/drools-repository/lib/jcr-1.0.jar trunk/labs/jbossrules/drools-repository/lib/junit-3.8.1.jar trunk/labs/jbossrules/drools-repository/lib/log4j-1.2.8.jar trunk/labs/jbossrules/drools-repository/lib/lucene-1.4.3.jar trunk/labs/jbossrules/drools-repository/lib/xercesImpl-2.6.2.jar trunk/labs/jbossrules/drools-repository/lib/xmlParserAPIs-2.0.2.jar trunk/labs/jbossrules/drools-repository/repotest/ trunk/labs/jbossrules/drools-repository/repotest/jaas.config trunk/labs/jbossrules/drools-repository/repotest/repository.xml trunk/labs/jbossrules/drools-repository/src/ trunk/labs/jbossrules/drools-repository/src/main/ trunk/labs/jbossrules/drools-repository/src/main/org/ trunk/labs/jbossrules/drools-repository/src/main/org/drools/ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Asset.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Rule.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleBase.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSet.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetConfig.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetFile.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/VersionInfo.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryServiceFactory.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RuleRepositoryException.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java trunk/labs/jbossrules/drools-repository/src/test/ trunk/labs/jbossrules/drools-repository/src/test/org/ trunk/labs/jbossrules/drools-repository/src/test/org/drools/ trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/ trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jackrabbit/ trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jackrabbit/JCRTest.java trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/ trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java Log: initial pre-christmas version Added: trunk/labs/jbossrules/drools-repository/doc/RepositorySpec.odt =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/doc/RepositorySpec.odt ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/doc/model.vsd =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/doc/model.vsd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/lib/commons-collections-3.1.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/lib/commons-collections-3.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/lib/concurrent-1.3.4.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/lib/concurrent-1.3.4.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/lib/derby-10.1.1.0.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/lib/derby-10.1.1.0.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/lib/geronimo-spec-jta-1.0-M1.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/lib/geronimo-spec-jta-1.0-M1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/lib/jackrabbit-1.0-SNAPSHOT.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/lib/jackrabbit-1.0-SNAPSHOT.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/lib/jcr-1.0.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/lib/jcr-1.0.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/lib/junit-3.8.1.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/lib/junit-3.8.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/lib/log4j-1.2.8.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/lib/log4j-1.2.8.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/lib/lucene-1.4.3.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/lib/lucene-1.4.3.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/lib/xercesImpl-2.6.2.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/lib/xercesImpl-2.6.2.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/lib/xmlParserAPIs-2.0.2.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-repository/lib/xmlParserAPIs-2.0.2.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/drools-repository/repotest/jaas.config =================================================================== --- trunk/labs/jbossrules/drools-repository/repotest/jaas.config 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/repotest/jaas.config 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,3 @@ +Jackrabbit { + org.apache.jackrabbit.core.security.SimpleLoginModule required anonymousId="anonymous"; +}; \ No newline at end of file Property changes on: trunk/labs/jbossrules/drools-repository/repotest/jaas.config ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/repotest/repository.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/repotest/repository.xml 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/repotest/repository.xml 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<Repository> + <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> + <param name="path" value="${rep.home}/repository"/> + </FileSystem> + <Security appName="Jackrabbit"> + <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager"/> + </Security> + <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" /> + <Workspace name="${wsp.name}"> + <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> + <param name="path" value="${wsp.home}"/> + </FileSystem> + <PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" /> + <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> + <param name="path" value="${wsp.home}/index"/> + </SearchIndex> + </Workspace> + <Versioning rootPath="${rep.home}/versions"> + <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> + <param name="path" value="${rep.home}/versions"/> + </FileSystem> + <PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" /> + </Versioning> +</Repository> \ No newline at end of file Property changes on: trunk/labs/jbossrules/drools-repository/repotest/repository.xml ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Asset.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Asset.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Asset.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,32 @@ +package org.drools.metamodel; + +import java.io.Serializable; + +/** + * This is the superclass for all metamodel repository classes. + * They are all assets. Some just have more assets then others. + * @author <a href="mailto:mic...@gm..."> Michael Neale</a> + */ +public class Asset implements Serializable +{ + /* + * This is based on the <a href="http://dublincore.org/documents/dces/"> Dublin Core</a> + * specification, plus a little bit more, and a little bit less. Not all of these fields will be used. + */ + public String name; + public String creator; + public String subject; + public String description; + public String publisher; + public String contributor; + public java.util.Date dateCreated; + public String format; + public String source; + public String language; + public String relation; + public String coverage; + public String rights; + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Asset.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,32 @@ +package org.drools.metamodel; + +/** + * This represents the content for a ruleset which is managed as one unit. + * @author <a href="mailto:mic...@gm..."> Michael Neale</a> + * + */ +public class DRLSourceFile extends RuleSetFile +{ + + private String content; + + + public DRLSourceFile(String content, String name) { + super.name = name; + this.content = content; + + } + + public String getContent() + { + return content; + } + + public void setContent(String content) + { + this.content = content; + } + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/DRLSourceFile.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Rule.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Rule.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Rule.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,10 @@ +package org.drools.metamodel; + +import java.util.Properties; + +public class Rule extends Asset +{ + private Properties properties; + private VersionInfo versionInfo; + private String fragment; +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/Rule.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleBase.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleBase.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleBase.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,38 @@ +package org.drools.metamodel; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * A rulebase view of the repository. + * + * @author <a href="mailto:mic...@gm..."> Michael Neale</a> + * + */ +public class RuleBase extends Asset +{ + + protected Collection ruleSets; + protected Collection ruleSetFiles; + + public RuleBase(String name) { + super.name = name; + ruleSets = new ArrayList(); + ruleSetFiles = new ArrayList(); + } + + public void addRuleSet(RuleSet rs) { + ruleSets.add(rs); + } + + public void addRuleSetFile(RuleSetFile rs) { + ruleSetFiles.add(rs); + } + + + + + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleBase.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSet.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSet.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSet.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,12 @@ +package org.drools.metamodel; + +import java.util.List; + +public class RuleSet extends Asset +{ + private RuleSetConfig config; + private List rules; + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSet.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetConfig.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetConfig.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetConfig.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,16 @@ +package org.drools.metamodel; + +import java.util.Properties; + +public class RuleSetConfig extends Asset +{ + private Properties imports; + private String functions; + private Properties applicationData; + private VersionInfo versionInfo; + + + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetConfig.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetFile.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetFile.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetFile.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,11 @@ +package org.drools.metamodel; + +public class RuleSetFile extends Asset +{ + + private VersionInfo versionInfo; + + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/RuleSetFile.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/VersionInfo.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/VersionInfo.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/VersionInfo.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,43 @@ +package org.drools.metamodel; + +/** + * This represents some information about the version, as it was checked in. + * @author <a href="mailto:mic...@gm..."> Michael Neale</a> + */ +public class VersionInfo extends Asset +{ + private String comment; + private long versionNumber; + private String status; + + public VersionInfo(String comment, long versionNumber, String status) { + this.comment = comment; + this.versionNumber = versionNumber; + this.status = status; + } + + public VersionInfo nextVersion(String comment) { + return new VersionInfo(comment, versionNumber + 1, this.status); + } + public VersionInfo nextVersion(String comment, String newStatus) { + return new VersionInfo(comment, versionNumber + 1, newStatus); + } + + + + public String getComment() + { + return comment; + } + public String getStatus() + { + return status; + } + public long getVersionNumber() + { + return versionNumber; + } + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/metamodel/VersionInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,111 @@ +package org.drools.repo; + +import java.util.List; +import java.util.Properties; + +import org.drools.metamodel.Asset; +import org.drools.metamodel.Rule; +import org.drools.metamodel.RuleBase; +import org.drools.metamodel.RuleSet; +import org.drools.metamodel.RuleSetConfig; +import org.drools.metamodel.RuleSetFile; +import org.drools.metamodel.VersionInfo; + + +public interface RepositoryService +{ + /** + * Nodes are represented with a "drools:..." prefix to prevent namespace collisions for people + * using a shared repository (shared with a CMS for instance). + */ + public static final String RULE_NAMESPACE_PREFIX = "drools"; + public static final String RULE_NAMESPACE = "http://www.drools.org/repo"; + + + /** + * This will mark the asset as checked out by the current user. + * + * The idea is to prevent anyone else working on it at the same time. + * Assets needs to be checked out, so when they are checked in their versions are updated. + * This may also lock the asset, not sure... + * Can provide seperate explicit lock methods if needed. + */ + public RuleSetFile checkoutFile(String ruleBaseName, String ruleSetName); + public RuleSetConfig checkoutRuleSetConfig(String ruleBaseName, String ruleSetName); + public Rule checkoutRule(String ruleBaseName, String ruleSetName, String ruleName); + + + /** + * These methods add brand new assets to the repository. + * Exceptions thrown if you don't fill out the right stuff etc. + * The names must be unique of course, or exceptions will be thrown. + */ + public RuleSetFile addNewFile(String ruleBaseName, RuleSetFile file); + public RuleSet addNewRuleSet(String ruleBaseName, RuleSet ruleSet); + public Rule addNewRule(String ruleBaseName, String ruleSetName, Rule rule); + + + /** + * This method updates the asset in the repository, and + * increment the version number etc. + * If someone else beat you to it, it will chuck a wobbly. Whereby you + * can tell the poor user, they are going to have to find out who it was, + * and throw a phone at their heads, russle crowe style. + * Of course, with checkouts, it should stop anyone else checking it out. + */ + public VersionInfo checkin(Asset asset, String comment); + + /** + * This will change the status flag on the latest version of the asset. + * It will make sure that your version is up to date before allowing it. + */ + public VersionInfo changeStatus(Asset asset, String newStatus); + + + /** + * Returns a list of rulebase names in the repository. + */ + public List listRuleBaseName(); + + + /** + * This returns a list of rule-set names for a given rulebase. + */ + public List listRuleSetNames(String ruleBase); + + + /** + * This will deeply load the whole RuleSet. + */ + public RuleSet retrieveRuleSet(String ruleBaseName, String ruleSetName); + + + /** + * This will load a RuleSetFile. + */ + public RuleSetFile retrieveRuleSetFile(String ruleBaseName, String ruleSetName); + + + /** + * Haven't really defined how to search for things, + * but will be on most fields. + * Can return a list of assets that match, which could be rules, rulesets etc... + * Probably need some canned queries, as well as some XPath ones. + * Can do things like search for rules modified on a certain date, in various states etc. + * TODO: get a list of basic functionality to support. + */ + public List searchRules(Properties searchProperties); + + + + /** + * Sets up a virgin repository. Only needs to be called once. + */ + public void createNewRepo(); + + + + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryService.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryServiceFactory.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryServiceFactory.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryServiceFactory.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,31 @@ +package org.drools.repo; + +import javax.jcr.RepositoryException; +import javax.naming.NamingException; + +import org.drools.repo.jcr.JCRSessionUtil; +import org.drools.repo.jcr.RepositoryServiceImpl; + +public class RepositoryServiceFactory +{ + + public static RepositoryService getRepositoryService() { + JCRSessionUtil factory = new JCRSessionUtil(); + RepositoryService service = null; + try + { + service = new RepositoryServiceImpl(factory.getSession()); + } + catch ( NamingException e ) + { + throw new RuleRepositoryException(e); + } + catch ( RepositoryException e ) + { + throw new RuleRepositoryException(e); + } + return service; + } + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RepositoryServiceFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RuleRepositoryException.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RuleRepositoryException.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RuleRepositoryException.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,17 @@ +package org.drools.repo; + +public class RuleRepositoryException extends RuntimeException +{ + public RuleRepositoryException(Throwable cause) { + super(cause); + } + + public RuleRepositoryException(String message, Throwable cause) { + super(message, cause); + } + + public RuleRepositoryException(String message) { + super(message); + } + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/RuleRepositoryException.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,53 @@ +package org.drools.repo.jcr; + +import java.util.Hashtable; + +import javax.jcr.Repository; +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.jcr.SimpleCredentials; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +import org.apache.jackrabbit.core.jndi.RegistryHelper; + +/** + * This is a dirty hack of a class while I get the hang of using JCR in and + * outside of containers. + * @author <a href="mailto:mic...@gm..."> Michael Neale</a> + * + */ +public class JCRSessionUtil +{ + + public Session getSession() throws NamingException, RepositoryException { + + System.setProperty("java.security.auth.login.config", "c:/jaas.config"); + String configFile = "repotest/repository.xml"; + String repHomeDir = "repotest"; + + Hashtable env = new Hashtable( ); + env.put( Context.INITIAL_CONTEXT_FACTORY, + "org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory" ); + env.put( Context.PROVIDER_URL, + "localhost" ); + + InitialContext ctx = new InitialContext( env ); + + //configure repo, if its not already + RegistryHelper.registerRepository( ctx, + "repo", + configFile, + repHomeDir, + true ); + Repository r = (Repository) ctx.lookup( "repo" ); + + Session session = r.login( new SimpleCredentials( "userid", + "".toCharArray( ) ), + null ); + return session; + + } + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/JCRSessionUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,295 @@ +package org.drools.repo.jcr; + +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import javax.jcr.NamespaceRegistry; +import javax.jcr.Node; +import javax.jcr.NodeIterator; +import javax.jcr.PathNotFoundException; +import javax.jcr.RepositoryException; +import javax.jcr.Session; + +import org.drools.metamodel.Asset; +import org.drools.metamodel.DRLSourceFile; +import org.drools.metamodel.Rule; +import org.drools.metamodel.RuleSet; +import org.drools.metamodel.RuleSetConfig; +import org.drools.metamodel.RuleSetFile; +import org.drools.metamodel.VersionInfo; +import org.drools.repo.RepositoryService; +import org.drools.repo.RuleRepositoryException; + +public class RepositoryServiceImpl + implements + RepositoryService +{ + private Session session; + + public RepositoryServiceImpl(Session session) + { + this.session = session; + + } + + public void createNamespace() + { + try + { + NamespaceRegistry reg = this.session.getWorkspace( ).getNamespaceRegistry( ); + if ( nameSpaceExists( reg ) ) + { + return; + } + else + { + log( "Registering new Namespace" ); + reg.registerNamespace( RepositoryService.RULE_NAMESPACE_PREFIX, + RepositoryService.RULE_NAMESPACE ); + } + } + catch ( RepositoryException e ) + { + throw new RuleRepositoryException( e ); + } + + } + + public void createNewRepo() + { + createNamespace( ); + createRuleRepoNode( ); + + + } + + private void createRuleRepoNode() + { + try + { + Node rn = this.session.getRootNode( ); + if ( !rn.hasNode( nodeNameOf( "repository" ) ) ) + { + this.session.getRootNode( ).addNode( nodeNameOf( "repository" ) ); + } + } + catch ( Exception e ) + { + throw new RuleRepositoryException( "Unable to create new repository root node.", + e ); + } + } + + private String nodeNameOf(String string) + { + return RepositoryService.RULE_NAMESPACE_PREFIX + ":" + string; + } + + private void log(String string) + { + System.out.println( "REPO:" + string ); + } + + private boolean nameSpaceExists(NamespaceRegistry registry) throws RepositoryException + { + String[] uris = registry.getURIs( ); + for ( int i = 0; i < uris.length; i++ ) + { + if ( uris[i].equals( RepositoryService.RULE_NAMESPACE ) ) + { + log( "Name space already exists." ); + return true; + } + } + return false; + + } + + public void xxxxsaveNewRuleset(String name, + String content) + { + Node repo = getRepository( ); + try + { + Node ruleset = repo.addNode(nodeNameOf("ruleset")); + ruleset.setProperty("content", content); + ruleset.setProperty("ruleset-name", name); + save(); + } + catch ( Exception e ) { + throw new RuleRepositoryException("Unable to add a new Ruleset called: " + name, e); + } + } + + private Node getRepository() + { + try + { + return session.getRootNode().getNode(nodeNameOf("repository")); + } + catch ( PathNotFoundException e ) + { + throw new RuleRepositoryException("Unable to find repository root node. Repository may not have been setup correctly.", e); + } + catch ( RepositoryException e ) + { + throw new RuleRepositoryException(e); + } + } + + public List xxxxfindAllRuleSetDRL() + { + List rulesets = new ArrayList(); + Node repo = getRepository(); + try + { + NodeIterator nodeIt = repo.getNodes(); + while(nodeIt.hasNext()) { + Node rulesetNode = nodeIt.nextNode(); + String content = rulesetNode.getProperty("content").getString(); + String name = rulesetNode.getProperty("ruleset-name").getString(); + DRLSourceFile drl = new DRLSourceFile(content, name); + rulesets.add(drl); + } + } + catch ( RepositoryException e ) + { + throw new RuleRepositoryException("Unable to list rulesets.", e); + } + return rulesets; + } + + public void save() { + try + { + session.save( ); + } + catch ( Exception e ) + { + throw new RuleRepositoryException( "Unable to save session.", + e ); + } + } + + public void xxxxeraseAllRuleSetDRL() + { + + Node repo = this.getRepository(); + NodeIterator it; + try + { + it = repo.getNodes(); + while (it.hasNext()) { + it.nextNode().remove(); + } + save(); + } + catch ( RepositoryException e ) + { + throw new RuleRepositoryException("Unable to delete DRL nodes.", e); + } + } + + + + public RuleSetFile addNewRulesetFile(RuleSetFile file, + String initialComment) + { + // TODO Auto-generated method stub + return null; + } + + public RuleSetFile checkoutFile(String ruleBaseName, + String ruleSetName) + { + // TODO Auto-generated method stub + return null; + } + + public RuleSetConfig checkoutRuleSetConfig(String ruleBaseName, + String ruleSetName) + { + // TODO Auto-generated method stub + return null; + } + + public Rule checkoutRule(String ruleBaseName, + String ruleSetName, + String ruleName) + { + // TODO Auto-generated method stub + return null; + } + + public RuleSetFile addNewFile(String ruleBaseName, + RuleSetFile file) + { + // TODO Auto-generated method stub + return null; + } + + public RuleSet addNewRuleSet(String ruleBaseName, + RuleSet ruleSet) + { + // TODO Auto-generated method stub + return null; + } + + public Rule addNewRule(String ruleBaseName, + String ruleSetName, + Rule rule) + { + // TODO Auto-generated method stub + return null; + } + + public VersionInfo checkin(Asset asset, + String comment) + { + // TODO Auto-generated method stub + return null; + } + + public VersionInfo changeStatus(Asset asset, + String newStatus) + { + // TODO Auto-generated method stub + return null; + } + + public List listRuleBaseName() + { + // TODO Auto-generated method stub + return null; + } + + public List listRuleSetNames(String ruleBase) + { + // TODO Auto-generated method stub + return null; + } + + public RuleSet retrieveRuleSet(String ruleBaseName, + String ruleSetName) + { + // TODO Auto-generated method stub + return null; + } + + public RuleSetFile retrieveRuleSetFile(String ruleBaseName, + String ruleSetName) + { + // TODO Auto-generated method stub + return null; + } + + public List searchRules(Properties searchProperties) + { + // TODO Auto-generated method stub + return null; + } + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/org/drools/repo/jcr/RepositoryServiceImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jackrabbit/JCRTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jackrabbit/JCRTest.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jackrabbit/JCRTest.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,102 @@ +package org.drools.repo.jackrabbit; + +import junit.framework.TestCase; + +import java.util.Hashtable; + +import javax.jcr.*; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +import org.apache.jackrabbit.core.jndi.RegistryHelper; + +public class JCRTest extends TestCase +{ + + public void testInitial() throws Exception + { + setupJAAS( ); + Session session = getSession( ); + String[] uris = session.getWorkspace().getNamespaceRegistry().getURIs(); // .registerNamespace("drools", "https://www.drools.org/repo"); + basicCase( session ); + + addSomething( session); + } + + private static void addSomething(Session session) throws Exception { + + Node node = session.getRootNode(); + + node.setProperty("drools:rules", "yeah"); + node.save(); + + session.save(); + + } + + private static void basicCase(Session session) + { + try + { + + + + Node rn = session.getRootNode( ); + + System.out.println( rn.getPrimaryNodeType( ).getName( ) ); + + } + catch ( Exception e ) + { + System.err.println( e ); + } + } + + private static Session getSession() throws NamingException, + RepositoryException, + LoginException, + NoSuchWorkspaceException + { + String configFile = "repotest/repository.xml"; + String repHomeDir = "repotest"; + + Hashtable env = new Hashtable( ); + env.put( Context.INITIAL_CONTEXT_FACTORY, + "org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory" ); + env.put( Context.PROVIDER_URL, + "localhost" ); + InitialContext ctx = new InitialContext( env ); + + registerRepo( configFile, + repHomeDir, + ctx ); + Repository r = (Repository) ctx.lookup( "repo" ); + + Session session = r.login( new SimpleCredentials( "userid", + "".toCharArray( ) ), + null ); + return session; + } + + private static void registerRepo(String configFile, + String repHomeDir, + InitialContext ctx) throws NamingException, + RepositoryException + { + RegistryHelper.registerRepository( ctx, + "repo", + configFile, + repHomeDir, + true ); + } + + private static void setupJAAS() + { + System.setProperty("java.security.auth.login.config", "c:/jaas.config"); + } + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jackrabbit/JCRTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java 2005-12-23 07:52:33 UTC (rev 1926) +++ trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java 2005-12-23 07:55:06 UTC (rev 1927) @@ -0,0 +1,31 @@ +package org.drools.repo.jcr; + +import java.util.List; + +import junit.framework.TestCase; + +import org.drools.repo.RepositoryServiceFactory; + +public class RepositoryServiceImplTest extends TestCase +{ + + + public void testCreateNewAndDelete() { + RepositoryServiceImpl repo = (RepositoryServiceImpl) RepositoryServiceFactory.getRepositoryService(); + repo.createNewRepo(); + + repo.xxxxeraseAllRuleSetDRL(); + + repo.xxxxsaveNewRuleset("My Ruleset", "vkahijkhfhdsjkfhdsh"); + + List rulesets = repo.xxxxfindAllRuleSetDRL(); + + System.out.println(rulesets.size()); + + + } + + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/test/org/drools/repo/jcr/RepositoryServiceImplTest.java ___________________________________________________________________ Name: svn:eol-style + native |
From: <jbo...@li...> - 2005-12-23 07:52:39
|
Author: mic...@jb... Date: 2005-12-23 02:52:33 -0500 (Fri, 23 Dec 2005) New Revision: 1926 Added: trunk/labs/jbossrules/drools-repository/ Log: Created directory drools-repository |
From: <jbo...@li...> - 2005-12-23 03:50:26
|
Author: mic...@jb... Date: 2005-12-22 22:50:14 -0500 (Thu, 22 Dec 2005) New Revision: 1925 Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/lexer/SimpleSnippetLexer.java trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/lexer/SimpleSnippetLexerTest.java Log: Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/lexer/SimpleSnippetLexer.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/lexer/SimpleSnippetLexer.java 2005-12-22 16:11:59 UTC (rev 1924) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/lexer/SimpleSnippetLexer.java 2005-12-23 03:50:14 UTC (rev 1925) @@ -13,8 +13,6 @@ * * Validates that brackets and quotes are balanced. * - * TODO: Build a "grammar aware" lexer so square brackets aren't always needed. - * It would need to extend this one, I think. * * @author <a href="mailto:mic...@gm..."> Michael Neale</a> * Modified: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/lexer/SimpleSnippetLexerTest.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/lexer/SimpleSnippetLexerTest.java 2005-12-22 16:11:59 UTC (rev 1924) +++ trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/lexer/SimpleSnippetLexerTest.java 2005-12-23 03:50:14 UTC (rev 1925) @@ -111,7 +111,7 @@ } public void testRemoveTabsAndNewLines() { - String sample = "[Age of] \n \r bob \t [less [] than] 35"; + String sample = "[Age of] \n \r bob \t [less [] than] 35"; NaturalSnippetLexer lex = new SimpleSnippetLexer(sample); List rawTokens = lex.getRawTokens().getTokens(); @@ -124,6 +124,7 @@ assertEquals(expected, rawTokens); } + } |
Author: aron.gombas Date: 2005-12-22 09:59:52 -0500 (Thu, 22 Dec 2005) New Revision: 1923 Added: trunk/labs/kosmos/web-portlet/pages/jira_monitoring_assignee_details.jsp Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/portlet/jira/JiraMonitoringPortlet.java trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_fr.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_hu.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_pl.properties trunk/labs/kosmos/web-portlet/pages/jira_monitoring.jsp trunk/labs/kosmos/web-portlet/pages/jira_monitoring_issue_details.jsp trunk/labs/kosmos/web-portlet/pages/jira_monitoring_project_details.jsp Log: JIRA: new subscreen "Assignee Details" Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/portlet/jira/JiraMonitoringPortlet.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/portlet/jira/JiraMonitoringPortlet.java 2005-12-22 14:54:19 UTC (rev 1922) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/portlet/jira/JiraMonitoringPortlet.java 2005-12-22 14:59:52 UTC (rev 1923) @@ -88,7 +88,7 @@ if(id != null) { // show details String action = request.getParameter("action"); - String page = action.equals("viewProjectDetails") ? "/pages/jira_monitoring_project_details.jsp" : "/pages/jira_monitoring_issue_details.jsp"; + String page = action.equals("viewProjectDetails") ? "/pages/jira_monitoring_project_details.jsp" : (action.equals("viewAssigneeDetails") ? "/pages/jira_monitoring_assignee_details.jsp" : "/pages/jira_monitoring_issue_details.jsp"); JiraProject project = (JiraProject)ModelUtils.findInCollection(projects, id); if(project != null) { Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring.properties 2005-12-22 14:54:19 UTC (rev 1922) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring.properties 2005-12-22 14:59:52 UTC (rev 1923) @@ -8,6 +8,7 @@ jiraproject.key=Key jiraproject.lead=Lead jiraproject.assignees=Assignees +jiraproject.assigneeDetails=Assignee Details jiraproject.issueDetails=Issue Details jiraproject.description=Description Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_fr.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_fr.properties 2005-12-22 14:54:19 UTC (rev 1922) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_fr.properties 2005-12-22 14:59:52 UTC (rev 1923) @@ -8,6 +8,7 @@ jiraproject.key=Cl\u00e9 jiraproject.lead=Responsable jiraproject.assignees=Assignees_fr +jiraproject.assigneeDetails=Assignee Details_fr jiraproject.issueDetails=D\u00e9tails des demandes jiraproject.description=Description Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_hu.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_hu.properties 2005-12-22 14:54:19 UTC (rev 1922) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_hu.properties 2005-12-22 14:59:52 UTC (rev 1923) @@ -8,6 +8,7 @@ jiraproject.key=Azonos jiraproject.lead=Vezetiraproject.assignees=Illetsek +jiraproject.assigneeDetails=Assignee Details_hu jiraproject.issueDetails=HibRletesen jiraproject.description=Les Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_pl.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_pl.properties 2005-12-22 14:54:19 UTC (rev 1922) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_pl.properties 2005-12-22 14:59:52 UTC (rev 1923) @@ -8,6 +8,7 @@ jiraproject.key=Klucz jiraproject.lead=Mened\u017cer projektu jiraproject.assignees=Przydzieleni +jiraproject.assigneeDetails=Assignee Details_pl jiraproject.issueDetails=Szczeg\u00f3\u0142y problemu jiraproject.description=Opis Modified: trunk/labs/kosmos/web-portlet/pages/jira_monitoring.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/jira_monitoring.jsp 2005-12-22 14:54:19 UTC (rev 1922) +++ trunk/labs/kosmos/web-portlet/pages/jira_monitoring.jsp 2005-12-22 14:59:52 UTC (rev 1923) @@ -26,6 +26,9 @@ <display:column titleKey="jiraproject.lead" style="white-space:nowrap" property="lead" sortable="true"/> <display:column titleKey="jiraproject.assignees" style="white-space:nowrap" sortProperty="openIssueAssignees" sortable="true"> <fmt:formatNumber value="${projectsIt.openIssueAssignees}"/> + <a href="<portlet:renderURL><portlet:param name="action" value="viewAssigneeDetails"/><portlet:param name="id" value="<%= pageContext.getAttribute("id").toString() %>"/></portlet:renderURL>"> + <img src="<%= renderRequest.getContextPath() %>/pages/images/info.gif" title="<fmt:message key="jiraproject.assigneeDetails"/>" border="0"/> + </a> </display:column> <display:column titleKey="jiraproject.openIssues" style="white-space:nowrap" sortProperty="openIssues" sortable="true"> <c:if test="${projectsIt.openIssues > 10}"><span class="portlet-msg-error"></c:if> Added: trunk/labs/kosmos/web-portlet/pages/jira_monitoring_assignee_details.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/jira_monitoring_assignee_details.jsp 2005-12-22 14:54:19 UTC (rev 1922) +++ trunk/labs/kosmos/web-portlet/pages/jira_monitoring_assignee_details.jsp 2005-12-22 14:59:52 UTC (rev 1923) @@ -0,0 +1,40 @@ +<%@include file="includes/taglibs.jsp"%> + +<portlet:defineObjects/> +<fmt:setBundle basename="hu.midori.kosmos.portlet.jira.jira_monitoring" scope="application"/> + +<table> + <tr class="portlet-section-body"> + <td valign="top"><fmt:message key="jiraproject.openIssuesByAssignee"/>:</td> + <td valign="top"><img src="<c:out value="${project.openIssuesPerAssigneeChartUrl}"/>" title="<fmt:message key="jiraproject.openIssuesByAssignee"/>"/></td> + <td valign="top"> + + <c:set var="listSize" value="${fn:length(project.openIssuesPerAssignee)}"/> + <c:set var="listIndex" value="0"/> + <%@include file="includes/table_expander.jsp" %> + + <table> + <c:forEach var="item" items="${project.openIssuesPerAssignee}" varStatus="status"> + <c:choose> + <c:when test="${status.index < 10}"> + <tr id="row-<portlet:namespace/>-0-<c:out value="${status.index}"/>" class="portlet-section-alternate"> + </c:when> + <c:otherwise> + <tr id="row-<portlet:namespace/>-0-<c:out value="${status.index}"/>" style="display: none" class="portlet-section-alternate"> + </c:otherwise> + </c:choose> + <td><c:out value="${1 + status.index}"/></td> + <td><c:out value="${item.key}"/></td> + <td><c:out value="${item.value}"/></td> + </tr> + </c:forEach> + </table> + </td> + </tr> + <%@include file="includes/table_footer.jsp"%> +</table> + +<form action="<portlet:renderURL/>" method="post"> + <input type="submit" class="portlet-form-button" name="submit" value="<fmt:message key="action.back"/>"/> +</form> + \ No newline at end of file Modified: trunk/labs/kosmos/web-portlet/pages/jira_monitoring_issue_details.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/jira_monitoring_issue_details.jsp 2005-12-22 14:54:19 UTC (rev 1922) +++ trunk/labs/kosmos/web-portlet/pages/jira_monitoring_issue_details.jsp 2005-12-22 14:59:52 UTC (rev 1923) @@ -5,8 +5,8 @@ <table> <tr class="portlet-section-body"> - <td><fmt:message key="jiraproject.openIssuesByPriority"/>:</td> - <td><img src="<c:out value="${project.openIssuesPerPriorityChartUrl}"/>" title="<fmt:message key="jiraproject.openIssuesByPriority"/>"/></td> + <td valign="top"><fmt:message key="jiraproject.openIssuesByPriority"/>:</td> + <td valign="top"><img src="<c:out value="${project.openIssuesPerPriorityChartUrl}"/>" title="<fmt:message key="jiraproject.openIssuesByPriority"/>"/></td> <td valign="top"> <table> <tr class="portlet-section-alternate"> @@ -30,33 +30,6 @@ </table> </td> </tr> - <tr class="portlet-section-alternate"> - <td valign="top"><fmt:message key="jiraproject.openIssuesByAssignee"/>:</td> - <td valign="top"><img src="<c:out value="${project.openIssuesPerAssigneeChartUrl}"/>" title="<fmt:message key="jiraproject.openIssuesByAssignee"/>"/></td> - <td valign="top"> - - <c:set var="listSize" value="${fn:length(project.openIssuesPerAssignee)}"/> - <c:set var="listIndex" value="0"/> - <%@include file="includes/table_expander.jsp" %> - - <table> - <c:forEach var="item" items="${project.openIssuesPerAssignee}" varStatus="status"> - <c:choose> - <c:when test="${status.index < 10}"> - <tr id="row-<portlet:namespace/>-0-<c:out value="${status.index}"/>" class="portlet-section-body"> - </c:when> - <c:otherwise> - <tr id="row-<portlet:namespace/>-0-<c:out value="${status.index}"/>" style="display: none" class="portlet-section-body"> - </c:otherwise> - </c:choose> - <td><c:out value="${1 + status.index}"/></td> - <td><c:out value="${item.key}"/></td> - <td><c:out value="${item.value}"/></td> - </tr> - </c:forEach> - </table> - </td> - </tr> <%@include file="includes/table_footer.jsp"%> </table> Modified: trunk/labs/kosmos/web-portlet/pages/jira_monitoring_project_details.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/jira_monitoring_project_details.jsp 2005-12-22 14:54:19 UTC (rev 1922) +++ trunk/labs/kosmos/web-portlet/pages/jira_monitoring_project_details.jsp 2005-12-22 14:59:52 UTC (rev 1923) @@ -13,8 +13,8 @@ <td colspan="2"><a href="<c:out value="${project.projectUrl}"/>"><c:out value="${project.projectUrl}"/></a></td> </tr> <tr class="portlet-section-body"> - <td><fmt:message key="jiraproject.issuesByStatus"/>:</td> - <td><img src="<c:out value="${project.issuesPerStatusChartUrl}"/>" title="<fmt:message key="jiraproject.issuesByStatus"/>"/></td> + <td valign="top"><fmt:message key="jiraproject.issuesByStatus"/>:</td> + <td valign="top"><img src="<c:out value="${project.issuesPerStatusChartUrl}"/>" title="<fmt:message key="jiraproject.issuesByStatus"/>"/></td> <td valign="top"> <table> <tr class="portlet-section-alternate"> |
From: <jbo...@li...> - 2005-12-22 14:54:42
|
Author: aron.gombas Date: 2005-12-22 09:54:19 -0500 (Thu, 22 Dec 2005) New Revision: 1922 Added: trunk/labs/kosmos/web-portlet/pages/svn_monitoring_committer_details.jsp Log: Ooops, this file was left out Added: trunk/labs/kosmos/web-portlet/pages/svn_monitoring_committer_details.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/svn_monitoring_committer_details.jsp 2005-12-22 14:39:52 UTC (rev 1921) +++ trunk/labs/kosmos/web-portlet/pages/svn_monitoring_committer_details.jsp 2005-12-22 14:54:19 UTC (rev 1922) @@ -0,0 +1,40 @@ +<%@include file="includes/taglibs.jsp"%> + +<portlet:defineObjects/> +<fmt:setBundle basename="hu.midori.kosmos.portlet.svn.svn_monitoring" scope="application"/> + +<table> + <tr class="portlet-section-body"> + <td valign="top"><fmt:message key="svnrepository.mostActiveCommitters"/>:</td> + <td valign="top"><img src="<c:out value="${repository.commitsPerAuthorChartUrl}"/>" title="<fmt:message key="svnrepository.mostActiveCommitters"/>"/></td> + <td valign="top"> + + <c:set var="listSize" value="${fn:length(repository.commitsPerAuthor)}"/> + <c:set var="listIndex" value="0"/> + <%@include file="includes/table_expander.jsp" %> + + <table> + <c:forEach var="item" items="${repository.commitsPerAuthor}" varStatus="status"> + <c:choose> + <c:when test="${status.index < 10}"> + <tr id="row-<portlet:namespace/>-0-<c:out value="${status.index}"/>" class="portlet-section-alternate"> + </c:when> + <c:otherwise> + <tr id="row-<portlet:namespace/>-0-<c:out value="${status.index}"/>" style="display: none" class="portlet-section-alternate"> + </c:otherwise> + </c:choose> + <td><c:out value="${1 + status.index}"/></td> + <td><c:out value="${item.key}"/></td> + <td><c:out value="${item.value}"/></td> + </tr> + </c:forEach> + </table> + </td> + </tr> + <%@include file="includes/table_footer.jsp"%> +</table> + +<form action="<portlet:renderURL/>" method="post"> + <input type="submit" class="portlet-form-button" name="submit" value="<fmt:message key="action.back"/>"/> +</form> + \ No newline at end of file |
Author: aron.gombas Date: 2005-12-22 09:39:52 -0500 (Thu, 22 Dec 2005) New Revision: 1921 Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/portlet/svn/SvnMonitoringPortlet.java trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_fr.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_hu.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_pl.properties trunk/labs/kosmos/web-portlet/pages/svn_monitoring.jsp trunk/labs/kosmos/web-portlet/pages/svn_monitoring_repository_details.jsp trunk/labs/kosmos/web-portlet/pages/svn_monitoring_revision_details.jsp Log: New SVN subpage: "Committer Details" Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/portlet/svn/SvnMonitoringPortlet.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/portlet/svn/SvnMonitoringPortlet.java 2005-12-22 14:13:56 UTC (rev 1920) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/portlet/svn/SvnMonitoringPortlet.java 2005-12-22 14:39:52 UTC (rev 1921) @@ -88,7 +88,7 @@ if(id != null) { // show details String action = request.getParameter("action"); - String page = action.equals("viewRepositoryDetails") ? "/pages/svn_monitoring_repository_details.jsp" : (action.equals("viewRevisionDetails") ? "/pages/svn_monitoring_revision_details.jsp" : "/pages/svn_monitoring_activity_details.jsp"); + String page = action.equals("viewRepositoryDetails") ? "/pages/svn_monitoring_repository_details.jsp" : (action.equals("viewCommitterDetails") ? "/pages/svn_monitoring_committer_details.jsp" : (action.equals("viewRevisionDetails") ? "/pages/svn_monitoring_revision_details.jsp" : "/pages/svn_monitoring_activity_details.jsp")); SvnRepository repository = (SvnRepository)ModelUtils.findInCollection(repositories, id); if(repository != null) { Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring.properties 2005-12-22 14:13:56 UTC (rev 1920) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring.properties 2005-12-22 14:39:52 UTC (rev 1921) @@ -7,6 +7,7 @@ svnrepository.repositoryDetails=Repository Details svnrepository.revision=Revision svnrepository.revisionDetails=Revision Details +svnrepository.committerDetails=Committer Details svnrepository.activityLast7Days=Activity Last 7 Days svnrepository.activityDetails=Activity Details svnrepository.latestTouchDate=Latest Touch @@ -17,7 +18,7 @@ svnrepository.totalRepositoryEntries=Total Repository Entries svnrepository.totalFileSize=Total File Size svnrepository.repositoryEntryHistory=Repository Entry History -svnrepository.filesPerFileType=Files Per File Type +svnrepository.filesByFileType=Files By File Type svnrepository.mostActiveCommitters=Most Active Committers svnrepository.mostActiveFiles=Most Active Files Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_fr.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_fr.properties 2005-12-22 14:13:56 UTC (rev 1920) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_fr.properties 2005-12-22 14:39:52 UTC (rev 1921) @@ -7,6 +7,7 @@ svnrepository.repositoryDetails=D\u00e9tails du d\u00e9p\u00f4t svnrepository.revision=Versions svnrepository.revisionDetails=D\u00e9tails des versions +svnrepository.committerDetails=fr_Committer Details svnrepository.activityLast7Days=Activit\u00e9 dans les 7 derniers jours svnrepository.activityDetails=D\u00e9tails de l'activit\u00e9 svnrepository.latestTouchDate=Dernier acc\u00e8s @@ -17,7 +18,7 @@ svnrepository.totalRepositoryEntries=Nombre total des entr\u00e9es dans le d\u00e9p\u00f4t svnrepository.totalFileSize=Taille totale des fichiers svnrepository.repositoryEntryHistory=Historique des entr\u00e9es dans le d\u00e9p\u00f4t -svnrepository.filesPerFileType=fr_Files Per File Type +svnrepository.filesByFileType=fr_Files By File Type svnrepository.mostActiveCommitters=Les auteurs les plus actifs svnrepository.mostActiveFiles=Les fichiers les plus actifs Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_hu.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_hu.properties 2005-12-22 14:13:56 UTC (rev 1920) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_hu.properties 2005-12-22 14:39:52 UTC (rev 1921) @@ -7,6 +7,7 @@ svnrepository.repositoryDetails=Tely Rletesen svnrepository.revision=Revvnrepository.revisionDetails=Revszletesen +svnrepository.committerDetails=hu_Committer Details svnrepository.activityLast7Days=Aktivs 7 Nap Sor svnrepository.activityDetails=Aktivs Rletesen svnrepository.latestTouchDate=Utolsdoss @@ -17,7 +18,7 @@ svnrepository.totalRepositoryEntries=Bejegyzk szesen svnrepository.totalFileSize=Fok szmte svnrepository.repositoryEntryHistory=Bejegyzk az Idggvn -svnrepository.filesPerFileType=Fok KiterjesztSzerint +svnrepository.filesByFileType=Fok KiterjesztSzerint svnrepository.mostActiveCommitters=Legaktbb Fejlesztsvnrepository.mostActiveFiles=Legaktbb Fok Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_pl.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_pl.properties 2005-12-22 14:13:56 UTC (rev 1920) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_pl.properties 2005-12-22 14:39:52 UTC (rev 1921) @@ -7,6 +7,7 @@ svnrepository.repositoryDetails=Szczeg\u00f3\u0142y repozytorium svnrepository.revision=Wersja svnrepository.revisionDetails=Szczeg\u00f3\u0142y wersji +svnrepository.committerDetails=pl_Committer Details svnrepository.activityLast7Days=Aktywno\u015b\u0107 w ostatnich 7 dniach svnrepository.activityDetails=Szczeg\u00f3\u0142y aktywno\u015bci svnrepository.latestTouchDate=Data ostatniej modyfikacji @@ -17,7 +18,7 @@ svnrepository.totalRepositoryEntries=Ca\u0142kowita liczba pozycji svnrepository.totalFileSize=Suma rozmiar\u00f3w plik\u00f3w svnrepository.repositoryEntryHistory=Historia pozycji -svnrepository.filesPerFileType=pl_Files Per File Type +svnrepository.filesByFileType=pl_Files By File Type svnrepository.mostActiveCommitters=Najbardziej aktywni autorzy svnrepository.mostActiveFiles=Najbardziej aktywne pliki Modified: trunk/labs/kosmos/web-portlet/pages/svn_monitoring.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/svn_monitoring.jsp 2005-12-22 14:13:56 UTC (rev 1920) +++ trunk/labs/kosmos/web-portlet/pages/svn_monitoring.jsp 2005-12-22 14:39:52 UTC (rev 1921) @@ -31,6 +31,9 @@ </display:column> <display:column titleKey="svnrepository.committersTotal" style="white-space:nowrap" sortProperty="committersTotal" sortable="true"> <fmt:formatNumber value="${repositoriesIt.committersTotal}"/> + <a href="<portlet:renderURL><portlet:param name="action" value="viewCommitterDetails"/><portlet:param name="id" value="<%= pageContext.getAttribute("id").toString() %>"/></portlet:renderURL>"> + <img src="<%= renderRequest.getContextPath() %>/pages/images/info.gif" title="<fmt:message key="svnrepository.committerDetails"/>" border="0"/> + </a> </display:column> <display:column titleKey="svnrepository.activityLast7Days" style="white-space:nowrap" sortProperty="activity" sortable="true"> <c:if test="${repositoriesIt.activity < 0.5}"><span class="portlet-msg-error"></c:if> Modified: trunk/labs/kosmos/web-portlet/pages/svn_monitoring_repository_details.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/svn_monitoring_repository_details.jsp 2005-12-22 14:13:56 UTC (rev 1920) +++ trunk/labs/kosmos/web-portlet/pages/svn_monitoring_repository_details.jsp 2005-12-22 14:39:52 UTC (rev 1921) @@ -30,7 +30,7 @@ <td/> </tr> <tr class="portlet-section-alternate"> - <td><fmt:message key="svnrepository.filesPerFileType"/>:</td> + <td><fmt:message key="svnrepository.filesByFileType"/>:</td> <td><img src="<c:out value="${repository.filesPerFileTypeChartUrl}"/>" title="<fmt:message key="svnrepository.filesPerFileType"/>"/></td> <td> <c:set var="listSize" value="${fn:length(repository.filesPerFileType)}"/> Modified: trunk/labs/kosmos/web-portlet/pages/svn_monitoring_revision_details.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/svn_monitoring_revision_details.jsp 2005-12-22 14:13:56 UTC (rev 1920) +++ trunk/labs/kosmos/web-portlet/pages/svn_monitoring_revision_details.jsp 2005-12-22 14:39:52 UTC (rev 1921) @@ -4,34 +4,7 @@ <fmt:setBundle basename="hu.midori.kosmos.portlet.svn.svn_monitoring" scope="application"/> <table> - <tr class="portlet-section-body"> - <td><fmt:message key="svnrepository.mostActiveCommitters"/>:</td> - <td><img src="<c:out value="${repository.commitsPerAuthorChartUrl}"/>" title="<fmt:message key="svnrepository.mostActiveCommitters"/>"/></td> - <td valign="top"> - - <c:set var="listSize" value="${fn:length(repository.commitsPerAuthor)}"/> - <c:set var="listIndex" value="0"/> - <%@include file="includes/table_expander.jsp" %> - - <table> - <c:forEach var="item" items="${repository.commitsPerAuthor}" varStatus="status"> - <c:choose> - <c:when test="${status.index < 10}"> - <tr id="row-<portlet:namespace/>-0-<c:out value="${status.index}"/>" class="portlet-section-alternate"> - </c:when> - <c:otherwise> - <tr id="row-<portlet:namespace/>-0-<c:out value="${status.index}"/>" style="display: none" class="portlet-section-alternate"> - </c:otherwise> - </c:choose> - <td><c:out value="${1 + status.index}"/></td> - <td><c:out value="${item.key}"/></td> - <td><c:out value="${item.value}"/></td> - </tr> - </c:forEach> - </table> - </td> - </tr> - <tr class="portlet-section-alternate"> + <tr class="portlet-section-body"> <td valign="top"><fmt:message key="svnrepository.mostActiveFiles"/>:</td> <td valign="top"><img src="<c:out value="${repository.commitsPerFileChartUrl}"/>" title="<fmt:message key="svnrepository.mostActiveFiles"/>"/></td> <td valign="top"> @@ -44,10 +17,10 @@ <c:forEach var="item" items="${repository.commitsPerFile}" varStatus="status"> <c:choose> <c:when test="${status.index < 10}"> - <tr id="row-<portlet:namespace/>-1-<c:out value="${status.index}"/>" class="portlet-section-body"> + <tr id="row-<portlet:namespace/>-1-<c:out value="${status.index}"/>" class="portlet-section-alternate"> </c:when> <c:otherwise> - <tr id="row-<portlet:namespace/>-1-<c:out value="${status.index}"/>" style="display: none" class="portlet-section-body"> + <tr id="row-<portlet:namespace/>-1-<c:out value="${status.index}"/>" style="display: none" class="portlet-section-alternate"> </c:otherwise> </c:choose> <td><c:out value="${1 + status.index}"/></td> |
From: <jbo...@li...> - 2005-12-22 14:14:03
|
Author: rem...@jb... Date: 2005-12-22 09:13:56 -0500 (Thu, 22 Dec 2005) New Revision: 1920 Modified: trunk/labs/jbossweb/src/share/classes/org/apache/catalina/authenticator/AuthenticatorBase.java Log: - Don't ask for authentication if deny-from-all is in effect. Fix for Bug #37934 Modified: trunk/labs/jbossweb/src/share/classes/org/apache/catalina/authenticator/AuthenticatorBase.java =================================================================== --- trunk/labs/jbossweb/src/share/classes/org/apache/catalina/authenticator/AuthenticatorBase.java 2005-12-22 14:13:21 UTC (rev 1919) +++ trunk/labs/jbossweb/src/share/classes/org/apache/catalina/authenticator/AuthenticatorBase.java 2005-12-22 14:13:56 UTC (rev 1920) @@ -69,7 +69,7 @@ * requests. Requests of any other type will simply be passed through. * * @author Craig R. McClanahan - * @version $Revision: 348087 $ $Date: 2005-11-22 06:06:40 +0100 (mar., 22 nov. 2005) $ + * @version $Revision: 357143 $ $Date: 2005-12-16 09:13:19 +0100 (ven., 16 déc. 2005) $ */ @@ -475,7 +475,12 @@ for(i=0; i < constraints.length && authRequired; i++) { if(!constraints[i].getAuthConstraint()) { authRequired = false; - } + } else if(!constraints[i].getAllRoles()) { + String [] roles = constraints[i].findAuthRoles(); + if(roles == null || roles.length == 0) { + authRequired = false; + } + } } if(authRequired) { |
From: <jbo...@li...> - 2005-12-22 14:13:29
|
Author: rem...@jb... Date: 2005-12-22 09:13:21 -0500 (Thu, 22 Dec 2005) New Revision: 1919 Modified: trunk/labs/jbossweb/src/share/classes/org/apache/catalina/realm/RealmBase.java Log: - Fix regression where the magic role '*' was denying all access. I had forgotten that '*' isn't stored as a role, so Tomcat was treating it like <auth-constraint />. Fix for Bug #37852 Submitted By: xrcat (xrcat at mailinator.com) Modified: trunk/labs/jbossweb/src/share/classes/org/apache/catalina/realm/RealmBase.java =================================================================== --- trunk/labs/jbossweb/src/share/classes/org/apache/catalina/realm/RealmBase.java 2005-12-21 16:19:19 UTC (rev 1918) +++ trunk/labs/jbossweb/src/share/classes/org/apache/catalina/realm/RealmBase.java 2005-12-22 14:13:21 UTC (rev 1919) @@ -60,7 +60,7 @@ * location) are identical to those currently supported by Tomcat 3.X. * * @author Craig R. McClanahan - * @version $Revision: 348091 $ $Date: 2005-11-22 06:18:05 +0100 (mar., 22 nov. 2005) $ + * @version $Revision: 355701 $ $Date: 2005-12-10 03:53:21 +0100 (sam., 10 déc. 2005) $ */ public abstract class RealmBase @@ -738,7 +738,7 @@ if (log.isDebugEnabled()) log.debug(" Checking roles " + principal); - if (roles.length == 0) { + if (roles.length == 0 && !constraint.getAllRoles()) { if(constraint.getAuthConstraint()) { if( log.isDebugEnabled() ) log.debug("No roles "); |
From: <jbo...@li...> - 2005-12-21 16:19:28
|
Author: aron.gombas Date: 2005-12-21 11:19:19 -0500 (Wed, 21 Dec 2005) New Revision: 1918 Modified: trunk/labs/kosmos/xdocs/reference/images/kosmos_logo.png trunk/labs/kosmos/xdocs/reference/reference-manual.xml Log: Manual fixed based on Neal's review Modified: trunk/labs/kosmos/xdocs/reference/images/kosmos_logo.png =================================================================== (Binary files differ) Modified: trunk/labs/kosmos/xdocs/reference/reference-manual.xml =================================================================== --- trunk/labs/kosmos/xdocs/reference/reference-manual.xml 2005-12-21 15:13:55 UTC (rev 1917) +++ trunk/labs/kosmos/xdocs/reference/reference-manual.xml 2005-12-21 16:19:19 UTC (rev 1918) @@ -36,7 +36,7 @@ <para>Working as developer and later lead engineer on various Java and C++ projects in the recent years, I had to spend a - serious amount of time with reguarly checking various sources of + serious amount of time reguarly checking various sources of information: build reports, source code metrics, PMD and CheckStyle reports, the source code itself, project pages of the dependencies, industry news in online mags and such. In other @@ -68,7 +68,8 @@ and had explained them my plans. They liked the idea, it was in sync with certain things what they wanted to do themselves, so they invited my project as one of the first projects hosted in - their new-born JBoss Labs forge.</para> + their new-born <ulink url="http://labs.jboss.com">JBoss Labs</ulink> + forge.</para> <para> <figure> @@ -81,9 +82,20 @@ <para>In the very beginning, the project ran under a different temporary codename, but when incubating it to JBoss Labs, I had to find out the final name. As the guys at JBoss were waiting for - me, I had to come up with a fancy name in a couple of hours. Finally, I + me, I had to come up with a fancy name in a couple of hours. I decided to use the word <emphasis>kosmos</emphasis>, because of - several reasons (not explained here).</para> + several reasons: + <itemizedlist> + <listitem>is there anything more beautyful than our universe + itself?</listitem> + <listitem>"mikrokozmosz" is a wonderful musical piece + by Bela Bartok, one of the greatest Hungarian composers</listitem> + <listitem>gives the opportunity to play more with the notions + related, like "kosmonaut"</listitem> + <listitem>a name with the length of six characters perfectly fits + Java package names, jar filenames and such</listitem> + </itemizedlist> + </para> </section> @@ -93,7 +105,9 @@ <para>Huge thanks to my wife, Szilva, for not giving up the struggle for such a long time, and Damon Sicore and everyone else - at JBoss Labs for their support.</para> + at <ulink url="http://labs.jboss.com">JBoss Labs</ulink> for + their support. Special thanks to every Kosmos project + contributor (you know, guys, who you are).</para> </section> @@ -126,17 +140,17 @@ <title>Vision</title> - <para>The first releases of Kosmos focus on integrating only a + <para>The first releases of Kosmos focuses on integrating a small set of de-facto standard open source tools like Subversion - or CruiseControl. These releases will also establish a stable base for - future development, and they target reaching a production-ready + or CruiseControl. These releases will form the base for + future development and aspire to reach a production-ready state as soon as possible.</para> - <para>For the long run, by leaving the door open with an - extensible architecture, we consider supporting anything - demanded: both popular open source and commercial tools if they - are accessible through some kind of public web-services, API or - at least by page-scraping (in case of web interfaces).</para> + <para>In the long run, we have left the door open with an + extensible architecture. We will consider supporting anything + demanded. That includes both popular open source and commercial tools if they + are accessible through some kind of public web-service, API, or + at by page-scraping (in case of web interfaces).</para> </section> @@ -151,34 +165,34 @@ <listitem> - <para>Lightweight architecture through POJOs.</para> + <para>Lightweight architecture implemented with POJOs.</para> </listitem> <listitem> - <para>Several independent and simplistic components instead - of a single monolithic monster.</para> + <para>Several independent and simplistic components rather than + single monolithic one.</para> </listitem> <listitem> - <para>Easy and flexible deployment: no changes to make - in the monitored resources.</para> + <para>Easy and flexible deployment, and so no changes in the + monitored resources.</para> </listitem> <listitem> <para>Full transparency for the monitored resources and no - extra burden on those.</para> + extra burden on them.</para> </listitem> <listitem> - <para>Maximal vendor-indepence: no proprietary features of + <para>Maximum vendor-indepence: no proprietary features of servlet containers, application servers, portlet containers or WebDAV servers.</para> @@ -194,7 +208,7 @@ <listitem> <para>Visualization by using charts and graphics instead of - plain textual information, whereever possible.</para> + plain textual information, wherever possible.</para> </listitem> @@ -215,7 +229,7 @@ <listitem> - <para>Java 1.5 language compatibility (however using some + <para>Java 1.5 language compatibility (some of the language features introduced in Java 1.5 are not compatible with Hessian).</para> @@ -223,7 +237,7 @@ <listitem> - <para>Portlets that are JSR-168-compliant.</para> + <para>Portlets that are perfectly JSR-168-compliant.</para> </listitem> @@ -330,8 +344,8 @@ <title>Compatibility</title> - <para>Please see the detailed compatibility matrix maintained - on the project website.</para> + <para>Please see the detailed compatibility matrix on the project + website.</para> </section> @@ -347,25 +361,24 @@ <para>The <quote>remote server</quote> component acts like a traditional back-end: it collects, analyzes, stores and caches - all the information rendered later by the front-end.</para> - - <para>You might want to ask, why is it necessary to complicate the - deployment with this additional component? Having a single layer + all the information. It then provides results for the front-end. + You might ask, "Is it necessary to complicate the + deployment with this additional component?" Having a single layer (portlets only, that access the monitored resources directly), it could be much simpler!</para> <para>The primary reason is that certain operations performed by - the system (for instance monitoring a remote Subversion + the system (like monitoring a remote Subversion repository) can be <emphasis>very</emphasis> expensive: - traversing the repository content can easily took for hours + traversing the repository content can easily take hours, depending on many factors like the repository complexity, server - performance or network bandwidth. By using a simple caching + performance, or network bandwidth. By using a simple caching mechanism built into the server component, if several portlet - instances are monitoring the same repo and they fire identical - requests, only the very first will result in a new traversal. The + instances are monitoring the same repository and they fire identical + requests, only the very first will result in a new traversal! The other requests will receive the cached result until the first cache-miss (which can be caused also by a time-out, of course). - Even this naive mechanism gives a huge performance boost and puts + This simple mechanism gives a huge performance boost and puts less burden on the <quote>target box</quote>, the Subversion server in this case.</para> @@ -383,7 +396,7 @@ <listitem> <para>Provides Hessian-based web services for the portlets - (i.e. view tier).</para> + (view tier).</para> </listitem> @@ -411,10 +424,10 @@ <quote>traditional</quote> web-application techniques, because flexible customization was a high-priority project goal.</para> - <para>You can easily configure custom-tailored portal pages, that - can contain any of the portlets in various layouts. Also, you can - mix Kosmos portlets with other portlets coming from other projects - and vendors, without any restriction. The deployment and configuration + <para>You can set up any portal page, which can contain any + number of the portlets in various layouts. Also, you can + mix Kosmos portlets with portlets coming from other projects + or vendors, without any restriction. The deployment and configuration process is portlet container-dependent, thus it is out of the scope of this document. Please refer to the technical documentation of your particular container.</para> @@ -422,7 +435,7 @@ <para> Using the portlet user interfaces should be straight-forward. - There is a couple of common features supported by all the + There are a set of common features supported by all the portlets: <itemizedlist> @@ -462,9 +475,9 @@ <para>This portlet monitors the continuous integration build processes managed by CruiseControl, a very well-known continuous - build framework. Thus it helps you to track whether the builds of - your projects didn't get broken, without checking email - reports or web reports one-by-one.</para> + build framework. It helps you to track whether the builds of + your projects break, without checking email, + reports, or web reports.</para> <para> @@ -474,7 +487,7 @@ <listitem> <para>It reports on the build labels, build results, - timestamps and unit test results. Also, you can get detailed + timestamps, and unit test results. You can also get detailed information about the unit tests.</para> </listitem> @@ -502,7 +515,7 @@ <title>JIRA Monitoring portlet</title> <para>This portlet monitors projects hosted by JIRA, a popular issue tracking - and project management application. It helps you by giving an + and project management application. It helps you by giving a quick overview about the state of several projects in a single place.</para> @@ -597,8 +610,8 @@ <title>Subversion Monitoring portlet</title> <para>This portlet monitors repositories managed by Subversion, one of the - most widely used version control systems. This way it helps you - to track the activity and complexity of several separate + most widely used version control systems. It helps you + track the activity and complexity of several separate repositories very easily in a single portlet.</para> <para> @@ -645,7 +658,7 @@ <para> - Here we just list a couple of additional ideas which can make + Here are a couple of additional ideas which can make your life easier when configuring your particular Kosmos portal instance: <itemizedlist> @@ -654,9 +667,7 @@ <para>Combining Kosmos portlets with other portlets is a good practice to maximize the information effectively - aggregated on your portal page.</para> - - <para>Other than the standard + aggregated on your portal page. Other than the standard Kosmos portlets, you should consider using: Forums portlet, RSS portlet, Blog portlet, Poll portlet, CMS portlet and Wiki portlet. All these (provided you use them in the right @@ -667,22 +678,12 @@ <listitem> - <para>If CruiseControl runs on a remote machine (not the - same machine like the container which hosts Kosmos - container), you can map the remote CruiseControl log - directory to the local filesystem and monitor it.</para> - - </listitem> - - <listitem> - - <para>All portlets support multiple monitored resources, - group those as you wish.</para> - <para>For example, you can have a + <para>All portlets support multiple monitored resources, and you can + group them as you wish. For example, you can have a separate portlet for monitoring Spring, and another for - monitoring ACEGI, but it might make sense to group those as - related packages together to a single portlet, plus keep - all the Struts-related packages in another portlet and + monitoring ACEGI. It might make sense to group those as + related packages together within a single portlet, and keep + all the Struts-related packages in another portlet, and Tomcat-related packages in a third one.</para> </listitem> @@ -718,15 +719,14 @@ <listitem> <para>We offer deployment scripts in form of Ant build - scripts, which automatize the deployment process. If you + scripts, which automate the deployment process. If you want to use these, you will need to install Ant. The default target of each script is <literal>redeploy</literal>, which deletes the old deployment (if there exists) and deploys a - new clean one.</para> - <para>Of course, you can still deploy manually if Ant is not available in - your environment. Even in this case, it's a good idea to - look through the deploy scripts and then to follow the - step-by-step guide provided in the next sections.</para> + new clean one. + Of course, you can still deploy manually if Ant is not available in + your environment. In any case, it's a good idea to + look through the deploy scripts.</para> </listitem> @@ -778,8 +778,8 @@ <listitem> <para><emphasis>minimalistic</emphasis>: a single container - which can act both as servlet-container for Kosmos server - and for the WebDAV server and as portlet-container for the + which can act both as servlet-container for Kosmos server, + the WebDAV server, and the portlet-container for the portlets. As result, there will be three separate web applications running in the same container. This is the simplest way to deploy Kosmos and it can be an effective @@ -794,7 +794,7 @@ network: for example you can use Apache Tomcat as servlet-container and JBoss AS with JBoss Portal as portlet-container. It means that your components will run - in separate JVMs which can be useful from stability or + in separate JVMs which can be useful from a stability or security viewpoint.</para> </listitem> @@ -802,19 +802,19 @@ <listitem> <para><emphasis>distributed</emphasis>: containers on - separate nodes, for example <emphasis>server A</emphasis> + separate nodes. <emphasis>Server A</emphasis> can run one instance of JBoss AS to host the server - component, <emphasis>server C</emphasis> can run another to + component, <emphasis>server B</emphasis> can run another to host the WebDAV repository, while <emphasis>server C</emphasis> can run a third one to host the portlet container.</para> - <para>Moreover, for advanced users it is possible to deploy + <para>For advanced users it is possible to deploy each service of the server component to different nodes if that's necessary! You can fine-tune the performance of the system this way.</para> - <para>And since all the information is exposed as standard + <para>Since all the information is exposed as standard Hessian web-services, it is possible and perfectly legal to develop other types of front-end for the system: web applications, applets or desktop applications and @@ -825,7 +825,9 @@ </itemizedlist> <figure> + <title>Minimalistic deployment</title> + <graphic fileref="images/kosmos_deployment.png"/> </figure> @@ -915,7 +917,7 @@ <para> - + Follow these steps: <orderedlist> <listitem> @@ -935,7 +937,7 @@ <listitem> <para>You can deploy the server component into the Apache Tomcat - instance used by Gridsphere simply by running the server deploy script: + instance used by Gridsphere, by running the server deploy script: <programlisting>ant -f deploy-server-tomcat.xml</programlisting> Please don't forget to set the <literal>CATALINA_HOME</literal> environment variable before. @@ -959,7 +961,7 @@ (e.g. <literal>http://localhost:8080/gridsphere</literal>), and login with the default account (<literal>root</literal> and empty password). After this, there are couple of extra steps - that you have to do using the Gridsphere admin portlets: + that you can do using the Gridsphere admin portlets: <orderedlist> <listitem> @@ -999,7 +1001,7 @@ <para> - + Follow these steps: <orderedlist> <listitem> @@ -1027,7 +1029,7 @@ <listitem> - <para>Install JBoss Portal as written in its manual. Check + <para>Install JBoss Portal as written in its manual. Test if there are no error messages in the JBoss AS logfile.</para> @@ -1094,9 +1096,9 @@ <listitem> <para>You can deploy the server component into the Apache Tomcat - instance used by Liferay simply by running the server deploy script: + instance used by Liferay, by running the server deploy script: <programlisting>ant -f deploy-server-tomcat.xml</programlisting> - Please don't forget to set the <literal>CATALINA_HOME</literal> + Don't forget to set the <literal>CATALINA_HOME</literal> environment variable before. </para> @@ -1105,6 +1107,14 @@ <listitem> <para> + Hot-deploy the portlets by running the portlet deploy script: + <programlisting>ant -f deploy-portlet-liferay-portal.xml</programlisting> + Edit this file and make sure the properties are correct. If you have CATALINA_HOME + set, you shouldn't have to worry about the <programlisting>container.dir</programlisting> + property. Ensure <programlisting>container.lib</programlisting> and + <programlisting>liferay.home</programlisting> are correct. + + Hot-deploy the portlets as written at <ulink url="http://www.liferay.com/web/guest/documentation/development/hot_deploy">http://www.liferay.com/web/guest/documentation/development/hot_deploy</ulink>. The portlet distribution package of Kosmos contains a customized version of <filename>portlet-deployer-3.5.0.xml</filename> which you might find convenient @@ -1193,7 +1203,7 @@ <listitem> <para>You can deploy the server component into the Apache Tomcat - instance used by Pluto simply by running the server deploy script: + instance used by Pluto, by running the server deploy script: <programlisting>ant -f deploy-server-tomcat.xml</programlisting> Please don't forget to set the <literal>CATALINA_HOME</literal> environment variable before. @@ -1211,9 +1221,9 @@ your portlets, otherwise your new portal page won't appear in the menu!</para> - <para>If for some reason you decided to do an automated deployment - instead of using the administrative portlet, deploy the portlet web application by running the portlet deploy script as: - <programlisting>ant -f deploy-portlet-pluto.xml</programlisting> + <para>If you decided to do an automated deployment + instead of using the administrative portlet, run the portlet deploy script: + <programlisting>ant -f deploy-portlet-pluto.xml</programlisting>. After this, you have to manually update the following Pluto configuration files: <simplelist> @@ -1254,7 +1264,7 @@ cache store mechanism, all configuration was moved to the Spring XML.) It's absolutely straightforward to modify it, but please note that the configuration changes might require - reloading the servlet to take effect! + reloading the servlet! </para> @@ -1358,8 +1368,8 @@ </itemizedlist> - For better understanding, please take a look at the full sample - configuration files shipped in the distributed package. + Please take a look at the sample configuration files shipped in + the distributed package. </para> </section> @@ -1424,18 +1434,11 @@ <listitem> - <para><literal>CcMonitoringPortlet</literal>: path - of the directories where CruiseControl produces its - logfiles related to the projects to monitor. For - example: <literal> - /cruisecontrol/logs/myproject1,/cruisecontrol/logs/myproject2</literal>. - <warning> - <para> - This portlet is not configured properly in the default <filename> - portlet.xml</filename> shipped in the package, - because it requires local paths! - </para> - </warning> + <para><literal>CcMonitoringPortlet</literal>: URLs of + the webpages where CruiseControl publishers produce their + output including the logfiles related to the projects to + monitor. For example: <literal> + http://cruisecontrol.jboss.com/cc/buildresults/ejb3-4.0-testsuite,http://cruisecontrol.jboss.com/cc/buildresults/ejb3-head-testsuite</literal>. </para> </listitem> @@ -1526,10 +1529,10 @@ <title>SourceForge Monitoring</title> </portlet-info> </portlet></programlisting> - Had you any problems or question, first please study the + If you have any problems or questions, please study the default - <filename>portlet.xml</filename>, probably you will find - the answer there. + <filename>portlet.xml</filename> + , and you will probably find the answer there. </para> </section> @@ -1690,7 +1693,7 @@ callback-like classes <literal>XxxHandler</literal> to do the actual work.</para> - <para>From server to the portlets, the data is transferred simply + <para>From the server to the portlets, the data is transferred simply by instantiating the DTO classes in the <literal> hu.midori.kosmos.protocol</literal> package and sending them over the wire using Hessian. All this is very simple and @@ -1702,7 +1705,7 @@ <title>Portlets architecture</title> - <para>The portlets are extremely simple: they just connect to the + <para>The portlets are extremely simple: they just connect the appropriate service, download a collection of DTOs and render the JSPs. That's it.</para> |
Author: aron.gombas Date: 2005-12-21 10:13:55 -0500 (Wed, 21 Dec 2005) New Revision: 1917 Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/SvnRepository.java trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_fr.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_hu.properties trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_pl.properties trunk/labs/kosmos/web-portlet/pages/svn_monitoring_repository_details.jsp Log: New SVN stat: files-per-file-type Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/model/SvnRepository.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/model/SvnRepository.java 2005-12-21 12:43:30 UTC (rev 1916) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/model/SvnRepository.java 2005-12-21 15:13:55 UTC (rev 1917) @@ -45,6 +45,8 @@ /** Number of committers over the last 31 days (about one month). */ private int committersLast31Days; + /** URL of the files-per-file-type chart image. */ + private String filesPerFileTypeChartUrl; /** URL of the commits-per-author chart image. */ private String commitsPerAuthorChartUrl; /** URL of the commits-per-file chart image. */ @@ -61,6 +63,8 @@ /** Total size of files. */ private int totalFileSize; + /** Files-per-file-type sorted by files in descending order. */ + private List<Map.Entry<String,Integer>> filesPerFileType; /** Commits-per-author sorted by commits in descending order. */ private List<Map.Entry<String,Integer>> commitsPerAuthor; /** Commits-per-file sorted by commits in descending order. */ @@ -78,9 +82,9 @@ Date createdDate, List<ScmRepositoryChange> commits, int commitsTotal, int commitsToday, int commitsLast7Days, int commitsLast31Days, int committersTotal, int committersToday, int committersLast7Days, int committersLast31Days, - String commitsPerAuthorChartUrl, String commitsPerFileChartUrl, String commitsPerWeekChartUrl, String repoEntriesPerWeekChartUrl, + String filesPerFileTypeChartUrl, String commitsPerAuthorChartUrl, String commitsPerFileChartUrl, String commitsPerWeekChartUrl, String repoEntriesPerWeekChartUrl, int dirs, int files, int totalFileSize, - List<Map.Entry<String,Integer>> commitsPerAuthor, List<Map.Entry<String,Integer>> commitsPerFile) { + List<Map.Entry<String,Integer>> filesPerFileType, List<Map.Entry<String,Integer>> commitsPerAuthor, List<Map.Entry<String,Integer>> commitsPerFile) { super(location + revision + commits.get(0).getDate()); this.location = location; @@ -99,6 +103,7 @@ this.committersLast7Days = committersLast7Days; this.committersLast31Days = committersLast31Days; + this.filesPerFileTypeChartUrl = filesPerFileTypeChartUrl; this.commitsPerAuthorChartUrl = commitsPerAuthorChartUrl; this.commitsPerFileChartUrl = commitsPerFileChartUrl; this.commitsPerWeekChartUrl = commitsPerWeekChartUrl; @@ -108,6 +113,7 @@ this.files = files; this.totalFileSize = totalFileSize; + this.filesPerFileType = filesPerFileType; this.commitsPerAuthor = commitsPerAuthor; this.commitsPerFile = commitsPerFile; } @@ -159,8 +165,12 @@ public int getCommittersLast31Days() { return committersLast31Days; } - - public String getCommitsPerAuthorChartUrl() { + + public String getFilesPerFileTypeChartUrl() { + return filesPerFileTypeChartUrl; + } + + public String getCommitsPerAuthorChartUrl() { return commitsPerAuthorChartUrl; } @@ -188,6 +198,10 @@ return totalFileSize; } + public List<Map.Entry<String,Integer>> getFilesPerFileType() { + return filesPerFileType; + } + public List<Map.Entry<String,Integer>> getCommitsPerAuthor() { return commitsPerAuthor; } Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java 2005-12-21 12:43:30 UTC (rev 1916) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/svn/SvnServiceImpl.java 2005-12-21 15:13:55 UTC (rev 1917) @@ -30,6 +30,7 @@ import java.util.Set; import java.util.TreeMap; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jfree.data.time.TimeSeries; @@ -110,7 +111,7 @@ SvnRepositoryLogStats logStats = analyzeLog(repo); SvnRepositoryContentStats contentStats = analyzeContent(repo); - generateCharts(repo, logStats); + generateCharts(repo, logStats, contentStats); disconnect(repo); @@ -120,9 +121,9 @@ logStats.createdDate, trimList(logStats.commits), logStats.commitsTotal, logStats.commitsToday, logStats.commitsLast7Days, logStats.commitsLast31Days, logStats.committersTotal.size(), logStats.committersToday.size(), logStats.committersLast7Days.size(), logStats.committersLast31Days.size(), - logStats.commitsPerAuthorChartUrl, logStats.commitsPerFileChartUrl, logStats.commitsPerWeekChartUrl, logStats.repoEntriesPerWeekChartUrl, + contentStats.filesPerFileTypeChartUrl, logStats.commitsPerAuthorChartUrl, logStats.commitsPerFileChartUrl, logStats.commitsPerWeekChartUrl, logStats.repoEntriesPerWeekChartUrl, contentStats.dirs, contentStats.files, contentStats.totalSize, - trimList(logStats.commitsPerAuthor), trimList(logStats.commitsPerFile)); + trimList(contentStats.filesPerFileType), trimList(logStats.commitsPerAuthor), trimList(logStats.commitsPerFile)); log.debug(String.format("Adding %s...", repository)); repositories.add(repository); } catch (Exception ex) { @@ -183,6 +184,10 @@ public Set<String> committersLast7Days = new HashSet<String>(); public Set<String> committersLast31Days = new HashSet<String>(); + /* No of repository entries per week. */ + public TimeSeries repoEntriesPerWeek = new TimeSeries("", Week.class); + public String repoEntriesPerWeekChartUrl; + /* No of commits per author. */ public List<Map.Entry<String,Integer>> commitsPerAuthor; public String commitsPerAuthorChartUrl; @@ -195,10 +200,6 @@ public TimeSeries commitsPerWeek = new TimeSeries("", Week.class); public String commitsPerWeekChartUrl; - /* No of repository entries per week. */ - public TimeSeries repoEntriesPerWeek = new TimeSeries("", Week.class); - public String repoEntriesPerWeekChartUrl; - /** Must be called to validate its content, after the processing was done. */ public void validate() { // revert history @@ -286,10 +287,6 @@ for(Iterator it = changedPaths.keySet().iterator(); it.hasNext();) { SVNLogEntryPath logEntryPath = (SVNLogEntryPath)changedPaths.get(it.next()); char type = logEntryPath.getType(); - - // skip copied branches - //if(logEntryPath.getCopyPath() != null) - // continue; // update repo entry counters int repoEntryAdder = 0; @@ -330,62 +327,89 @@ /** Wraps the stats retrieved from the log of a SVN repository. */ private class SvnRepositoryContentStats { + /** No of dirs. */ public int dirs; + /** No of files. */ public int files; + /** Total filesize. */ public int totalSize; + + /* No of files per file-type. */ + public List<Map.Entry<String,Integer>> filesPerFileType; + public String filesPerFileTypeChartUrl; } /** Analyzes the repository content and returns its stats. */ + @SuppressWarnings("unchecked") protected SvnRepositoryContentStats analyzeContent(SVNRepository repository) throws SVNException { SvnRepositoryContentStats stats = new SvnRepositoryContentStats(); + Map<String,Integer> filesPerFileTypeMap = new TreeMap<String,Integer>(); log.info(String.format("Analyzing content of \"%s\" repository...", repository.getLocation().toString())); stats.dirs = 1; // starting root dir - traverseRepository(repository, "", stats); + traverseRepository(repository, "", stats, filesPerFileTypeMap); log.info(String.format("%d repo-entries processed.", stats.dirs + stats.files)); + + // validate + stats.filesPerFileType = ChartUtils.intValuedMapToSortedList(filesPerFileTypeMap); return stats; } /** Recursively traverses the given SVN repository tree and updates the stats passed. */ @SuppressWarnings("unchecked") - protected void traverseRepository(SVNRepository repository, String path, SvnRepositoryContentStats stats) throws SVNException { - Collection<SVNDirEntry> entries = (Collection<SVNDirEntry>)repository.getDir(path, -1, null, (Collection)null); - + protected void traverseRepository(SVNRepository repository, String path, SvnRepositoryContentStats stats, Map<String,Integer> filesPerFileTypeMap) throws SVNException { + Collection<SVNDirEntry> entries = (Collection<SVNDirEntry>)repository.getDir(path, -1, null, (Collection)null); + for(SVNDirEntry entry : entries) { log.debug(String.format("Traversing \"/%s%s\"...", path.equals("") ? "" : path + "/", entry.getName())); if (entry.getKind() == SVNNodeKind.DIR) { + // update stats stats.dirs++; + // traverse recursively - traverseRepository(repository, path.equals("") ? entry.getName() : path + "/" + entry.getName(), stats); + traverseRepository(repository, path.equals("") ? entry.getName() : path + "/" + entry.getName(), stats, filesPerFileTypeMap); } else if (entry.getKind() == SVNNodeKind.FILE){ + // update stats stats.files++; stats.totalSize += entry.size(); + + // count file-types + String fileType = StringUtils.substringAfterLast(entry.getName(), "."); + if(!StringUtils.isEmpty(fileType)) { + fileType = fileType.toLowerCase(); + Integer filesPerCurrentType = filesPerFileTypeMap.get(fileType); + filesPerFileTypeMap.put(fileType, (filesPerCurrentType == null) ? 1 : filesPerCurrentType + 1); + } } } } /** Generates and saves the chart images on the server, and sets the URLs to the stats. */ - protected void generateCharts(SVNRepository repository, SvnRepositoryLogStats stats) throws IOException { + protected void generateCharts(SVNRepository repository, SvnRepositoryLogStats logStats, SvnRepositoryContentStats contentStats) throws IOException { String prefix = ScrapingUtils.removeUserInfoFromUrl(repository.getLocation().toString()); - // generate charts + // generate charts ByteArrayOutputStream out = new ByteArrayOutputStream(); - ChartUtils.writeChartAsPng(ChartUtils.generatePieChart(ChartUtils.collectionToPieDataset(stats.commitsPerAuthor, ChartUtils.MAX_ITEMS)), out); - stats.commitsPerAuthorChartUrl = storeFile(prefix + "_commits_per_author.png", new ByteArrayInputStream(out.toByteArray())); + ChartUtils.writeChartAsPng(ChartUtils.generatePieChart(ChartUtils.collectionToPieDataset(contentStats.filesPerFileType, ChartUtils.MAX_ITEMS)), out); + contentStats.filesPerFileTypeChartUrl = storeFile(prefix + "_files_per_file_type.png", new ByteArrayInputStream(out.toByteArray())); out.reset(); - ChartUtils.writeChartAsPng(ChartUtils.generatePieChart(ChartUtils.collectionToPieDataset(stats.commitsPerFile, ChartUtils.MAX_ITEMS)), out); - stats.commitsPerFileChartUrl = storeFile(prefix + "_commits_per_file.png", new ByteArrayInputStream(out.toByteArray())); + ChartUtils.writeChartAsPng(ChartUtils.generatePieChart(ChartUtils.collectionToPieDataset(logStats.commitsPerAuthor, ChartUtils.MAX_ITEMS)), out); + logStats.commitsPerAuthorChartUrl = storeFile(prefix + "_commits_per_author.png", new ByteArrayInputStream(out.toByteArray())); out.reset(); - ChartUtils.writeChartAsPng(ChartUtils.generateTimeBarChart(stats.commitsPerWeek), out); - stats.commitsPerWeekChartUrl = storeFile(prefix + "_commits_per_week.png", new ByteArrayInputStream(out.toByteArray())); + ChartUtils.writeChartAsPng(ChartUtils.generatePieChart(ChartUtils.collectionToPieDataset(logStats.commitsPerFile, ChartUtils.MAX_ITEMS)), out); + logStats.commitsPerFileChartUrl = storeFile(prefix + "_commits_per_file.png", new ByteArrayInputStream(out.toByteArray())); out.reset(); - ChartUtils.writeChartAsPng(ChartUtils.generateTimeLineChart(stats.repoEntriesPerWeek), out); - stats.repoEntriesPerWeekChartUrl = storeFile(prefix + "_files_per_week.png", new ByteArrayInputStream(out.toByteArray())); + ChartUtils.writeChartAsPng(ChartUtils.generateTimeBarChart(logStats.commitsPerWeek), out); + logStats.commitsPerWeekChartUrl = storeFile(prefix + "_commits_per_week.png", new ByteArrayInputStream(out.toByteArray())); + + out.reset(); + ChartUtils.writeChartAsPng(ChartUtils.generateTimeLineChart(logStats.repoEntriesPerWeek), out); + logStats.repoEntriesPerWeekChartUrl = storeFile(prefix + "_files_per_week.png", new ByteArrayInputStream(out.toByteArray())); } } } Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring.properties 2005-12-21 12:43:30 UTC (rev 1916) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring.properties 2005-12-21 15:13:55 UTC (rev 1917) @@ -17,6 +17,7 @@ svnrepository.totalRepositoryEntries=Total Repository Entries svnrepository.totalFileSize=Total File Size svnrepository.repositoryEntryHistory=Repository Entry History +svnrepository.filesPerFileType=Files Per File Type svnrepository.mostActiveCommitters=Most Active Committers svnrepository.mostActiveFiles=Most Active Files Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_fr.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_fr.properties 2005-12-21 12:43:30 UTC (rev 1916) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_fr.properties 2005-12-21 15:13:55 UTC (rev 1917) @@ -17,6 +17,7 @@ svnrepository.totalRepositoryEntries=Nombre total des entr\u00e9es dans le d\u00e9p\u00f4t svnrepository.totalFileSize=Taille totale des fichiers svnrepository.repositoryEntryHistory=Historique des entr\u00e9es dans le d\u00e9p\u00f4t +svnrepository.filesPerFileType=fr_Files Per File Type svnrepository.mostActiveCommitters=Les auteurs les plus actifs svnrepository.mostActiveFiles=Les fichiers les plus actifs Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_hu.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_hu.properties 2005-12-21 12:43:30 UTC (rev 1916) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_hu.properties 2005-12-21 15:13:55 UTC (rev 1917) @@ -17,6 +17,7 @@ svnrepository.totalRepositoryEntries=Bejegyzk szesen svnrepository.totalFileSize=Fok szmte svnrepository.repositoryEntryHistory=Bejegyzk az Idggvn +svnrepository.filesPerFileType=Fok KiterjesztSzerint svnrepository.mostActiveCommitters=Legaktbb Fejlesztsvnrepository.mostActiveFiles=Legaktbb Fok Modified: trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_pl.properties =================================================================== --- trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_pl.properties 2005-12-21 12:43:30 UTC (rev 1916) +++ trunk/labs/kosmos/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_pl.properties 2005-12-21 15:13:55 UTC (rev 1917) @@ -17,6 +17,7 @@ svnrepository.totalRepositoryEntries=Ca\u0142kowita liczba pozycji svnrepository.totalFileSize=Suma rozmiar\u00f3w plik\u00f3w svnrepository.repositoryEntryHistory=Historia pozycji +svnrepository.filesPerFileType=pl_Files Per File Type svnrepository.mostActiveCommitters=Najbardziej aktywni autorzy svnrepository.mostActiveFiles=Najbardziej aktywne pliki Modified: trunk/labs/kosmos/web-portlet/pages/svn_monitoring_repository_details.jsp =================================================================== --- trunk/labs/kosmos/web-portlet/pages/svn_monitoring_repository_details.jsp 2005-12-21 12:43:30 UTC (rev 1916) +++ trunk/labs/kosmos/web-portlet/pages/svn_monitoring_repository_details.jsp 2005-12-21 15:13:55 UTC (rev 1917) @@ -7,23 +7,54 @@ <tr class="portlet-section-body"> <td><fmt:message key="svnrepository.dirs"/>:</td> <td><fmt:formatNumber value="${repository.dirs}"/></td> + <td/> </tr> <tr class="portlet-section-alternate"> <td><fmt:message key="svnrepository.files"/>:</td> <td><fmt:formatNumber value="${repository.files}"/></td> + <td/> </tr> <tr class="portlet-section-body"> <td><fmt:message key="svnrepository.totalRepositoryEntries"/>:</td> <td><fmt:formatNumber value="${repository.dirs + repository.files}"/></td> + <td/> </tr> <tr class="portlet-section-alternate"> <td><fmt:message key="svnrepository.totalFileSize"/>:</td> <td><fmt:formatNumber value="${repository.totalFileSize}"/> B</td> + <td/> </tr> <tr class="portlet-section-body"> <td><fmt:message key="svnrepository.repositoryEntryHistory"/>:</td> <td><img src="<c:out value="${repository.repoEntriesPerWeekChartUrl}"/>" title="<fmt:message key="svnrepository.repositoryEntryHistory"/>"/></td> + <td/> </tr> + <tr class="portlet-section-alternate"> + <td><fmt:message key="svnrepository.filesPerFileType"/>:</td> + <td><img src="<c:out value="${repository.filesPerFileTypeChartUrl}"/>" title="<fmt:message key="svnrepository.filesPerFileType"/>"/></td> + <td> + <c:set var="listSize" value="${fn:length(repository.filesPerFileType)}"/> + <c:set var="listIndex" value="0"/> + <%@include file="includes/table_expander.jsp" %> + + <table> + <c:forEach var="item" items="${repository.filesPerFileType}" varStatus="status"> + <c:choose> + <c:when test="${status.index < 10}"> + <tr id="row-<portlet:namespace/>-0-<c:out value="${status.index}"/>" class="portlet-section-body"> + </c:when> + <c:otherwise> + <tr id="row-<portlet:namespace/>-0-<c:out value="${status.index}"/>" style="display: none" class="portlet-section-body"> + </c:otherwise> + </c:choose> + <td><c:out value="${1 + status.index}"/></td> + <td><c:out value="${item.key}"/></td> + <td><c:out value="${item.value}"/></td> + </tr> + </c:forEach> + </table> + </td> + </tr> <%@include file="includes/table_footer.jsp"%> </table> |