001/*
002 * (C) Copyright 2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *    Mariana Cedica
018 */
019package org.nuxeo.ecm.platform.importer.service;
020
021import org.nuxeo.common.xmap.annotation.XNode;
022import org.nuxeo.common.xmap.annotation.XObject;
023import org.nuxeo.ecm.platform.importer.factories.DefaultDocumentModelFactory;
024import org.nuxeo.ecm.platform.importer.log.ImporterLogger;
025import org.nuxeo.ecm.platform.importer.source.FileSourceNode;
026
027@XObject("importerConfig")
028public class ImporterConfigurationDescriptor {
029
030    @XNode("@sourceNodeClass")
031    protected Class<? extends FileSourceNode> sourceNodeClass;
032
033    @XNode("@importerLogClass")
034    protected Class<? extends ImporterLogger> importerLogClass;
035
036    @XNode("bulkMode")
037    protected Boolean bulkMode;
038
039    @XNode("documentModelFactory")
040    protected DocumentModelFactory documentModelFactory;
041
042    @XNode("repository")
043    protected String repository;
044
045    @XObject("documentModelFactory")
046    public static class DocumentModelFactory {
047
048        @XNode("@documentModelFactoryClass")
049        protected Class<? extends DefaultDocumentModelFactory> documentModelFactoryClass;
050
051        @XNode("@leafType")
052        protected String leafType;
053
054        @XNode("@folderishType")
055        protected String folderishType;
056
057        public String getFolderishType() {
058            return folderishType;
059        }
060
061        public String getLeafType() {
062            return leafType;
063        }
064
065        public Class<? extends DefaultDocumentModelFactory> getDocumentModelFactoryClass() {
066            return documentModelFactoryClass;
067        }
068    }
069
070    public Class<?> getSourceNodeClass() {
071        return sourceNodeClass;
072    }
073
074    public DocumentModelFactory getDocumentModelFactory() {
075        return documentModelFactory;
076    }
077
078    public Class<? extends ImporterLogger> getImporterLog() {
079        return importerLogClass;
080    }
081
082    public String getRepository() {
083        return repository;
084    }
085
086    public Boolean getBulkMode() {
087        return bulkMode;
088    }
089
090}