Index: content-beans/src/main/java/org/hippoecm/hst/content/beans/solr/HstBeanIteratorImpl.java
===================================================================
--- content-beans/src/main/java/org/hippoecm/hst/content/beans/solr/HstBeanIteratorImpl.java	(revision 0)
+++ content-beans/src/main/java/org/hippoecm/hst/content/beans/solr/HstBeanIteratorImpl.java	(revision 0)
@@ -0,0 +1,80 @@
+package org.hippoecm.hst.content.beans.solr;
+
+import java.util.NoSuchElementException;
+
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.solr.common.SolrDocumentList;
+import org.hippoecm.hst.content.beans.HstBean;
+import org.hippoecm.hst.content.beans.standard.HippoBean;
+
+public class HstBeanIteratorImpl implements HstBeanIterator<HstBean> {
+
+    private  Session session;
+    private int position = 0;
+    private SolrDocumentList docs;
+    private Class<HstBean> beanMappingClazz;
+    private HstDocumentObjectBinder binder;
+    
+    public HstBeanIteratorImpl(SolrDocumentList docs, Session session, Class<HstBean> beanMappingClazz, HstDocumentObjectBinder binder) {
+       this.docs = docs;
+       this.session = session;
+       this.beanMappingClazz = beanMappingClazz;
+       this.binder = binder;
+    }
+    
+    @Override
+    public int getPosition() {
+        return position;
+    }
+
+    @Override
+    public int getSize() {
+        return docs.size();
+    }
+
+    @Override
+    public void skip(int skipNum) {
+        position+=skipNum;
+        if(position >= getSize()) {
+            position = getSize() - 1;
+        }
+    }
+
+    @Override
+    public boolean hasNext() {
+        return position < getSize();
+    }
+ 
+    @Override
+    public HstBean next() {
+        if(position >= getSize()) {
+            throw new NoSuchElementException("No next bean");
+        }
+        HstBean next = binder.getBean(beanMappingClazz, docs.get(position));
+        // HstBean next = beans.get(position);
+        position++;
+        if(next instanceof HippoBean) {
+            // attach jcr node again
+            try {
+                HippoBean bean = (HippoBean)next;
+                Node jcrNode = session.getNodeByIdentifier(bean.getCanonicalUUID());
+                bean.setNode(jcrNode);
+            } catch (ItemNotFoundException e) {
+                // log warning : cannot attach jcr node 
+            } catch (RepositoryException e) {
+                // log warning : cannot attach jcr node  
+            }
+        }
+        return next;
+    }
+
+    @Override
+    public void remove() {
+        throw new UnsupportedOperationException("Remove is not supported");
+    }
+
+}
Index: content-beans/src/main/java/org/hippoecm/hst/content/beans/solr/HstDocumentObjectBinder.java
===================================================================
--- content-beans/src/main/java/org/hippoecm/hst/content/beans/solr/HstDocumentObjectBinder.java	(revision 0)
+++ content-beans/src/main/java/org/hippoecm/hst/content/beans/solr/HstDocumentObjectBinder.java	(revision 0)
@@ -0,0 +1,443 @@
+package org.hippoecm.hst.content.beans.solr;
+
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Array;
+import java.lang.reflect.Field;
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.regex.Pattern;
+
+import org.apache.commons.lang.time.FastDateFormat;
+import org.apache.solr.client.solrj.beans.DocumentObjectBinder;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrInputDocument;
+import org.hippoecm.hst.content.beans.index.IndexField;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A class to map objects to and from solr documents.
+ * 
+ * @version $Id: DocumentObjectBinder.java 812759 2009-09-09 03:49:18Z noble $
+ * @since solr 1.3
+ */
+public class HstDocumentObjectBinder extends DocumentObjectBinder {
+  
+  private static final FastDateFormat df = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("GMT+00:00"));
+     
+  private static final org.slf4j.Logger log = LoggerFactory.getLogger(HstDocumentObjectBinder.class);
+    
+  private final Map<Class, List<DocField>> infocache = new ConcurrentHashMap<Class, List<DocField>>();
+  
+  private final static String HST_BEAN_FQN_CLAZZ_NAME = "hst_bean_fqn_clazz_name";
+  public HstDocumentObjectBinder() {
+  }
+
+  public <T> T  getBean(Class<T> clazz, SolrDocument sdoc) {
+      String beanClazz = (String) sdoc.get(HST_BEAN_FQN_CLAZZ_NAME);
+      if (beanClazz == null) {
+          // we cannot return beans that do not have a 'clazz'
+          return null;
+      }
+
+      Object obj = null;
+      try { 
+          Class c = Thread.currentThread().getContextClassLoader().loadClass(beanClazz);
+          if (!clazz.isAssignableFrom(c)) {
+              // log warning
+              return null;
+          }
+          obj = c.newInstance();
+          List<DocField> fields = getDocFields(c);
+          for (int i = 0; i < fields.size(); i++) {
+              DocField docField = fields.get(i);
+              docField.inject(obj, sdoc);
+          }
+          return (T) obj;
+      } catch (Exception e) {
+          log.warn("Could not instantiate object of class " + beanClazz, e);
+          return null;
+      }
+  }
+  
+  @Override
+  public <T> List<T> getBeans(Class<T> clazz, SolrDocumentList solrDocList) {
+       
+    List<T> result = new ArrayList<T>();
+    for (int j = 0; j < solrDocList.size(); j++) {
+        SolrDocument sdoc = solrDocList.get(j);
+        T bean = (T) getBean(clazz, sdoc);
+        result.add(bean);
+    }
+    return result;
+  }
+  
+
+  @Override
+  public SolrInputDocument toSolrInputDocument( Object obj )
+  {
+    List<DocField> fields = getDocFields( obj.getClass() );
+    if( fields.isEmpty() ) {
+      throw new RuntimeException( "class: "+obj.getClass()+" does not define any fields." );
+    }
+    
+    SolrInputDocument doc = new SolrInputDocument();
+    for( DocField field : fields ) {
+      doc.setField( field.name, field.get( obj ), 1.0f );
+    }
+    // default field name we always add:
+    doc.setField( HST_BEAN_FQN_CLAZZ_NAME, obj.getClass().getName(), 1.0f );
+    return doc;
+  }
+  
+
+  private List<DocField> getDocFields( Class clazz )
+  {
+        boolean caching = true;
+        if (caching) {
+            List<DocField> fields = infocache.get(clazz);
+            if (fields == null) {
+                synchronized (infocache) {
+                    infocache.put(clazz, fields = collectInfo(clazz));
+                }
+            }
+            return fields;
+        } else {
+            return collectInfo(clazz);
+        }
+
+  }
+
+
+  private List<DocField> collectInfo(Class clazz) {
+    List<DocField> fields = new ArrayList<DocField>();
+    Class superClazz = clazz;
+    ArrayList<AccessibleObject> members = new ArrayList<AccessibleObject>();
+    while (superClazz != null && superClazz != Object.class) {
+         
+      members.addAll(Arrays.asList(superClazz.getDeclaredFields()));
+      members.addAll(Arrays.asList(superClazz.getDeclaredMethods()));
+      superClazz = superClazz.getSuperclass();
+    }
+    for (AccessibleObject member : members) {
+      if (member.isAnnotationPresent(IndexField.class)) {
+        member.setAccessible(true);
+        fields.add(new DocField(member));
+      }
+    }
+    return fields;
+  }
+
+  private static class DocField {
+    private String name;
+    private java.lang.reflect.Field field;
+    private Method getter;
+    private Class type;
+    private boolean isArray = false, isList=false;
+
+    /*
+     * dynamic fields may use a Map based data structure to bind a given field.
+     * if a mapping is done using, "Map<String, List<String>> foo", <code>isContainedInMap</code>
+     * is set to <code>TRUE</code> as well as <code>isList</code> is set to <code>TRUE</code>
+     */
+    boolean isContainedInMap =false;
+    private Pattern dynamicFieldNamePatternMatcher;
+
+    public DocField(AccessibleObject member) {
+      if (member instanceof java.lang.reflect.Field) {
+        field = (java.lang.reflect.Field) member;
+      } else {
+        getter = (Method) member;
+      }
+      IndexField annotation = member.getAnnotation(IndexField.class);
+      storeName(annotation);
+      storeType();
+      
+      // Look for a matching getter for either field or setter. 
+      
+      String gname = null;
+      Class<?> declaringClass = null;
+      if( getter != null ) {
+       // we already have a getter
+      } else {
+          gname = "get" + field.getName().substring(0,1).toUpperCase() + field.getName().substring(1);
+          declaringClass = field.getDeclaringClass();
+          if(gname != null && declaringClass != null) {
+          try {
+              getter = declaringClass.getMethod( gname, (Class[])null );
+            }
+            catch( Exception ex ) {
+              // no getter -- don't worry about it...
+              if( type == Boolean.class ) {
+                gname = "is" + gname.substring( 3 );
+                try {
+                  getter = declaringClass.getMethod( gname, (Class[])null );
+                }
+                catch( Exception ex2 ) {
+                  // no getter -- don't worry about it...
+                }
+              }
+            }
+          }
+      }
+      
+      
+      
+    }
+
+    private void storeName(IndexField annotation) {
+      if (annotation.name().equals(IndexField.DEFAULT)) {
+        if (field != null) {
+          name = field.getName();
+        } else {
+          String getterName = getter.getName();
+          if (getterName.startsWith("get") && getterName.length() > 3) {
+            name = getterName.substring(3, 4).toLowerCase() + getterName.substring(4);
+          } else {
+            name = getter.getName();
+          }
+        }
+      }
+      //dynamic fields are annotated as @Field("categories_*")
+      else if(annotation.name().indexOf('*') >= 0){
+        //if the field was annotated as a dynamic field, convert the name into a pattern
+        //the wildcard (*) is supposed to be either a prefix or a suffix, hence the use of replaceFirst
+        name = annotation.name().replaceFirst("\\*", "\\.*");
+        dynamicFieldNamePatternMatcher = Pattern.compile("^"+name+"$");
+      } else {
+        name = annotation.name();
+      }
+    }
+
+    private void storeType() {
+      if (field != null) {
+        type = field.getType();
+      } else { 
+        type = getter.getReturnType();
+      }
+      if(type == Collection.class || type == List.class || type == ArrayList.class) {
+        type = Object.class;
+        isList = true;
+      } else if(type == byte[].class){
+        //no op
+      }else if (type.isArray()) {
+        isArray = true;
+        type = type.getComponentType();
+      }
+      //corresponding to the support for dynamicFields
+      else if (type == Map.class || type == HashMap.class) {
+        isContainedInMap = true;
+        //assigned a default type
+        type = Object.class;
+        if(field != null){
+          if(field.getGenericType() instanceof ParameterizedType){
+            //check what are the generic values
+            ParameterizedType parameterizedType = (ParameterizedType) field.getGenericType();
+            Type[] types = parameterizedType.getActualTypeArguments();
+            if(types != null && types.length == 2 && types[0] == String.class){
+              //the key should always be String
+              //Raw and primitive types
+              if(types[1] instanceof Class){
+                //the value could be multivalued then it is a List ,Collection,ArrayList
+                if(types[1]== Collection.class || types[1] == List.class || types[1] == ArrayList.class){
+                  type = Object.class;
+                  isList = true;
+                }else{
+                  //else assume it is a primitive and put in the source type itself
+                  type = (Class) types[1];
+                }
+              }
+              //Of all the Parameterized types, only List is supported
+              else if(types[1] instanceof ParameterizedType){
+                Type rawType = ((ParameterizedType)types[1]).getRawType();
+                if(rawType== Collection.class || rawType == List.class || rawType == ArrayList.class){
+                  type = Object.class;
+                  isList = true;
+                }
+              }
+              //Array types
+              else if(types[1] instanceof GenericArrayType){
+                type = (Class) ((GenericArrayType) types[1]).getGenericComponentType();
+                isArray = true;
+              }
+              //Throw an Exception if types are not known
+              else{
+                throw new RuntimeException("Allowed type for values of mapping a dynamicField are : " +
+                    "Object, Object[] and List");
+              }
+            }
+          }
+        }
+      }
+    }
+
+    /**
+     * Called by the {@link #inject} method to read the value(s) for a field
+     * This method supports reading of all "matching" fieldName's in the <code>SolrDocument</code>
+     *
+     * Returns <code>SolrDocument.getFieldValue</code> for regular fields,
+     * and <code>Map<String, List<Object>></code> for a dynamic field. The key is all matching fieldName's.
+     */
+    @SuppressWarnings("unchecked")
+    private Object getFieldValue(SolrDocument sdoc){
+      Object fieldValue = sdoc.getFieldValue(name);
+      if(fieldValue != null) {
+        //this is not a dynamic field. so return te value
+        return fieldValue;
+      }
+      //reading dynamic field values
+      if(dynamicFieldNamePatternMatcher != null){
+        Map<String, Object> allValuesMap = null;
+        ArrayList allValuesList = null;
+        if(isContainedInMap){
+         allValuesMap = new HashMap<String, Object>();
+        } else {
+          allValuesList = new ArrayList();
+        }
+        for(String field : sdoc.getFieldNames()){
+          if(dynamicFieldNamePatternMatcher.matcher(field).find()){
+            Object val = sdoc.getFieldValue(field);
+            if(val == null) continue;
+            if(isContainedInMap){
+              if(isList){
+                if (!(val instanceof List)) {
+                  ArrayList al = new ArrayList();
+                  al.add(val);
+                  val = al;
+                }
+              } else if(isArray){
+                if (!(val instanceof List)) {
+                  Object[] arr= (Object[]) Array.newInstance(type,1);
+                  arr[0] = val;
+                  val= arr;
+                } else {
+                  val = Array.newInstance(type,((List)val).size());
+                }
+              }
+              allValuesMap.put(field, val);
+            }else {
+              if (val instanceof Collection) {
+                allValuesList.addAll((Collection) val);
+              } else {
+                allValuesList.add(val);
+              }
+            }
+          }
+        }
+        if (isContainedInMap) {
+          return allValuesMap.isEmpty() ? null : allValuesMap;
+        } else {
+          return allValuesList.isEmpty() ? null : allValuesList;
+        }
+      }
+      return null;
+    }
+    <T> void inject(T obj, SolrDocument sdoc) {
+      Object val = getFieldValue(sdoc);
+      if(val == null) {
+        return;
+      } 
+      if(isArray && !isContainedInMap){
+        List list = null;
+        if(val.getClass().isArray()){
+          set(obj,val);
+          return;
+        } else if (val instanceof List) {
+          list = (List) val;
+        } else{
+          list = new ArrayList();
+          list.add(val);
+        }
+        set(obj, list.toArray((Object[]) Array.newInstance(type,list.size())));        
+      } else if(isList && !isContainedInMap){
+        if (!(val instanceof List)) {
+          ArrayList list = new ArrayList();
+          list.add(val);
+          val =  list;
+        }
+        set(obj, val);
+      } else if(isContainedInMap){
+        if (val instanceof Map) {
+          set(obj,  val);
+        }
+      } else {
+        set(obj, val);
+      }
+
+    }
+
+
+    private void set(Object obj, Object v) {
+      if(v!= null && type == ByteBuffer.class && v.getClass()== byte[].class) {
+        v = ByteBuffer.wrap((byte[])v);
+      }
+      try {
+        if (field != null) { 
+          Object formatted = formatValueToField(field, v);
+          field.set(obj, formatted);
+        }
+      } 
+      catch (Exception e) {
+        throw new RuntimeException("Exception while setting value : "+v+" on " +  field , e);
+      }
+    }
+ 
+
+    private Object formatValueToField(Field f, Object v) {
+        if(f.getType().equals(Calendar.class) && (v instanceof Date)) {
+            Calendar cal = Calendar.getInstance();
+            cal.setTime((Date)v);
+            return cal;
+        }
+        return v;
+    }
+
+    public Object get( final Object obj )
+    {  
+     
+      Object val;
+      if (field != null) {
+        try { 
+          val = field.get(obj);
+          if(val != null) {
+              return format(val);
+          }
+        } 
+        catch (Exception e) {        
+          throw new RuntimeException("Exception while getting value: " + field, e);
+        }
+      }
+      
+      if (getter != null) {
+            try {
+                return format( getter.invoke(obj, (Object[]) null));
+            } catch (Exception e) {
+                throw new RuntimeException("Exception while getting value: " + getter, e);
+            }
+      } 
+      
+      return null;
+    }
+
+    private Object format(Object val) {
+        if(val instanceof Calendar) {
+            return  df.format((Calendar)val);
+        }
+        return val;
+    }
+  }
+}
+
Index: content-beans/src/main/java/org/hippoecm/hst/content/beans/solr/HstSolrQueryImpl.java
===================================================================
--- content-beans/src/main/java/org/hippoecm/hst/content/beans/solr/HstSolrQueryImpl.java	(revision 0)
+++ content-beans/src/main/java/org/hippoecm/hst/content/beans/solr/HstSolrQueryImpl.java	(revision 0)
@@ -0,0 +1,144 @@
+package org.hippoecm.hst.content.beans.solr;
+
+import java.util.List;
+
+import javax.jcr.Session;
+
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.SolrServer;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.util.NamedList;
+import org.hippoecm.hst.content.beans.HstBean;
+import org.hippoecm.hst.content.beans.query.exceptions.QueryException;
+import org.hippoecm.hst.content.beans.query.filter.BaseFilter;
+import org.hippoecm.hst.content.beans.query.filter.Filter;
+
+public class HstSolrQueryImpl implements HstSolrQuery {
+
+    private SolrServer server;
+
+    private Session session;
+    
+    private String query;
+    
+    private int limit;
+    
+    private int offset;
+    
+    public HstSolrQueryImpl(Session session, SolrServer server) {
+        this.server = server;
+        this.session = session;
+    }
+    
+    
+    public HstSolrQueryImpl(Session session, SolrServer server, String query) {
+        this.server = server;
+        this.session = session;
+        this.query = query;
+    }
+    
+    
+    @Override
+    public void addOrderByAscending(String fieldNameAttribute) {
+       throw new UnsupportedOperationException("not yet implemented");
+    }
+
+
+
+    @Override
+    public void addOrderByDescending(String fieldNameAttribute) {
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+
+
+    @Override
+    public Filter createFilter() {
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+
+
+    @Override
+    public HstSolrQueryResult execute() throws QueryException {
+        SolrQuery solrQuery = new SolrQuery();
+         
+        if(query == null) {
+            solrQuery.setQuery( "*:*" );
+        } else {
+
+            //solrQuery.setQuery("constructionDate:[1976-03-06T23:59:59.999Z TO *]");
+            solrQuery.setQuery(query);
+        }
+        solrQuery.addSortField( "name", SolrQuery.ORDER.asc );
+
+        solrQuery.set("start", offset);
+        solrQuery.set("rows", limit);
+        
+        try {
+            QueryResponse rsp = server.query( solrQuery );
+           
+            SolrDocumentList docs = rsp.getResults();
+            NamedList<Object> namedList =  rsp.getResponse();
+             
+            //System.out.println(rsp.getSpellCheckResponse());
+            //System.out.println(docs.size());
+            
+            System.out.println(docs.getNumFound());
+            
+            List<HstBean> bindedBeans = new HstDocumentObjectBinder().getBeans(HstBean.class, docs);
+            
+            //List<TextItem> beans = rsp.getBeans(TextItem.class);
+            
+            return new HstSolrQueryResultImpl(docs , session, HstBean.class, new HstDocumentObjectBinder());
+            
+        } catch (SolrServerException e) {
+           throw new QueryException("Exception during querying Solr server", e);
+        }
+    }
+
+
+
+    @Override
+    public BaseFilter getFilter() {
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    @Override
+    public int getLimit() {
+        return limit;
+    }
+
+    @Override
+    public int getOffset() {
+       return offset;
+    }
+
+    @Override
+    public String getQueryAsString() throws QueryException {
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    @Override
+    public void setFilter(BaseFilter filter) {
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    @Override
+    public void setLimit(int limit) {
+       this.limit = limit;
+    }
+
+
+
+    @Override
+    public void setOffset(int offset) {
+       this.offset = offset;
+    }
+    
+    
+    
+
+}
Index: content-beans/src/main/java/org/hippoecm/hst/content/beans/solr/HstSolrQueryResultImpl.java
===================================================================
--- content-beans/src/main/java/org/hippoecm/hst/content/beans/solr/HstSolrQueryResultImpl.java	(revision 0)
+++ content-beans/src/main/java/org/hippoecm/hst/content/beans/solr/HstSolrQueryResultImpl.java	(revision 0)
@@ -0,0 +1,38 @@
+package org.hippoecm.hst.content.beans.solr;
+
+import javax.jcr.Session;
+
+import org.apache.solr.common.SolrDocumentList;
+import org.hippoecm.hst.content.beans.HstBean;
+
+public class HstSolrQueryResultImpl implements HstSolrQueryResult {
+
+    private SolrDocumentList docs;
+    private Session session;
+    private Class<HstBean> beanMappingClazz;
+    private HstDocumentObjectBinder binder;
+    
+    
+    public HstSolrQueryResultImpl(SolrDocumentList docs, Session session, Class<HstBean> beanMappingClazz, HstDocumentObjectBinder binder) {
+       this.docs = docs;
+       this.session = session;
+       this.beanMappingClazz = beanMappingClazz;
+       this.binder = binder;
+    }
+
+    @Override
+    public HstBeanIterator<HstBean> getHstBeans() {
+        return new HstBeanIteratorImpl(docs, session, beanMappingClazz, binder);
+    }
+
+    @Override
+    public int getSize() {
+        return (int)docs.getNumFound();
+    }
+
+    @Override
+    public int getTotalSize() {
+        return (int)docs.getNumFound();
+    }
+
+}
Index: content-beans/src/main/java/org/hippoecm/hst/content/beans/standard/HippoItem.java
===================================================================
--- content-beans/src/main/java/org/hippoecm/hst/content/beans/standard/HippoItem.java	(revision 29843)
+++ content-beans/src/main/java/org/hippoecm/hst/content/beans/standard/HippoItem.java	(working copy)
@@ -28,6 +28,7 @@
 import javax.jcr.Session;
 
 import org.hippoecm.hst.content.beans.ObjectBeanManagerException;
+import org.hippoecm.hst.content.beans.index.IndexField;
 import org.hippoecm.hst.content.beans.manager.ObjectConverter;
 import org.hippoecm.hst.content.beans.query.HstContextualizeException;
 import org.hippoecm.hst.content.beans.query.HstCtxWhereClauseComputer;
@@ -77,6 +78,7 @@
         return this.valueProvider;
     }
 
+    @IndexField // this is a mandatory field for indexing
     public String getName() {
         return valueProvider.getName();
     }
@@ -89,9 +91,16 @@
         return (valueProvider == null) ? null : valueProvider.getPath();
     }
 
+    @IndexField(name="id") // this is a mandatory field for indexing
+    String canonicalUUID;
+    
     @Override
     public String getCanonicalUUID() {
-        return getValueProvider().getIdentifier();
+        if(canonicalUUID != null) {
+            return canonicalUUID;
+        }
+        canonicalUUID = getValueProvider().getIdentifier();
+        return canonicalUUID;
     }
 
     @Override
Index: content-beans/pom.xml
===================================================================
--- content-beans/pom.xml	(revision 29843)
+++ content-beans/pom.xml	(working copy)
@@ -125,6 +125,17 @@
     
     <!-- Hst test dependencies -->
     
+    
+    <!-- SOLR  -->
+    <dependency>
+        <artifactId>solr-solrj</artifactId>
+        <groupId>org.apache.solr</groupId>
+        <version>1.4.1</version>
+        <!-- version>${solr-solrj.version}</version-->
+    </dependency>
+    
+    <!-- END SOLR  -->
+    
   </dependencies>
   
   <build>
Index: client-modules/solr/.classpath
===================================================================
--- client-modules/solr/.classpath	(revision 0)
+++ client-modules/solr/.classpath	(revision 0)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>
Index: client-modules/solr/.project
===================================================================
--- client-modules/solr/.project	(revision 0)
+++ client-modules/solr/.project	(revision 0)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>hst-trunk-hst-solr</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+	</natures>
+</projectDescription>
Index: client-modules/solr/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- client-modules/solr/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ client-modules/solr/.settings/org.eclipse.jdt.core.prefs	(revision 0)
@@ -0,0 +1,6 @@
+#Fri Aug 26 12:18:28 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.6
Index: client-modules/solr/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- client-modules/solr/.settings/org.maven.ide.eclipse.prefs	(revision 0)
+++ client-modules/solr/.settings/org.maven.ide.eclipse.prefs	(revision 0)
@@ -0,0 +1,9 @@
+#Fri Aug 26 12:04:55 CEST 2011
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Index: client-modules/solr/pom.xml
===================================================================
--- client-modules/solr/pom.xml	(revision 0)
+++ client-modules/solr/pom.xml	(revision 0)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2008 Hippo
+
+  Licensed under the Apache License, Version 2.0 (the  "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS"
+  BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.onehippo.cms7.hst</groupId>
+    <artifactId>client-modules</artifactId>
+    <version>2.23.02-SNAPSHOT</version>
+  </parent>
+
+  <name>Hippo Site Toolkit Client Module Solr Integration</name>
+  <description>Hippo Site Toolkit Client Module Solr Integration</description>
+  <groupId>org.onehippo.cms7.hst.client-modules</groupId>
+  <artifactId>hst-solr</artifactId>
+  <packaging>jar</packaging>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>org.onehippo.cms7</groupId>
+      <artifactId>hippo-repository-api</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.onehippo.cms7.hst</groupId>
+      <artifactId>hst-content-beans</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.onehippo.cms7.hst</groupId>
+      <artifactId>hst-client</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.onehippo.cms7.hst</groupId>
+      <artifactId>hst-api</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.onehippo.cms7.hst.components</groupId>
+      <artifactId>hst-core</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.onehippo.cms7.hst</groupId>
+      <artifactId>hst-commons</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    
+  </dependencies>
+  
+ <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <workingDirectory>${project.build.directory}</workingDirectory>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  
+</project>
Index: client-modules/solr/src/main/java/org/hippoecm/hst/solr/SolrIntegration.java
===================================================================
--- client-modules/solr/src/main/java/org/hippoecm/hst/solr/SolrIntegration.java	(revision 0)
+++ client-modules/solr/src/main/java/org/hippoecm/hst/solr/SolrIntegration.java	(revision 0)
@@ -0,0 +1,387 @@
+package org.hippoecm.hst.solr;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.jcr.Credentials;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.solr.client.solrj.SolrServer;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.beans.DocumentObjectBinder;
+import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
+import org.hippoecm.hst.component.support.spring.util.MetadataReaderClasspathResourceScanner;
+import org.hippoecm.hst.content.beans.HstBean;
+import org.hippoecm.hst.content.beans.ObjectBeanManagerException;
+import org.hippoecm.hst.content.beans.manager.ObjectConverter;
+import org.hippoecm.hst.content.beans.solr.HstDocumentObjectBinder;
+import org.hippoecm.hst.content.beans.standard.HippoBean;
+import org.hippoecm.hst.content.beans.standard.HippoDocumentBean;
+import org.hippoecm.hst.logging.Logger;
+import org.hippoecm.hst.logging.LoggerFactory;
+import org.hippoecm.hst.site.HstServices;
+import org.hippoecm.hst.util.ObjectConverterUtils;
+import org.hippoecm.repository.api.HippoNodeType;
+import org.springframework.core.io.DefaultResourceLoader;
+import org.xml.sax.SAXException;
+
+public class SolrIntegration {
+    
+    private static final String LOGGER_CATEGORY_NAME = SolrIntegration.class.getName();
+
+    protected LoggerFactory loggerFactory;
+    
+    /*
+    CommonsHttpSolrServer is thread-safe and if you are using the following constructor,
+    you *MUST* re-use the same instance for all requests.  If instances are created on
+    the fly, it can cause a connection leak. The recommended practice is to keep a
+    static instance of CommonsHttpSolrServer per solr server url and share it for all requests.
+    See https://issues.apache.org/jira/browse/SOLR-861 for more details
+    */ 
+    
+    private static final String DEFAULT_SOLR_URL = "http://localhost:8983/solr"; 
+    private String solrUrl = DEFAULT_SOLR_URL;
+    private SolrServer solrServer;
+    private SolrIndexerThread solrIndexerThread;
+
+    protected long checkInterval = 5000L;
+    protected Repository repository; 
+    protected Credentials credentials;
+    protected ObjectConverter objectConverter = null;
+    protected Session session;
+    protected boolean stopped = false;
+    protected String rootScope = "/content";
+    
+    public void setLoggerFactory(LoggerFactory loggerFactory) {
+        this.loggerFactory = loggerFactory;
+    }
+    
+    protected Logger getLogger() {
+        if (loggerFactory != null) {
+            return loggerFactory.getLogger(LOGGER_CATEGORY_NAME);
+        } else {
+            return HstServices.getLogger(LOGGER_CATEGORY_NAME);
+        }
+    }
+    
+    public void setSolrUrl(String solrUrl) {
+        this.solrUrl = solrUrl;
+    } 
+    public void setRepository(Repository repository) {
+        this.repository = repository;
+    }
+
+    public void setCredentials(Credentials credentials) {
+        this.credentials = credentials;
+    }
+
+    
+   public void start() {
+       doInit();
+   }
+   
+   protected void doInit() {
+       objectConverter = getObjectConvertor();
+       if(objectConverter == null) {
+           getLogger().error("Cannot get annotated beans");
+           return;
+       }
+       
+       solrIndexerThread = new SolrIndexerThread() ;
+       solrIndexerThread.start();
+       
+       
+   }
+
+   protected void doDeinit() {
+       doDeInitSolrServer();
+       doDeInitJcrSession();
+   }
+   
+   protected void doInitSolrServer() throws Exception {
+        solrServer = getSolrServer();
+        solrServer.ping();
+ 
+   }
+   
+   protected void doDeInitSolrServer() {
+      
+   }
+   
+   protected void doInitJcrSession() throws RepositoryException {
+       if (this.credentials == null) {
+           session = this.repository.login();
+       } else {
+           session = this.repository.login(this.credentials);
+       }
+      
+   }
+   
+   protected void doDeInitJcrSession() {
+       
+   }
+  
+   public void stop() {
+       this.stopped = true;
+       doDeinit();
+   }
+   
+    public ObjectConverter getObjectConvertor() {
+        try {
+            return ObjectConverterUtils.createObjectConverter(getAnnotatedClasses());
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+            return null;
+        } 
+    }
+
+    public List<Class<? extends HippoBean>> getAnnotatedClasses() throws IOException, SAXException,
+            ParserConfigurationException {
+
+        MetadataReaderClasspathResourceScanner scanner = new MetadataReaderClasspathResourceScanner();
+        scanner.setResourceLoader(new DefaultResourceLoader());
+        return ObjectConverterUtils.getAnnotatedClasses(scanner, StringUtils.split("classpath*:org/hippoecm/hst/demo/beans/**/*.class", ", \t\r\n"));
+
+    }
+     
+    public SolrServer getSolrServer() throws SolrServerNotAvailableException {
+        if(solrServer != null) {
+            if(isSolrServerLive()) {
+                return solrServer;
+            } else {
+                throw new SolrServerNotAvailableException();
+            }
+        }
+        try {
+            solrServer = new CommonsHttpSolrServer(solrUrl) {
+            private static final long serialVersionUID = 1L;
+                @Override
+                public DocumentObjectBinder getBinder() {
+                    return new HstDocumentObjectBinder();
+                }
+            };
+        } catch (MalformedURLException e) {
+            throw new SolrServerNotAvailableException();
+        }
+        
+        if(!isSolrServerLive ()) {
+            throw new SolrServerNotAvailableException();
+        }        
+        
+        return solrServer;
+    }
+    
+    public boolean isSolrServerLive () {
+        if(solrServer != null) {
+            try {
+                solrServer.ping();
+                // solrServer up & running & accessible
+                return true;
+            } catch (Exception e) {
+              e.printStackTrace();
+            }
+        }
+        return false;
+    }
+    
+    
+    private class SolrIndexerThread extends Thread {
+
+        private boolean firstIndexingCrawlDone = false;
+        
+        private SolrIndexerThread() {
+            super("SolrAndJcrSessionChecker");
+            setDaemon(true);
+        }
+
+        public void run() {
+            boolean canIndex = true;
+            while (!SolrIntegration.this.stopped) {
+                boolean isSessionLive = false;
+                try {
+                    if(SolrIntegration.this.session != null){
+                        isSessionLive = SolrIntegration.this.session.isLive();
+                    }
+                } catch (Exception e) {
+                    getLogger().debug("Exception while checking jcr session: {}", e.toString());
+                }
+                
+                if (SolrIntegration.this.session == null || !isSessionLive) {
+                    doDeInitJcrSession();
+                    try {
+                        doInitJcrSession();
+                    } catch (RepositoryException e) {
+                        canIndex = false;
+                        e.printStackTrace();
+                    }
+                }
+                
+                boolean isSolrServerAvailable = false;
+                if(SolrIntegration.this.solrServer != null){
+                    try {
+                        solrServer.ping();
+                        isSolrServerAvailable = true;
+                    } catch (Exception e) {
+                        getLogger().debug("Exception while checking solr server: {}", e.toString());
+                    }
+                } 
+                
+                if(!isSolrServerAvailable) {
+                    doDeInitSolrServer();
+                    try {
+                        doInitSolrServer();
+                    } catch (Exception e) {
+                        canIndex = false;
+                        e.printStackTrace();
+                    }
+                }
+ 
+                if(canIndex) {
+                    if(!firstIndexingCrawlDone) {
+                        try {
+                            solrServer.deleteByQuery("*:*"); // delete everything! 
+                            solrServer.commit();
+
+                            long start = System.currentTimeMillis();
+                            Node jcrNode = session.getNode(rootScope);
+                            AutoBeanCommittingAndClearingList<HstBean> beansToIndex = 
+                                new AutoBeanCommittingAndClearingList<HstBean>(1000, solrServer);
+                            indexDescendantDocuments(jcrNode, beansToIndex);
+                            beansToIndex.commit();
+                            firstIndexingCrawlDone = true;
+                            System.out.println("It took " + (System.currentTimeMillis() - start) + " ms to index " + beansToIndex.totalCommitted +" documents ");
+                        } catch (SolrServerException e) {
+                            e.printStackTrace();
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                        } catch (PathNotFoundException e) {
+                            e.printStackTrace();
+                        } catch (RepositoryException e) {
+                            e.printStackTrace();
+                        } 
+                        
+                    } else {
+                        // pick up queue
+                    }
+                }
+                
+                synchronized (this) {
+                    try {
+                        wait(SolrIntegration.this.checkInterval);
+                    } catch (InterruptedException e) {
+                        if (SolrIntegration.this.stopped) {
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+        
+        private void indexDescendantDocuments(Node node, List<HstBean> beansToIndex) {
+            try {
+                NodeIterator childNodes = node.getNodes();
+                while(childNodes.hasNext()) {
+                    Node child = childNodes.nextNode();
+                    if(child.isNodeType(HippoNodeType.NT_HARDHANDLE)) {
+                        // fetch the beans for all the documents that are of type hippo:harddocument and index them
+                        NodeIterator documents = child.getNodes();
+                        while(documents.hasNext()) {
+                            Node doc = documents.nextNode();
+                            if(doc.isNodeType(HippoNodeType.NT_HARDDOCUMENT)) {
+                              try {
+                                HippoDocumentBean documentBean = (HippoDocumentBean)objectConverter.getObject(doc);
+                                beansToIndex.add(documentBean);
+                            } catch (ObjectBeanManagerException e) {
+                                e.printStackTrace();
+                            }  
+                            } 
+                        }
+                    } else if(child.isNodeType(HippoNodeType.NT_HARDDOCUMENT)) {
+                        indexDescendantDocuments(child, beansToIndex);
+                    }
+                }
+            } catch (RepositoryException e) {
+                e.printStackTrace();
+            }
+            
+        }
+        
+        
+    }
+    
+    
+    private class AutoBeanCommittingAndClearingList<E extends HstBean> extends ArrayList<E> {
+
+        private static final long serialVersionUID = 1L;
+        
+        private int limit;
+        private SolrServer server;
+        private int totalCommitted;
+        
+        AutoBeanCommittingAndClearingList(int limit, SolrServer server) {
+            this.limit = limit;
+            this.server = server;
+        }
+
+        @Override
+        public boolean add(E e) {
+            boolean b =  super.add(e);
+            ifFullCommit();
+            return b;
+        }
+
+        @Override
+        public void add(int index, E element) {
+           super.add(index, element);
+           ifFullCommit();
+        }
+
+        @Override
+        public boolean addAll(Collection<? extends E> c) {
+            boolean b =  super.addAll(c);
+            ifFullCommit();
+            return b;
+        }
+
+        @Override
+        public boolean addAll(int index, Collection<? extends E> c) {
+            boolean b =  super.addAll(index, c);
+            ifFullCommit();
+            return b;
+        }
+        
+        private void ifFullCommit() {
+            if(size() >= limit) {
+               commit(); 
+            }
+        }
+        
+        private void commit() { 
+            try {
+                server.addBeans(this);
+                server.commit();
+                totalCommitted += this.size();
+                System.out.println("totalCommitted = " + totalCommitted);
+                this.clear();
+            } catch (SolrServerException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            } catch (IOException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+    }
+
+}
Index: client-modules/solr/src/main/java/org/hippoecm/hst/solr/SolrServerNotAvailableException.java
===================================================================
--- client-modules/solr/src/main/java/org/hippoecm/hst/solr/SolrServerNotAvailableException.java	(revision 0)
+++ client-modules/solr/src/main/java/org/hippoecm/hst/solr/SolrServerNotAvailableException.java	(revision 0)
@@ -0,0 +1,7 @@
+package org.hippoecm.hst.solr;
+
+public class SolrServerNotAvailableException extends Exception {
+
+    private static final long serialVersionUID = 1L;
+
+}
Index: client-modules/solr/src/main/resources/org/hippoecm/hst/solr/SpringComponentManager-solr.xml
===================================================================
--- client-modules/solr/src/main/resources/org/hippoecm/hst/solr/SpringComponentManager-solr.xml	(revision 0)
+++ client-modules/solr/src/main/resources/org/hippoecm/hst/solr/SpringComponentManager-solr.xml	(revision 0)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2011 Hippo
+
+  Licensed under the Apache License, Version 2.0 (the  "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS"
+  BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:lang="http://www.springframework.org/schema/lang"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                           http://www.springframework.org/schema/lang http://www.springframework.org/schema/beans/spring-lang-3.0.xsd
+                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
+                           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
+
+  <bean id="org.hippoecm.hst.solr.SolrIntegration" class="org.hippoecm.hst.solr.SolrIntegration" init-method="start"
+    destroy-method="stop">
+    <property name="loggerFactory" ref="org.hippoecm.hst.logging.LoggerFactory"/>
+    <property name="solrUrl" value="http://localhost:8983/solr"/>
+    <property name="repository" ref="javax.jcr.Repository"/>
+    <property name="credentials" ref="javax.jcr.Credentials.hstconfigreader"/>
+  </bean>
+
+</beans>
+  
\ No newline at end of file
Index: client-modules/solr/target/.plxarc
===================================================================
--- client-modules/solr/target/.plxarc	(revision 0)
+++ client-modules/solr/target/.plxarc	(revision 0)
@@ -0,0 +1 @@
+maven-shared-archive-resources
\ No newline at end of file
Index: client-modules/solr/target/classes/META-INF/DEPENDENCIES
===================================================================
--- client-modules/solr/target/classes/META-INF/DEPENDENCIES	(revision 0)
+++ client-modules/solr/target/classes/META-INF/DEPENDENCIES	(revision 0)
@@ -0,0 +1,11 @@
+// ------------------------------------------------------------------
+// Transitive dependencies of this project determined from the
+// maven pom organized by organization.
+// ------------------------------------------------------------------
+
+Hippo Site Toolkit Client Module Solr Integration
+
+
+
+
+
Index: client-modules/solr/target/classes/META-INF/LICENSE
===================================================================
--- client-modules/solr/target/classes/META-INF/LICENSE	(revision 0)
+++ client-modules/solr/target/classes/META-INF/LICENSE	(revision 0)
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
Index: client-modules/solr/target/classes/META-INF/NOTICE
===================================================================
--- client-modules/solr/target/classes/META-INF/NOTICE	(revision 0)
+++ client-modules/solr/target/classes/META-INF/NOTICE	(revision 0)
@@ -0,0 +1,8 @@
+
+Hippo Site Toolkit Client Module Solr Integration
+Copyright 2008-2011 Hippo
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+
Index: client-modules/solr/target/classes/org/hippoecm/hst/solr/SpringComponentManager-solr.xml
===================================================================
--- client-modules/solr/target/classes/org/hippoecm/hst/solr/SpringComponentManager-solr.xml	(revision 0)
+++ client-modules/solr/target/classes/org/hippoecm/hst/solr/SpringComponentManager-solr.xml	(revision 0)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2011 Hippo
+
+  Licensed under the Apache License, Version 2.0 (the  "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS"
+  BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:lang="http://www.springframework.org/schema/lang"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                           http://www.springframework.org/schema/lang http://www.springframework.org/schema/beans/spring-lang-3.0.xsd
+                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
+                           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
+
+  <bean id="org.hippoecm.hst.solr.SolrIntegration" class="org.hippoecm.hst.solr.SolrIntegration" init-method="start"
+    destroy-method="stop">
+    <property name="loggerFactory" ref="org.hippoecm.hst.logging.LoggerFactory"/>
+    <property name="solrUrl" value="http://localhost:8983/solr"/>
+    <property name="repository" ref="javax.jcr.Repository"/>
+    <property name="credentials" ref="javax.jcr.Credentials.hstconfigreader"/>
+  </bean>
+
+</beans>
+  
\ No newline at end of file
Index: client-modules/solr/target/maven-archiver/pom.properties
===================================================================
--- client-modules/solr/target/maven-archiver/pom.properties	(revision 0)
+++ client-modules/solr/target/maven-archiver/pom.properties	(revision 0)
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Fri Aug 26 15:41:53 CEST 2011
+version=2.23.02-SNAPSHOT
+groupId=org.onehippo.cms7.hst.client-modules
+artifactId=hst-solr
Index: client-modules/solr/target/maven-shared-archive-resources/META-INF/DEPENDENCIES
===================================================================
--- client-modules/solr/target/maven-shared-archive-resources/META-INF/DEPENDENCIES	(revision 0)
+++ client-modules/solr/target/maven-shared-archive-resources/META-INF/DEPENDENCIES	(revision 0)
@@ -0,0 +1,11 @@
+// ------------------------------------------------------------------
+// Transitive dependencies of this project determined from the
+// maven pom organized by organization.
+// ------------------------------------------------------------------
+
+Hippo Site Toolkit Client Module Solr Integration
+
+
+
+
+
Index: client-modules/solr/target/maven-shared-archive-resources/META-INF/LICENSE
===================================================================
--- client-modules/solr/target/maven-shared-archive-resources/META-INF/LICENSE	(revision 0)
+++ client-modules/solr/target/maven-shared-archive-resources/META-INF/LICENSE	(revision 0)
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
Index: client-modules/solr/target/maven-shared-archive-resources/META-INF/NOTICE
===================================================================
--- client-modules/solr/target/maven-shared-archive-resources/META-INF/NOTICE	(revision 0)
+++ client-modules/solr/target/maven-shared-archive-resources/META-INF/NOTICE	(revision 0)
@@ -0,0 +1,8 @@
+
+Hippo Site Toolkit Client Module Solr Integration
+Copyright 2008-2011 Hippo
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+
Index: client-modules/solr/target/test-classes/META-INF/DEPENDENCIES
===================================================================
--- client-modules/solr/target/test-classes/META-INF/DEPENDENCIES	(revision 0)
+++ client-modules/solr/target/test-classes/META-INF/DEPENDENCIES	(revision 0)
@@ -0,0 +1,11 @@
+// ------------------------------------------------------------------
+// Transitive dependencies of this project determined from the
+// maven pom organized by organization.
+// ------------------------------------------------------------------
+
+Hippo Site Toolkit Client Module Solr Integration
+
+
+
+
+
Index: client-modules/solr/target/test-classes/META-INF/LICENSE
===================================================================
--- client-modules/solr/target/test-classes/META-INF/LICENSE	(revision 0)
+++ client-modules/solr/target/test-classes/META-INF/LICENSE	(revision 0)
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
Index: client-modules/solr/target/test-classes/META-INF/NOTICE
===================================================================
--- client-modules/solr/target/test-classes/META-INF/NOTICE	(revision 0)
+++ client-modules/solr/target/test-classes/META-INF/NOTICE	(revision 0)
@@ -0,0 +1,8 @@
+
+Hippo Site Toolkit Client Module Solr Integration
+Copyright 2008-2011 Hippo
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+
Index: client-modules/pom.xml
===================================================================
--- client-modules/pom.xml	(revision 29843)
+++ client-modules/pom.xml	(working copy)
@@ -29,6 +29,7 @@
 
   <modules>
     <module>page-composer</module>
+    <module>solr</module>
   </modules>
     
 </project>
Index: components/core/src/main/java/org/hippoecm/hst/core/container/HstComponentInvokerImpl.java
===================================================================
--- components/core/src/main/java/org/hippoecm/hst/core/container/HstComponentInvokerImpl.java	(revision 29843)
+++ components/core/src/main/java/org/hippoecm/hst/core/container/HstComponentInvokerImpl.java	(working copy)
@@ -147,7 +147,8 @@
                 if (this.exceptionThrowable) {
                     throw new HstComponentException(e);
                 }
-                
+
+                e.printStackTrace();
                 window.addComponentExcpetion(new HstComponentException(e));
                 
                 if (log.isDebugEnabled()) {
Index: api/src/main/java/org/hippoecm/hst/content/beans/HstBean.java
===================================================================
--- api/src/main/java/org/hippoecm/hst/content/beans/HstBean.java	(revision 0)
+++ api/src/main/java/org/hippoecm/hst/content/beans/HstBean.java	(revision 0)
@@ -0,0 +1,5 @@
+package org.hippoecm.hst.content.beans;
+
+public interface HstBean {
+
+}
Index: api/src/main/java/org/hippoecm/hst/content/beans/standard/HippoBean.java
===================================================================
--- api/src/main/java/org/hippoecm/hst/content/beans/standard/HippoBean.java	(revision 29843)
+++ api/src/main/java/org/hippoecm/hst/content/beans/standard/HippoBean.java	(working copy)
@@ -21,12 +21,13 @@
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
+import org.hippoecm.hst.content.beans.HstBean;
 import org.hippoecm.hst.content.beans.NodeAware;
 import org.hippoecm.hst.content.beans.manager.ObjectConverterAware;
 import org.hippoecm.hst.provider.jcr.JCRValueProvider;
 import org.hippoecm.repository.api.HippoNode;
 
-public interface HippoBean extends NodeAware, ObjectConverterAware, Comparable<HippoBean> {
+public interface HippoBean extends HstBean, NodeAware, ObjectConverterAware, Comparable<HippoBean> {
 
     /**
      * This returns the backing jcr node for this bean. 
Index: api/src/main/java/org/hippoecm/hst/content/beans/solr/HstBeanIterator.java
===================================================================
--- api/src/main/java/org/hippoecm/hst/content/beans/solr/HstBeanIterator.java	(revision 0)
+++ api/src/main/java/org/hippoecm/hst/content/beans/solr/HstBeanIterator.java	(revision 0)
@@ -0,0 +1,38 @@
+package org.hippoecm.hst.content.beans.solr;
+
+import java.util.Iterator;
+
+import org.hippoecm.hst.content.beans.HstBean;
+
+public interface HstBeanIterator<E> extends Iterator<HstBean>{
+
+    /**
+     * Skip a number of elements in the iterator. Using skip is very efficient when you know you want to have the, say, 100 to 110 
+     * beans, as the skip does not need to fetch number 1 to 100. 
+     *
+     * @param skipNum the non-negative number of elements to skip
+     * @throws java.util.NoSuchElementException
+     *          if skipped past the last element in the iterator.
+     */
+    void skip(int skipNum);
+
+    /**
+     * Returns the number of elements in the iterator.
+     * If this information is unavailable, returns -1.
+     *
+     * @return a long
+     */
+    int getSize();
+
+    /**
+     * Returns the current position within the iterator. The number
+     * returned is the 0-based index of the next element in the iterator,
+     * i.e. the one that will be returned on the subsequent <code>next</code> call.
+     * <p/>
+     * Note that this method does not check if there is a next element,
+     * i.e. an empty iterator will always return 0.
+     *
+     * @return a long
+     */
+    int getPosition();
+}
Index: api/src/main/java/org/hippoecm/hst/content/beans/solr/HstSolrQuery.java
===================================================================
--- api/src/main/java/org/hippoecm/hst/content/beans/solr/HstSolrQuery.java	(revision 0)
+++ api/src/main/java/org/hippoecm/hst/content/beans/solr/HstSolrQuery.java	(revision 0)
@@ -0,0 +1,89 @@
+/*
+ *  Copyright 2008 Hippo.
+ * 
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ * 
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.hippoecm.hst.content.beans.solr;
+
+import org.hippoecm.hst.content.beans.query.exceptions.QueryException;
+import org.hippoecm.hst.content.beans.query.filter.BaseFilter;
+import org.hippoecm.hst.content.beans.query.filter.Filter;
+
+public interface HstSolrQuery {
+
+    /**
+     * The default limit that is used for a HstSolrQuery. Use {@link #setLimit(int)} if you need to override this value. 
+     */
+    final static int DEFAULT_LIMIT = 1000;
+    
+    void setFilter(BaseFilter filter);
+
+    BaseFilter getFilter();
+
+    /**
+     * 
+     * @return a new empty Filter
+     */
+    Filter createFilter();
+    
+    /**
+     * Sets the limit of search results.
+     * <b>Note</b> that setting this value very high might influence performance negatively
+     * @param limit
+     */
+    void setLimit(int limit);
+    
+    /**
+     * @return the query as string
+     * @throws QueryException if we cannot build the query string
+     */
+    String getQueryAsString() throws QueryException;
+    
+    /**
+     * Returns the limit of the HstQuery. If no limit is set, it returns the default HstQuery limit {@link #DEFAULT_LIMIT}
+     * @return the limit 
+     */
+    int getLimit();
+    
+    /**
+     * Sets the offset to start searching from. Default offset is <code>-1</code> which means it is ignored. A negative offset will be ignored
+     * @param offset
+     */
+    void setOffset(int offset);
+
+    /**
+     * Returns the offset of the HstQuery. If no offset is set through {@link #setOffset(int)}, the offset will be <code>-1</code> and will be ignored 
+     * @return the offset 
+     */
+    int getOffset();
+    
+    /**
+     * Order the object found (ascending)
+     * @param fieldNameAttribute the name of the field used to sort the search result
+     */
+    void addOrderByAscending(String fieldNameAttribute);
+
+    /**
+     * Order the object found (descending)
+     * @param fieldNameAttribute the name of the field used to sort the search result
+     */
+
+    void addOrderByDescending(String fieldNameAttribute);
+
+    /**
+     * The actual execution of the HstQuery. The HstQueryResult will never contain one and the same result twice. So, if a result matches
+     * the search criteria twice, it is still returned as one hit. 
+     * @return <code>{@link HstSolrQueryResult}</code>
+     */
+    HstSolrQueryResult execute() throws QueryException;
+}
Index: api/src/main/java/org/hippoecm/hst/content/beans/solr/HstSolrQueryResult.java
===================================================================
--- api/src/main/java/org/hippoecm/hst/content/beans/solr/HstSolrQueryResult.java	(revision 0)
+++ api/src/main/java/org/hippoecm/hst/content/beans/solr/HstSolrQueryResult.java	(revision 0)
@@ -0,0 +1,41 @@
+/*
+ *  Copyright 2008 Hippo.
+ * 
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ * 
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.hippoecm.hst.content.beans.solr;
+
+import org.hippoecm.hst.content.beans.HstBean;
+
+
+
+/**
+ * The result of the execution of the HstQuery. 
+ */
+public interface HstSolrQueryResult {
+    
+    /**
+     * @see #getTotalSize()
+     * @return the total number of authorized hits. 
+     */
+    int getSize();
+    
+    /** 
+     */
+    int getTotalSize();
+    
+    /**
+     * This returns the hits
+     */
+    HstBeanIterator<HstBean> getHstBeans();
+}
Index: api/src/main/java/org/hippoecm/hst/content/beans/index/IndexField.java
===================================================================
--- api/src/main/java/org/hippoecm/hst/content/beans/index/IndexField.java	(revision 0)
+++ api/src/main/java/org/hippoecm/hst/content/beans/index/IndexField.java	(revision 0)
@@ -0,0 +1,21 @@
+package org.hippoecm.hst.content.beans.index;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.METHOD, ElementType.FIELD })
+@Documented
+public @interface IndexField {
+    
+    public static final String DEFAULT ="#default";
+    
+    /**
+     * @return Returns the field name. Defaults to the JavaBean property name.
+     */
+
+    String name() default DEFAULT;
+}
