ruper2/src/java/core/org/krysalis/ruper/query DefaultQueryEngine.java,1.7,1.8 ResourceQuery.java,1.7,1.8

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

Modified Files:
	DefaultQueryEngine.java ResourceQuery.java 
Log Message:
Tinkering...

Index: DefaultQueryEngine.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/query/DefaultQueryEngine.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** DefaultQueryEngine.java	23 Sep 2003 00:19:17 -0000	1.7
--- DefaultQueryEngine.java	23 Sep 2003 05:03:06 -0000	1.8
***************
*** 74,79 ****
  						Logger.getLog().warn(
  							Messages.getString(
! 								MessageConstants.NO_RESOURCES_FOUND,
! 								repo));
  					}
  					else {
--- 74,81 ----
  						Logger.getLog().warn(
  							Messages.getString(
! 								MessageConstants.NO_RESOURCES_FOUND_IN,
! 								query,
! 								repo,
! 								resourceGroup));
  					}
  					else {
***************
*** 103,117 ****
  				Messages.getString(MessageConstants.NO_RESOURCES_FOUND));
  		else {
! 			
  			if (Logger.getLog().isDebug()) {
  				DebugUtils.printSeparator();
! 			DebugUtils.dump("All Results", results);
  			}
  
  			groupBy(result, results, groupBy);
  
! 			
! 			if (Logger.getLog().isDebug()) {DebugUtils.printSeparator();
! 			DebugUtils.dump("Grouped Results", result);}
  
  			//
--- 105,120 ----
  				Messages.getString(MessageConstants.NO_RESOURCES_FOUND));
  		else {
! 
  			if (Logger.getLog().isDebug()) {
  				DebugUtils.printSeparator();
! 				DebugUtils.dump("All Results", results);
  			}
  
  			groupBy(result, results, groupBy);
  
! 			if (Logger.getLog().isDebug()) {
! 				DebugUtils.printSeparator();
! 				DebugUtils.dump("Grouped Results", result);
! 			}
  
  			//
***************
*** 125,131 ****
  			orderBy(result, orderBy);
  
! 			
! 			if (Logger.getLog().isDebug()) {DebugUtils.printSeparator();
! 			DebugUtils.dump("Final (Grouped/Ordered) Results", result);}
  
  		}
--- 128,135 ----
  			orderBy(result, orderBy);
  
! 			if (Logger.getLog().isDebug()) {
! 				DebugUtils.printSeparator();
! 				DebugUtils.dump("Final (Grouped/Ordered) Results", result);
! 			}
  
  		}

Index: ResourceQuery.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/query/ResourceQuery.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ResourceQuery.java	16 Sep 2003 20:40:32 -0000	1.7
--- ResourceQuery.java	23 Sep 2003 05:03:06 -0000	1.8
***************
*** 45,53 ****
  
  	private List m_groups = null;
! 	
  	//repository
  	private RepositorySet m_repositories = null;
  	private RepositorySetSortContext m_repositorySetSortContext = null;
! 	
  	private Selector m_where = null;
  	private Comparator m_orderBy = null;
--- 45,53 ----
  
  	private List m_groups = null;
! 
  	//repository
  	private RepositorySet m_repositories = null;
  	private RepositorySetSortContext m_repositorySetSortContext = null;
! 
  	private Selector m_where = null;
  	private Comparator m_orderBy = null;
***************
*** 72,76 ****
  		m_orderBy = orderBy;
  	}
! 	
  	public ResourceQuery(
  		ResourceGroup group,
--- 72,76 ----
  		m_orderBy = orderBy;
  	}
! 
  	public ResourceQuery(
  		ResourceGroup group,
***************
*** 85,95 ****
  		m_orderBy = orderBy;
  	}
! 	
! 	public ResourceQuery(
! 		ResourceGroup group) {
  		m_groups = new ArrayList();
  		m_groups.add(group);
  	}
! 	
  	//
  	// :TODO: Nice if we could make queries referenceable
--- 85,94 ----
  		m_orderBy = orderBy;
  	}
! 
! 	public ResourceQuery(ResourceGroup group) {
  		m_groups = new ArrayList();
  		m_groups.add(group);
  	}
! 
  	//
  	// :TODO: Nice if we could make queries referenceable
***************
*** 189,193 ****
  		DebugUtils.dump(out, depth + 1, "Resource Groups: ", verbose, m_groups);
  
! 		DebugUtils.printSeparator(out,depth+1);
  		DebugUtils.dump(
  			out,
--- 188,192 ----
  		DebugUtils.dump(out, depth + 1, "Resource Groups: ", verbose, m_groups);
  
! 		DebugUtils.printSeparator(out, depth + 1);
  		DebugUtils.dump(
  			out,
***************
*** 197,207 ****
  			m_repositories);
  
! 		DebugUtils.printSeparator(out,depth+1);
  		DebugUtils.dump(out, depth + 1, "Where: ", verbose, m_where);
! 		DebugUtils.printSeparator(out,depth+1);
  		DebugUtils.dump(out, depth + 1, "Group By: ", verbose, m_groupBy);
! 		DebugUtils.printSeparator(out,depth+1);
  		DebugUtils.dump(out, depth + 1, "Order By: ", verbose, m_orderBy);
  	}
  	/**
  	 * @return
--- 196,236 ----
  			m_repositories);
  
! 		DebugUtils.printSeparator(out, depth + 1);
  		DebugUtils.dump(out, depth + 1, "Where: ", verbose, m_where);
! 		DebugUtils.printSeparator(out, depth + 1);
  		DebugUtils.dump(out, depth + 1, "Group By: ", verbose, m_groupBy);
! 		DebugUtils.printSeparator(out, depth + 1);
  		DebugUtils.dump(out, depth + 1, "Order By: ", verbose, m_orderBy);
  	}
+ 
+ 	public String toString() {
+ 		StringBuffer buffer = new StringBuffer();
+ 
+ 		buffer.append("SELECT * FROM ");
+ 		if (null != m_repositories) {
+ 			buffer.append(m_repositories.getIdentifier());
+ 		}
+ 		else {
+ 			buffer.append("Default Repositories");
+ 		}
+ 
+ 		if (null != m_groups) {
+ 			buffer.append(":");
+ 			buffer.append(m_groups);
+ 		}
+ 		buffer.append(" WHERE ");
+ 		buffer.append(m_where);
+ 		if (null != m_groupBy) {
+ 			buffer.append(" GROUP_BY ");
+ 			buffer.append(m_groupBy);
+ 		}
+ 		if (null != m_orderBy) {
+ 			buffer.append(" ORDER_BY ");
+ 			buffer.append(m_orderBy);
+ 		}
+ 		//:TODO:Anou's stuff?
+ 		return buffer.toString();
+ 	}
+ 
  	/**
  	 * @return
***************
*** 231,234 ****
  		m_repositorySetSortContext = context;
  	}
- 
  }
--- 260,262 ----




-------------------------------------------------------
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.