ruper2/src/java/core/org/krysalis/ruper2/tool Tool.java,1.1,1.2 RepositoryTool.java,1.1,1.2 ResourceTool.java,1.1,1.2

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/tool
In directory sc8-pr-cvs1:/tmp/cvs-serv25526/src/java/core/org/krysalis/ruper2/tool

Modified Files:
	Tool.java RepositoryTool.java ResourceTool.java 
Log Message:
1) Copied over Ruper1 documentation to work on
2) Worked on RepositoryTool [command line] to list groups/resoruces
3) Ignore .* files, and associate .MD5 w/ original. [Later check hash]

Index: Tool.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/tool/Tool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Tool.java	29 Sep 2003 18:09:15 -0000	1.1
--- Tool.java	1 Oct 2003 21:55:54 -0000	1.2
***************
*** 6,9 ****
--- 6,10 ----
  import java.io.PrintWriter;
  
+ import org.krysalis.ruper2.config.RuperConfig;
  import org.krysalis.ruper2.log.LogConstant;
  import org.krysalis.ruper2.log.Logger;
***************
*** 62,66 ****
  			CommandLineParser parser = new CommandLineParser();
  
! 			parser.setStrict(false);
  			cmdline = parser.parse(l_options, args);
  
--- 63,67 ----
  			CommandLineParser parser = new CommandLineParser();
  
! 			parser.setStrict(true);
  			cmdline = parser.parse(l_options, args);
  
***************
*** 83,86 ****
--- 84,89 ----
  		DebugUtils.enableCommonsLogging();
  
+ 		RuperConfig.configure();
+ 		
  		init();
  

Index: RepositoryTool.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/tool/RepositoryTool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RepositoryTool.java	29 Sep 2003 18:09:15 -0000	1.1
--- RepositoryTool.java	1 Oct 2003 21:55:54 -0000	1.2
***************
*** 12,17 ****
--- 12,19 ----
  import org.krysalis.ruper2.repository.RepositoryWrapper;
  import org.krysalis.ruper2.resource.ResourceGroup;
+ import org.krysalis.ruper2.util.RuperConstants;
  import org.krysalis.ruper2.util.select.AllSelector;
  import org.krysalis.version.util.cli.CommandLine;
+ import org.krysalis.version.util.cli.Option;
  import org.krysalis.version.util.debug.DebugUtils;
  
***************
*** 20,40 ****
  public class RepositoryTool extends Tool {
  
! 	protected void init()
! 	{
  	}
- 	
  
  	public void execute(CommandLine cmdline) throws Exception {
  
! 		//:TODO: Get from Manager/Factory, testing/playing hack...
  		RepositoryWrapper repo =
  			new RepositoryWrapper(
! 				DefaultRepository.getLocalTestRepository(),
! 				ResourceUpdaterContext.getTestContext());
  
! 		DebugUtils.dump(
! 			repo.listResources(
! 				new ResourceGroup("junit"),
! 				AllSelector.getInstance()));
  	}
  
--- 22,71 ----
  public class RepositoryTool extends Tool {
  
! 	private static Option l_repoOption = null;
! 	private static Option l_groupsOption = null;
! 	private static Option l_listOption = null;
! 
! 	static {
! 		l_repoOption = new Option("r", "repo", true, "Repository");
! 		l_groupsOption = new Option("g", "groups", false, "List groups");
! 		l_listOption = new Option("l", "list", true, "List resources");
! 	}
! 
! 	protected void init() {
! 		getOptions().addOption(l_repoOption);
! 		getOptions().addOption(l_groupsOption);
! 		getOptions().addOption(l_listOption);
  	}
  
  	public void execute(CommandLine cmdline) throws Exception {
+ 		String repoId =
+ 			cmdline.isSet(l_repoOption)
+ 				? cmdline.getOptionValue(l_repoOption)
+ 				: RuperConstants.DEFAULT;
  
! 		//DebugUtils.printSeparator();
! 		//DebugUtils.dump(cmdline);
! 		
  		RepositoryWrapper repo =
  			new RepositoryWrapper(
! 				DefaultRepository.getRepository(repoId, true),
! 				ResourceUpdaterContext.getDefaultContext());
  
! 		DebugUtils.printSeparator();
! 		DebugUtils.dump(repo);
! 
! 		if (cmdline.isSet(l_groupsOption)) {
! 			DebugUtils.printSeparator();
! 			DebugUtils.dump(repo.listGroups(AllSelector.getInstance()));
! 		}
! 
! 		if (cmdline.isSet(l_listOption)) {
! 			DebugUtils.printSeparator();
! 			DebugUtils.dump(
! 				repo.listResources(
! 					new ResourceGroup(
! 						cmdline.getMandatoryOptionValue(l_listOption)),
! 					AllSelector.getInstance()));
! 		}
  	}
  

Index: ResourceTool.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/tool/ResourceTool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ResourceTool.java	29 Sep 2003 18:09:15 -0000	1.1
--- ResourceTool.java	1 Oct 2003 21:55:54 -0000	1.2
***************
*** 25,29 ****
  	static {
  
! 		l_resourceOption = new Option("r", "resource", false, "resource");
  
  	}
--- 25,29 ----
  	static {
  
! 		l_resourceOption = new Option("r", "resource", true, "The resource to work on");
  
  	}




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.