|
|
@@ -1,8 +1,5 @@
|
|
|
package com.uas.report.axis.repository;
|
|
|
|
|
|
-import java.io.File;
|
|
|
-import java.io.FileNotFoundException;
|
|
|
-import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
import java.io.StringReader;
|
|
|
import java.io.StringWriter;
|
|
|
@@ -26,7 +23,6 @@ import org.apache.axis.attachments.Attachments;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.InitializingBean;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.MessageSourceResolvable;
|
|
|
import org.springframework.context.NoSuchMessageException;
|
|
|
import org.springframework.context.support.DefaultMessageSourceResolvable;
|
|
|
@@ -35,7 +31,6 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.DefaultMessageCodesResolver;
|
|
|
import org.springframework.validation.MessageCodesResolver;
|
|
|
|
|
|
-import com.uas.report.SpecialProperties;
|
|
|
import com.uas.report.axis.Argument;
|
|
|
import com.uas.report.axis.ListItem;
|
|
|
import com.uas.report.axis.OperationResult;
|
|
|
@@ -44,15 +39,12 @@ import com.uas.report.axis.Resource;
|
|
|
import com.uas.report.axis.ResourceDescriptor;
|
|
|
import com.uas.report.axis.BasicResourceHandler;
|
|
|
import com.uas.report.axis.ResourceHandlerRegistry;
|
|
|
-import com.uas.report.axis.ResourceProperty;
|
|
|
-import com.uas.report.axis.ResultAttachments;
|
|
|
import com.uas.report.axis.ValidationError;
|
|
|
import com.uas.report.axis.ValidationErrors;
|
|
|
import com.uas.report.axis.WSException;
|
|
|
import com.uas.report.axis.WSValidationException;
|
|
|
import com.uas.report.axis.util.Marshaller;
|
|
|
import com.uas.report.axis.util.Unmarshaller;
|
|
|
-import com.uas.report.util.ContextUtils;
|
|
|
import com.uas.report.util.FileUtils;
|
|
|
|
|
|
@Service
|
|
|
@@ -225,10 +217,11 @@ public class RepositoryManagementServiceImpl implements RepositoryManagementServ
|
|
|
|
|
|
List<Argument> args = request.getArguments();
|
|
|
|
|
|
- List<ListItem> params = Collections.emptyList();
|
|
|
- if (request.getResourceDescriptor() != null && request.getResourceDescriptor().getParameters() != null) {
|
|
|
- params = request.getResourceDescriptor().getParameters();
|
|
|
- }
|
|
|
+ // 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) {
|
|
|
@@ -264,9 +257,9 @@ public class RepositoryManagementServiceImpl implements RepositoryManagementServ
|
|
|
+ rd.getResourceType());
|
|
|
operationResult.getResourceDescriptors().add(rd);
|
|
|
|
|
|
- ResultAttachments attachments = new ResultAttachments();
|
|
|
- attachments
|
|
|
- .setEncapsulationDime(getArgumentValue("USE_DIME_ATTACHMENTS", request.getArguments()) != null);
|
|
|
+ // ResultAttachments attachments = new ResultAttachments();
|
|
|
+ // attachments.setEncapsulationDime(getArgumentValue("USE_DIME_ATTACHMENTS",
|
|
|
+ // request.getArguments()) != null);
|
|
|
// ResourceHandler handler =
|
|
|
// getHandlerRegistry().getHandler(rd.getWsType());
|
|
|
// handler.getAttachments(resource, specialOptions, rd,
|
|
|
@@ -275,9 +268,11 @@ public class RepositoryManagementServiceImpl implements RepositoryManagementServ
|
|
|
// addExceptionToAllAuditEvents(new
|
|
|
// Exception(operationResult.getMessage()));
|
|
|
// }
|
|
|
- //
|
|
|
// return marshalResponse(operationResult, attachments);
|
|
|
- return marshalResponse(operationResult);
|
|
|
+ BasicResourceHandler handler = resourceHandlerRegistry.getHandler(rd.getWsType());
|
|
|
+ Map<String, DataSource> attachments = handler.getAttachments(specialOptions, rd);
|
|
|
+ boolean isEncapsulationDime = getArgumentValue("USE_DIME_ATTACHMENTS", request.getArguments()) != null;
|
|
|
+ return marshalResponse(operationResult, attachments, isEncapsulationDime);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
|