From: <jbo...@li...> - 2005-12-01 11:20:36
|
Author: wrzep Date: 2005-12-01 06:20:26 -0500 (Thu, 01 Dec 2005) New Revision: 1679 Added: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/RevisionStatusPlugin.java trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/TotalRepoSizeStatusPlugin.java Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java Log: revision and repo size plugins http://jira.jboss.com/jira/browse/JBLAB-415 Pawel Added: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/RevisionStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/RevisionStatusPlugin.java 2005-12-01 10:51:58 UTC (rev 1678) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/RevisionStatusPlugin.java 2005-12-01 11:20:26 UTC (rev 1679) @@ -0,0 +1,53 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.plugins.svn; + +import java.util.Map; + +/** +* @author Pawel Wrzeszcz +*/ + +public class RevisionStatusPlugin extends SvnStatusPlugin { + + protected static String PLUGIN_NAME = "Revision no"; + protected static String PLUGIN_ID = "revision"; + + public String getId() { return PLUGIN_ID; } + public String getName() { return PLUGIN_NAME; } + + public RevisionStatusPlugin() { + super(); + } + @Override + protected int getPluginSpecyficValue(Map projectMap) { + Long commitsTotal = (Long) projectMap.get("revision"); + return commitsTotal.intValue(); + } + + @Override + protected int getPluginSpecyficDefaultValue() { + return 0; + } + +} \ No newline at end of file Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java 2005-12-01 10:51:58 UTC (rev 1678) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java 2005-12-01 11:20:26 UTC (rev 1679) @@ -89,7 +89,7 @@ List repositories = service.getRepositories(repoURL); repositoryMap = (Map) repositories.get(0); - printRepo(repositoryMap); + //printRepo(repositoryMap); return repositoryMap; } Added: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/TotalRepoSizeStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/TotalRepoSizeStatusPlugin.java 2005-12-01 10:51:58 UTC (rev 1678) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/TotalRepoSizeStatusPlugin.java 2005-12-01 11:20:26 UTC (rev 1679) @@ -0,0 +1,53 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.plugins.svn; + +import java.util.Map; + +/** +* @author Pawel Wrzeszcz +*/ + +public class TotalRepoSizeStatusPlugin extends SvnStatusPlugin { + + protected static String PLUGIN_NAME = "Total File Size"; + protected static String PLUGIN_ID = "total_file_size"; + + public String getId() { return PLUGIN_ID; } + public String getName() { return PLUGIN_NAME; } + + public TotalRepoSizeStatusPlugin() { + super(); + } + @Override + protected int getPluginSpecyficValue(Map projectMap) { + Integer commitsTotal = (Integer) projectMap.get("totalFileSize"); + return commitsTotal.intValue(); + } + + @Override + protected int getPluginSpecyficDefaultValue() { + return 0; + } + +} \ No newline at end of file |