001/* 002 * (C) Copyright 2002 - 2006 Nuxeo SARL <http://nuxeo.com> and others 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the Eclipse Public License v1.0 006 * which accompanies this distribution, and is available at 007 * http://www.eclipse.org/legal/epl-v10.html 008 * 009 * Contributors: 010 * Nuxeo - initial API and implementation 011 * 012 * 013 * $Id: PluginExtension.java 3036 2006-09-18 17:32:20Z janguenot $ 014 */ 015 016package org.nuxeo.ecm.platform.filemanager.service.extension; 017 018import java.io.Serializable; 019import java.util.ArrayList; 020import java.util.List; 021 022import org.nuxeo.common.xmap.annotation.XNode; 023import org.nuxeo.common.xmap.annotation.XNodeList; 024import org.nuxeo.common.xmap.annotation.XObject; 025 026/** 027 * @author akalogeropoulos 028 */ 029@XObject("plugin") 030public class FileImporterDescriptor implements Serializable { 031 032 public static final List<String> DEFAULT_FILTER = new ArrayList<String>(); 033 034 private static final long serialVersionUID = 1L; 035 036 @XNode("@enabled") 037 boolean enabled = true; 038 039 @XNode("@name") 040 protected String name; 041 042 @XNode("@class") 043 protected String className; 044 045 @XNode("@docType") 046 protected String docType; 047 048 @XNodeList(value = "filter", type = ArrayList.class, componentType = String.class) 049 protected List<String> filters = DEFAULT_FILTER; 050 051 @XNode("@filter") 052 protected String filter; 053 054 @XNode("@order") 055 private Integer order; 056 057 @XNode("@merge") 058 private boolean merge = false; 059 060 public String getName() { 061 return name; 062 } 063 064 public void setName(String name) { 065 this.name = name; 066 } 067 068 public String getClassName() { 069 return className; 070 } 071 072 public void setClassName(String className) { 073 this.className = className; 074 } 075 076 /** 077 * Returns the configured document type to be created when using the importer 078 * 079 * @since 5.5 080 */ 081 public String getDocType() { 082 return docType; 083 } 084 085 public String getFilter() { 086 return filter; 087 } 088 089 public void setFilter(String filter) { 090 this.filter = filter; 091 } 092 093 public List<String> getFilters() { 094 return filters; 095 } 096 097 public void setFilters(List<String> filters) { 098 this.filters = filters; 099 } 100 101 public boolean isEnabled() { 102 return enabled; 103 } 104 105 public Integer getOrder() { 106 return order; 107 } 108 109 /** 110 * Returns {@code true} if this {@code FileImporterDescriptor} should be merged with an existing one, {@code false} 111 * otherwise. 112 * 113 * @since 5.5 114 */ 115 public boolean isMerge() { 116 return merge; 117 } 118}