|
From: <jav...@us...> - 2008-01-18 13:57:43
|
Revision: 5720
http://dcm4che.svn.sourceforge.net/dcm4che/?rev=5720&view=rev
Author: javawilli
Date: 2008-01-18 05:57:41 -0800 (Fri, 18 Jan 2008)
Log Message:
-----------
[#DCMEE-709] Use indention for logging SOAP messages.
[#DCMEE-708] Remove outdated attributes and methods from XDS-I Service.
Modified Paths:
--------------
dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/xmdesc/dcm4chee-xdsi-xmbean.xml
dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/java/org/dcm4chex/archive/xdsi/XDSIService.java
Modified: dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/xmdesc/dcm4chee-xdsi-xmbean.xml
===================================================================
--- dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/xmdesc/dcm4chee-xdsi-xmbean.xml 2008-01-18 13:36:54 UTC (rev 5719)
+++ dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/xmdesc/dcm4chee-xdsi-xmbean.xml 2008-01-18 13:57:41 UTC (rev 5720)
@@ -266,17 +266,6 @@
<value value="AutoPublish^Automatic XDS-I export of received images"/>
</descriptors>
</attribute>
-
-
- <attribute access="read-write" getMethod="getTestPath" setMethod="setTestPath">
- <description>Base directory path. (is used in sendSOAP for metadata and doc files!)
- </description>
- <name>TestPath</name>
- <type>java.lang.String</type>
- <descriptors>
- <value value="C:\willi\testkit\test"/>
- </descriptors>
- </attribute>
<attribute access="read-write" getMethod="getRidURL" setMethod="setRidURL">
<description>RID URL to get PDF Document for exportPDF.
@@ -320,7 +309,7 @@
<attribute access="read-write"
getMethod="isLogSOAPMessage"
setMethod="setLogSOAPMessage">
- <description>Enable logging of SOAP message (send and receive).
+ <description>Enable logging of SOAP message.
</description>
<name>LogSOAPMessage</name>
<type>boolean</type>
@@ -328,6 +317,17 @@
<value value="true" />
</descriptors>
</attribute>
+ <attribute access="read-write"
+ getMethod="isIndentSOAPLog"
+ setMethod="setIndentSOAPLog">
+ <description>Enable/disable indention of logged SOAP message.
+ </description>
+ <name>IndentSOAPLog</name>
+ <type>boolean</type>
+ <descriptors>
+ <value value="true" />
+ </descriptors>
+ </attribute>
<attribute access="read-write"
getMethod="getPixQueryServiceName"
Modified: dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/java/org/dcm4chex/archive/xdsi/XDSIService.java
===================================================================
--- dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/java/org/dcm4chex/archive/xdsi/XDSIService.java 2008-01-18 13:36:54 UTC (rev 5719)
+++ dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/java/org/dcm4chex/archive/xdsi/XDSIService.java 2008-01-18 13:57:41 UTC (rev 5720)
@@ -149,9 +149,6 @@
private static Logger log = Logger.getLogger(XDSIService.class.getName());
- private String testPath;
-
-
private Map usr2author = new TreeMap();
@@ -162,11 +159,6 @@
private int proxyPort;
private boolean useHttp;
-// SMTP attributes to document repository actor (asynchron)
- private String docRepositoryMailAddr;//TODO
- private String smtpHost;
- private int smtpPort;
- private boolean useSmtp;
// Metadata attributes
private File propertyFile;
@@ -198,15 +190,16 @@
private String ridURL;
private boolean logSOAPMessage = true;
+ private boolean indentSOAPLog = true;
- private final NotificationListener ianListener =
- new NotificationListener() {
- public void handleNotification(Notification notif, Object handback) {
- log.info("ianListener called!");
- onIAN((Dataset) notif.getUserData());
- }
+ private final NotificationListener ianListener =
+ new NotificationListener() {
+ public void handleNotification(Notification notif, Object handback) {
+ log.info("ianListener called!");
+ onIAN((Dataset) notif.getUserData());
+ }
- };
+ };
/**
* @return Returns the property file path.
@@ -492,22 +485,6 @@
this.useHttp = useHttp;
}
- /**
- * @return Returns the testPath.
- */
- public String getTestPath() {
- return testPath == null ? "NONE":testPath;
- }
- /**
- * @param testPath The testPath to set.
- */
- public void setTestPath(String testPath) {
- if ( "NONE".equals(testPath) )
- this.testPath = null;
- else
- this.testPath = testPath;
- }
-
public final ObjectName getAuditLoggerName() {
return auditLogger.getAuditLoggerName();
}
@@ -662,6 +639,14 @@
public void setLogSOAPMessage(boolean logSOAPMessage) {
this.logSOAPMessage = logSOAPMessage;
}
+
+ public boolean isIndentSOAPLog() {
+ return indentSOAPLog;
+ }
+ public void setIndentSOAPLog(boolean indentSOAPLog) {
+ this.indentSOAPLog = indentSOAPLog;
+ }
+
// Operations
/**
@@ -735,57 +720,15 @@
mapCodeLists.clear();
}
-
-
- public boolean nistTest(String testID){
- if ( testID == null || testID.trim().length() < 1) {
- File dir = new File( testPath );
- File[] testDirs = dir.listFiles();
- boolean result = true;
- for ( int i = 0; i< testDirs.length; i++) {
- if ( testDirs[i].isDirectory())
- if ( !nistTest(testDirs[i].getName()) ) result = false;
- }
- return result;
- }
- log.info("\n\nPerform NIST test:"+testID);
- File propFile = new File( new File( testPath, testID), "test.properties");
- Properties props = new Properties();
- try {
- props.load(new FileInputStream(propFile));
- } catch(FileNotFoundException e) {
- log.warn(" Not a test Directory");
- return false;
- } catch(IOException e) {
- log.error("Error reading test.properties file!",e);
- }
- log.info(" Test with URI:"+props.getProperty("url"));
- String docs = null;
- if ( !props.getProperty("NumOfDoc","0").equals("0") ) {
- StringBuffer sb = new StringBuffer();
- int idx=1;
- String doc, docPropName;
- while ( (doc = props.getProperty( docPropName="doc"+idx++) ) != null) {
- sb.append(',').append(doc).append('|').append(props.get(docPropName+"mimeType"));
- sb.append('|').append(props.getProperty(docPropName+"UUID"));
- }
- if ( sb.length() > 1 ) docs = sb.toString().substring(1);
- }
- return sendSOAP(propFile.getParentFile().getAbsolutePath()+"/",props.getProperty("metadatafile"),docs, props.getProperty("url") );
- }
public boolean sendSOAP( String metaDataFilename, String docNames, String url ) {
- return sendSOAP(null,metaDataFilename,docNames, url);
- }
- public boolean sendSOAP( String baseDir, String metaDataFilename, String docNames, String url ) {
- if ( baseDir == null ) baseDir = testPath == null ? "": testPath+"/";
- File metaDataFile = new File( baseDir+metaDataFilename);
+ File metaDataFile = new File( metaDataFilename);
XDSIDocument[] docFiles = null;
if ( docNames != null && docNames.trim().length() > 0) {
StringTokenizer st = new StringTokenizer( docNames, "," );
docFiles = new XDSIDocument[ st.countTokens() ];
for ( int i=0; st.hasMoreTokens(); i++ ) {
- docFiles[i] = XDSIFileDocument.valueOf( baseDir+st.nextToken() );
+ docFiles[i] = XDSIFileDocument.valueOf( st.nextToken() );
}
}
return sendSOAP( readXMLFile(metaDataFile), docFiles, url );
@@ -1258,6 +1201,8 @@
ByteArrayOutputStream out = new ByteArrayOutputStream();
out.write("SOAP message:".getBytes());
Transformer t = TransformerFactory.newInstance().newTransformer();
+ if (indentSOAPLog)
+ t.setOutputProperty("indent", "yes");
t.transform(s, new StreamResult(out));
log.info(out.toString());
} catch (Exception e) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|