[exo-jcr-commits] exo-jcr SVN: r2141 - in jcr/trunk/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/impl/dataflow/serialization and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Mar 25 12:14:59 EDT 2010


Author: sergiykarpenko
Date: 2010-03-25 12:14:57 -0400 (Thu, 25 Mar 2010)
New Revision: 2141

Added:
   jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TestPropsDeserialization.java
Removed:
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/FilterMultiColumnQuery.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrTextExtractor.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NamePathResolverImpl.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PooledTextExtractor.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextExtractorFilter.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextFilterExtractor.java
   jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TetsPropsDeserialization.java
Log:
EXOJCR-605: empty classes removed and test renamed

Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/FilterMultiColumnQuery.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/FilterMultiColumnQuery.java	2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/FilterMultiColumnQuery.java	2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.exoplatform.services.jcr.impl.core.query.lucene;
-
-
-/**
- * <code>FilterMultiColumnQuery</code> wraps a multi column query and filters
- * out rows that do not satisfy a given constraint.
- */
-public class FilterMultiColumnQuery
-{
-   //implements MultiColumnQuery {
-   //
-   //    /**
-   //     * The logger instance for this class.
-   //     */
-   //    private static final Logger log = LoggerFactory.getLogger(FilterMultiColumnQuery.class);
-   //
-   //    /**
-   //     * The query to filter.
-   //     */
-   //    private final MultiColumnQuery query;
-   //
-   //    /**
-   //     * The constraint for filtering.
-   //     */
-   //    private final Constraint constraint;
-   //
-   //    /**
-   //     * Creates a new filter multi column query for the given <code>query</code>
-   //     * and <code>constraint</code>.
-   //     *
-   //     * @param query      the query to filter.
-   //     * @param constraint the constraint for filtering.
-   //     */
-   //    public FilterMultiColumnQuery(MultiColumnQuery query,
-   //                                  Constraint constraint) {
-   //        this.query = query;
-   //        this.constraint = constraint;
-   //    }
-   //
-   //    /**
-   //     * {@inheritDoc}
-   //     */
-   //    public MultiColumnQueryHits execute(final JackrabbitIndexSearcher searcher,
-   //                                        Sort sort,
-   //                                        long resultFetchHint)
-   //            throws IOException {
-   //        return new FilterMultiColumnQueryHits(query.execute(
-   //                searcher, sort, resultFetchHint)) {
-   //
-   //            {
-   //                log.debug(Arrays.asList(getSelectorNames()).toString());
-   //            }
-   //
-   //            public ScoreNode[] nextScoreNodes() throws IOException {
-   //                ScoreNode[] next;
-   //                do {
-   //                    next = super.nextScoreNodes();
-   //                    if (log.isDebugEnabled()) {
-   //                        if (next != null) {
-   //                            log.debug(Arrays.asList(next).toString());
-   //                        }
-   //                    }
-   //                } while (next != null && !constraint.evaluate(next, getSelectorNames(), searcher));
-   //                return next;
-   //            }
-   //        };
-   //    }
-}

Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrTextExtractor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrTextExtractor.java	2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrTextExtractor.java	2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,182 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.exoplatform.services.jcr.impl.core.query.lucene;
-
-//
-///**
-// * Backwards-compatible Jackrabbit text extractor component. This class
-// * implements the following functionality:
-// * <ul>
-// *   <li>
-// *     Parses the configured {@link TextExtractor} and {@link TextFilter}
-// *     class names and instantiates the configured classes.
-// *   </li>
-// *   <li>
-// *     Acts as the delegate extractor for any configured
-// *     {@link DelegatingTextExtractor} instances.
-// *   </li>
-// *   <li>
-// *     Maintains a {@link CompositeTextExtractor} instance that contains
-// *     all the configured extractors and to which all text extraction calls
-// *     are delegated.
-// *   </li>
-// *   <li>
-// *     Creates a {@link TextFilterExtractor} adapter for a configured
-// *     {@link TextFilter} instance when it is first used and adds that adapter
-// *     to the composite extractor for use in text extraction.
-// *   </li>
-// *   <li>
-// *     Logs a warning and creates a dummy {@link EmptyTextExtractor} instance
-// *     for any unsupported content types when first detected. The dummy
-// *     extractor is added to the composite extractor to prevent future
-// *     warnings about the same content type.
-// *   </li>
-// * </ul>
-// */
-public class JcrTextExtractor
-{
-   //implements TextExtractor {
-
-   //    /**
-   //     * Logger instance.
-   //     */
-   //    private static final Logger logger =
-   //        LoggerFactory.getLogger(JackrabbitTextExtractor.class);
-   //
-   //    /**
-   //     * Set of content types that are known to be supported by the
-   //     * composite extractor.
-   //     */
-   //    private final Set types = new HashSet();
-   //
-   //    /**
-   //     * Composite extractor used to for all text extration tasks. Contains
-   //     * all the {@link TextExtractor} instances for directly supported content
-   //     * types, the {@link TextFilterExtractor} adapters for backwards
-   //     * compatibility with configured {@link TextFilter} instances that have
-   //     * already been used, and the dummy {@link EmptyTextExtractor} instances
-   //     * created for unsupported content types.
-   //     */
-   //    private final CompositeTextExtractor extractor =
-   //        new CompositeTextExtractor();
-   //
-   //    /**
-   //     * Configured {@link TextFilter} instances. Used for backwards
-   //     * compatibility with existing configuration files and {@link TextFilter}
-   //     * implementations.
-   //     */
-   //    private final Collection filters = new ArrayList();
-   //
-   //    /**
-   //     * Creates a Jackrabbit text extractor containing the configured component
-   //     * classes.
-   //     *
-   //     * @param classes configured {@link TextExtractor} (and {@link TextFilter})
-   //     *                class names (space- or comma-separated)
-   //     */
-   //    public JackrabbitTextExtractor(String classes) {
-   //        logger.debug("JackrabbitTextExtractor({})", classes);
-   //        StringTokenizer tokenizer = new StringTokenizer(classes, ", \t\n\r\f");
-   //        while (tokenizer.hasMoreTokens()) {
-   //            String name = tokenizer.nextToken();
-   //            try {
-   //                Object object = Class.forName(name).newInstance();
-   //                if (object instanceof DelegatingTextExtractor) {
-   //                    ((DelegatingTextExtractor) object)
-   //                        .setDelegateTextExtractor(this);
-   //                }
-   //                if (object instanceof TextExtractor) {
-   //                    extractor.addTextExtractor((TextExtractor) object);
-   //                } else if (object instanceof TextFilter) {
-   //                    filters.add(object);
-   //                } else {
-   //                    logger.warn("Unknown text extractor class: {}", name);
-   //                }
-   //            } catch (ClassNotFoundException e) {
-   //                logger.warn("Extractor class not found: " + name, e);
-   //            } catch (LinkageError e) {
-   //                logger.warn("Extractor dependency not found: " + name, e);
-   //            } catch (IllegalAccessException e) {
-   //                logger.warn("Extractor constructor not accessible: " + name, e);
-   //            } catch (InstantiationException e) {
-   //                logger.warn("Extractor instantiation failed: " + name, e);
-   //            }
-   //        }
-   //
-   //        types.addAll(Arrays.asList(extractor.getContentTypes()));
-   //    }
-   //
-   //    //-------------------------------------------------------< TextExtractor >
-   //
-   //    /**
-   //     * Returns the content types that the component extractors are known
-   //     * to support.
-   //     *
-   //     * @return supported content types
-   //     */
-   //    public String[] getContentTypes() {
-   //        return extractor.getContentTypes(); // and then some
-   //    }
-   //
-   //    /**
-   //     * Extracts the text content from the given binary stream. The given
-   //     * content type is used to look up a configured text extractor to which
-   //     * to delegate the request.
-   //     * <p>
-   //     * If a matching extractor is not found, then the configured text filters
-   //     * searched for an instance that claims to support the given content type.
-   //     * A text extractor adapter is created for that filter and saved in the
-   //     * extractor map for future use before delegating the request to the
-   //     * adapter.
-   //     * <p>
-   //     * If not even a text filter is found for the given content type, a warning
-   //     * is logged and an empty text extractor is created for that content type
-   //     * and saved in the extractor map for future use before delegating the
-   //     * request to the empty extractor.
-   //     *
-   //     * @param stream binary stream
-   //     * @param type content type
-   //     * @param encoding character encoding, or <code>null</code>
-   //     * @return reader for the text content of the binary stream
-   //     * @throws IOException if the binary stream can not be read
-   //     */
-   //    public Reader extractText(InputStream stream, String type, String encoding)
-   //            throws IOException {
-   //        logger.debug("extractText(stream, {}, {})", type, encoding);
-   //        if (!types.contains(type)) {
-   //            Iterator iterator = filters.iterator();
-   //            while (iterator.hasNext()) {
-   //                TextFilter filter = (TextFilter) iterator.next();
-   //                if (filter.canFilter(type)) {
-   //                    types.add(type);
-   //                    extractor.addTextExtractor(
-   //                            new TextFilterExtractor(type, filter));
-   //                    break;
-   //                }
-   //            }
-   //        }
-   //
-   //        if (!types.contains(type)) {
-   //            logger.debug("Full text indexing of {} is not supported", type);
-   //            types.add(type);
-   //            extractor.addTextExtractor(new EmptyTextExtractor(type));
-   //        }
-   //
-   //        return extractor.extractText(stream, type, encoding);
-   //    }
-
-}

Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NamePathResolverImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NamePathResolverImpl.java	2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NamePathResolverImpl.java	2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.exoplatform.services.jcr.impl.core.query.lucene;
-
-
-/**
- * <code>NamePathResolverImpl</code>...
- */
-public class NamePathResolverImpl{ 
-//extends DefaultNamePathResolver {
-//
-//    private static Logger log = LoggerFactory.getLogger(NamePathResolverImpl.class);
-//
-//    private static final NameFactory NAME_FACTORY = NameFactoryImpl.getInstance();
-//    private static final PathFactory PATH_FACTORY = PathFactoryImpl.getInstance();
-//
-//    private NamePathResolverImpl(NameResolver nResolver, PathResolver pResolver) {
-//        super(nResolver, pResolver);
-//    }
-//
-//    public static NamePathResolver create(NamespaceMappings nsMappings) {
-//        NameResolver nResolver = new NameResolverImpl(nsMappings);
-//        PathResolver pResolver = new ParsingPathResolver(PATH_FACTORY, nResolver);
-//        return new NamePathResolverImpl(nResolver, pResolver);
-//    }
-//
-//
-//    //--------------------------------------------------------< inner class >---
-//    /**
-//     * Query specific NameResolver that does not assume an empty prefix for the
-//     * default namespace URI. Instead the prefix is always retrieved from the
-//     * NamespaceResolver.
-//     */
-//    private static class NameResolverImpl implements NameResolver {
-//
-//        /**
-//         * Namespace resolver.
-//         */
-//        private final NamespaceResolver resolver;
-//
-//        /**
-//         * Creates a parsing name resolver.
-//         *
-//         * @param resolver namespace resolver
-//         */
-//        public NameResolverImpl(NamespaceResolver resolver) {
-//            this.resolver = resolver;
-//        }
-//
-//        //-------------------------------------------------------< NameResolver >---
-//        /**
-//         * Parses the prefixed JCR name and returns the resolved qualified name.
-//         *
-//         * @param name prefixed JCR name
-//         * @return qualified name
-//         * @throws IllegalNameException if the JCR name format is invalid
-//         * @throws NamespaceException if the namespace prefix can not be resolved
-//         */
-//        public Name getQName(String name) throws IllegalNameException, NamespaceException {
-//            return NameParser.parse(name, resolver, NAME_FACTORY);
-//        }
-//
-//        /**
-//         * Returns the prefixed JCR name for the given qualified name.
-//         * Note, that the JCR prefix is always retrieved from the NamespaceResolver
-//         * even if the name is in the defaut namespace. This is a special treatement
-//         * for query specific implementation, which defines a prefix for all namespace
-//         * URIs including the default namespace.
-//         *
-//         * @param name qualified name
-//         * @return prefixed JCR name
-//         * @throws NamespaceException if the namespace URI can not be resolved
-//         */
-//        public String getJCRName(Name name) throws NamespaceException {
-//            String uri = name.getNamespaceURI();
-//            if (resolver.getPrefix(uri).length() == 0) {
-//                return name.getLocalName();
-//            } else {
-//                return resolver.getPrefix(uri) + ":" + name.getLocalName();
-//            }
-//        }
-//    }
-
-}

Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PooledTextExtractor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PooledTextExtractor.java	2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PooledTextExtractor.java	2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.exoplatform.services.jcr.impl.core.query.lucene;
-
-
-/**
- * <code>PooledTextExtractor</code> implements a text extractor that extracts
- * the text using a pool of background threads.
- */
-public class PooledTextExtractor{
-//implements TextExtractor {
-//
-//    /**
-//     * The logger instance for this class.
-//     */
-//    private static final Logger log = LoggerFactory.getLogger(PooledTextExtractor.class);
-//
-//    /**
-//     * The actual text extractor.
-//     */
-//    private final TextExtractor extractor;
-//
-//    /**
-//     * The pooled executor.
-//     */
-//    private final PooledExecutor executor;
-//
-//    /**
-//     * The timeout for the {@link TextExtractorReader}.
-//     */
-//    private final long timout;
-//
-//    /**
-//     * Returns a pooled text extractor based on <code>extractor</code>.
-//     *
-//     * @param extractor the actual text extractor.
-//     * @param poolSize  the pool size.
-//     * @param backLog   size of the back log queue.
-//     * @param timeout   the timeout in milliseconds until text extraction is put
-//     *                  into the indexing queue and the fulltext index for the
-//     *                  node is later updated when the text extractor finished
-//     *                  its work.
-//     */
-//    public PooledTextExtractor(TextExtractor extractor,
-//                               int poolSize,
-//                               int backLog,
-//                               long timeout) {
-//        this.extractor = extractor;
-//        this.timout = timeout;
-//        Channel c;
-//        if (backLog <= 0) {
-//            c = new SynchronousChannel();
-//        } else {
-//            c = new BoundedLinkedQueue(backLog);
-//        }
-//        this.executor = new PooledExecutor(c, poolSize);
-//        this.executor.setMinimumPoolSize(poolSize);
-//        this.executor.setBlockedExecutionHandler(
-//                new PooledExecutor.BlockedExecutionHandler() {
-//            public boolean blockedAction(Runnable command) {
-//                // execute with current thread and log message
-//                log.info("Extractor pool busy, running command with "
-//                        + "current thread: {}", command.toString());
-//                command.run();
-//                return true;
-//            }
-//        });
-//    }
-//
-//
-//    /**
-//     * {@inheritDoc}
-//     */
-//    public String[] getContentTypes() {
-//        return extractor.getContentTypes();
-//    }
-//
-//    /**
-//     * {@inheritDoc}
-//     * <p/>
-//     * This implementation returns an instance of {@link TextExtractorReader}.
-//     */
-//    public Reader extractText(InputStream stream,
-//                              String type,
-//                              String encoding) throws IOException {
-//        TextExtractorJob job = new TextExtractorJob(extractor, stream, type, encoding);
-//        return new TextExtractorReader(job, executor, timout);
-//    }
-//
-//    /**
-//     * Shuts down this pooled text extractor. This methods stops all currently
-//     * running text extractor tasks and cleans up the pending queue (back log).
-//     */
-//    public void shutdown() {
-//        executor.shutdownNow();
-//        boolean interrupted;
-//        do {
-//            try {
-//                executor.awaitTerminationAfterShutdown();
-//                interrupted = false;
-//            } catch (InterruptedException e) {
-//                interrupted = true;
-//            }
-//        } while (interrupted);
-//        executor.drain();
-//    }
-}

Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextExtractorFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextExtractorFilter.java	2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextExtractorFilter.java	2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.exoplatform.services.jcr.impl.core.query.lucene;
-
-import org.exoplatform.services.jcr.impl.core.query.TextFilter;
-
-/**
- * Utility base class for migrating functionality from existing implementations
- * of the deprecated {@link TextFilter} interface to the new
- * {@link TextExtractor} interface. Once the functionality of an existing
- * TextFilter has been copied to a new TextExtractor, the original class can
- * be replaced with the following template to keep backwards compatibility
- * while avoiding the burden of maintaining duplicate code:
- * <pre>
- * <b>public class</b> SomeTextFilter <b>extends</b> TextExtractorFilter {
- *     <b>public</b> SomeTextFilter() {
- *         <b>super</b>(<b>new</b> SomeTextExtractor());
- *     }
- * }
- * </pre>
- */
-public class TextExtractorFilter {
-//implements TextFilter {
-//
-//    /**
-//     * The adapted text extractor.
-//     */
-//    private final TextExtractor extractor;
-//
-//    /**
-//     * Creates a text filter adapter for the given text extractor.
-//     *
-//     * @param extractor adapted text extractor
-//     */
-//    public TextExtractorFilter(TextExtractor extractor) {
-//        this.extractor = extractor;
-//    }
-//
-//    /**
-//     * Returns true if the adapted text extractor supports the given
-//     * content type.
-//     *
-//     * @param mimeType content type
-//     * @return <code>true</code> if the content type is supported,
-//     *         <code>false</code> otherwise
-//     */
-//    public boolean canFilter(String mimeType) {
-//        mimeType = mimeType.toLowerCase();
-//        String[] types = extractor.getContentTypes();
-//        for (int i = 0; i < types.length; i++) {
-//            if (types[i].equals(mimeType)) {
-//                return true;
-//            }
-//        }
-//        return false;
-//    }
-//
-//    /**
-//     * Extracts text content of the given binary property using the adapted
-//     * text extractor.
-//     *
-//     * @param data binary property
-//     * @param encoding character encoding, or <code>null</code>
-//     * @return map that contains a reader for the extracted text as
-//     *         the {@link FieldNames#FULLTEXT} entry
-//     * @throws RepositoryException if the binary property can not be read
-//     */
-//    public Map doFilter(PropertyState data, String encoding)
-//            throws RepositoryException {
-//        InternalValue[] values = data.getValues();
-//        if (values.length == 1) {
-//            try {
-//                String type = "application/octet-stream";
-//                String[] types = extractor.getContentTypes();
-//                if (types.length > 0) {
-//                    type = types[0];
-//                }
-//
-////                BLOBFileValue blob = values[0].getBLOBFileValue();
-//                Reader reader = 
-//                    extractor.extractText(null, type, encoding);
-//
-//                Map result = new HashMap();
-//                result.put(FieldNames.FULLTEXT, reader);
-//                return result;
-//            } catch (IOException e) {
-//                throw new RepositoryException("Text extraction error", e);
-//            }
-//        } else {
-//            // multi value not supported
-//            throw new RepositoryException(
-//                    "Multi-valued binary properties not supported.");
-//        }
-//    }
-
-}

Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextFilterExtractor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextFilterExtractor.java	2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextFilterExtractor.java	2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.exoplatform.services.jcr.impl.core.query.lucene;
-
-import org.exoplatform.services.jcr.impl.core.query.TextFilter;
-
-/**
- * Adapter class for achieving backwards compatibility with classes
- * implementing the deprectated {@link TextFilter} interface. This class
- * implements the {@link TextExtractor} interface through calls to an
- * underlying {@link TextFilter} instance.
- */
-public class TextFilterExtractor { 
-//implements TextExtractor {
-//
-//    /**
-//     * Supported content types.
-//     */
-//    private final String[] types;
-//
-//    /**
-//     * The adapted text filter.
-//     */
-//    private final TextFilter filter;
-//
-//    /**
-//     * Creates a text extractor adapter that supports the given content
-//     * types using the given text filter.
-//     *
-//     * @param types supported content types
-//     * @param filter text filter to be adapted
-//     */
-//    public TextFilterExtractor(String[] types, TextFilter filter) {
-//        this.types = types;
-//        this.filter = filter;
-//    }
-//
-//    /**
-//     * Creates a text extractor adapter that supports the given content
-//     * type using the given text filter.
-//     *
-//     * @param type supported content type
-//     * @param filter text filter to be adapted
-//     */
-//    public TextFilterExtractor(String type, TextFilter filter) {
-//        this(new String[] { type }, filter);
-//    }
-//
-//    /**
-//     * Returns the supported content types.
-//     *
-//     * @return supported content types
-//     */
-//    public String[] getContentTypes() {
-//        return types;
-//    }
-//
-//    /**
-//     * Extracts the text content of the given binary stream by calling the
-//     * underlying {@link TextFilter} instance. A dummy {@link PropertyState}
-//     * instance is created to comply with the
-//     * {@link TextFilter#doFilter(PropertyState, String)} method signature.
-//     *
-//     * @param stream binary stream
-//     * @param type content type
-//     * @param encoding character encoding, or <code>null</code>
-//     * @return reader reader for the extracted text content
-//     * @throws IOException if the adapted call fails
-//     */
-//    public Reader extractText(InputStream stream, String type, String encoding)
-//            throws IOException {
-////        InternalValue v = null;
-////        try {
-////            v = InternalValue.createTemporary(stream);
-////            final InternalValue value = v;
-////            PropertyState state = new PropertyState(
-////                    (PropertyId) null, ItemState.STATUS_EXISTING, true);
-////            state.setValues(new InternalValue[] { value });
-////            Map fields = filter.doFilter(state, encoding);
-////            Object fulltext = fields.get(FieldNames.FULLTEXT);
-////            if (fulltext instanceof Reader) {
-////                return new FilterReader((Reader) fulltext) {
-////                    public void close() throws IOException {
-////                        super.close();
-////                        value.getBLOBFileValue().discard();
-////                    }
-////                };
-////            } else {
-////                value.getBLOBFileValue().discard();
-////                return new StringReader("");
-////            }
-////        } catch (RepositoryException e) {
-////            if (v != null) {
-////                v.getBLOBFileValue().discard();
-////            }
-////            return new StringReader("");
-////        }
-//       return null;
-//    }
-
-}

Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TestPropsDeserialization.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TestPropsDeserialization.java	                        (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TestPropsDeserialization.java	2010-03-25 16:14:57 UTC (rev 2141)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.impl.dataflow.serialization;
+
+import org.exoplatform.services.jcr.dataflow.TransactionChangesLog;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Calendar;
+import java.util.List;
+
+import javax.jcr.Node;
+
+/**
+ * Created by The eXo Platform SAS.
+ * 
+ * <br/>Date: 
+ *
+ * @author <a href="karpenko.sergiy at gmail.com">Karpenko Sergiy</a> 
+ * @version $Id: TetsPropsDeserialization.java 111 2008-11-11 11:11:11Z serg $
+ */
+public class TestPropsDeserialization extends JcrImplSerializationBaseTest
+{
+
+   public void testPropReSetVal() throws Exception
+   {
+      TesterItemsPersistenceListener pl = new TesterItemsPersistenceListener(this.session);
+
+      File content1 = this.createBLOBTempFile(300);
+      File content2 = this.createBLOBTempFile(301);
+
+      Node srcVersionNode = root.addNode("nt_file_node", "nt:file");
+      Node contentNode = srcVersionNode.addNode("jcr:content", "nt:resource");
+      contentNode.setProperty("jcr:data", new FileInputStream(content1));
+      contentNode.setProperty("jcr:mimeType", "text/plain");
+      contentNode.setProperty("jcr:lastModified", session.getValueFactory().createValue(Calendar.getInstance()));
+      srcVersionNode.addMixin("mix:versionable");
+
+      session.save();
+
+      contentNode.setProperty("jcr:data", new FileInputStream(content2));
+      session.save();
+
+      List<TransactionChangesLog> logs = pl.pushChanges();
+
+      File jcrfile = super.serializeLogs(logs);
+
+      List<TransactionChangesLog> destLog = super.deSerializeLogs(jcrfile);
+
+      assertEquals(logs.size(), destLog.size());
+
+      for (int i = 0; i < logs.size(); i++)
+         checkIterator(logs.get(i).getAllStates().iterator(), destLog.get(i).getAllStates().iterator());
+   }
+
+}

Deleted: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TetsPropsDeserialization.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TetsPropsDeserialization.java	2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TetsPropsDeserialization.java	2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.impl.dataflow.serialization;
-
-import org.exoplatform.services.jcr.dataflow.TransactionChangesLog;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.Calendar;
-import java.util.List;
-
-import javax.jcr.Node;
-
-/**
- * Created by The eXo Platform SAS.
- * 
- * <br/>Date: 
- *
- * @author <a href="karpenko.sergiy at gmail.com">Karpenko Sergiy</a> 
- * @version $Id: TetsPropsDeserialization.java 111 2008-11-11 11:11:11Z serg $
- */
-public class TetsPropsDeserialization extends JcrImplSerializationBaseTest
-{
-
-   public void testPropReSetVal() throws Exception
-   {
-      TesterItemsPersistenceListener pl = new TesterItemsPersistenceListener(this.session);
-
-      File content1 = this.createBLOBTempFile(300);
-      File content2 = this.createBLOBTempFile(301);
-
-      Node srcVersionNode = root.addNode("nt_file_node", "nt:file");
-      Node contentNode = srcVersionNode.addNode("jcr:content", "nt:resource");
-      contentNode.setProperty("jcr:data", new FileInputStream(content1));
-      contentNode.setProperty("jcr:mimeType", "text/plain");
-      contentNode.setProperty("jcr:lastModified", session.getValueFactory().createValue(Calendar.getInstance()));
-      srcVersionNode.addMixin("mix:versionable");
-
-      session.save();
-
-      contentNode.setProperty("jcr:data", new FileInputStream(content2));
-      session.save();
-
-      List<TransactionChangesLog> logs = pl.pushChanges();
-
-      File jcrfile = super.serializeLogs(logs);
-
-      List<TransactionChangesLog> destLog = super.deSerializeLogs(jcrfile);
-
-      assertEquals(logs.size(), destLog.size());
-
-      for (int i = 0; i < logs.size(); i++)
-         checkIterator(logs.get(i).getAllStates().iterator(), destLog.get(i).getAllStates().iterator());
-   }
-
-}



More information about the exo-jcr-commits mailing list