lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r430568 [3/8] - in /lucene/java/trunk/contrib/gdata-server: ./ lib/ src/java/org/apache/lucene/gdata/data/ src/java/org/apache/lucene/gdata/search/ src/java/org/apache/lucene/gdata/search/analysis/ src/java/org/apache/lucene/gdata/search/co...
Date Thu, 10 Aug 2006 22:32:47 GMT
Added: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexDocumentBuilder.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexDocumentBuilder.java?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexDocumentBuilder.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexDocumentBuilder.java Thu Aug 10 15:32:40 2006
@@ -0,0 +1,32 @@
+/**
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.lucene.gdata.search.index;
+
+import java.util.concurrent.Callable;
+
+/**
+ * Interface for DocumentBuilders
+ * @author Simon Willnauer
+ * @param <T> IndexDocument implementation
+ *
+ */
+public interface IndexDocumentBuilder<T extends IndexDocument> extends Callable<T>{
+    /**
+     * @see java.util.concurrent.Callable#call()
+     */
+    public T call() throws GdataIndexerException; 
+
+}

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexDocumentBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexDocumentBuilder.java
------------------------------------------------------------------------------
    svn:executable = *

Added: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexDocumentBuilderTask.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexDocumentBuilderTask.java?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexDocumentBuilderTask.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexDocumentBuilderTask.java Thu Aug 10 15:32:40 2006
@@ -0,0 +1,104 @@
+/**
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.lucene.gdata.search.index;
+
+import java.util.Collection;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.lucene.gdata.data.ServerBaseEntry;
+import org.apache.lucene.gdata.search.analysis.ContentStrategy;
+import org.apache.lucene.gdata.search.analysis.Indexable;
+import org.apache.lucene.gdata.search.analysis.NotIndexableException;
+import org.apache.lucene.gdata.search.config.IndexSchema;
+import org.apache.lucene.gdata.search.config.IndexSchemaField;
+
+/**
+ * This callable does all of the entiti processing concurrently while added to
+ * the {@link org.apache.lucene.gdata.search.index.GDataIndexer} task queue;
+ * 
+ * @see org.apache.lucene.gdata.search.analysis.Indexable
+ * @see org.apache.lucene.gdata.search.analysis.ContentStrategy
+ * @author Simon Willnauer
+ * 
+ */
+class IndexDocumentBuilderTask<T extends IndexDocument> implements IndexDocumentBuilder<T> {
+    private static final Log LOG = LogFactory
+            .getLog(IndexDocumentBuilderTask.class);
+
+    private final ServerBaseEntry entry;
+
+    private final IndexSchema schema;
+
+    private final IndexAction action;
+
+    private final boolean commitAfter;
+    private final boolean optimizeAfter;
+    protected IndexDocumentBuilderTask(final ServerBaseEntry entry,
+            final IndexSchema schema, IndexAction action, boolean commitAfter, boolean optimizeAfter) {
+        /*
+         * omit check for null parameter this happens in the controller.
+         */
+        this.schema = schema;
+        this.entry = entry;
+        this.action = action;
+        this.commitAfter = commitAfter;
+        this.optimizeAfter = optimizeAfter;
+    }
+
+    /**
+     * @see java.util.concurrent.Callable#call()
+     */
+    @SuppressWarnings("unchecked")
+    public T call() throws GdataIndexerException {
+        
+        Collection<IndexSchemaField> fields = this.schema.getFields();
+        GDataIndexDocument document = new GDataIndexDocument(this.action,
+                this.entry.getId(),this.entry.getFeedId(), this.commitAfter,this.optimizeAfter);
+        if(this.action != IndexAction.DELETE){
+        int addedFields = 0;
+        for (IndexSchemaField field : fields) {
+            /*
+             * get the strategy to process the field
+             */
+            ContentStrategy strategy = ContentStrategy.getFieldStrategy(field);
+            if (LOG.isInfoEnabled())
+                LOG.info("Process indexable for " + field);
+            try {
+                /*
+                 * get the indexable via the factory method to enable new /
+                 * different implementation of the interface (this could be a
+                 * faster dom impl e.g. dom4j)
+                 */
+                strategy.processIndexable(Indexable.getIndexable(this.entry));
+                addedFields++;
+            } catch (NotIndexableException e) {
+                LOG.warn("Can not create field for " + field+" field will be skipped -- reason: ", e);
+                continue;
+            }
+         
+            document.addField(strategy);
+
+        }
+        if(addedFields == 0)
+            throw new GdataIndexerException("No field added to document for Schema: "+this.schema); 
+        }
+        return (T)document;
+    }
+
+    
+}

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexDocumentBuilderTask.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexDocumentBuilderTask.java
------------------------------------------------------------------------------
    svn:executable = *

Added: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexEventListener.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexEventListener.java?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexEventListener.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexEventListener.java Thu Aug 10 15:32:40 2006
@@ -0,0 +1,36 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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.apache.lucene.gdata.search.index;
+
+/**
+ * This interface should be implemented by classes need to be notified when an
+ * index is commited
+ * 
+ * @author Simon Willnauer
+ * 
+ */
+public interface IndexEventListener {
+
+    /**
+     * This method will be invoked by an instance of {@link GDataIndexer} if the
+     * index is commited
+     * 
+     * @param service -
+     *            the name of the service the invoking indexer runs for
+     */
+    public abstract void commitCallBack(String service);
+
+}

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexEventListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexEventListener.java
------------------------------------------------------------------------------
    svn:executable = *

Added: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexLogReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexLogReader.java?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexLogReader.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexLogReader.java Thu Aug 10 15:32:40 2006
@@ -0,0 +1,168 @@
+/**
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.lucene.gdata.search.index;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * @author Simon Willnauer
+ * 
+ */
+class IndexLogReader {
+
+     static Map<String,IndexAction> readIndexLog(File indexLogFile, Map<String,IndexAction> contentMap) throws SAXException,IOException{
+        XMLReader reader = XMLReaderFactory.createXMLReader();
+        
+        Map<String, IndexAction> logContent = contentMap;
+        if(logContent == null)
+            logContent = new HashMap<String,IndexAction>(64);
+        
+        reader.setContentHandler(new IndexLogContentHandler(logContent));
+        InputSource source = new InputSource(new FileInputStream(indexLogFile));
+        try{
+        reader.parse(source);
+        }catch (SAXException e) {
+            /*
+             * try to append the Root element end
+             * this happens if the server crashes.
+             * If it dies while writing an entry the log file has to be fixed manually
+             */
+            IndexLogWriter.tryCloseRoot(indexLogFile);
+            source = new InputSource(new FileInputStream(indexLogFile));
+            reader.parse(source);
+        }
+        return logContent;
+    }
+    
+
+    private static class IndexLogContentHandler implements ContentHandler {
+        private final Map<String, IndexAction> logContent;
+        private String currentID;
+        private String currentAction;
+        private boolean isId;
+        private boolean isAction;
+        IndexLogContentHandler(final Map<String, IndexAction> content) {
+            this.logContent = content;
+        }
+
+        /**
+         * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
+         */
+        public void setDocumentLocator(Locator locator) {
+        }
+
+        /**
+         * @see org.xml.sax.ContentHandler#startDocument()
+         */
+        public void startDocument() throws SAXException {
+        }
+
+        /**
+         * @see org.xml.sax.ContentHandler#endDocument()
+         */
+        public void endDocument() throws SAXException {
+        }
+
+        /**
+         * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String, java.lang.String)
+         */
+        public void startPrefixMapping(String prefix, String uri)
+                throws SAXException {
+        }
+
+        /**
+         * @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String)
+         */
+        public void endPrefixMapping(String prefix) throws SAXException {
+        }
+
+        /**
+         * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
+         */
+        public void startElement(String uri, String localName, String qName,
+                Attributes atts) throws SAXException {
+            if(localName.equals("entryid")){
+                this.isId = true;
+            }else if(localName.equals("action")){
+                this.isAction = true;
+            }
+        }
+
+        /**
+         * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
+         */
+        public void endElement(String uri, String localName, String qName)
+                throws SAXException {
+            if(localName.equals("entryid")){
+                this.isId = false;
+            }else if(localName.equals("action")){
+                this.isAction = false;
+            }else if(localName.equals("indexentry")){
+                this.logContent.put(this.currentID,IndexAction.valueOf(this.currentAction));
+            }
+        }
+
+        /**
+         * @see org.xml.sax.ContentHandler#characters(char[], int, int)
+         */
+        public void characters(char[] ch, int start, int length)
+                throws SAXException {
+            if(this.isId)
+                this.currentID = new String(ch,start,length);
+            if(this.isAction)
+                this.currentAction = new String(ch,start,length);
+            
+        }
+
+        /**
+         * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
+         */
+        public void ignorableWhitespace(char[] ch, int start, int length)
+                throws SAXException {
+        }
+
+        /**
+         * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String, java.lang.String)
+         */
+        public void processingInstruction(String target, String data)
+                throws SAXException {
+        }
+
+        /**
+         * @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String)
+         */
+        public void skippedEntity(String name) throws SAXException {
+        }
+        
+        
+
+    }
+    
+   
+}

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexLogReader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexLogReader.java
------------------------------------------------------------------------------
    svn:executable = *

Added: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexLogWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexLogWriter.java?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexLogWriter.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexLogWriter.java Thu Aug 10 15:32:40 2006
@@ -0,0 +1,112 @@
+/**
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.lucene.gdata.search.index;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.RandomAccessFile;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * @author Simon Willnauer
+ * 
+ */
+class IndexLogWriter {
+    private static final String LINE_BREAK = System
+            .getProperty("line.separator");
+
+    private static final String XMLHEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+            + LINE_BREAK;
+    private static final String CHARSET = "UTF-8";
+    private static final String ROOT_BEGIN = "<indexlog>" + LINE_BREAK;
+
+    private static final String ROOT_END = "</indexlog>";
+
+    
+
+    private final BufferedWriter writer;
+
+    private final AtomicBoolean isClosed;
+
+    /**
+     * @param file
+     * @throws IOException
+     * 
+     */
+    public IndexLogWriter(File file) throws IOException {
+
+        this.writer = new BufferedWriter(new OutputStreamWriter(
+                new FileOutputStream(file), CHARSET));
+        this.writer.write(XMLHEADER);
+        this.writer.write(ROOT_BEGIN);
+        this.writer.flush();
+        this.isClosed = new AtomicBoolean(false);
+
+    }
+
+    synchronized void writeAction(String id, IndexAction action)
+            throws IOException {
+        if (this.isClosed.get())
+            throw new IllegalStateException("Writer is already closed");
+        this.writer.write(buildElement(id, action.name()));
+        this.writer.flush();
+    }
+
+    static synchronized void tryCloseRoot(File file) throws IOException {
+        /*
+         * try to append the Root element end
+         * this happens if the server crashes.
+         * If it dies while writing an entry the log file has to be fixed manually
+         */
+        RandomAccessFile raFile = new RandomAccessFile(file, "rw");
+        raFile.seek(raFile.length());
+        raFile.write(IndexLogWriter.ROOT_END.getBytes(CHARSET));
+        raFile.close();
+        
+
+    }
+
+    private static String buildElement(String id, String action) {
+        StringBuilder builder = new StringBuilder("\t<indexentry>")
+                .append(LINE_BREAK);
+        builder.append("\t\t<entryid>");
+        builder.append(id);
+        builder.append("</entryid>").append(LINE_BREAK);
+        builder.append("\t\t<action>");
+        builder.append(action);
+        builder.append("</action>").append(LINE_BREAK);
+        builder.append("\t</indexentry>").append(LINE_BREAK);
+        return builder.toString();
+
+    }
+
+    synchronized void close() throws IOException {
+        if (!this.isClosed.compareAndSet(false,true))
+            throw new IllegalStateException("Writer is already closed");
+        try {
+            this.writer.write(ROOT_END);
+            this.writer.flush();
+        } finally {
+            this.writer.close();
+        }
+
+    }
+
+}

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexLogWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexLogWriter.java
------------------------------------------------------------------------------
    svn:executable = *

Added: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexTask.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexTask.java?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexTask.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexTask.java Thu Aug 10 15:32:40 2006
@@ -0,0 +1,174 @@
+/**
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.lucene.gdata.search.index;
+
+import java.io.IOException;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * 
+ * Class to be used inside a
+ * {@link org.apache.lucene.gdata.search.index.GDataIndexer} to process the task
+ * queue. This class calls the commit method of the indexer if commit is
+ * scheduled.
+ * 
+ * @author Simon Willnauer
+ * 
+ */
+class IndexTask implements Runnable {
+    private static final Log INNERLOG = LogFactory.getLog(IndexTask.class);
+
+    private AtomicBoolean stopped = new AtomicBoolean(false);
+
+    private final GDataIndexer indexer;
+
+    protected AtomicBoolean commit = new AtomicBoolean(false);
+    
+    protected AtomicBoolean optimize = new AtomicBoolean(false);
+
+    /*
+     * keep protected for subclassing
+     */
+    protected final BlockingQueue<Future<IndexDocument>> taskQueue;
+
+    IndexTask(final GDataIndexer indexer,
+            final BlockingQueue<Future<IndexDocument>> taskQueue) {
+        this.indexer = indexer;
+        this.taskQueue = taskQueue;
+    }
+
+    /**
+     * @see java.lang.Runnable#run()
+     */
+    public void run() {
+
+        while (!this.stopped.get() || this.taskQueue.size() != 0) {
+
+            try {
+                /*
+                 * get the future from the queue and wait until processing has
+                 * been done
+                 */
+                Future<IndexDocument> future = getTask();
+                if (future != null) {
+                    IndexDocument document = future.get();
+                    setOptimize(document);
+                    processDocument(document); 
+                    /*
+                     * the document contains the info for commit or optimize -->
+                     * this comes from the controller
+                     */
+                    if (document == null || document.commitAfter())
+                        this.indexer.commit(document == null ? false : this.optimize.getAndSet(false));
+                }
+                if (this.commit.getAndSet(false))
+                    this.indexer.commit(this.optimize.getAndSet(false));
+
+            } catch (InterruptedException e) {
+                INNERLOG.warn("Queue is interrupted exiting IndexTask -- ", e);
+
+            } catch (GdataIndexerException e) {
+                /*
+                 * 
+                 * TODO fire callback here as well
+                 */
+                INNERLOG.error("can not retrieve Field from IndexDocument  ", e);
+            } catch (ExecutionException e) {
+                /*
+                 * TODO callback for fail this exception is caused by an
+                 * exception while processing the document. call back for failed
+                 * docs should be placed here
+                 */
+                INNERLOG.error("Future throws execution exception ", e);
+
+            } catch (IOException e) {
+                INNERLOG.error("IOException thrown while processing document ",
+                        e);
+
+            } catch (Throwable e) {
+                /*
+                 * catch all to prevent the thread from dieing
+                 */
+                INNERLOG.error(
+                        "Unexpected exception while processing document -- "
+                                + e.getMessage(), e);
+            }
+        }
+        try {
+            this.indexer.commit(this.optimize.getAndSet(false));
+        } catch (IOException e) {
+            INNERLOG.warn("commit on going down failed - "+e.getMessage(),e);
+            
+        }
+        this.stop();
+    }
+    protected void setOptimize(IndexDocument document){
+        if(document == null)
+            return;
+        this.optimize.set(document.optimizeAfter());
+    }
+
+    /*
+     * keep this protected for subclassing see TimedIndexTask!
+     */
+    protected Future<IndexDocument> getTask() throws InterruptedException {
+        return this.taskQueue.take();
+    }
+
+    private void processDocument(IndexDocument document) throws IOException {
+        /*
+         * a null document is used for waking up the task if the indexer has
+         * been destroyed to finish up and commit. should I change this?! -->
+         * see TimedIndexTask#getTask() also!!
+         */
+        if (document == null) {
+            INNERLOG.warn("Can not process document -- is null -- run commit");
+            return;
+        }
+        if (document.isDelete()) {
+            this.indexer.deleteDocument(document);
+            return;
+        } else if (document.isInsert()) {
+            this.indexer.addDocument(document);
+            return;
+        } else if (document.isUpdate()) {
+            this.indexer.updateDocument(document);
+            return;
+        }
+        /*
+         * that should not happen -- anyway skip the document and write it to
+         * the log
+         */
+        INNERLOG.warn("IndexDocument has no Action " + document);
+
+    }
+
+    protected boolean isStopped() {
+        return this.stopped.get();
+    }
+
+    protected void stop() {
+        this.stopped.set(true);
+    }
+
+}
\ No newline at end of file

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexTask.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/IndexTask.java
------------------------------------------------------------------------------
    svn:executable = *

Added: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/TimedIndexTask.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/TimedIndexTask.java?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/TimedIndexTask.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/TimedIndexTask.java Thu Aug 10 15:32:40 2006
@@ -0,0 +1,67 @@
+/**
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.lucene.gdata.search.index;
+
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * This {@link IndexTask} will idle the given time if no task is on the queue.
+ * If the idle time exceeds the task will force a commit on the index. The timer
+ * will be reset if a task is on the queue.
+ * 
+ * @author Simon Willnauer
+ * 
+ */
+class TimedIndexTask extends IndexTask {
+    protected final static TimeUnit TIME_UNIT = TimeUnit.SECONDS;
+
+    protected final static long DEFAULT_IDLE_TIME = 30;
+
+    private final long idleTime;
+
+    TimedIndexTask(final GDataIndexer indexer,
+            final BlockingQueue<Future<IndexDocument>> taskQueue,
+            final long idleTime) {
+        super(indexer, taskQueue);
+        this.idleTime = idleTime < DEFAULT_IDLE_TIME ? DEFAULT_IDLE_TIME
+                : idleTime;
+
+    }
+
+    /**
+     * @see org.apache.lucene.gdata.search.index.IndexTask#getTask()
+     */
+    @Override
+    protected Future<IndexDocument> getTask() throws InterruptedException {
+        /*
+         * wait for a certain time and return null if no task is on the queue.
+         * If return null --> commit will be called
+         */
+        Future<IndexDocument> retVal = this.taskQueue.poll(this.idleTime, TIME_UNIT);
+        if(retVal== null)
+            this.commit.set(true);
+        return retVal;
+        
+    }
+    
+    protected long getIdleTime(){
+        return this.idleTime;
+    }
+
+}

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/TimedIndexTask.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/TimedIndexTask.java
------------------------------------------------------------------------------
    svn:executable = *

Added: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/package.html
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/package.html?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/package.html (added)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/package.html Thu Aug 10 15:32:40 2006
@@ -0,0 +1,10 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> 
+<html> 
+<head> 
+   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
+   <meta name="Author" content="Simon Willnauer"> 
+</head> 
+<body> 
+Contains classes processing of documents and accessing the search index of the server
+</body> 
+</html> 
\ No newline at end of file

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/index/package.html
------------------------------------------------------------------------------
    svn:executable = *

Added: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/package.html
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/package.html?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/package.html (added)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/package.html Thu Aug 10 15:32:40 2006
@@ -0,0 +1,10 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> 
+<html> 
+<head> 
+   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
+   <meta name="Author" content="Simon Willnauer"> 
+</head> 
+<body> 
+Classes used for query the lucene index for a specific feed instance
+</body> 
+</html> 
\ No newline at end of file

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/package.html
------------------------------------------------------------------------------
    svn:executable = *

Added: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/query/GDataQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/query/GDataQueryParser.java?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/query/GDataQueryParser.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/query/GDataQueryParser.java Thu Aug 10 15:32:40 2006
@@ -0,0 +1,57 @@
+/**
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.lucene.gdata.search.query;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.gdata.search.config.IndexSchema;
+import org.apache.lucene.queryParser.QueryParser;
+
+/**
+ * @author Simon Willnauer
+ * 
+ */
+public class GDataQueryParser extends QueryParser {
+
+    /**
+     * Creates a new QueryParser instance and sets the default operator to
+     * {@link Operator#AND}
+     * 
+     * @param field -
+     *            the parser field
+     * @param analyzer -
+     *            the parser analyzer
+     */
+    public GDataQueryParser(String field, Analyzer analyzer) {
+        super(field, analyzer);
+        this.setDefaultOperator(Operator.AND);
+    }
+
+    /**
+     * Creates a new QueryParser instance and sets the default operator to
+     * {@link Operator#AND}. The parser will use
+     * {@link IndexSchema#getDefaultSearchField} as the field and
+     * {@link IndexSchema#getSchemaAnalyzer()} as the analyzer.
+     * 
+     * @param schema -
+     *            the schema to set the default fields
+     */
+    public GDataQueryParser(IndexSchema schema) {
+        this(schema.getDefaultSearchField(), schema.getSchemaAnalyzer());
+
+    }
+
+}

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/query/GDataQueryParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/query/GDataQueryParser.java
------------------------------------------------------------------------------
    svn:executable = *

Added: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/query/QueryTranslator.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/query/QueryTranslator.java?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/query/QueryTranslator.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/query/QueryTranslator.java Thu Aug 10 15:32:40 2006
@@ -0,0 +1,134 @@
+/**
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.lucene.gdata.search.query;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.lucene.gdata.search.config.IndexSchema;
+
+import com.google.gdata.data.DateTime;
+
+/**
+ * Simple static methods to translate the http query to a lucene query string.
+ * @author Simon Willnauer
+ * 
+ */
+public class QueryTranslator {
+    private static final Set<String> STANDARD_REQUEST_PARAMETER = new HashSet<String>(3);
+    private static final String GDATA_DEFAULT_SEARCH_PARAMETER = "q";
+    private static final String UPDATED_MIN = Long.toString(0);
+    private static final String UPDATED_MAX = Long.toString(Long.MAX_VALUE);
+//    private static final String GDATA_CATEGORY_FIEL = 
+
+    
+    
+    static{
+        STANDARD_REQUEST_PARAMETER.add("max-results");
+        STANDARD_REQUEST_PARAMETER.add("start-index");
+        STANDARD_REQUEST_PARAMETER.add("alt");
+    }
+    /**
+     * This method does a little preprocessing of the query. Basically it will map the given request parameters to a lucene syntax. Each
+     * parameter matching a index field in the given schema will be translated into a grouped query string according to the lucene query syntax. 
+     * <p>
+     * <ol>
+     * <li>title=foo bar AND "FooBar" will be title:(foo bar AND "FooBar)</i>
+     * <li>updated-min=2005-08-09T10:57:00-08:00 will be translated to updated:[1123613820000 TO 9223372036854775807] according to the gdata protocol</i>
+     * </ol>
+     * </p>
+     * @param schema the index schema for the queried service
+     * @param parameterMap - the http parameter map returning String[] instances as values
+     * @param categoryQuery - the parsed category query from the request
+     * @return - a lucene syntax query string
+     */
+    public static String translateHttpSearchRequest(IndexSchema schema,
+            Map<String, String[]> parameterMap, String categoryQuery) {
+        Set<String> searchableFieldNames = schema.getSearchableFieldNames();
+        Set<String> parameterSet = parameterMap.keySet();
+        StringBuilder translatedQuery = new StringBuilder();
+        if(categoryQuery != null){
+           translatedQuery.append(translateCategory(translatedQuery,categoryQuery));
+        }
+        String updateMin = null;
+        String updateMax = null;
+        for (String parameterName : parameterSet) {
+            if (STANDARD_REQUEST_PARAMETER.contains(parameterName))
+                continue;
+            if (searchableFieldNames.contains(parameterName)) {
+                translatedQuery.append(parameterName).append(":(");
+                translatedQuery.append(parameterMap.get(parameterName)[0]);
+                translatedQuery.append(") ");
+                continue;
+            }
+            if(parameterName.equals(GDATA_DEFAULT_SEARCH_PARAMETER)){
+                translatedQuery.append(schema.getDefaultSearchField());
+                translatedQuery.append(":(");
+                translatedQuery.append(parameterMap.get(parameterName)[0]);
+                translatedQuery.append(") ");
+                continue;
+                
+            }
+            if(parameterName.endsWith("updated-min")){
+                updateMin = parameterMap.get(parameterName)[0];
+                continue;
+            }
+            if(parameterName.endsWith("updated-max")){
+                updateMax = parameterMap.get(parameterName)[0];
+                continue;
+            }
+            throw new RuntimeException("Can not apply parameter -- invalid -- "
+                    + parameterName);
+        }
+        if(updateMax!=null || updateMin!= null)
+            translatedQuery.append(translateUpdate(updateMin,updateMax));
+            
+        return translatedQuery.length() == 0?null:translatedQuery.toString();
+    }
+    
+    
+     static String translateUpdate(String updateMin, String updateMax){
+        StringBuilder builder = new StringBuilder("updated:[");
+        if(updateMin != null)
+            builder.append(Long.toString(DateTime.parseDateTime(updateMin).getValue()));
+        else
+            builder.append(UPDATED_MIN);
+        builder.append(" TO ");
+        if(updateMax != null)
+            builder.append(Long.toString(DateTime.parseDateTime(updateMax).getValue()-1));
+        else
+            builder.append(UPDATED_MAX);
+        builder.append("]");
+        return builder.toString();
+        
+        
+    }
+     
+     static String translateCategory(StringBuilder builder, String categoryQuery){
+         return categoryQuery;
+         //TODO Implement this
+//         GDataCategoryQueryParser parser = new GDataCategoryQueryParser()
+         
+        
+     }
+     
+     
+     
+    
+    
+}

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/query/QueryTranslator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/search/query/QueryTranslator.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/FeedNotFoundException.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/FeedNotFoundException.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/FeedNotFoundException.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/FeedNotFoundException.java Thu Aug 10 15:32:40 2006
@@ -12,41 +12,46 @@
  
     private static final long serialVersionUID = 1L; 
  
-    /** 
-     * Constructs a FeedNotFoundException 
-     */ 
-    public FeedNotFoundException() { 
-        super(); 
- 
-    } 
- 
-    /** 
-     * @param arg0 - 
-     *            message 
-     * @param arg1 - 
-     *            cause 
-     */ 
-    public FeedNotFoundException(String arg0, Throwable arg1) { 
-        super(arg0, arg1); 
- 
-    } 
- 
-    /** 
-     * @param arg0 - 
-     *            message 
-     */ 
-    public FeedNotFoundException(String arg0) { 
-        super(arg0); 
- 
-    } 
- 
-    /** 
-     * @param arg0 - 
-     *            cause 
-     */ 
-    public FeedNotFoundException(Throwable arg0) { 
-        super(arg0); 
- 
-    } 
+    /**
+     * Constructs a new FeedNotFoundException
+     * @param errorCode - gdata request errorcode
+     */
+    public FeedNotFoundException(int errorCode) {
+        super(errorCode);
+        
+
+    }
+
+    /**
+     * Constructs a new FeedNotFoundException
+     * @param arg0 - the exception message
+     * @param errorCode - gdata request errorcode
+     */
+    public FeedNotFoundException(String arg0,int errorCode) {
+        super(arg0, errorCode);
+        
+    }
+
+    /**
+     * Constructs a new FeedNotFoundException
+     * @param arg0 - the exceptin message
+     * @param arg1 - the exception cause
+     * @param errorCode - gdata request errorcode
+     */
+    public FeedNotFoundException(String arg0, Throwable arg1,int errorCode) {
+        super(arg0, arg1, errorCode);
+        
+        
+    }
+
+    /**
+     * Constructs a new FeedNotFoundException
+     * @param arg0 - the exception cause
+     * @param errorCode - gdata request errorcode
+     */
+    public FeedNotFoundException(Throwable arg0,int errorCode) {
+        super(arg0, errorCode);
+        
+    }
  
 } 

Modified: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataRequest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataRequest.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataRequest.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataRequest.java Thu Aug 10 15:32:40 2006
@@ -27,23 +27,22 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.lucene.gdata.search.config.IndexSchema;
+import org.apache.lucene.gdata.search.query.QueryTranslator;
 import org.apache.lucene.gdata.server.authentication.AuthenticationController;
-import org.apache.lucene.gdata.server.registry.ComponentType;
 import org.apache.lucene.gdata.server.registry.GDataServerRegistry;
 import org.apache.lucene.gdata.server.registry.ProvidedService;
-import org.apache.lucene.gdata.storage.Storage;
-import org.apache.lucene.gdata.storage.StorageController;
 
 /**
  * The GDataRequest Class wraps the incoming HttpServletRequest. Needed
  * information coming with the HttpServletRequest can be accessed directly. It
  * represents an abstraction on the plain HttpServletRequest. Every GData
- * specific data coming from the client will be availiable and can be accessed
+ * specific data coming from the client will be available and can be accessed
  * via the GDataRequest.
  * <p>
  * GDataRequest instances will be passed to any action requested by the client.
  * This class also holds the logic to retrieve important information like
- * response format, the reqeusted feed instance and query parameters.
+ * response format, the requested feed instance and query parameters.
  * 
  * </p>
  * 
@@ -52,7 +51,8 @@
  */
 /* this class might be extracted as an interface in later development */
 public class GDataRequest {
-
+    
+    
     private static final Log LOG = LogFactory.getLog(GDataRequest.class);
 
     private static final String RESPONSE_FORMAT_PARAMETER = "alt";
@@ -76,7 +76,9 @@
 
     private static final String HTTP_HEADER_AUTH = "Authorization";
 
-    // Atom is the default resopnse format
+    private static final Object CATEGORY_QUERY_INDICATOR = "-";
+
+    // Atom is the default response format
     private OutputFormat responseFormat = OutputFormat.ATOM;
 
     private final HttpServletRequest request;
@@ -85,12 +87,22 @@
 
     private String entryId = null;
 
+    private String service = null;
+
     private ProvidedService configurator = null;
 
+    private boolean isSearchRequest = false;
+
     private String entryVersion = null;
 
     private GDataRequestType type;
 
+    private String categoryQuery;
+    
+    private String translatedSearchQuery;
+
+    private boolean isFeedRequest = false;
+
     /**
      * Creates a new FeedRequest
      * 
@@ -120,35 +132,40 @@
     public void initializeRequest() throws GDataRequestException {
         generateIdentificationProperties();
         setOutputFormat();
-        // TODO remove this dependency
-        StorageController controller = GDataServerRegistry.getRegistry()
-                .lookup(StorageController.class,
-                        ComponentType.STORAGECONTROLLER);
+        
         try {
-
-            Storage storage = controller.getStorage();
-
-            String service = storage.getServiceForFeed(this.feedId);
-            storage.close();
             /*
              * ExtensionProfile and the type is used for building the Entry /
-             * Feed Instances from an inputstream or reader
+             * Feed Instances from an input stream or reader
              * 
              */
             this.configurator = GDataServerRegistry.getRegistry()
-                    .getProvidedService(service);
+                    .getProvidedService(this.service);
+            
             if (this.configurator == null)
                 throw new GDataRequestException(
-                        "feed is not registered or extension profile could not be created");
-
+                        "no Provided Service found for service id: "+this.service,GDataResponse.NOT_FOUND);
+            applyRequestParameter();
+            if(this.translatedSearchQuery != null)
+                this.isSearchRequest = true;
+        } catch(GDataRequestException ex){
+            throw ex;
         } catch (Exception e) {
-            e.printStackTrace();
-            
             throw new GDataRequestException(
-                    "feed is not registered or extension profile could not be created -- "
-                            + e.getMessage(), e);
+                    "failed to initialize GDataRequest -- "
+                            + e.getMessage(), e,GDataResponse.SERVER_ERROR);
+        }
+        
+    }
+    
+    @SuppressWarnings("unchecked")
+    private void applyRequestParameter() throws GDataRequestException{
+        IndexSchema schema = this.configurator.getIndexSchema();
+        try{
+        this.translatedSearchQuery = QueryTranslator.translateHttpSearchRequest(schema,this.request.getParameterMap(),this.categoryQuery);
+        }catch (Exception e) {
+            throw new GDataRequestException("Can not translate user query to search query",e,GDataResponse.BAD_REQUEST);
         }
-
     }
 
     /**
@@ -181,15 +198,15 @@
      * 
      * @return - the HttpServletRequest {@link Reader}
      * @throws IOException -
-     *             if an I/O Exception occures
+     *             if an I/O Exception occurs
      */
     public Reader getReader() throws IOException {
         return this.request.getReader();
     }
 
     /**
-     * Returns the {@link HttpServletRequest} parameter map containig all <i>GET</i>
-     * request parameters.
+     * Returns the {@link HttpServletRequest} parameter map containing all
+     * <i>GET</i> request parameters.
      * 
      * @return the parameter map
      */
@@ -222,19 +239,34 @@
             throws GDataRequestException {
         /* generate all needed data to identify the requested feed/entry */
         String pathInfo = this.request.getPathInfo();
-        /*
-         * TODO this has to be changed to support the category queries. Category
-         * queries could also be rewrited in the Servlet.
-         */
-        if (pathInfo.length() <= 1)
+              if (pathInfo.length() <= 1)
             throw new GDataRequestException(
-                    "No feed or entry specified for this request");
+                    "No feed or entry specified for this request",GDataResponse.BAD_REQUEST);
         StringTokenizer tokenizer = new StringTokenizer(pathInfo, "/");
+        this.service = tokenizer.nextToken();
+        if (!tokenizer.hasMoreTokens())
+            throw new GDataRequestException(
+                    "Can not find feed id in requested path " + pathInfo,GDataResponse.BAD_REQUEST);
         this.feedId = tokenizer.nextToken();
-        this.entryId = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : "";
-        this.entryVersion = tokenizer.hasMoreTokens() ? tokenizer.nextToken()
-                : "";
 
+        String appendix = tokenizer.hasMoreTokens() ? tokenizer.nextToken()
+                : null;
+        if (appendix == null){
+            this.isFeedRequest = true;
+            return;
+        }
+        if (appendix.equals(CATEGORY_QUERY_INDICATOR)) {
+            StringBuilder builder = new StringBuilder();
+            while (tokenizer.hasMoreTokens())
+                builder.append("/").append(tokenizer.nextToken());
+            this.categoryQuery = builder.toString();
+        } else {
+            this.entryId = appendix;
+            this.entryVersion = tokenizer.hasMoreTokens() ? tokenizer
+                    .nextToken() : "";
+        }
+        this.isFeedRequest = (this.type == GDataRequestType.GET && (this.entryId == null
+                || this.entryId.length() == 0 || (this.entryId.equals('/'))));
     }
 
     private void setOutputFormat() {
@@ -259,7 +291,7 @@
             retval = new Integer(this.request
                     .getParameter(ITEMS_PER_PAGE_PARAMETER)).intValue();
         } catch (Exception e) {
-            LOG.warn("Intems per page could not be parsed - " + e.getMessage(),
+            LOG.warn("Items per page could not be parsed - " + e.getMessage(),
                     e);
         }
 
@@ -269,26 +301,26 @@
     /**
      * Start index represents the number of the first entry of the query -
      * result. The order depends on the query. Is the query a search query the
-     * this value will be assinged to the score in a common feed query the value
+     * this value will be assigned to the score in a common feed query the value
      * will be assigned to the update time of the entries.
      * 
      * @return - the requested start index
      */
     public int getStartIndex() {
-        if (this.request.getParameter(START_INDEX_NEXT_PAGE_PARAMETER) == null)
+        String startIndex = this.request.getParameter(START_INDEX_NEXT_PAGE_PARAMETER);
+        if (startIndex == null)
             return DEFAULT_START_INDEX;
         int retval = -1;
         try {
-            retval = new Integer(this.request
-                    .getParameter(START_INDEX_NEXT_PAGE_PARAMETER)).intValue();
+            retval = new Integer(startIndex).intValue();
         } catch (Exception e) {
-            LOG.warn("Start-index could not be parsed - " + e.getMessage(), e);
+            LOG.warn("Start-index could not be parsed - not an integer - " + e.getMessage());
         }
         return retval < 0 ? DEFAULT_START_INDEX : retval;
     }
 
     /**
-     * The selfid is <i>href</i> pointing to the requested resource
+     * The self id is the feeds <i>href</i> pointing to the requested resource
      * 
      * @return - the self id
      */
@@ -300,55 +332,59 @@
 
         return builder.toString();
     }
-
+    
     /**
-     * The <i>href</i> id of the next page of the requested resource.
+       * The previous id is the feeds <i>href</i> pointing to the previous result of the requested resource
      * 
-     * @return the id of the next page
+     * @return - the self id
      */
-    public String getNextId() {
+    public String getPreviousId(){
+        
+        int startIndex = getStartIndex();
+        if(startIndex == DEFAULT_START_INDEX )
+            return null;
         StringBuilder builder = new StringBuilder();
         builder.append(buildRequestIDString(false));
-        builder.append("?");
-
-        if (builder.charAt(builder.length() - 1) != '?')
-            builder.append('&');
-        Enumeration parameters = this.request.getParameterNames();
-        while (parameters.hasMoreElements()) {
-            String element = (String) parameters.nextElement();
-            String values = this.request.getParameter(element);
-
-            builder.append(element).append("=");
-            if (element.equals(START_INDEX_NEXT_PAGE_PARAMETER)) {
-                int tempVal = DEFAULT_START_INDEX;
-                try {
-                    tempVal = Integer.parseInt(values);
-                } catch (Exception e) {
-                    LOG.info("Can not parse StartIndex -- use defaut");
-                }
-                builder.append(tempVal + getItemsPerPage());
-                continue;
-            }
-
-            builder.append(values);
-
-            if (parameters.hasMoreElements())
-                builder.append("&");
+        startIndex = startIndex-getItemsPerPage();
+        builder.append(getPreparedQueryString(startIndex<1?DEFAULT_START_INDEX:startIndex));
+        return builder.toString();
+    }
+  
 
+    
+    private String getPreparedQueryString(int startIndex){
+        String queryString = this.request.getQueryString();
+        String startIndexValue = this.request.getParameter(START_INDEX_NEXT_PAGE_PARAMETER);
+        String maxResultsValue = this.request.getParameter(ITEMS_PER_PAGE_PARAMETER);
+        
+        StringBuilder builder = new StringBuilder("?");
+        if(maxResultsValue == null){
+            builder.append(ITEMS_PER_PAGE_PARAMETER).append("=").append(DEFAULT_ITEMS_PER_PAGE);
+            builder.append("&");
         }
-        if (this.request.getParameter(ITEMS_PER_PAGE_PARAMETER) == null) {
-            if (builder.charAt(builder.length() - 1) != '?')
-                builder.append('&');
-            builder.append(ITEMS_PER_PAGE_PARAMETER).append("=").append(
-                    DEFAULT_ITEMS_PER_PAGE);
-        }
-        if (this.request.getParameter(START_INDEX_NEXT_PAGE_PARAMETER) == null) {
-            if (builder.charAt(builder.length() - 1) != '?')
-                builder.append('&');
+        if(startIndexValue== null){
             builder.append(START_INDEX_NEXT_PAGE_PARAMETER).append("=");
-            builder.append(getItemsPerPage() + 1);
+            builder.append(Integer.toString(startIndex));
+            if(queryString!=null){
+                builder.append("&");
+                builder.append(queryString);
+            }
+        }else{
+            builder.append(queryString.replaceAll("start-index=[\\d]*",START_INDEX_NEXT_PAGE_PARAMETER+"="+Integer.toString(startIndex)));
         }
-
+        return builder.toString();
+    }
+    /**
+     * The <i>href</i> id of the next page of the requested resource.
+     * 
+     * @return the id of the next page
+     */
+    public String getNextId() {
+        int startIndex = getStartIndex();
+        StringBuilder builder = new StringBuilder();
+        builder.append(buildRequestIDString(false));
+        startIndex = startIndex+getItemsPerPage();
+        builder.append(getPreparedQueryString(startIndex));
         return builder.toString();
 
     }
@@ -367,14 +403,14 @@
 
     /**
      * This will return the current query string including all parameters.
-     * Additionaly the <code>max-resul</code> parameter will be added if not
+     * Additionally the <code>max-resul</code> parameter will be added if not
      * specified.
      * <p>
      * <code>max-resul</code> indicates the number of results returned to the
      * client. The default value is 25.
      * </p>
      * 
-     * @return - the query string incluing all parameters
+     * @return - the query string including all parameters
      */
     public String getQueryString() {
         String retVal = this.request.getQueryString();
@@ -453,7 +489,7 @@
     }
 
     /**
-     * If the reuquest is a {@link GDataRequestType#GET} request and there is no
+     * If the request is a {@link GDataRequestType#GET} request and there is no
      * entry id specified, the requested resource is a feed.
      * 
      * @return - <code>true</code> if an only if the requested resource is a
@@ -461,12 +497,11 @@
      */
     public boolean isFeedRequested() {
 
-        return (this.type == GDataRequestType.GET && (this.entryId == null
-                || this.entryId.length() == 0 || (this.entryId.equals('/'))));
+        return this.isFeedRequest ;
     }
 
     /**
-     * * If the reuquest is a {@link GDataRequestType#GET} request and there is
+     * * If the request is a {@link GDataRequestType#GET} request and there is
      * an entry id specified, the requested resource is an entry.
      * 
      * @return - <code>true</code> if an only if the requested resource is an
@@ -475,6 +510,12 @@
     public boolean isEntryRequested() {
         return !this.isFeedRequested();
     }
+    /**
+     * @return - <code>true</code> if an only if the user request is a search request, otherwise <code>false</code>
+     */
+    public boolean isSearchRequested(){
+        return this.isSearchRequest;
+    }
 
     /**
      * @return the configuration for this request
@@ -505,7 +546,7 @@
 
     /**
      * @return - Returns an array containing all of the Cookie objects the
-     *         client sent with underlaying HttpServletRequest.
+     *         client sent with underlying HttpServletRequest.
      */
     public Cookie[] getCookies() {
         return this.request.getCookies();
@@ -513,7 +554,7 @@
 
     /**
      * @return - the cookie set instead of the authentication token or
-     *         <code>null</code> if not auth cookie is set
+     *         <code>null</code> if no auth cookie is set
      */
     public Cookie getAuthCookie() {
         Cookie[] cookies = this.request.getCookies();
@@ -535,10 +576,16 @@
     }
 
     /**
-     * @return - the underlaying HttpServletRequest
+     * @return - the underlying HttpServletRequest
      */
     public HttpServletRequest getHttpServletRequest() {
 
         return this.request;
     }
+    
+    protected String getTranslatedQuery(){
+        return this.translatedSearchQuery;
+    }
+
+ 
 }

Modified: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataRequestException.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataRequestException.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataRequestException.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataRequestException.java Thu Aug 10 15:32:40 2006
@@ -17,51 +17,64 @@
 package org.apache.lucene.gdata.server; 
  
 /** 
- * This exception wraps all exceptions occure inside the {@link org.apache.lucene.gdata.server.GDataRequest} 
+ * This exception wraps all exceptions occur inside the {@link org.apache.lucene.gdata.server.GDataRequest} 
  * @author Simon Willnauer 
  * 
  */ 
 public class GDataRequestException extends Exception { 
- 
+    private final int errorCode;
     /** 
      * Serial version ID. -> Implements Serializable 
      */ 
     private static final long serialVersionUID = -4440777051466950723L; 
  
     /** 
-     * Constructs a new GDataException 
-     */ 
-    public GDataRequestException() { 
-        super(); 
-         
-    } 
- 
-    /** 
-     * Constructs a new GDataException with a given message string 
-     * @param arg0 - the excpetion message  
-     */ 
-    public GDataRequestException(String arg0) { 
-        super(arg0); 
-         
-    } 
- 
-    /** 
-     * Constructs a new GDataException with a given message string and cause 
-     * @param arg0 - the exception message 
-     * @param arg1 - the exception who caused this exception 
-     */ 
-    public GDataRequestException(String arg0, Throwable arg1) { 
-        super(arg0, arg1); 
-         
-    } 
- 
-    /** 
-     * Constructs a new GDataException with a given cause 
-     * @param arg0 - exception cause 
-     */ 
-    public GDataRequestException(Throwable arg0) { 
-        super(arg0); 
-         
-    } 
- 
+       /**
+     * Constructs a new GDataRequestException
+     * @param errorCode - gdata request error code
+     */
+    public GDataRequestException(int errorCode) {
+        super();
+        this.errorCode = errorCode;
+
+    }
+
+    /**
+     * Constructs a new GDataRequestException
+     * @param arg0 - the exception message
+     * @param errorCode - gdata request error code
+     */
+    public GDataRequestException(String arg0,int errorCode) {
+        super(arg0);
+        this.errorCode = errorCode;
+    }
+
+    /**
+     * Constructs a new GDataRequestException
+     * @param arg0 - the exception message
+     * @param arg1 - the exception cause
+     * @param errorCode - gdata request error code
+     */
+    public GDataRequestException(String arg0, Throwable arg1,int errorCode) {
+        super(arg0, arg1);
+        this.errorCode = errorCode;
+        
+    }
+
+    /**
+     * Constructs a new GDataRequestException
+     * @param arg0 - the exception cause
+     * @param errorCode - gdata request error code
+     */
+    public GDataRequestException(Throwable arg0,int errorCode) {
+        super(arg0);
+        this.errorCode = errorCode;
+    }
+
+    /**
+     * @return Returns the errorCode.
+     */
+    public int getErrorCode() {
+        return this.errorCode;
+    }
 } 

Modified: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataResponse.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataResponse.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataResponse.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataResponse.java Thu Aug 10 15:32:40 2006
@@ -35,18 +35,18 @@
 import com.google.gdata.util.common.xml.XmlWriter.Namespace;
 
 /**
- * The FeedRequest Class wraps the curren HttpServletResponse. Any action on the
+ * The FeedRequest Class wraps the current HttpServletResponse. Any action on the
  * HttpServletRequest will be executed via this class. This represents an
  * abstraction on the plain {@link HttpServletResponse}. Any action which has
- * to be performed on the underlaying {@link HttpServletResponse} will be
+ * to be performed on the underlying {@link HttpServletResponse} will be
  * executed within this class.
  * <p>
- * The GData basicly writes two different kinds ouf reponse to the output
+ * The GData basically writes two different kinds of response to the output
  * stream.
  * <ol>
- * <li>update, delete or insert requests will respond with a statuscode and if
+ * <li>update, delete or insert requests will respond with a status code and if
  * successful the feed entry modified or created</li>
- * <li>get requests will respond with a statuscode and if successful the
+ * <li>get requests will respond with a status code and if successful the
  * requested feed</li>
  * </ol>
  * 
@@ -70,6 +70,40 @@
  * 
  */
 public class GDataResponse {
+    /**
+     * Response code bad request
+     */
+    public static final int BAD_REQUEST = HttpServletResponse.SC_BAD_REQUEST;
+    /**
+     * Response code version conflict
+     */
+    public static final int CONFLICT = HttpServletResponse.SC_CONFLICT;
+    /**
+     * Response code forbidden access
+     */
+    public static final int FORBIDDEN = HttpServletResponse.SC_FORBIDDEN;
+    /**
+     * Response code internal server error
+     */
+    public static final int SERVER_ERROR = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+    /**
+     * Response code not found
+     */
+    public static final int NOT_FOUND = HttpServletResponse.SC_NOT_FOUND;
+    /**
+     * Response code not modified since
+     */
+    public static final int NOT_MODIFIED = HttpServletResponse.SC_NOT_MODIFIED;
+    /**
+     * Response code created
+     */
+    public static final int CREATED = HttpServletResponse.SC_CREATED;
+    /**
+     * Response code unauthorized access
+     */
+    public static final int UNAUTHORIZED = HttpServletResponse.SC_UNAUTHORIZED;
+    
+    
     private static final Log LOG = LogFactory.getLog(GDataResponse.class);
     private int error;
 
@@ -96,7 +130,7 @@
      * Creates a new GDataResponse
      * 
      * @param response -
-     *            The underlaying {@link HttpServletResponse}
+     *            The underlying {@link HttpServletResponse}
      */
     public GDataResponse(HttpServletResponse response) {
         if (response == null)
@@ -117,7 +151,7 @@
     }
 
     /**
-     * Sets the status of the underlaying response
+     * Sets the status of the underlying response
      * 
      * @see HttpServletResponse
      * @param responseCode -
@@ -131,7 +165,7 @@
      * This method sends the specified error to the user if set
      * 
      * @throws IOException -
-     *             if an I/O Exception occures
+     *             if an I/O Exception occurs
      */
     public void sendError() throws IOException {
         if (this.isError)
@@ -142,7 +176,7 @@
     /**
      * @return - the {@link HttpServletResponse} writer
      * @throws IOException -
-     *             If an I/O exception occures
+     *             If an I/O exception occurs
      */
     public Writer getWriter() throws IOException {
         return this.response.getWriter();
@@ -150,14 +184,14 @@
 
     /**
      * Sends a response for a get e.g. query request. This method must not
-     * invoked in a case of an error performing the requeste action.
+     * invoked in a case of an error performing the requested action.
      * 
      * @param feed -
      *            the feed to respond to the client
      * @param profile -
-     *            the extension profil for the feed to write
+     *            the extension profile for the feed to write
      * @throws IOException -
-     *             if an I/O exception accures, often caused by an already
+     *             if an I/O exception occurs, often caused by an already
      *             closed Writer or OutputStream
      * 
      */
@@ -167,7 +201,7 @@
             throw new IllegalArgumentException("feed must not be null");
         if (profile == null)
             throw new IllegalArgumentException(
-                    "extension profil must not be null");
+                    "extension profile must not be null");
         DateTime time = feed.getUpdated();
         if (time != null)
             setLastModifiedHeader(time.getValue());
@@ -186,7 +220,7 @@
     /**
      * 
      * Sends a response for an update, insert or delete request. This method
-     * must not invoked in a case of an error performing the requeste action. If
+     * must not invoked in a case of an error performing the requested action. If
      * the specified response format is ATOM the default namespace will be set
      * to ATOM.
      * 
@@ -195,7 +229,7 @@
      * @param profile -
      *            the entries extension profile
      * @throws IOException -
-     *             if an I/O exception accures, often caused by an already
+     *             if an I/O exception occurs, often caused by an already
      *             closed Writer or OutputStream
      */
     public void sendResponse(BaseEntry entry, ExtensionProfile profile)
@@ -204,7 +238,7 @@
             throw new IllegalArgumentException("entry must not be null");
         if (profile == null)
             throw new IllegalArgumentException(
-                    "extension profil must not be null");
+                    "extension profile must not be null");
         DateTime time = entry.getUpdated();
         if (time != null)
             setLastModifiedHeader(time.getValue());

Added: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataSearchService.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataSearchService.java?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataSearchService.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataSearchService.java Thu Aug 10 15:32:40 2006
@@ -0,0 +1,108 @@
+/**
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.lucene.gdata.server;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.lucene.gdata.data.ServerBaseEntry;
+import org.apache.lucene.gdata.data.ServerBaseFeed;
+import org.apache.lucene.gdata.search.GDataSearcher;
+import org.apache.lucene.gdata.search.SearchComponent;
+import org.apache.lucene.gdata.search.query.GDataQueryParser;
+import org.apache.lucene.gdata.server.registry.ComponentType;
+import org.apache.lucene.gdata.server.registry.GDataServerRegistry;
+import org.apache.lucene.gdata.server.registry.ProvidedService;
+import org.apache.lucene.gdata.storage.StorageException;
+import org.apache.lucene.queryParser.ParseException;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.search.Query;
+
+import com.google.gdata.data.BaseEntry;
+import com.google.gdata.data.BaseFeed;
+
+/**
+ * @author Simon Willnauer
+ *
+ */
+public class GDataSearchService extends GDataService {
+    private static final Log LOG = LogFactory.getLog(GDataSearchService.class);
+    private static SearchComponent SEARCHCOMPONENT;
+    private GDataSearcher<String> searcher;
+    protected GDataSearchService() throws ServiceException {
+        if(SEARCHCOMPONENT == null)
+            SEARCHCOMPONENT = GDataServerRegistry.getRegistry().lookup(SearchComponent.class,ComponentType.SEARCHCONTROLLER);
+        
+       
+    }
+
+    /**
+     * @see org.apache.lucene.gdata.server.GDataService#getFeed(org.apache.lucene.gdata.server.GDataRequest, org.apache.lucene.gdata.server.GDataResponse)
+     */
+    @Override
+    public BaseFeed getFeed(GDataRequest request, GDataResponse response) throws ServiceException {
+        String translatedQuery = request.getTranslatedQuery();
+        ProvidedService service = request.getConfigurator();
+        
+        QueryParser parser = new GDataQueryParser(service.getIndexSchema());
+        Query query;
+        try {
+            query = parser.parse(translatedQuery);
+           
+        } catch (ParseException e1) {
+            throw new ServiceException("Search Failed -- Can not parse query",e1,GDataResponse.BAD_REQUEST);
+        }
+        if(LOG.isInfoEnabled())
+            LOG.info("Fire search for user query  query: "+query.toString());
+        this.searcher = SEARCHCOMPONENT.getServiceSearcher(service);
+        List<String> result;
+        try {
+            result = this.searcher.search(query,request.getItemsPerPage(),request.getStartIndex(),request.getFeedId());
+        } catch (IOException e) {
+           throw new ServiceException("Search Failed -- Searcher throws IOException",e,GDataResponse.SERVER_ERROR); 
+           
+        }
+        if(LOG.isInfoEnabled())
+            LOG.info("Fetching results for user query result size: "+result.size());
+        ServerBaseFeed requestFeed = new ServerBaseFeed();
+        requestFeed.setServiceConfig(service);
+        requestFeed.setStartIndex(0);
+        requestFeed.setItemsPerPage(0);
+        requestFeed.setId(request.getFeedId());
+        
+        BaseFeed feed = this.storage.getFeed(requestFeed);
+        for (String entryId : result) {
+            ServerBaseEntry requestEntry = new ServerBaseEntry();
+            requestEntry.setId(entryId);
+            requestEntry.setServiceConfig(service);
+            try{
+            BaseEntry entry = this.storage.getEntry(requestEntry);
+            feed.getEntries().add(entry);
+            }catch (StorageException e) {
+                
+                LOG.error("StorageException caught while fetching query results -- skip entry -- "+e.getMessage(),e);
+            }
+        }
+        dynamicElementFeedStragey(feed,request);
+        return feed;
+    }
+
+    
+
+}

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataSearchService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/java/org/apache/lucene/gdata/server/GDataSearchService.java
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message