Package org.apache.stanbol.cmsadapter.servicesapi.mapping

Examples of org.apache.stanbol.cmsadapter.servicesapi.mapping.ContenthubFeeder


     */
    @SuppressWarnings({"rawtypes", "unchecked"})
    public ContenthubFeeder getContenthubFeeder(Object session, List<String> contentProperties) throws RepositoryAccessException,
                                                                                               ContenthubFeederException {

        ContenthubFeeder feeder = null;
        for (ContenthubFeeder f : boundedFeeders) {
            if (f.canFeedWith(session)) {
                feeder = f;
            }
        }

        if (feeder != null) {
            final Dictionary props = new Hashtable();
            props.put(ContenthubFeeder.PROP_SESSION, session);
            props.put(ContenthubFeeder.PROP_CONTENT_PROPERTIES, contentProperties != null ? contentProperties
                    : new ArrayList<String>());
            feeder.setConfigs(props);
        } else {
            log.warn("Failed to obtain a suitable ContenthubFeeder instance for session: {}", session);
            throw new ContenthubFeederException(String.format(
                "Failed to obtain a suitable ContenthubFeeder instance for session: %s", session));
        }
View Full Code Here


            return Response.status(Status.BAD_REQUEST).entity("Session key should not be null").build();
        }

        List<String> contentFieldList = parseContentProperties(contentProperties);

        ContenthubFeeder feeder = feederManager.getContenthubFeeder(sessionKey, contentFieldList);

        if (id != null) {
            feeder.submitContentItemByID(id, indexName);
        } else if (path != null) {
            if (!recursive) {
                feeder.submitContentItemByPath(path, indexName);
            } else {
                feeder.submitContentItemsUnderPath(path, indexName);
            }
        } else {
            return Response.status(Status.BAD_REQUEST)
                    .entity("There is no parameter specified to select content repository objects\n").build();
        }
View Full Code Here

        if (sessionKey == null) {
            return Response.status(Status.BAD_REQUEST).entity("Session key should not be null").build();
        }

        ContenthubFeeder feeder = feederManager.getContenthubFeeder(sessionKey, null);

        if (id != null) {
            feeder.deleteContentItemByID(id, indexName);
        } else if (path != null) {
            if (!recursive) {
                feeder.deleteContentItemByPath(path, indexName);
            } else {
                feeder.deleteContentItemsUnderPath(path, indexName);
            }
        } else {
            return Response.status(Status.BAD_REQUEST)
                    .entity("There is no parameter specified to select content repository objects\n").build();
        }
View Full Code Here

            return Response.status(Status.BAD_REQUEST).entity("Session key should not be null").build();
        }

        List<String> contentFieldList = parseContentProperties(contentProperties);

        ContenthubFeeder feeder = feederManager.getContenthubFeeder(sessionKey, contentFieldList);

        if (id != null) {
            feeder.submitContentItemByID(id, indexName);
        } else if (path != null) {
            if (!recursive) {
                feeder.submitContentItemByPath(path, indexName);
            } else {
                feeder.submitContentItemsUnderPath(path, indexName);
            }
        } else {
            return Response.status(Status.BAD_REQUEST)
                    .entity("There is no parameter specified to select content repository objects\n").build();
        }
View Full Code Here

        if (sessionKey == null) {
            return Response.status(Status.BAD_REQUEST).entity("Session key should not be null").build();
        }

        ContenthubFeeder feeder = feederManager.getContenthubFeeder(sessionKey, null);

        if (id != null) {
            feeder.deleteContentItemByID(id, indexName);
        } else if (path != null) {
            if (!recursive) {
                feeder.deleteContentItemByPath(path, indexName);
            } else {
                feeder.deleteContentItemsUnderPath(path, indexName);
            }
        } else {
            return Response.status(Status.BAD_REQUEST)
                    .entity("There is no parameter specified to select content repository objects\n").build();
        }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.cmsadapter.servicesapi.mapping.ContenthubFeeder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.