Просмотр исходного кода

jasperserver axis接口初步结构

sunyj 9 лет назад
Родитель
Сommit
1671b5b02d

+ 72 - 0
src/main/java/com/uas/report/aop/AxisServiceLogAspect.java

@@ -0,0 +1,72 @@
+package com.uas.report.aop;
+
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.Signature;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Component;
+
+import com.alibaba.druid.util.StringUtils;
+
+/**
+ * 利用AOP处理Axis Service日志
+ * 
+ * @author sunyj
+ * @since 2017年1月3日 上午9:47:17
+ */
+@Aspect
+@Component
+@EnableAspectJAutoProxy
+public class AxisServiceLogAspect {
+
+	private Logger logger = LoggerFactory.getLogger(getClass());
+
+	@Pointcut("execution(public * com.uas.report.axis..*Impl.*(..))")
+	public void log() {
+
+	}
+
+	@Before("log()")
+	public void before(JoinPoint joinPoint) {
+		StringBuilder stringBuilder = new StringBuilder("request... ");
+
+		// 类名
+		Object target = joinPoint.getTarget();
+		Class<?> clazz = target.getClass();
+		stringBuilder.append(clazz.getSimpleName());
+
+		// 方法名
+		Signature signature = joinPoint.getSignature();
+		String methodName = signature.getName();
+		stringBuilder.append(".").append(methodName);
+
+		// 方法全名
+		String methodString = signature.toString();
+		// 取出参数类型
+		String substring = methodString.substring(methodString.indexOf("(") + 1, methodString.lastIndexOf(")"));
+		if (!StringUtils.isEmpty(substring)) {
+			stringBuilder.append(": ");
+			String[] strs = substring.split(",");
+			Object[] args = joinPoint.getArgs();
+			for (int i = 0; i < strs.length; i++) {
+				// 参数类型和参数值
+				stringBuilder.append(strs[i]).append("=").append(args[i]);
+				if (i != strs.length - 1) {
+					stringBuilder.append(",");
+				}
+			}
+		}
+		logger.info(stringBuilder.toString());
+	}
+
+	@AfterReturning(value = "log()", returning = "result")
+	public void afterReturning(JoinPoint joinPoint, Object result) {
+		logger.info("result... " + result + "\n");
+	}
+
+}

+ 82 - 0
src/main/java/com/uas/report/axis/Argument.java

@@ -0,0 +1,82 @@
+package com.uas.report.axis;
+
+public class Argument {
+
+	public static final String LIST_DATASOURCES = "LIST_DATASOURCES";
+
+	public static final String VALUE_TRUE = "true";
+	public static final String VALUE_FALSE = "false";
+
+	public static final String RU_REF_URI = "RU_REF_URI";
+	public static final String PARAMS_ARG = "PARAMS_ARG";
+
+	/**
+	 * Argument used for the <code>list</code> method to specify that a resource
+	 * lookup is to be performed.
+	 * 
+	 * <p>
+	 * The {@link #RESOURCE_TYPE} argument is mandatory and needs to be set to a
+	 * resource type.
+	 * 
+	 * Optionally, {@link #PARENT_DIRECTORY} or {@link #START_FROM_DIRECTORY}
+	 * can be used to specify a folder to use as parent/ancestor when listing
+	 * resources.
+	 */
+	public static final String LIST_RESOURCES = "LIST_RESOURCES";
+
+	/**
+	 * An argument used along with {@link #LIST_RESOURCES} which specifies the
+	 * type of resources to be listed.
+	 * 
+	 * <p>
+	 * Valid valus for this argument are resource types such as
+	 * {@link ResourceDescriptor#TYPE_IMAGE TYPE_IMAGE} and the special value
+	 * {@link #REPORT_TYPE}.
+	 */
+	public static final String RESOURCE_TYPE = "RESOURCE_TYPE";
+
+	/**
+	 * A special {@link #RESOURCE_TYPE} value which is used for listing reports.
+	 * 
+	 * <p>
+	 * Using this differs from using {@link ResourceDescriptor#TYPE_REPORTUNIT}
+	 * in that listed reports are filtered not to include reports that are not
+	 * meant to be executed by users.
+	 */
+	public static final String REPORT_TYPE = "REPORT_TYPE";
+
+	/**
+	 * Argument used in conjunction with {@link #LIST_RESOURCES} to specify a
+	 * folder starting from which to list resources.
+	 * 
+	 * <p>
+	 * When this argument is used, resources located under the specified folder
+	 * at any level are returned by the <code>list</code> operation.
+	 */
+	public static final String START_FROM_DIRECTORY = "START_FROM_DIRECTORY";
+
+	private String name;
+	private String value;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getValue() {
+		return value;
+	}
+
+	public void setValue(String value) {
+		this.value = value;
+	}
+
+	@Override
+	public String toString() {
+		return "Argument [name=" + name + ", value=" + value + "]";
+	}
+
+}

+ 29 - 0
src/main/java/com/uas/report/axis/Attribute.java

@@ -0,0 +1,29 @@
+package com.uas.report.axis;
+
+public class Attribute {
+
+	private String name;
+	private AttributeValue value;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public AttributeValue getValue() {
+		return value;
+	}
+
+	public void setValue(AttributeValue value) {
+		this.value = value;
+	}
+
+	@Override
+	public String toString() {
+		return "Attribute [name=" + name + ", value=" + value + "]";
+	}
+
+}

+ 5 - 0
src/main/java/com/uas/report/axis/AttributeValue.java

@@ -0,0 +1,5 @@
+package com.uas.report.axis;
+
+public class AttributeValue {
+
+}

+ 119 - 0
src/main/java/com/uas/report/axis/FileHelper.java

@@ -0,0 +1,119 @@
+package com.uas.report.axis;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.springframework.util.StringUtils;
+
+import com.uas.report.SpecialProperties;
+import com.uas.report.util.ContextUtils;
+
+public class FileHelper {
+
+	private static SpecialProperties specialProperties = ContextUtils.getBean(SpecialProperties.class);
+
+	private static FileFilter filter = new FileFilter() {
+		@Override
+		public boolean accept(File file) {
+			if (file == null || !file.exists()) {
+				return false;
+			}
+			// 不支持查看、压缩:jasper文件、tmp路径
+			String filePath = file.getPath();
+			if (filePath.endsWith(".jasper") || filePath.endsWith("tmp") || filePath.contains("\\tmp\\")
+					|| filePath.contains("/tmp/")) {
+				return false;
+			}
+			return true;
+		}
+	};
+
+	public static List<Resource> listResource(String resourceURI) throws FileNotFoundException, IOException {
+		File dir = new File(specialProperties.getLocalBaseDir() + Folder.SEPARATOR + resourceURI);
+		if (!dir.exists() || !dir.isDirectory() || !filter.accept(dir)) {
+			return null;
+		}
+		List<Resource> resources = new ArrayList<>();
+		File[] files = dir.listFiles(filter);
+		for (File file : files) {
+			resources.add(locateResource(file));
+		}
+		return resources;
+	}
+
+	public static Resource locateResource(String resourceURI) throws FileNotFoundException, IOException {
+		return locateResource(getFile(resourceURI));
+	}
+
+	private static Resource locateResource(File file) throws FileNotFoundException, IOException {
+		if (file == null || !file.exists() || !filter.accept(file)) {
+			return null;
+		}
+		Resource resource = null;
+		if (file.isDirectory()) {
+			resource = new Folder();
+		} else {
+			resource = locateFileResource(file);
+		}
+		resource.setCreationDate(new Date(file.lastModified()));
+		resource.setUpdateDate(new Date(file.lastModified()));
+		resource.setVersion(1);
+		resource.setName(file.getName());
+		resource.setLabel(file.getName());
+		resource.setDescription(file.getName());
+		resource.setUri(getResourceURI(file));
+		return resource;
+	}
+
+	private static FileResource locateFileResource(File file) throws FileNotFoundException, IOException {
+		FileResource fileResource = new FileResource();
+		String fileType = getFileType(file.getName());
+		if (StringUtils.isEmpty(fileType)) {
+			fileResource.setFileType(FileResource.TYPE_UNKNOW);
+		} else {
+			if (fileType.equalsIgnoreCase(FileResource.TYPE_JRXML)) {
+				fileResource.setFileType(FileResource.TYPE_JRXML);
+			} else if (isImage(fileType)) {
+				fileResource.setFileType(FileResource.TYPE_IMAGE);
+			} else {
+				fileResource.setFileType(FileResource.TYPE_UNKNOW);
+			}
+		}
+		fileResource.readData(new FileInputStream(file));
+		return fileResource;
+	}
+
+	private static boolean isImage(String fileType) {
+		return fileType.toLowerCase()
+				.matches("^(gif|jpg|jpeg|png|bmp|tiff|pcx|tga|exif|fpx|svg|psd|cdr|pcd|dxf|ufo|eps|ai|raw)$");
+	}
+
+	private static File getFile(String resourceURI) {
+		return new File(specialProperties.getLocalBaseDir() + "/" + resourceURI);
+	}
+
+	private static String getResourceURI(File file) {
+		String resourceURI = file.getPath();
+		resourceURI = resourceURI.replace(new File(specialProperties.getLocalBaseDir()).getPath(), "");
+		resourceURI = resourceURI.replace("\\", Folder.SEPARATOR);
+		if (!resourceURI.startsWith(Folder.SEPARATOR)) {
+			resourceURI = Folder.SEPARATOR + resourceURI;
+		}
+		return resourceURI;
+	}
+
+	private static String getFileType(String fileName) {
+		int index = fileName.lastIndexOf(".");
+		if (index < 0) {
+			return null;
+		}
+		return fileName.substring(index + 1);
+	}
+
+}

+ 83 - 0
src/main/java/com/uas/report/axis/FileResource.java

@@ -0,0 +1,83 @@
+package com.uas.report.axis;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+
+import com.uas.report.axis.util.StreamUtil;
+
+public class FileResource extends Resource {
+
+	public static final String TYPE_IMAGE = "img";
+	public static final String TYPE_FONT = "font";
+	public static final String TYPE_JRXML = "jrxml";
+	public static final String TYPE_JAR = "jar";
+	public static final String TYPE_RESOURCE_BUNDLE = "prop";
+	public static final String TYPE_STYLE_TEMPLATE = "jrtx";
+	public static final String TYPE_XML = "xml";
+	public static final String TYPE_JSON = "json";
+	public static final String TYPE_CSS = "css";
+	public static final String TYPE_ACCESS_GRANT_SCHEMA = "accessGrantSchema";
+	public static final String TYPE_MONGODB_JDBC_CONFIG = "config";
+	public static final String TYPE_AZURE_CERTIFICATE = "cer";
+	public static final String TYPE_SECURE_FILE = "secureFile";
+	public static final String TYPE_DASHBOARD_COMPONENTS_SCHEMA = "dashboardComponent";
+	public static final String TYPE_UNKNOW = "unknow";
+
+	private String fileType;
+	private byte[] data;
+	private String referenceURI;
+
+	public String getFileType() {
+		return fileType;
+	}
+
+	public void setFileType(String fileType) {
+		this.fileType = fileType;
+	}
+
+	public byte[] getData() {
+		return data;
+	}
+
+	public void setData(byte[] data) {
+		this.data = data;
+	}
+
+	public String getReferenceURI() {
+		return referenceURI;
+	}
+
+	public void setReferenceURI(String referenceURI) {
+		this.referenceURI = referenceURI;
+	}
+
+	public void readData(InputStream is) throws IOException {
+		setData(StreamUtil.readData(is));
+	}
+
+	public InputStream getDataStream() {
+		return data == null ? null : new ByteArrayInputStream(data);
+	}
+
+	public boolean isReference() {
+		return referenceURI != null && referenceURI.length() > 0;
+	}
+
+	public boolean hasData() {
+		// empty array is considered no data
+		return !isReference() && data != null && data.length > 0;
+	}
+
+	@Override
+	protected Class<?> getImplementingItf() {
+		return FileResource.class;
+	}
+
+	@Override
+	public String toString() {
+		return "FileResource [fileType=" + fileType + ", data=" + Arrays.toString(data) + "]";
+	}
+
+}

+ 12 - 0
src/main/java/com/uas/report/axis/Folder.java

@@ -0,0 +1,12 @@
+package com.uas.report.axis;
+
+public class Folder extends Resource {
+
+	static final String SEPARATOR = "/";
+
+	@Override
+	protected Class<?> getImplementingItf() {
+		return Folder.class;
+	}
+
+}

+ 37 - 0
src/main/java/com/uas/report/axis/ListItem.java

@@ -0,0 +1,37 @@
+package com.uas.report.axis;
+
+public class ListItem {
+	private Object value;
+	private String label;
+	private boolean isListItem = false;
+
+	public Object getValue() {
+		return value;
+	}
+
+	public void setValue(Object value) {
+		this.value = value;
+	}
+
+	public String getLabel() {
+		return label;
+	}
+
+	public void setLabel(String label) {
+		this.label = label;
+	}
+
+	public boolean isListItem() {
+		return isListItem;
+	}
+
+	public void setIsListItem(boolean isListItem) {
+		this.isListItem = isListItem;
+	}
+
+	@Override
+	public String toString() {
+		return "ListItem [value=" + value + ", label=" + label + ", isListItem=" + isListItem + "]";
+	}
+
+}

+ 47 - 0
src/main/java/com/uas/report/axis/OperationResult.java

@@ -0,0 +1,47 @@
+package com.uas.report.axis;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class OperationResult {
+
+	public static final int SUCCESS = 0;
+
+	private int returnCode = SUCCESS;
+	private String message;
+	private List<ResourceDescriptor> resourceDescriptors = new ArrayList<>();
+	private String version = "1.2.1";
+
+	public int getReturnCode() {
+		return returnCode;
+	}
+
+	public void setReturnCode(int returnCode) {
+		this.returnCode = returnCode;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+
+	public List<ResourceDescriptor> getResourceDescriptors() {
+		return resourceDescriptors;
+	}
+
+	public void setResourceDescriptors(List<ResourceDescriptor> resourceDescriptors) {
+		this.resourceDescriptors = resourceDescriptors;
+	}
+
+	public String getVersion() {
+		return version;
+	}
+
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+}

+ 88 - 0
src/main/java/com/uas/report/axis/Request.java

@@ -0,0 +1,88 @@
+package com.uas.report.axis;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Request {
+
+	/**
+	 * List of arguments
+	 */
+	private List<Argument> arguments = new ArrayList<>();
+	private ResourceDescriptor resourceDescriptor;
+
+	private String operationName = null;
+	private String locale = null; // a string defining locale...
+
+	public List<Argument> getArguments() {
+		return arguments;
+	}
+
+	public void setArguments(List<Argument> arguments) {
+		this.arguments = arguments;
+	}
+
+	public ResourceDescriptor getResourceDescriptor() {
+		return resourceDescriptor;
+	}
+
+	public void setResourceDescriptor(ResourceDescriptor resourceDescriptor) {
+		this.resourceDescriptor = resourceDescriptor;
+	}
+
+	public String getOperationName() {
+		return operationName;
+	}
+
+	public void setOperationName(String operationName) {
+		this.operationName = operationName;
+	}
+
+	public String getLocale() {
+		return locale;
+	}
+
+	public void setLocale(String locale) {
+		this.locale = locale;
+	}
+
+	public String getArgumentValue(String argumentName) {
+		String value = null;
+		for (int i = 0; i < arguments.size(); ++i) {
+			Argument a = (Argument) arguments.get(i);
+			if (a.getName() == null ? a.getName() == argumentName : a.getName().equals(argumentName)) {
+				value = a.getValue();
+				break;
+			}
+		}
+		return value;
+	}
+
+	/**
+	 * Determines if a specific argument name is present in this request's list
+	 * of arguments.
+	 * 
+	 * @param argumentName
+	 *            the name of the argument to look for
+	 * @return <code>true</code> if an argument having the specified name is
+	 *         found in this request
+	 */
+	public boolean hasArgument(String argumentName) {
+		boolean found = false;
+		for (int i = 0; i < arguments.size(); ++i) {
+			Argument arg = (Argument) arguments.get(i);
+			if (argumentName.equals(arg.getName())) {
+				found = true;
+				break;
+			}
+		}
+		return found;
+	}
+
+	@Override
+	public String toString() {
+		return "Request [arguments=" + arguments + ", resourceDescriptor=" + resourceDescriptor + ", operationName="
+				+ operationName + ", locale=" + locale + "]";
+	}
+
+}

+ 120 - 0
src/main/java/com/uas/report/axis/Resource.java

@@ -0,0 +1,120 @@
+package com.uas.report.axis;
+
+import java.util.Date;
+import java.util.List;
+
+public abstract class Resource {
+
+	private int version;
+	private Date creationDate;
+	private Date updateDate;
+	private String name;
+	private String label;
+	private String description;
+	private List<Attribute> attributes;
+	private String folderUri;
+	private String uri;
+
+	public int getVersion() {
+		return version;
+	}
+
+	public void setVersion(int version) {
+		this.version = version;
+	}
+
+	public Date getCreationDate() {
+		return creationDate;
+	}
+
+	public void setCreationDate(Date creationDate) {
+		this.creationDate = creationDate;
+	}
+
+	public Date getUpdateDate() {
+		return updateDate;
+	}
+
+	public void setUpdateDate(Date updateDate) {
+		this.updateDate = updateDate;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getLabel() {
+		return label;
+	}
+
+	public void setLabel(String label) {
+		this.label = label;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public List<Attribute> getAttributes() {
+		return attributes;
+	}
+
+	public void setAttributes(List<Attribute> attributes) {
+		this.attributes = attributes;
+	}
+
+	public String getFolderUri() {
+		return folderUri;
+	}
+
+	public void setFolderUri(String folderUri) {
+		this.folderUri = folderUri;
+	}
+
+	public String getUri() {
+		return uri;
+	}
+
+	public void setUri(String uri) {
+		this.uri = uri;
+	}
+
+	public String getURIString() {
+		if (uri == null) {
+			StringBuffer sb = new StringBuffer();
+			if (getParentFolder() != null && !getParentFolder().equals(Folder.SEPARATOR))
+				sb.append(getParentFolder());
+			sb.append(Folder.SEPARATOR);
+			if (getName() != null && !getName().equals(Folder.SEPARATOR))
+				sb.append(getName());
+			uri = sb.toString();
+		}
+		return uri;
+	}
+
+	public String getParentFolder() {
+		return folderUri;
+	}
+
+	public String getResourceType() {
+		return getImplementingItf().getName();
+	}
+
+	protected abstract Class<?> getImplementingItf();
+
+	@Override
+	public String toString() {
+		return "Resource [version=" + version + ", creationDate=" + creationDate + ", updateDate=" + updateDate
+				+ ", name=" + name + ", label=" + label + ", description=" + description + ", attributes=" + attributes
+				+ ", folderUri=" + folderUri + ", uri=" + uri + "]";
+	}
+
+}

+ 225 - 0
src/main/java/com/uas/report/axis/ResourceDescriptor.java

@@ -0,0 +1,225 @@
+package com.uas.report.axis;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+public class ResourceDescriptor {
+
+	public static final String TYPE_FOLDER = "folder";
+	public static final String TYPE_REPORTUNIT = "reportUnit";
+
+	public static final String TYPE_REFERENCE = "reference";
+	public static final String REFERENCE_TYPE = "referenceType";
+
+	public static final String PROP_VERSION = "PROP_VERSION";
+	public static final String PROP_PARENT_FOLDER = "PROP_PARENT_FOLDER";
+	public static final String PROP_RESOURCE_TYPE = "PROP_RESOURCE_TYPE";
+
+	// File resource properties
+	public static final String PROP_FILERESOURCE_HAS_DATA = "PROP_HAS_DATA";
+
+	private List<ResourceProperty> properties = new ArrayList<>();
+	private HashMap<String, ResourceProperty> hm = new HashMap<>();
+
+	private String name;
+	private String label;
+	private String wsType;
+	private String uriString;
+	private boolean isNew = false;
+	private String description;
+
+	private Date creationDate;
+
+	private List<ResourceDescriptor> children = new ArrayList<>();
+	private List<ListItem> parameters = new ArrayList<>();
+
+	private String referenceType;
+
+	public List<ResourceProperty> getProperties() {
+		return properties;
+	}
+
+	public void setProperties(List<ResourceProperty> properties) {
+		this.properties = properties;
+	}
+
+	public HashMap<String, ResourceProperty> getHm() {
+		return hm;
+	}
+
+	public void setHm(HashMap<String, ResourceProperty> hm) {
+		this.hm = hm;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getLabel() {
+		return label;
+	}
+
+	public void setLabel(String label) {
+		this.label = label;
+	}
+
+	public String getWsType() {
+		return wsType;
+	}
+
+	public void setWsType(String wsType) {
+		this.wsType = wsType;
+	}
+
+	public String getUriString() {
+		return uriString;
+	}
+
+	public void setUriString(String uriString) {
+		this.uriString = uriString;
+	}
+
+	public boolean isNew() {
+		return isNew;
+	}
+
+	public void setIsNew(boolean isNew) {
+		this.isNew = isNew;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public Date getCreationDate() {
+		return creationDate;
+	}
+
+	public void setCreationDate(Date creationDate) {
+		this.creationDate = creationDate;
+	}
+
+	public List<ResourceDescriptor> getChildren() {
+		return children;
+	}
+
+	public void setChildren(List<ResourceDescriptor> children) {
+		this.children = children;
+	}
+
+	public List<ListItem> getParameters() {
+		return parameters;
+	}
+
+	public void setParameters(List<ListItem> parameters) {
+		this.parameters = parameters;
+	}
+
+	public String getReferenceType() {
+		return referenceType;
+	}
+
+	public void setReferenceType(String referenceType) {
+		this.referenceType = referenceType;
+	}
+
+	public void setVersion(int version) {
+		setResourceProperty(PROP_VERSION, "" + version);
+	}
+
+	public void setHasData(boolean hasData) {
+		setResourceProperty(PROP_FILERESOURCE_HAS_DATA, "" + hasData);
+	}
+
+	public String getResourceType() {
+		return getResourcePropertyValue(PROP_RESOURCE_TYPE);
+	}
+
+	public void setResourceType(String resourceType) {
+		setResourceProperty(PROP_RESOURCE_TYPE, "" + resourceType);
+	}
+
+	public void setParentFolder(String parentFolder) {
+		setResourceProperty(PROP_PARENT_FOLDER, "" + parentFolder);
+	}
+
+	public ResourceProperty getResourceProperty(String resourcePropertyName) {
+		return hm.get(resourcePropertyName);
+	}
+
+	/**
+	 * Return the value of the property resourcePropertyName as String Return
+	 * null if the property is not found or the [operty value is null.
+	 *
+	 */
+	public String getResourcePropertyValue(String resourcePropertyName) {
+		ResourceProperty rp = getResourceProperty(resourcePropertyName);
+		if (rp != null)
+			return rp.getValue();
+
+		return null;
+	}
+
+	/**
+	 * Add or replace the resource property in the ResourceDescriptor.
+	 */
+	public void setResourceProperty(ResourceProperty rp) {
+		if (rp == null)
+			return;
+		removeResourceProperty(rp.getName());
+		this.getProperties().add(rp);
+		this.hm.put(rp.getName(), rp);
+	}
+
+	/**
+	 * Remove all the resource properties with name = rp.getName()
+	 */
+	public void removeResourceProperty(ResourceProperty rp) {
+		removeResourceProperty(rp.getName());
+	}
+
+	/**
+	 * Remove all resources with name = resourcePropertyName
+	 */
+	public void removeResourceProperty(String resourcePropertyName) {
+		Object obj = this.hm.remove(resourcePropertyName);
+		if (obj != null) {
+			this.getProperties().remove(obj);
+		}
+	}
+
+	/**
+	 * Setting a property to a null value is the same as remove it.
+	 *
+	 */
+	public void setResourceProperty(String resourcePropertyName, String value) {
+		if (resourcePropertyName == null)
+			return;
+		if (value == null) {
+			removeResourceProperty(resourcePropertyName);
+		} else {
+			ResourceProperty rp = new ResourceProperty(resourcePropertyName);
+			rp.setValue(value);
+			setResourceProperty(rp);
+		}
+	}
+
+	@Override
+	public String toString() {
+		return "ResourceDescriptor [properties=" + properties + ", hm=" + hm + ", name=" + name + ", label=" + label
+				+ ", wsType=" + wsType + ", uriString=" + uriString + ", isNew=" + isNew + ", description="
+				+ description + ", creationDate=" + creationDate + ", children=" + children + ", parameters="
+				+ parameters + ", referenceType=" + referenceType + "]";
+	}
+
+}

+ 53 - 0
src/main/java/com/uas/report/axis/ResourceProperty.java

@@ -0,0 +1,53 @@
+package com.uas.report.axis;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ResourceProperty {
+
+	private String name = "";
+	private String value = "";
+
+	private List<ResourceProperty> properties = new ArrayList<>();
+
+	/** Creates a new instance of ResourceProperty */
+	public ResourceProperty(String name) {
+		this(name, null);
+	}
+
+	/** Creates a new instance of ResourceProperty */
+	public ResourceProperty(String name, String value) {
+		this.name = name;
+		this.value = value;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getValue() {
+		return value;
+	}
+
+	public void setValue(String value) {
+		this.value = value;
+	}
+
+	public List<ResourceProperty> getProperties() {
+		return properties;
+	}
+
+	public void setProperties(List<ResourceProperty> properties) {
+		this.properties = properties;
+	}
+
+	@Override
+	public String toString() {
+		return "ResourceProperty [name=" + name + ", value=" + value + ", properties=" + properties + "]";
+	}
+
+}

+ 20 - 0
src/main/java/com/uas/report/axis/ResultAttachments.java

@@ -0,0 +1,20 @@
+package com.uas.report.axis;
+
+public class ResultAttachments {
+
+	private boolean encapsulationDime;
+
+	public boolean isEncapsulationDime() {
+		return encapsulationDime;
+	}
+
+	public void setEncapsulationDime(boolean encapsulationDime) {
+		this.encapsulationDime = encapsulationDime;
+	}
+
+	@Override
+	public String toString() {
+		return "ResultAttachments [encapsulationDime=" + encapsulationDime + "]";
+	}
+
+}

+ 37 - 0
src/main/java/com/uas/report/axis/repository/RepositoryManagement.java

@@ -0,0 +1,37 @@
+package com.uas.report.axis.repository;
+
+import com.uas.report.util.ContextUtils;
+
+public class RepositoryManagement {
+
+	private RepositoryManagementService repositoryManagementService = ContextUtils
+			.getBean(RepositoryManagementService.class);
+
+	public String list(String requestXmlString) {
+		return repositoryManagementService.list(requestXmlString);
+	}
+
+	public String get(String requestXmlString) {
+		return repositoryManagementService.get(requestXmlString);
+	}
+
+	public String put(String requestXmlString) {
+		return repositoryManagementService.put(requestXmlString);
+	}
+
+	public String delete(String requestXmlString) {
+		return repositoryManagementService.delete(requestXmlString);
+	}
+
+	public String runReport(String requestXmlString) {
+		return repositoryManagementService.runReport(requestXmlString);
+	}
+
+	public String move(String requestXmlString) {
+		return repositoryManagementService.move(requestXmlString);
+	}
+
+	public String copy(String requestXmlString) {
+		return repositoryManagementService.copy(requestXmlString);
+	}
+}

+ 18 - 0
src/main/java/com/uas/report/axis/repository/RepositoryManagementService.java

@@ -0,0 +1,18 @@
+package com.uas.report.axis.repository;
+
+public interface RepositoryManagementService {
+
+	public String list(String requestXmlString);
+
+	public String get(String requestXmlString);
+
+	public String put(String requestXmlString);
+
+	public String delete(String requestXmlString);
+
+	public String runReport(String requestXmlString);
+
+	public String move(String requestXmlString);
+
+	public String copy(String requestXmlString);
+}

+ 475 - 0
src/main/java/com/uas/report/axis/repository/RepositoryManagementServiceImpl.java

@@ -0,0 +1,475 @@
+package com.uas.report.axis.repository;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+
+import org.apache.axis.Message;
+import org.apache.axis.MessageContext;
+import org.apache.axis.attachments.Attachments;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import com.uas.report.axis.Argument;
+import com.uas.report.axis.FileHelper;
+import com.uas.report.axis.FileResource;
+import com.uas.report.axis.Folder;
+import com.uas.report.axis.ListItem;
+import com.uas.report.axis.OperationResult;
+import com.uas.report.axis.Request;
+import com.uas.report.axis.Resource;
+import com.uas.report.axis.ResourceDescriptor;
+import com.uas.report.axis.ResultAttachments;
+import com.uas.report.axis.util.Marshaller;
+import com.uas.report.axis.util.Unmarshaller;
+
+@Service
+public class RepositoryManagementServiceImpl implements RepositoryManagementService {
+
+	private static final String VERSION = "2.0.1";
+
+	private Locale locale = null; // Default locale....
+
+	private Logger logger = LoggerFactory.getLogger(getClass());
+
+	@Override
+	public String list(String requestXmlString) {
+		OperationResult operationResult = new OperationResult();
+		operationResult.setVersion(VERSION);
+		try {
+			StringReader xmlStringReader = new StringReader(requestXmlString);
+			Request request = (Request) Unmarshaller.unmarshal(xmlStringReader);
+			setLocale(request.getLocale());
+
+			List<ResourceDescriptor> list = null;
+
+			if (request.getResourceDescriptor() == null) {
+				list = new ArrayList<>();
+				logger.debug("Null resourceDescriptor");
+				// Look for specific list requests...
+				if (getArgumentValue(Argument.LIST_DATASOURCES, request.getArguments()) != null
+						&& getArgumentValue(Argument.LIST_DATASOURCES, request.getArguments())
+								.equals(Argument.VALUE_TRUE)) {
+					/*
+					 * // List all datasources... FilterCriteria criteria =
+					 * FilterCriteria.createFilter(ReportDataSource.class);
+					 * logger.debug("Listing datasources...");
+					 * 
+					 * // This filters with object level security // Will only
+					 * get resources the user has access to
+					 * 
+					 * List lookups = repository.loadClientResources(criteria);
+					 * if (lookups != null && !lookups.isEmpty()) {
+					 * 
+					 * for (Iterator it = lookups.iterator(); it.hasNext();) {
+					 * list.add(createResourceDescriptor((Resource) it.next()));
+					 * } }
+					 */
+				} else if (request.hasArgument(Argument.LIST_RESOURCES)
+						&& getArgumentValue(Argument.RESOURCE_TYPE, request.getArguments())
+								.equals(Argument.REPORT_TYPE)) {
+					/*
+					 * // get list of reports from a certain directory
+					 * recursively // List all datasources... logger.debug(
+					 * "Listing all reports...");
+					 * 
+					 * String parentFolder =
+					 * getArgumentValue(Argument.START_FROM_DIRECTORY,
+					 * request.getArguments()); if ((parentFolder == null) ||
+					 * (!(parentFolder.startsWith("/")))) { parentFolder = "/";
+					 * } // all options List allSubFolders =
+					 * repository.getAllFolders(null); for (int i = 0; i <
+					 * allSubFolders.size(); i++) { String currentFolder =
+					 * ((Folder) allSubFolders.get(i)).getURIString();
+					 * FilterCriteria filterCriteria = new FilterCriteria();
+					 * filterCriteria.addFilterElement(FilterCriteria.
+					 * createParentFolderFilter(currentFolder)); List units =
+					 * repository.loadClientResources(filterCriteria); for (int
+					 * j = 0; j < units.size(); j++) { Resource currentRs =
+					 * (Resource) units.get(j); if ((currentRs.getResourceType()
+					 * != null) &&
+					 * ((currentRs.getResourceType().contains("ReportOptions"))
+					 * || (currentRs.getResourceType().contains("ReportUnit"))
+					 * ||
+					 * (currentRs.getResourceType().contains("AdhocReportUnit"))
+					 * )) {
+					 * 
+					 * String temp = serviceConfiguration.getTempFolder(); if
+					 * ("/".equals(parentFolder)) { if
+					 * ((!(ADHOC_TOPICS.equals(currentRs.getParentFolder()))) &&
+					 * (!(temp.equals(currentRs.getParentFolder())))) {
+					 * list.add(createResourceDescriptor(currentRs)); } } else
+					 * if ((currentRs.getURIString() +
+					 * "/").startsWith(parentFolder + "/")) { if
+					 * ((!(ADHOC_TOPICS.equals(currentRs.getParentFolder()))) &&
+					 * (!(temp.equals(currentRs.getParentFolder())))) {
+					 * list.add(createResourceDescriptor(currentRs)); } } } } }
+					 */
+				} else if (request.hasArgument(Argument.LIST_RESOURCES)) {
+					/*
+					 * String resourceType =
+					 * request.getArgumentValue(Argument.RESOURCE_TYPE);
+					 * 
+					 * if (resourceType == null) { if (logger.isDebugEnabled())
+					 * { logger.debug("No " + Argument.RESOURCE_TYPE +
+					 * " argument, nothing to list"); } } else { ResourceHandler
+					 * handler = handlerRegistry.getHandler(resourceType); if
+					 * (handler == null) { throw new JSException(
+					 * "No resource hander found for type " + resourceType); }
+					 * 
+					 * List resources = handler.listResources(request, this); if
+					 * (resources != null) { list.addAll(resources); } }
+					 */
+				}
+			} else if (request.getResourceDescriptor().getWsType().equals(ResourceDescriptor.TYPE_FOLDER)) {
+				logger.debug("List folders");
+				list = listResources(request.getResourceDescriptor().getUriString());
+			} else if (request.getResourceDescriptor().getWsType().equals(ResourceDescriptor.TYPE_REPORTUNIT)) {
+				/*
+				 * logger.debug("List report units"); list =
+				 * createResourceDescriptor(request.getResourceDescriptor().
+				 * getUriString()).getChildren();
+				 */
+			} else {
+				logger.debug("Listed nothing");
+			}
+
+			if (logger.isDebugEnabled()) {
+				logger.debug("Found " + list.size() + " things");
+				for (Iterator<ResourceDescriptor> it = list.iterator(); it.hasNext();) {
+					ResourceDescriptor rd = it.next();
+					logger.debug(rd != null ? rd.getName() : "rd was null");
+				}
+			}
+
+			operationResult.setResourceDescriptors(list);
+
+			logger.debug("Marshalling response");
+
+		} catch (Exception e) {
+			logger.error("caught exception: " + e.getMessage(), e);
+			operationResult.setReturnCode(1);
+			operationResult.setMessage(e.getMessage());
+		} catch (Throwable e) {
+			logger.error("caught exception: " + e.getMessage(), e);
+		}
+
+		return marshalResponse(operationResult);
+	}
+
+	@Override
+	public String get(String requestXmlString) {
+		OperationResult operationResult = new OperationResult();
+		operationResult.setVersion(VERSION);
+		try {
+			StringReader xmlStringReader = new StringReader(requestXmlString);
+			Request request = (Request) Unmarshaller.unmarshal(xmlStringReader);
+			// createAuditEvent(request.getOperationName(),
+			// request.getResourceDescriptor().getWsType(),
+			// request.getResourceDescriptor().isNew());
+			setLocale(request.getLocale());
+
+			List<Argument> args = request.getArguments();
+
+			List<ListItem> params = Collections.emptyList();
+			if (request.getResourceDescriptor() != null && request.getResourceDescriptor().getParameters() != null) {
+				params = request.getResourceDescriptor().getParameters();
+			}
+
+			HashMap<String, String> specialOptions = new HashMap<>();
+			if (args != null) {
+				for (int i = 0; i < args.size(); ++i) {
+					Argument arg = args.get(i);
+					if (arg != null) {
+						specialOptions.put(arg.getName(), arg.getValue());
+					}
+				}
+			}
+//			if (params.size() > 0 && specialOptions.containsKey(Argument.RU_REF_URI)) {
+//				ResourceDescriptor reportDescriptior = createResourceDescriptor(
+//						(String) specialOptions.get(Argument.RU_REF_URI));
+//				specialOptions.put(Argument.PARAMS_ARG, buildParameterMap(params, reportDescriptior));
+//			}
+
+			String resourceURI = request.getResourceDescriptor().getUriString();
+			Resource resource = FileHelper.locateResource(resourceURI);
+			if (resource == null) {
+				logger.warn("Get: null resourceDescriptor for " + resourceURI);
+				operationResult.setReturnCode(2);
+//				operationResult
+//						.setMessage(messageSource.getMessage("webservices.error.resourceNotFound", null, getLocale()));
+			} else {
+//				ResourceDescriptor rd = createResourceDescriptor(resource, processDescriptorOptions(specialOptions));
+				ResourceDescriptor rd = createResourceDescriptor(resource);
+
+				logger.debug("Get: " + resourceURI + ", wsType: " + rd.getWsType() + ", resourceType: "
+						+ rd.getResourceType());
+				operationResult.getResourceDescriptors().add(rd);
+
+				ResultAttachments attachments = new ResultAttachments();
+				attachments
+						.setEncapsulationDime(getArgumentValue("USE_DIME_ATTACHMENTS", request.getArguments()) != null);
+//				ResourceHandler handler = getHandlerRegistry().getHandler(rd.getWsType());
+//				handler.getAttachments(resource, specialOptions, rd, attachments, this);
+//				if (operationResult.getReturnCode() != 0) {
+//					addExceptionToAllAuditEvents(new Exception(operationResult.getMessage()));
+//				}
+//
+//				return marshalResponse(operationResult, attachments);
+				return marshalResponse(operationResult);
+			}
+		} catch (Exception e) {
+
+			logger.error("caught exception: " + e.getMessage(), e);
+			operationResult.setReturnCode(1);
+			operationResult.setMessage(e.getMessage());
+			// addExceptionToAllAuditEvents(e);
+		}
+		logger.debug("Marshalling response");
+
+		return marshalResponse(operationResult);
+	}
+
+	@Override
+	public String put(String requestXmlString) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public String delete(String requestXmlString) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public String runReport(String requestXmlString) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public String move(String requestXmlString) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public String copy(String requestXmlString) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public Locale getLocale() {
+		return locale;
+	}
+
+	// TODO fix
+	public void setLocale(Locale locale) {
+		this.locale = locale;
+	}
+
+	/**
+	 * This method takes the Locale requested by the client. If the requested
+	 * locale is null, the default locale is returned.
+	 *
+	 * A locale code can be in the form:
+	 *
+	 * langagecode[_countrycode]
+	 *
+	 * Ex: en_US, it_IT, it, en_UK
+	 *
+	 */
+	private void setLocale(String requestedLocale) {
+		try {
+			if (requestedLocale != null) {
+				String language = requestedLocale;
+				String country = "";
+				if (requestedLocale.indexOf("_") > 0) {
+					language = requestedLocale.substring(0, requestedLocale.indexOf("_"));
+					country = requestedLocale.substring(requestedLocale.indexOf("_") + 1);
+					setLocale(new Locale(language, country));
+				} else {
+					setLocale(new Locale(language));
+				}
+			}
+		} catch (Exception ex) {
+			logger.error("Unable to get requested locale (" + requestedLocale + ")");
+			setLocale(Locale.getDefault());
+		}
+	}
+
+	private String marshalResponse(OperationResult operationResult) {
+		return marshalResponse(operationResult, new HashMap<String, DataSource>(), false);
+	}
+
+	private String marshalResponse(OperationResult operationResult, Map<String, DataSource> datasources,
+			boolean isEncapsulationDime) {
+
+		String result = "";
+
+		// First of all attach the attachments...
+		if (datasources != null) {
+			MessageContext msgContext = MessageContext.getCurrentContext();
+			Message responseMessage = msgContext.getResponseMessage();
+
+			logger.debug("Encapsulation DIME? : " + isEncapsulationDime);
+
+			if (isEncapsulationDime) {
+				responseMessage.getAttachmentsImpl().setSendType(Attachments.SEND_TYPE_DIME);
+			}
+
+			for (Iterator<Entry<String, DataSource>> it = datasources.entrySet().iterator(); it.hasNext();) {
+				try {
+					Entry<String, DataSource> entry = it.next();
+					String name = (String) entry.getKey();
+					DataSource datasource = (DataSource) entry.getValue();
+
+					logger.debug("Adding attachment: " + name + ", type: " + datasource.getContentType());
+
+					DataHandler expectedDH = new DataHandler(datasource);
+
+					javax.xml.soap.AttachmentPart attachPart = null;
+					attachPart = responseMessage.createAttachmentPart(expectedDH);
+
+					// javax.xml.soap.AttachmentPart ap2 =
+					// responseMessage.createAttachmentPart();
+					// ap2.setContent( datasource.getInputStream(),
+					// datasource.getContentType());
+					attachPart.setContentId(name);
+					responseMessage.addAttachmentPart(attachPart);
+
+				} catch (Exception ex) {
+					logger.error("caught exception marshalling an OperationResult: " + ex.getMessage(), ex);
+					// What to do?
+					operationResult.setReturnCode(1);
+					operationResult.setMessage("Error attaching a resource to the SOAP message: " + ex.getMessage());
+				}
+			}
+
+		}
+
+		try {
+			StringWriter xmlStringWriter = new StringWriter();
+			Marshaller.marshal(operationResult, xmlStringWriter);
+			if (logger.isDebugEnabled()) {
+				logger.debug("Has descriptors: " + ((operationResult.getResourceDescriptors() == null
+						|| operationResult.getResourceDescriptors().size() == 0) ? 0
+								: operationResult.getResourceDescriptors().size()));
+				logger.debug("marshalled response");
+				logger.debug(xmlStringWriter.toString());
+			}
+			result = xmlStringWriter.toString();
+
+		} catch (Exception ex) {
+			logger.error("caught exception marshalling an OperationResult: " + ex.getMessage(), ex);
+			// What to do?
+		}
+
+		return result;
+	}
+
+	protected String getArgumentValue(String argumentName, List<Argument> arguments) {
+		for (int i = 0; i < arguments.size(); ++i) {
+			Argument a = (Argument) arguments.get(i);
+			if (a.getName() == null ? a.getName() == argumentName : a.getName().equals(argumentName)) {
+				return a.getValue();
+			}
+		}
+
+		return null;
+	}
+
+	/**
+	 * Return a list of ResourceDescriptor(s)
+	 * @throws IOException 
+	 * @throws FileNotFoundException 
+	 * 
+	 * @throws WSException
+	 */
+	public List<ResourceDescriptor> listResources(String uri) throws FileNotFoundException, IOException {
+		logger.debug("list for uri: " + uri);
+
+		List<ResourceDescriptor> returnedMaps = new ArrayList<>();
+
+		List<Resource> resources = FileHelper.listResource(uri);
+		if(CollectionUtils.isEmpty(resources)){
+			return returnedMaps;
+		}
+		for(Resource resource :resources){
+			returnedMaps.add(createResourceDescriptor(resource));
+		}
+		
+		/*
+		 * // This filters with object level security. // Will only get folders
+		 * the user has access to
+		 * 
+		 * List<Resource> folders = getRepository().getSubFolders(null, uri);
+		 * filterFolderList(folders);
+		 * 
+		 * if (folders == null) return returnedMaps;
+		 * 
+		 * for (int i = 0; i < folders.size(); ++i) { Resource folderRes =
+		 * folders.get(i);
+		 * returnedMaps.add(createResourceDescriptor(folderRes)); }
+		 * 
+		 * // create a criteria for finding things with a common parent folder.
+		 * FilterCriteria filterCriteria = new FilterCriteria();
+		 * filterCriteria.addFilterElement(FilterCriteria.
+		 * createParentFolderFilter(uri));
+		 * 
+		 * // This filters with object level security // Will only get resources
+		 * the user has access to
+		 * 
+		 * List units = getRepository().loadClientResources(filterCriteria);
+		 * 
+		 * if (units == null) return returnedMaps;
+		 * 
+		 * for (Iterator it = units.iterator(); units != null && it.hasNext();)
+		 * { Resource fileRes = (Resource) it.next(); try {
+		 * returnedMaps.add(createResourceDescriptor(fileRes)); } catch
+		 * (Exception ex) { logger.error(ex); } }
+		 */
+
+		return returnedMaps;
+	}
+
+	/**
+	 * the same as createResourceDescriptor( resource, false)
+	 */
+	public ResourceDescriptor createResourceDescriptor(Resource resource) {
+		ResourceDescriptor descriptor = new ResourceDescriptor();
+		if(resource instanceof Folder){
+			descriptor.setWsType(ResourceDescriptor.TYPE_FOLDER);
+			descriptor.setHasData(false);
+		}else if(resource instanceof FileResource){
+			FileResource fileResource=(FileResource)resource;
+			descriptor.setWsType(fileResource.getFileType());
+			descriptor.setHasData(fileResource.hasData());
+		}
+		descriptor.setUriString(resource.getURIString());
+		descriptor.setDescription(resource.getDescription());
+		descriptor.setLabel(resource.getLabel());
+		descriptor.setName(resource.getName());
+		descriptor.setResourceType(resource.getResourceType());
+		descriptor.setParentFolder(resource.getParentFolder());
+		descriptor.setVersion(resource.getVersion());
+		descriptor.setCreationDate(resource.getCreationDate());
+		return descriptor;
+	}
+
+}

+ 0 - 21
src/main/java/service/MyService.java

@@ -1,21 +0,0 @@
-package service;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class MyService {
-
-	private Logger logger = LoggerFactory.getLogger(MyService.class);
-
-	public String getGreeting(String name) {
-		String message = "您好 " + name;
-		logger.info(message);
-		System.out.println(message);
-		return message;
-	}
-
-	public void update(String data) {
-		String message = "<" + data + ">已经更新";
-		logger.info(message);
-	}
-}

+ 90 - 58
src/main/webapp/WEB-INF/server-config.wsdd

@@ -1,60 +1,92 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
- <globalConfiguration>
-  <parameter name="sendMultiRefs" value="true"/>
-  <parameter name="disablePrettyXML" value="true"/>
-  <parameter name="adminPassword" value="admin"/>
-  <parameter name="dotNetSoapEncFix" value="true"/>
-  <parameter name="enableNamespacePrefixOptimization" value="false"/>
-  <parameter name="sendXMLDeclaration" value="true"/>
-  <parameter name="sendXsiTypes" value="true"/>
-  <parameter name="attachments.implementation" value="org.apache.axis.attachments.AttachmentsImpl"/>
-  <requestFlow>
-   <handler type="java:org.apache.axis.handlers.LogHandler"/>
-   <handler type="java:org.apache.axis.handlers.JWSHandler">
-    <parameter name="scope" value="session"/>
-   </handler>
-   <handler type="java:org.apache.axis.handlers.JWSHandler">
-    <parameter name="scope" value="request"/>
-    <parameter name="extension" value=".jwr"/>
-   </handler>
-  </requestFlow>
-  <responseFlow>
-    <handler type="java:org.apache.axis.handlers.LogHandler"/>
-  </responseFlow>
- </globalConfiguration>
- <handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper"/>
- <handler name="LocalResponder" type="java:org.apache.axis.transport.local.LocalResponder"/>
- <handler name="Authenticate" type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
- <service name="MyService" provider="java:RPC">
-  <parameter name="allowedMethods" value="*"/>
-  <parameter name="className" value="service.MyService"/>
- </service>
- <service name="AdminService" provider="java:MSG">
-  <parameter name="allowedMethods" value="AdminService"/>
-  <parameter name="enableRemoteAdmin" value="false"/>
-  <parameter name="className" value="org.apache.axis.utils.Admin"/>
-  <namespace>http://xml.apache.org/axis/wsdd/</namespace>
- </service>
- <service name="Version" provider="java:RPC">
-  <parameter name="allowedMethods" value="getVersion"/>
-  <parameter name="className" value="org.apache.axis.Version"/>
- </service>
- <transport name="http">
-  <requestFlow>
-   <handler type="URLMapper"/>
-   <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
-  </requestFlow>
-  <parameter name="qs:list" value="org.apache.axis.transport.http.QSListHandler"/>
-  <parameter name="qs:wsdl" value="org.apache.axis.transport.http.QSWSDLHandler"/>
-  <parameter name="qs.list" value="org.apache.axis.transport.http.QSListHandler"/>
-  <parameter name="qs.method" value="org.apache.axis.transport.http.QSMethodHandler"/>
-  <parameter name="qs:method" value="org.apache.axis.transport.http.QSMethodHandler"/>
-  <parameter name="qs.wsdl" value="org.apache.axis.transport.http.QSWSDLHandler"/>
- </transport>
- <transport name="local">
-  <responseFlow>
-   <handler type="LocalResponder"/>
-  </responseFlow>
- </transport>
+<deployment xmlns="http://xml.apache.org/axis/wsdd/"
+	xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+	<globalConfiguration>
+		<parameter name="sendMultiRefs" value="true" />
+		<parameter name="disablePrettyXML" value="true" />
+		<parameter name="adminPassword" value="admin" />
+		<parameter name="dotNetSoapEncFix" value="true" />
+		<parameter name="enableNamespacePrefixOptimization" value="false" />
+		<parameter name="sendXMLDeclaration" value="true" />
+		<parameter name="sendXsiTypes" value="true" />
+		<parameter name="attachments.implementation"
+			value="org.apache.axis.attachments.AttachmentsImpl" />
+		<requestFlow>
+			<handler type="java:org.apache.axis.handlers.LogHandler" />
+			<handler type="java:org.apache.axis.handlers.JWSHandler">
+				<parameter name="scope" value="session" />
+			</handler>
+			<handler type="java:org.apache.axis.handlers.JWSHandler">
+				<parameter name="scope" value="request" />
+				<parameter name="extension" value=".jwr" />
+			</handler>
+		</requestFlow>
+		<responseFlow>
+			<handler type="java:org.apache.axis.handlers.LogHandler" />
+		</responseFlow>
+	</globalConfiguration>
+	<handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper" />
+	<handler name="LocalResponder"
+		type="java:org.apache.axis.transport.local.LocalResponder" />
+	<handler name="Authenticate"
+		type="java:org.apache.axis.handlers.SimpleAuthenticationHandler" />
+	<service name="AdminService" provider="java:MSG">
+		<parameter name="allowedMethods" value="AdminService" />
+		<parameter name="enableRemoteAdmin" value="false" />
+		<parameter name="className" value="org.apache.axis.utils.Admin" />
+		<namespace>http://xml.apache.org/axis/wsdd/</namespace>
+	</service>
+	<service name="Version" provider="java:RPC">
+		<parameter name="allowedMethods" value="getVersion" />
+		<parameter name="className" value="org.apache.axis.Version" />
+	</service>
+
+	<!-- jasper axis service 接口 -->
+	<service name="UserAndRoleManagementService" provider="java:RPC">
+		<parameter name="allowedMethods"
+			value="findUsers putUser deleteUser findRoles putRole updateRoleName deleteRole" />
+		<parameter name="className"
+			value="com.uas.report.axis.authority.UserAndRoleManagement" />
+	</service>
+	<service name="PermissionsManagementService" provider="java:RPC">
+		<parameter name="allowedMethods"
+			value="getPermissionsForObject putPermission deletePermission" />
+		<parameter name="className"
+			value="com.uas.report.axis.authority.PermissionsManagement" />
+	</service>
+	<service name="ReportScheduler" provider="java:RPC">
+		<parameter name="allowedMethods"
+			value="getJob scheduleJob updateJob deleteJob deleteJobs getAllJobs getReportJobs" />
+		<parameter name="className"
+			value="com.uas.report.axis.scheduling.ReportSchedulerManagement" />
+	</service>
+	<service name="repository" provider="java:RPC">
+		<parameter name="allowedMethods" value="list get put delete runReport move copy" />
+		<parameter name="className"
+			value="com.uas.report.axis.repository.RepositoryManagement" />
+	</service>
+
+	<transport name="http">
+		<requestFlow>
+			<handler type="URLMapper" />
+			<handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler" />
+		</requestFlow>
+		<parameter name="qs:list"
+			value="org.apache.axis.transport.http.QSListHandler" />
+		<parameter name="qs:wsdl"
+			value="org.apache.axis.transport.http.QSWSDLHandler" />
+		<parameter name="qs.list"
+			value="org.apache.axis.transport.http.QSListHandler" />
+		<parameter name="qs.method"
+			value="org.apache.axis.transport.http.QSMethodHandler" />
+		<parameter name="qs:method"
+			value="org.apache.axis.transport.http.QSMethodHandler" />
+		<parameter name="qs.wsdl"
+			value="org.apache.axis.transport.http.QSWSDLHandler" />
+	</transport>
+	<transport name="local">
+		<responseFlow>
+			<handler type="LocalResponder" />
+		</responseFlow>
+	</transport>
 </deployment>