You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(69) |
Jul
(3) |
Aug
(11) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
|
Feb
|
Mar
(54) |
Apr
|
May
(14) |
Jun
(3) |
Jul
(4) |
Aug
(7) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
|
Feb
(8) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
(9) |
2019 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <csi...@us...> - 2016-10-19 06:20:26
|
Revision: 194 http://sourceforge.net/p/andspidclient/code/194 Author: csirobuilduser Date: 2016-10-19 06:20:25 +0000 (Wed, 19 Oct 2016) Log Message: ----------- [maven-release-plugin] copy for tag ands-pid-client-1.0.33 Added Paths: ----------- tags/ands-pid-client-1.0.33/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <csi...@us...> - 2016-10-19 06:20:12
|
Revision: 193 http://sourceforge.net/p/andspidclient/code/193 Author: csirobuilduser Date: 2016-10-19 06:20:10 +0000 (Wed, 19 Oct 2016) Log Message: ----------- [maven-release-plugin] prepare release ands-pid-client-1.0.33 Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2016-10-19 06:12:58 UTC (rev 192) +++ trunk/pom.xml 2016-10-19 06:20:10 UTC (rev 193) @@ -52,7 +52,7 @@ <groupId>net.sourceforge.andspidclient</groupId> <artifactId>ands-pid-client</artifactId> <packaging>jar</packaging> - <version>1.0.33-SNAPSHOT</version> + <version>1.0.33</version> <name>ands-pid-client</name> <description>A generic client library for accessing the ANDS Persistent Identifier and the DOI services. See the Javadoc report for full details on usage.</description> <url>http://andspidclient.sourceforge.net/</url> @@ -61,9 +61,9 @@ <url>https://sourceforge.net/apps/trac/andspidclient/</url> </issueManagement> <scm> - <connection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/trunk</connection> - <developerConnection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/trunk</developerConnection> - <url>http://svn.code.sf.net/p/viewvc/andspidclient/trunk</url> + <connection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/tags/ands-pid-client-1.0.33</connection> + <developerConnection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/tags/ands-pid-client-1.0.33</developerConnection> + <url>http://svn.code.sf.net/p/viewvc/andspidclient/tags/ands-pid-client-1.0.33</url> </scm> <distributionManagement> <site> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <viv...@us...> - 2016-10-19 06:13:00
|
Revision: 192 http://sourceforge.net/p/andspidclient/code/192 Author: vivekpulukuri Date: 2016-10-19 06:12:58 +0000 (Wed, 19 Oct 2016) Log Message: ----------- Unit tests update to check resource type. Modified Paths: -------------- trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java Modified: trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java =================================================================== --- trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java 2016-10-10 06:54:28 UTC (rev 191) +++ trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java 2016-10-19 06:12:58 UTC (rev 192) @@ -42,6 +42,11 @@ /** Constant giving the xpath of the identifier name **/ private static final String IDENTIFIER_NAME_XPATH = "/xsi:resource/xsi:identifier"; + + /** + * Constant giving the xPath of the Resource type + */ + private static final String RESOURCETYPE_NAME_XPATH = "/xsi:resource/xsi:resourceType"; /** Constant giving the path to the meta-data template **/ String metadataTemplatePath = "DoiMetadataTemplate.xml"; @@ -108,11 +113,20 @@ xPath.addNamespace("xsi", document.getRootElement().getNamespaceURI()); @SuppressWarnings("rawtypes") List nodes = xPath.selectNodes(document); - assertEquals(6, nodes.size()); assertEquals("creatorName", ((Element) nodes.get(0)).getName()); - assertEquals("Phillips,David", ((Element) nodes.get(0)).getText()); + assertEquals("Phillips,David", ((Element) nodes.get(0)).getText()); + + XPath resourceTypeXPath = XPath.newInstance(RESOURCETYPE_NAME_XPATH); + resourceTypeXPath.addNamespace("xsi", document.getRootElement().getNamespaceURI()); + @SuppressWarnings("rawtypes") + List rnodes = resourceTypeXPath.selectNodes(document); + + assertEquals(1, rnodes.size()); + + assertEquals("resourceType", ((Element) rnodes.get(0)).getName()); + assertEquals("Reports", ((Element) rnodes.get(0)).getText()); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <viv...@us...> - 2016-10-10 06:54:31
|
Revision: 191 http://sourceforge.net/p/andspidclient/code/191 Author: vivekpulukuri Date: 2016-10-10 06:54:28 +0000 (Mon, 10 Oct 2016) Log Message: ----------- Add Support for minting DOI's for grey literature EPR-547 Modified Paths: -------------- trunk/src/main/java/au/csiro/doiclient/business/DoiDTO.java trunk/src/main/java/au/csiro/doiclient/utils/ConverterUtils.java trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java trunk/src/main/resources/DoiMetadataTemplate.xml trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java Modified: trunk/src/main/java/au/csiro/doiclient/business/DoiDTO.java =================================================================== --- trunk/src/main/java/au/csiro/doiclient/business/DoiDTO.java 2016-03-04 03:36:17 UTC (rev 190) +++ trunk/src/main/java/au/csiro/doiclient/business/DoiDTO.java 2016-10-10 06:54:28 UTC (rev 191) @@ -61,6 +61,17 @@ /** Primary language of the resource. Allowed values from: ISO 639-2/B, ISO 639-3 **/ private String language; + + /** + * Type of resource such as datasets and collections + * associated workflows, software, models, grey literature + */ + private String resourceType; + + /** + * Resource type description + */ + private String resourceTypeDescription; /** * @return the title @@ -179,7 +190,27 @@ { this.identifier = identifier; } + + public String getResourceType() + { + return resourceType; + } + public void setResourceType(String resourceType) + { + this.resourceType = resourceType; + } + + public String getResourceTypeDescription() + { + return resourceTypeDescription; + } + + public void setResourceTypeDescription(String resourceTypeDescription) + { + this.resourceTypeDescription = resourceTypeDescription; + } + /* (non-Javadoc) * @see java.lang.Object#toString() */ @@ -202,10 +233,12 @@ if (subject != null) builder.append("subject=").append(subject).append(", "); if (language != null) - builder.append("language=").append(language); + builder.append("language=").append(language).append(", "); + if (resourceType != null) + builder.append("resourceType=").append(resourceType).append(", "); + if (resourceTypeDescription != null) + builder.append("resourceTypeDescription=").append(resourceTypeDescription); builder.append("]"); return builder.toString(); - } - - + } } Modified: trunk/src/main/java/au/csiro/doiclient/utils/ConverterUtils.java =================================================================== --- trunk/src/main/java/au/csiro/doiclient/utils/ConverterUtils.java 2016-03-04 03:36:17 UTC (rev 190) +++ trunk/src/main/java/au/csiro/doiclient/utils/ConverterUtils.java 2016-10-10 06:54:28 UTC (rev 191) @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; +import org.jdom.Attribute; import org.jdom.Document; import org.jdom.Element; import org.jdom.JDOMException; @@ -106,6 +107,32 @@ Element theElement = (Element) xPath.selectSingleNode(document); theElement.setText(stripNonValidXMLCharacters(value)); } + + /** + * Update an existing XML element within an XML document using XPath. + * + * @param document + * the existing XML document to update + * @param nameSpace + * Namespace associated with the element + * @param element + * the element XPath that needs to be updated + * @param name + * the attribute name + * @param value + * the new value of the element + * @throws JDOMException + * when invalid XML parsing/access occurs + */ + public static void updateAttribute (Document document, String nameSpace, String element, + String name, String value) throws JDOMException + { + XPath xPath = XPath.newInstance(element); + xPath.addNamespace(nameSpace, document.getRootElement().getNamespaceURI()); + Element theElement = (Element) xPath.selectSingleNode(document); + Attribute attr = theElement.getAttribute(name); + attr.setValue(stripNonValidXMLCharacters(value)); + } /** * Update an existing XML element within an XML document using XPath. Modified: trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java =================================================================== --- trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java 2016-03-04 03:36:17 UTC (rev 190) +++ trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java 2016-10-10 06:54:28 UTC (rev 191) @@ -72,6 +72,16 @@ private static final String PUBLICATIONYEAR_NAME_XPATH = "/xsi:resource/xsi:publicationYear"; /** + * Constant giving the xPath of the Resource type + */ + private static final String RESOURCETYPE_NAME_XPATH = "/xsi:resource/xsi:resourceType"; + + /** + * Constant giving the xPath of the Resource type + */ + private static final String RESOURCETYPE_GENERAL = "resourceTypeGeneral"; + + /** * Constant giving the xPath of the Creator Name */ private static final String NAME_SPACE = "xsi"; @@ -120,8 +130,12 @@ ConverterUtils.updateElementValue(document, NAME_SPACE, DoiMetaDataGenerator.PUBLISHER_NAME_XPATH, doiDTO.getPublisher()); ConverterUtils.updateElementValue(document, NAME_SPACE, DoiMetaDataGenerator.PUBLICATIONYEAR_NAME_XPATH, - doiDTO.getPublicationYear()); - + doiDTO.getPublicationYear()); + ConverterUtils.updateElementValue(document, NAME_SPACE, DoiMetaDataGenerator.RESOURCETYPE_NAME_XPATH, + doiDTO.getResourceTypeDescription()); + ConverterUtils.updateAttribute (document, NAME_SPACE, DoiMetaDataGenerator.RESOURCETYPE_NAME_XPATH, + RESOURCETYPE_GENERAL, doiDTO.getResourceType()); + String result = ConverterUtils.outputTheXml(document); try Modified: trunk/src/main/resources/DoiMetadataTemplate.xml =================================================================== --- trunk/src/main/resources/DoiMetadataTemplate.xml 2016-03-04 03:36:17 UTC (rev 190) +++ trunk/src/main/resources/DoiMetadataTemplate.xml 2016-10-10 06:54:28 UTC (rev 191) @@ -32,5 +32,6 @@ Institut für Geowissenschaften, Christian-Albrechts-Universität, Kiel </publisher> <publicationYear>2005</publicationYear> +<resourceType resourceTypeGeneral="Collection">Grey literature</resourceType> </resource> \ No newline at end of file Modified: trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java =================================================================== --- trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java 2016-03-04 03:36:17 UTC (rev 190) +++ trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java 2016-10-10 06:54:28 UTC (rev 191) @@ -76,6 +76,8 @@ doiDTO.setTitle("A conceptual sediment budget for the Vietnam Shelf"); doiDTO.setPublicationYear("2001"); doiDTO.setPublisher("CSIRO"); + doiDTO.setResourceType("Text"); + doiDTO.setResourceTypeDescription("Reports"); return doiDTO; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <csi...@us...> - 2016-03-04 03:36:19
|
Revision: 190 http://sourceforge.net/p/andspidclient/code/190 Author: csirobuilduser Date: 2016-03-04 03:36:17 +0000 (Fri, 04 Mar 2016) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2016-03-04 03:36:12 UTC (rev 189) +++ trunk/pom.xml 2016-03-04 03:36:17 UTC (rev 190) @@ -52,7 +52,7 @@ <groupId>net.sourceforge.andspidclient</groupId> <artifactId>ands-pid-client</artifactId> <packaging>jar</packaging> - <version>1.0.32</version> + <version>1.0.33-SNAPSHOT</version> <name>ands-pid-client</name> <description>A generic client library for accessing the ANDS Persistent Identifier and the DOI services. See the Javadoc report for full details on usage.</description> <url>http://andspidclient.sourceforge.net/</url> @@ -61,9 +61,9 @@ <url>https://sourceforge.net/apps/trac/andspidclient/</url> </issueManagement> <scm> - <connection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/tags/ands-pid-client-1.0.32</connection> - <developerConnection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/tags/ands-pid-client-1.0.32</developerConnection> - <url>http://svn.code.sf.net/p/viewvc/andspidclient/tags/ands-pid-client-1.0.32</url> + <connection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/trunk</connection> + <developerConnection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/trunk</developerConnection> + <url>http://svn.code.sf.net/p/viewvc/andspidclient/trunk</url> </scm> <distributionManagement> <site> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <csi...@us...> - 2016-03-04 03:36:13
|
Revision: 189 http://sourceforge.net/p/andspidclient/code/189 Author: csirobuilduser Date: 2016-03-04 03:36:12 +0000 (Fri, 04 Mar 2016) Log Message: ----------- [maven-release-plugin] copy for tag ands-pid-client-1.0.32 Added Paths: ----------- tags/ands-pid-client-1.0.32/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <csi...@us...> - 2016-03-04 03:36:02
|
Revision: 188 http://sourceforge.net/p/andspidclient/code/188 Author: csirobuilduser Date: 2016-03-04 03:36:01 +0000 (Fri, 04 Mar 2016) Log Message: ----------- [maven-release-plugin] prepare release ands-pid-client-1.0.32 Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2016-02-19 06:14:46 UTC (rev 187) +++ trunk/pom.xml 2016-03-04 03:36:01 UTC (rev 188) @@ -52,7 +52,7 @@ <groupId>net.sourceforge.andspidclient</groupId> <artifactId>ands-pid-client</artifactId> <packaging>jar</packaging> - <version>1.0.32-SNAPSHOT</version> + <version>1.0.32</version> <name>ands-pid-client</name> <description>A generic client library for accessing the ANDS Persistent Identifier and the DOI services. See the Javadoc report for full details on usage.</description> <url>http://andspidclient.sourceforge.net/</url> @@ -61,9 +61,9 @@ <url>https://sourceforge.net/apps/trac/andspidclient/</url> </issueManagement> <scm> - <connection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/trunk</connection> - <developerConnection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/trunk</developerConnection> - <url>http://svn.code.sf.net/p/viewvc/andspidclient/trunk</url> + <connection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/tags/ands-pid-client-1.0.32</connection> + <developerConnection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/tags/ands-pid-client-1.0.32</developerConnection> + <url>http://svn.code.sf.net/p/viewvc/andspidclient/tags/ands-pid-client-1.0.32</url> </scm> <distributionManagement> <site> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <csi...@us...> - 2016-02-19 06:14:49
|
Revision: 187 http://sourceforge.net/p/andspidclient/code/187 Author: csirobuilduser Date: 2016-02-19 06:14:46 +0000 (Fri, 19 Feb 2016) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2016-02-19 06:14:42 UTC (rev 186) +++ trunk/pom.xml 2016-02-19 06:14:46 UTC (rev 187) @@ -52,7 +52,7 @@ <groupId>net.sourceforge.andspidclient</groupId> <artifactId>ands-pid-client</artifactId> <packaging>jar</packaging> - <version>1.0.31</version> + <version>1.0.32-SNAPSHOT</version> <name>ands-pid-client</name> <description>A generic client library for accessing the ANDS Persistent Identifier and the DOI services. See the Javadoc report for full details on usage.</description> <url>http://andspidclient.sourceforge.net/</url> @@ -61,9 +61,9 @@ <url>https://sourceforge.net/apps/trac/andspidclient/</url> </issueManagement> <scm> - <connection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/tags/ands-pid-client-1.0.31</connection> - <developerConnection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/tags/ands-pid-client-1.0.31</developerConnection> - <url>http://svn.code.sf.net/p/viewvc/andspidclient/tags/ands-pid-client-1.0.31</url> + <connection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/trunk</connection> + <developerConnection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/trunk</developerConnection> + <url>http://svn.code.sf.net/p/viewvc/andspidclient/trunk</url> </scm> <distributionManagement> <site> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <csi...@us...> - 2016-02-19 06:14:43
|
Revision: 186 http://sourceforge.net/p/andspidclient/code/186 Author: csirobuilduser Date: 2016-02-19 06:14:42 +0000 (Fri, 19 Feb 2016) Log Message: ----------- [maven-release-plugin] copy for tag ands-pid-client-1.0.31 Added Paths: ----------- tags/ands-pid-client-1.0.31/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <csi...@us...> - 2016-02-19 06:14:32
|
Revision: 185 http://sourceforge.net/p/andspidclient/code/185 Author: csirobuilduser Date: 2016-02-19 06:14:30 +0000 (Fri, 19 Feb 2016) Log Message: ----------- [maven-release-plugin] prepare release ands-pid-client-1.0.31 Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2016-02-19 06:10:29 UTC (rev 184) +++ trunk/pom.xml 2016-02-19 06:14:30 UTC (rev 185) @@ -52,7 +52,7 @@ <groupId>net.sourceforge.andspidclient</groupId> <artifactId>ands-pid-client</artifactId> <packaging>jar</packaging> - <version>1.0.31-SNAPSHOT</version> + <version>1.0.31</version> <name>ands-pid-client</name> <description>A generic client library for accessing the ANDS Persistent Identifier and the DOI services. See the Javadoc report for full details on usage.</description> <url>http://andspidclient.sourceforge.net/</url> @@ -61,9 +61,9 @@ <url>https://sourceforge.net/apps/trac/andspidclient/</url> </issueManagement> <scm> - <connection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/trunk</connection> - <developerConnection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/trunk</developerConnection> - <url>http://svn.code.sf.net/p/viewvc/andspidclient/trunk</url> + <connection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/tags/ands-pid-client-1.0.31</connection> + <developerConnection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/tags/ands-pid-client-1.0.31</developerConnection> + <url>http://svn.code.sf.net/p/viewvc/andspidclient/tags/ands-pid-client-1.0.31</url> </scm> <distributionManagement> <site> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <joh...@us...> - 2016-02-19 06:10:31
|
Revision: 184 http://sourceforge.net/p/andspidclient/code/184 Author: johnpage-09 Date: 2016-02-19 06:10:29 +0000 (Fri, 19 Feb 2016) Log Message: ----------- Fix to version number in the pom.xml Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2016-02-19 06:02:10 UTC (rev 183) +++ trunk/pom.xml 2016-02-19 06:10:29 UTC (rev 184) @@ -52,7 +52,7 @@ <groupId>net.sourceforge.andspidclient</groupId> <artifactId>ands-pid-client</artifactId> <packaging>jar</packaging> - <version>1.0.31</version> + <version>1.0.31-SNAPSHOT</version> <name>ands-pid-client</name> <description>A generic client library for accessing the ANDS Persistent Identifier and the DOI services. See the Javadoc report for full details on usage.</description> <url>http://andspidclient.sourceforge.net/</url> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <joh...@us...> - 2016-02-19 06:02:13
|
Revision: 183 http://sourceforge.net/p/andspidclient/code/183 Author: johnpage-09 Date: 2016-02-19 06:02:10 +0000 (Fri, 19 Feb 2016) Log Message: ----------- Fix url to scm in pom.xml Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2016-02-19 05:15:49 UTC (rev 182) +++ trunk/pom.xml 2016-02-19 06:02:10 UTC (rev 183) @@ -61,9 +61,9 @@ <url>https://sourceforge.net/apps/trac/andspidclient/</url> </issueManagement> <scm> - <connection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/tags/ands-pid-client-1.0.31</connection> - <developerConnection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/tags/ands-pid-client-1.0.31</developerConnection> - <url>http://andspidclient.svn.sourceforge.net/viewvc/andspidclient/tags/ands-pid-client-1.0.31</url> + <connection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/trunk</connection> + <developerConnection>scm:svn:https://svn.code.sf.net/p/andspidclient/code/trunk</developerConnection> + <url>http://svn.code.sf.net/p/viewvc/andspidclient/trunk</url> </scm> <distributionManagement> <site> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <csi...@us...> - 2016-02-19 05:15:51
|
Revision: 182 http://sourceforge.net/p/andspidclient/code/182 Author: csirobuilduser Date: 2016-02-19 05:15:49 +0000 (Fri, 19 Feb 2016) Log Message: ----------- [maven-release-plugin] prepare release ands-pid-client-1.0.31 Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2016-02-19 02:40:28 UTC (rev 181) +++ trunk/pom.xml 2016-02-19 05:15:49 UTC (rev 182) @@ -1,533 +1,533 @@ -<!-- - -This pom.xml has been configured with the following dependencies: - -1.) gpg.exe needs to be installed on your system - you can specify the path to gpg.exe as follows: - - SNAPSHOT Release: mvn deploy -Dgpg.executable="C:\Progra~1\GNU\GnuPG\gpg.exe" - Test Release: mvn release:prepare release:perform -Dusername="<insert svn username here>" -Darguments="-Dgpg.executable=C:\\Progra~1\\GNU\\GnuPG\\gpg.exe" - -2.) Our Maven settings.xml contains the credentials for: accessing SCM; running GPG; site deployment to SourceForge; and deploying to repositories (both our local SNAPSHOT repository and Sonatype.org's staging repository), e.g. - -<settings> - <servers> - <server> - <id>snapshots</id> - <username>-insert username here-</username> - <password>-insert password here-</password> - </server> - <server> - <id>release-sonatype</id> - <username>-insert username here-</username> - <password>-insert password here-</password> - </server> - <server> - <id>sourceforge.net</id> - <username>-insert username here-</username> - <password>-insert password here-</password> - </server> - </servers> - <profiles> - <profile> - <id>activeProfile</id> - <properties> - <scm.username>-insert username here-</scm.username> - <scm.password>-insert password here-</scm.password> - <gpg.keyname>-insert keyname here-</gpg.keyname> - <gpg.passphrase>-insert passphrase here-</gpg.passphrase> - </properties> - </profile> - </profiles> - <activeProfiles> - <activeProfile>activeProfile</activeProfile> - </activeProfiles> -</settings> - -3.) This pom.xml is not configured to perform site deployment or file releases (see commented out sections), -these steps will need to be performed manually. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>net.sourceforge.andspidclient</groupId> - <artifactId>ands-pid-client</artifactId> - <packaging>jar</packaging> - <version>1.0.31-SNAPSHOT</version> - <name>ands-pid-client</name> - <description>A generic client library for accessing the ANDS Persistent Identifier and the DOI services. See the Javadoc report for full details on usage.</description> - <url>http://andspidclient.sourceforge.net/</url> - <issueManagement> - <system>SourceForge Trac</system> - <url>https://sourceforge.net/apps/trac/andspidclient/</url> - </issueManagement> - <scm> - <connection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/trunk</connection> - <developerConnection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/trunk/</developerConnection> - <url>http://andspidclient.svn.sourceforge.net/viewvc/andspidclient/trunk</url> - </scm> - <distributionManagement> - <site> - <id>sourceforge.net</id> - <url>scp://shell.sourceforge.net/home/groups/a/an/andspidclient/htdocs</url> - </site> - <repository> - <id>release-sonatype</id> - <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url> <!-- sonatype.org repository for staging releases --> - </repository> - - - <snapshotRepository> - <id>snapshots</id> - <url>http://jenkins-cdc.it.csiro.au:8085/nexus/content/repositories/snapshots</url> - </snapshotRepository> - </distributionManagement> - <properties> - <targetJdk>1.5</targetJdk> - <jar.outputDirectory> - ${project.build.directory} - </jar.outputDirectory> - </properties> - <licenses> - <license> - <name>The Apache Software License, Version 2.0</name> - <url>src/main/resources/LICENSE.txt</url> - <distribution>repo</distribution> - <comments>A business-friendly OSS license</comments> - </license> - </licenses> - <mailingLists> - <mailingList> - <name>Project SVN Changes Notification List</name> - <subscribe>https://lists.sourceforge.net/mailman/listinfo/andspidclient-commit-svn</subscribe> - <unsubscribe>https://lists.sourceforge.net/mailman/listinfo/andspidclient-commit-svn</unsubscribe> - <archive>https://sourceforge.net/mailarchive/forum.php?forum_name=andspidclient-commit-svn</archive> - <post>and...@li...</post> - </mailingList> - <mailingList> - <name>Project Users List</name> - <subscribe>https://lists.sourceforge.net/mailman/listinfo/andspidclient-users</subscribe> - <unsubscribe>https://lists.sourceforge.net/mailman/listinfo/andspidclient-users</unsubscribe> - <archive>https://sourceforge.net/mailarchive/forum.php?forum_name=andspidclient-users</archive> - <post>and...@li...</post> - </mailingList> - </mailingLists> - - <build> - <resources> - <resource> - <directory>src/main/resources</directory> - <filtering>true</filtering> - <includes> - <include>**/*.properties</include> - </includes> - </resource> - <resource> - <directory>src/main/resources</directory> - <filtering>false</filtering> - <excludes> - <exclude>**/*.properties</exclude> - </excludes> - </resource> - </resources> - <plugins> - - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>1.5</source> - <target>1.5</target> - </configuration> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>2.2</version> - <configuration> - <archive> - <manifest> - <addDefaultImplementationEntries>true</addDefaultImplementationEntries> - </manifest> - </archive> - </configuration> - </plugin> - - <!-- - Add or update existing license headers, see: http://code.google.com/p/maven-license-plugin/wiki/Configuration - --> - <plugin> - <groupId>com.mycila.maven-license-plugin</groupId> - <artifactId>maven-license-plugin</artifactId> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>format</goal> - </goals> - </execution> - </executions> - <configuration> - <header>config/header.txt</header> - <excludes> - <exclude>src/main/resources/LICENSE.txt</exclude> - <exclude>src/main/resources/NOTICE.txt</exclude> - </excludes> - </configuration> - </plugin> - - <!-- - Generate source jar as a build artifacts - --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-source-plugin</artifactId> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>jar</goal> - </goals> - </execution> - </executions> - </plugin> - - <!-- - Generate javadoc jar as a build artifacts - --> - <plugin> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.6</version> - <executions> - <execution> - <id>generate-javadoc</id> - <phase>package</phase> - <goals> - <goal>jar</goal> - </goals> - </execution> - </executions> - </plugin> - - <!-- WE NOW PERFORM A MANUAL FILE RELEASE TO SOURECFORGE --> - <!-- Include the created software artifacts in the site --> - <!-- - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <version>2.4.1</version> - <executions> - <execution> - <id>copy-resources</id> - <phase>pre-site</phase> - <goals> - <goal>copy-resources</goal> - </goals> - <configuration> - <outputDirectory>${basedir}/target/site/downloads</outputDirectory> - <resources> - <resource> - <directory>target</directory> - <includes> - <include>ands-pid-client-*.zip</include> - <include>ands-pid-client-*.jar</include> - </includes> - <filtering>false</filtering> - </resource> - </resources> - </configuration> - </execution> - </executions> - </plugin> - --> - - <!-- This configures the scm plugin. note: the variables ${scm.username} and ${scm.password} are retrieved from local file: settings.xml --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-scm-plugin</artifactId> - <version>1.3</version> - <configuration> - <username>${scm.username}</username> - <password>${scm.password}</password> - </configuration> - </plugin> - - <!-- This is a simple debug statement. note: the variables ${scm.username} and ${scm.password} are retrieved from local file: settings.xml --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <version>1.1</version> - <executions> - <execution> - <phase>deploy</phase> - <goals> - <goal>run</goal> - </goals> - <configuration> - <tasks> - <echo>Using SCM credentials</echo> - <echo>[scm.username] ${scm.username}</echo> - <echo>[scm.password] ${scm.password}</echo> - </tasks> - </configuration> - </execution> - </executions> - </plugin> - - <!-- WE NOW PERFORM A MANUAL SITE DEPLOY TO SOURECFORGE --> - <!-- Run script to create SourceForge shell so that site can be uploaded via SCP --> - <!-- - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <version>1.1</version> - <executions> - <execution> - <id>create_shell_on_sourceforge</id> - <phase>pre-site</phase> - <goals> - <goal>exec</goal> - </goals> - <configuration> - <arguments> - <argument>-ssh</argument> - <argument>-pw</argument> - <argument>${scm.password}</argument> - <argument>-P</argument> - <argument>22</argument> - <argument>${scm.username},and...@sh...</argument> - <argument>create</argument> - </arguments> - </configuration> - </execution> - <execution> - <id>change_htdocs_ownership</id> - <phase>pre-site</phase> - <goals> - <goal>exec</goal> - </goals> - <configuration> - <arguments> - <argument>-ssh</argument> - <argument>-pw</argument> - <argument>${scm.password}</argument> - <argument>-P</argument> - <argument>22</argument> - <argument>${scm.username},and...@sh...</argument> - <argument>chown ${scm.username} /home/groups/a/an/andspidclient/htdocs</argument> - </arguments> - </configuration> - </execution> - </executions> - </plugin> - --> - - <!-- use 2.0-beta-9 or later to overcome bug when tagging a release (http://jira.codehaus.org/browse/SCM-406) --> - <plugin> - <artifactId>maven-release-plugin</artifactId> - <version>2.0</version> - <configuration> - <goal>deploy</goal> <!-- Because we have a populated <site> element, the site-deploy goal will execute. We specify that only the deploy goal should execute, since we will perform site-deploys manually --> - </configuration> - </plugin> - - <!-- This will sign the artifacts before being deployed to the release repository. note: the variables ${gpg.keyname} and ${gpg.passphrase} are retrieved from local file: settings.xml --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-gpg-plugin</artifactId> - <configuration> - <keyname>${gpg.keyname}</keyname> - <passphrase>${gpg.passphrase}</passphrase> - </configuration> - <executions> - <execution> - <id>sign-artifacts</id> - <phase>verify</phase> - <goals> - <goal>sign</goal> - </goals> - </execution> - </executions> - </plugin> - - </plugins> - </build> - - <ciManagement> - <system>hudson</system> - <url>http://jenkins-cdc.it.csiro.au:8080/</url> - <notifiers> - <notifier> - <type>mail</type> - <configuration> - <recipients>de...@cs...</recipients> - <sendOnError>true</sendOnError> - <sendOnFailure>true</sendOnFailure> - <sendOnSuccess>true</sendOnSuccess> - <sendOnWarning>true</sendOnWarning> - </configuration> - </notifier> - </notifiers> - </ciManagement> - - <!-- - We don't package the dependencies (i.e. a \lib directory) in the jar, - the pom.xml should tell consumers about any dependencies (i.e. the - transitive dependencies) - --> - - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>commons-httpclient</groupId> - <artifactId>commons-httpclient</artifactId> - <version>3.1</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.7</version> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.4</version> - </dependency> - <dependency> - <groupId>org.jdom</groupId> - <artifactId>jdom</artifactId> - <version>1.1.2</version> - <!-- http://jira.codehaus.org/browse/JAXEN-217 --> - <exclusions> - <exclusion> - <groupId>maven-plugins</groupId> - <artifactId>maven-cobertura-plugin</artifactId> - </exclusion> - <exclusion> - <groupId>maven-plugins</groupId> - <artifactId>maven-findbugs-plugin</artifactId> - </exclusion> - </exclusions> - </dependency> -</dependencies> - <reporting> - <plugins> - <plugin> - <artifactId>maven-changelog-plugin</artifactId> - <version>2.1</version> - <configuration> - <type>range</type> - <range>60</range> - </configuration> - </plugin> - <!-- Maven changes plugin does not currently support SourceForge's Trac --> - <!-- - <plugin> - <artifactId>maven-changes-plugin</artifactId> - <version>2.1</version> - <reportSets> - <reportSet> - <reports> - <report>changes-report</report> - </reports> - </reportSet> - </reportSets> - <configuration> - <issueLinkTemplate> - %URL%/ticket/%ISSUE% - </issueLinkTemplate> - </configuration> - </plugin> - --> - <plugin> - <artifactId>maven-checkstyle-plugin</artifactId> - <version>2.3</version> - <configuration> - <configLocation>config/checkstyle_checks.xml</configLocation> - </configuration> - </plugin> - <plugin> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.6</version> - </plugin> - <plugin> - <artifactId>maven-jxr-plugin</artifactId> - <version>2.1</version> - </plugin> - <plugin> - <artifactId>maven-pmd-plugin</artifactId> - <version>2.4</version> - <configuration> - <targetJdk>${targetJdk}</targetJdk> - </configuration> - </plugin> - <plugin> - <artifactId>maven-surefire-report-plugin</artifactId> - <version>2.4.3</version> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>cobertura-maven-plugin</artifactId> - <version>2.3</version> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>jdepend-maven-plugin</artifactId> - <version>2.0-beta-2</version> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>taglist-maven-plugin</artifactId> - <version>2.3</version> - </plugin> - </plugins> - </reporting> - <developers> - <developer> - <id>jdempsey</id> - <name>James Dempsey</name> - <email>jde...@us...</email> - <organization>CSIRO</organization> - <timezone>+11</timezone> - </developer> - <developer> - <id>ritacsiro</id> - <name>Rita Chen</name> - <email>rit...@us...</email> - <organization>CSIRO</organization> - <timezone>+11</timezone> - </developer> - <developer> - <id>mpienaar</id> - <name>Martin Pienaar</name> - <email>mpi...@us...</email> - <organization>CSIRO</organization> - <timezone>+10</timezone> - </developer> - <developer> - <id>robertbridle</id> - <name>Robert Bridle</name> - <email>rob...@us...</email> - <organization>CSIRO</organization> - <timezone>+11</timezone> - </developer> - <developer> - <id>vivekpulukuri</id> - <name>Vivek Pulukuri</name> - <email>viv...@us...</email> - <organization>CSIRO</organization> - <timezone>+11</timezone> - </developer> - <developer> - <id>pag06d</id> - <name>John Page</name> - <email>joh...@us...</email> - <organization>CSIRO</organization> - <timezone>+11</timezone> - </developer> - </developers> -</project> +<!-- + +This pom.xml has been configured with the following dependencies: + +1.) gpg.exe needs to be installed on your system - you can specify the path to gpg.exe as follows: + + SNAPSHOT Release: mvn deploy -Dgpg.executable="C:\Progra~1\GNU\GnuPG\gpg.exe" + Test Release: mvn release:prepare release:perform -Dusername="<insert svn username here>" -Darguments="-Dgpg.executable=C:\\Progra~1\\GNU\\GnuPG\\gpg.exe" + +2.) Our Maven settings.xml contains the credentials for: accessing SCM; running GPG; site deployment to SourceForge; and deploying to repositories (both our local SNAPSHOT repository and Sonatype.org's staging repository), e.g. + +<settings> + <servers> + <server> + <id>snapshots</id> + <username>-insert username here-</username> + <password>-insert password here-</password> + </server> + <server> + <id>release-sonatype</id> + <username>-insert username here-</username> + <password>-insert password here-</password> + </server> + <server> + <id>sourceforge.net</id> + <username>-insert username here-</username> + <password>-insert password here-</password> + </server> + </servers> + <profiles> + <profile> + <id>activeProfile</id> + <properties> + <scm.username>-insert username here-</scm.username> + <scm.password>-insert password here-</scm.password> + <gpg.keyname>-insert keyname here-</gpg.keyname> + <gpg.passphrase>-insert passphrase here-</gpg.passphrase> + </properties> + </profile> + </profiles> + <activeProfiles> + <activeProfile>activeProfile</activeProfile> + </activeProfiles> +</settings> + +3.) This pom.xml is not configured to perform site deployment or file releases (see commented out sections), +these steps will need to be performed manually. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>net.sourceforge.andspidclient</groupId> + <artifactId>ands-pid-client</artifactId> + <packaging>jar</packaging> + <version>1.0.31</version> + <name>ands-pid-client</name> + <description>A generic client library for accessing the ANDS Persistent Identifier and the DOI services. See the Javadoc report for full details on usage.</description> + <url>http://andspidclient.sourceforge.net/</url> + <issueManagement> + <system>SourceForge Trac</system> + <url>https://sourceforge.net/apps/trac/andspidclient/</url> + </issueManagement> + <scm> + <connection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/tags/ands-pid-client-1.0.31</connection> + <developerConnection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/tags/ands-pid-client-1.0.31</developerConnection> + <url>http://andspidclient.svn.sourceforge.net/viewvc/andspidclient/tags/ands-pid-client-1.0.31</url> + </scm> + <distributionManagement> + <site> + <id>sourceforge.net</id> + <url>scp://shell.sourceforge.net/home/groups/a/an/andspidclient/htdocs</url> + </site> + <repository> + <id>release-sonatype</id> + <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url> <!-- sonatype.org repository for staging releases --> + </repository> + + + <snapshotRepository> + <id>snapshots</id> + <url>http://jenkins-cdc.it.csiro.au:8085/nexus/content/repositories/snapshots</url> + </snapshotRepository> + </distributionManagement> + <properties> + <targetJdk>1.5</targetJdk> + <jar.outputDirectory> + ${project.build.directory} + </jar.outputDirectory> + </properties> + <licenses> + <license> + <name>The Apache Software License, Version 2.0</name> + <url>src/main/resources/LICENSE.txt</url> + <distribution>repo</distribution> + <comments>A business-friendly OSS license</comments> + </license> + </licenses> + <mailingLists> + <mailingList> + <name>Project SVN Changes Notification List</name> + <subscribe>https://lists.sourceforge.net/mailman/listinfo/andspidclient-commit-svn</subscribe> + <unsubscribe>https://lists.sourceforge.net/mailman/listinfo/andspidclient-commit-svn</unsubscribe> + <archive>https://sourceforge.net/mailarchive/forum.php?forum_name=andspidclient-commit-svn</archive> + <post>and...@li...</post> + </mailingList> + <mailingList> + <name>Project Users List</name> + <subscribe>https://lists.sourceforge.net/mailman/listinfo/andspidclient-users</subscribe> + <unsubscribe>https://lists.sourceforge.net/mailman/listinfo/andspidclient-users</unsubscribe> + <archive>https://sourceforge.net/mailarchive/forum.php?forum_name=andspidclient-users</archive> + <post>and...@li...</post> + </mailingList> + </mailingLists> + + <build> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + <includes> + <include>**/*.properties</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + <filtering>false</filtering> + <excludes> + <exclude>**/*.properties</exclude> + </excludes> + </resource> + </resources> + <plugins> + + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifest> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + </manifest> + </archive> + </configuration> + </plugin> + + <!-- + Add or update existing license headers, see: http://code.google.com/p/maven-license-plugin/wiki/Configuration + --> + <plugin> + <groupId>com.mycila.maven-license-plugin</groupId> + <artifactId>maven-license-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>format</goal> + </goals> + </execution> + </executions> + <configuration> + <header>config/header.txt</header> + <excludes> + <exclude>src/main/resources/LICENSE.txt</exclude> + <exclude>src/main/resources/NOTICE.txt</exclude> + </excludes> + </configuration> + </plugin> + + <!-- + Generate source jar as a build artifacts + --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + + <!-- + Generate javadoc jar as a build artifacts + --> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.6</version> + <executions> + <execution> + <id>generate-javadoc</id> + <phase>package</phase> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + + <!-- WE NOW PERFORM A MANUAL FILE RELEASE TO SOURECFORGE --> + <!-- Include the created software artifacts in the site --> + <!-- + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>2.4.1</version> + <executions> + <execution> + <id>copy-resources</id> + <phase>pre-site</phase> + <goals> + <goal>copy-resources</goal> + </goals> + <configuration> + <outputDirectory>${basedir}/target/site/downloads</outputDirectory> + <resources> + <resource> + <directory>target</directory> + <includes> + <include>ands-pid-client-*.zip</include> + <include>ands-pid-client-*.jar</include> + </includes> + <filtering>false</filtering> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + --> + + <!-- This configures the scm plugin. note: the variables ${scm.username} and ${scm.password} are retrieved from local file: settings.xml --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-scm-plugin</artifactId> + <version>1.3</version> + <configuration> + <username>${scm.username}</username> + <password>${scm.password}</password> + </configuration> + </plugin> + + <!-- This is a simple debug statement. note: the variables ${scm.username} and ${scm.password} are retrieved from local file: settings.xml --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.1</version> + <executions> + <execution> + <phase>deploy</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks> + <echo>Using SCM credentials</echo> + <echo>[scm.username] ${scm.username}</echo> + <echo>[scm.password] ${scm.password}</echo> + </tasks> + </configuration> + </execution> + </executions> + </plugin> + + <!-- WE NOW PERFORM A MANUAL SITE DEPLOY TO SOURECFORGE --> + <!-- Run script to create SourceForge shell so that site can be uploaded via SCP --> + <!-- + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.1</version> + <executions> + <execution> + <id>create_shell_on_sourceforge</id> + <phase>pre-site</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <arguments> + <argument>-ssh</argument> + <argument>-pw</argument> + <argument>${scm.password}</argument> + <argument>-P</argument> + <argument>22</argument> + <argument>${scm.username},and...@sh...</argument> + <argument>create</argument> + </arguments> + </configuration> + </execution> + <execution> + <id>change_htdocs_ownership</id> + <phase>pre-site</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <arguments> + <argument>-ssh</argument> + <argument>-pw</argument> + <argument>${scm.password}</argument> + <argument>-P</argument> + <argument>22</argument> + <argument>${scm.username},and...@sh...</argument> + <argument>chown ${scm.username} /home/groups/a/an/andspidclient/htdocs</argument> + </arguments> + </configuration> + </execution> + </executions> + </plugin> + --> + + <!-- use 2.0-beta-9 or later to overcome bug when tagging a release (http://jira.codehaus.org/browse/SCM-406) --> + <plugin> + <artifactId>maven-release-plugin</artifactId> + <version>2.0</version> + <configuration> + <goal>deploy</goal> <!-- Because we have a populated <site> element, the site-deploy goal will execute. We specify that only the deploy goal should execute, since we will perform site-deploys manually --> + </configuration> + </plugin> + + <!-- This will sign the artifacts before being deployed to the release repository. note: the variables ${gpg.keyname} and ${gpg.passphrase} are retrieved from local file: settings.xml --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-gpg-plugin</artifactId> + <configuration> + <keyname>${gpg.keyname}</keyname> + <passphrase>${gpg.passphrase}</passphrase> + </configuration> + <executions> + <execution> + <id>sign-artifacts</id> + <phase>verify</phase> + <goals> + <goal>sign</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + </build> + + <ciManagement> + <system>hudson</system> + <url>http://jenkins-cdc.it.csiro.au:8080/</url> + <notifiers> + <notifier> + <type>mail</type> + <configuration> + <recipients>de...@cs...</recipients> + <sendOnError>true</sendOnError> + <sendOnFailure>true</sendOnFailure> + <sendOnSuccess>true</sendOnSuccess> + <sendOnWarning>true</sendOnWarning> + </configuration> + </notifier> + </notifiers> + </ciManagement> + + <!-- + We don't package the dependencies (i.e. a \lib directory) in the jar, + the pom.xml should tell consumers about any dependencies (i.e. the + transitive dependencies) + --> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>commons-httpclient</groupId> + <artifactId>commons-httpclient</artifactId> + <version>3.1</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.7.7</version> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.4</version> + </dependency> + <dependency> + <groupId>org.jdom</groupId> + <artifactId>jdom</artifactId> + <version>1.1.2</version> + <!-- http://jira.codehaus.org/browse/JAXEN-217 --> + <exclusions> + <exclusion> + <groupId>maven-plugins</groupId> + <artifactId>maven-cobertura-plugin</artifactId> + </exclusion> + <exclusion> + <groupId>maven-plugins</groupId> + <artifactId>maven-findbugs-plugin</artifactId> + </exclusion> + </exclusions> + </dependency> +</dependencies> + <reporting> + <plugins> + <plugin> + <artifactId>maven-changelog-plugin</artifactId> + <version>2.1</version> + <configuration> + <type>range</type> + <range>60</range> + </configuration> + </plugin> + <!-- Maven changes plugin does not currently support SourceForge's Trac --> + <!-- + <plugin> + <artifactId>maven-changes-plugin</artifactId> + <version>2.1</version> + <reportSets> + <reportSet> + <reports> + <report>changes-report</report> + </reports> + </reportSet> + </reportSets> + <configuration> + <issueLinkTemplate> + %URL%/ticket/%ISSUE% + </issueLinkTemplate> + </configuration> + </plugin> + --> + <plugin> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.3</version> + <configuration> + <configLocation>config/checkstyle_checks.xml</configLocation> + </configuration> + </plugin> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.6</version> + </plugin> + <plugin> + <artifactId>maven-jxr-plugin</artifactId> + <version>2.1</version> + </plugin> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + <version>2.4</version> + <configuration> + <targetJdk>${targetJdk}</targetJdk> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-report-plugin</artifactId> + <version>2.4.3</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <version>2.3</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>jdepend-maven-plugin</artifactId> + <version>2.0-beta-2</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>taglist-maven-plugin</artifactId> + <version>2.3</version> + </plugin> + </plugins> + </reporting> + <developers> + <developer> + <id>jdempsey</id> + <name>James Dempsey</name> + <email>jde...@us...</email> + <organization>CSIRO</organization> + <timezone>+11</timezone> + </developer> + <developer> + <id>ritacsiro</id> + <name>Rita Chen</name> + <email>rit...@us...</email> + <organization>CSIRO</organization> + <timezone>+11</timezone> + </developer> + <developer> + <id>mpienaar</id> + <name>Martin Pienaar</name> + <email>mpi...@us...</email> + <organization>CSIRO</organization> + <timezone>+10</timezone> + </developer> + <developer> + <id>robertbridle</id> + <name>Robert Bridle</name> + <email>rob...@us...</email> + <organization>CSIRO</organization> + <timezone>+11</timezone> + </developer> + <developer> + <id>vivekpulukuri</id> + <name>Vivek Pulukuri</name> + <email>viv...@us...</email> + <organization>CSIRO</organization> + <timezone>+11</timezone> + </developer> + <developer> + <id>pag06d</id> + <name>John Page</name> + <email>joh...@us...</email> + <organization>CSIRO</organization> + <timezone>+11</timezone> + </developer> + </developers> +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <joh...@us...> - 2016-02-19 02:40:30
|
Revision: 181 http://sourceforge.net/p/andspidclient/code/181 Author: johnpage-09 Date: 2016-02-19 02:40:28 +0000 (Fri, 19 Feb 2016) Log Message: ----------- DMSTECH-6822 : Updated to offer TLS1 and TLS1.1 as a part of the connection negotiation. Modified Paths: -------------- trunk/src/main/java/au/csiro/pidclient/CustomHttpsSocketFactory.java Modified: trunk/src/main/java/au/csiro/pidclient/CustomHttpsSocketFactory.java =================================================================== --- trunk/src/main/java/au/csiro/pidclient/CustomHttpsSocketFactory.java 2016-02-18 07:01:34 UTC (rev 180) +++ trunk/src/main/java/au/csiro/pidclient/CustomHttpsSocketFactory.java 2016-02-19 02:40:28 UTC (rev 181) @@ -62,7 +62,7 @@ return socket; } SSLSocket sslSocket = (SSLSocket) socket; - sslSocket.setEnabledProtocols(new String[] { "TLSv1.2" }); + sslSocket.setEnabledProtocols(new String[] { "TLSv1", "TLSv1.1", "TLSv1.2" }); return sslSocket; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <joh...@us...> - 2016-02-18 07:01:36
|
Revision: 180 http://sourceforge.net/p/andspidclient/code/180 Author: johnpage-09 Date: 2016-02-18 07:01:34 +0000 (Thu, 18 Feb 2016) Log Message: ----------- Fix to enforce Apache HttpClient to use TLS1.2 to instantiate SSL Handshakes Modified Paths: -------------- trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java trunk/src/main/java/au/csiro/pidclient/AndsPidClient.java Added Paths: ----------- trunk/src/main/java/au/csiro/pidclient/CustomHttpsSocketFactory.java Modified: trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java =================================================================== --- trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java 2014-12-09 06:05:29 UTC (rev 179) +++ trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java 2016-02-18 07:01:34 UTC (rev 180) @@ -225,12 +225,8 @@ * @param appId * the unique Id provided to the caller upon IP registration with the ANDS Digital Object Identifier * service. - * @param identifier - * the identifier or name of the repository calling the service. * @param authDomain * the domain of the organisation calling the service. - * @param doiDTO - * a DTO with the meta data info. * */ public AndsDoiClient(String doiServiceHost, String doiServicePath, String appId, String authDomain) @@ -278,9 +274,8 @@ * Responsible for the creation of a DOI. * <p> * If the value arguments are both empty, a handle with no values is created. The handle is assigned to an owner, - * specified by the {@link AndsDoiIdentity#getAppId()} value. If the owner is not known to the handle system, an - * owner is created from the {@link AndsDoiIdentity#getIdentifier()} and {@link AndsDoiIdentity#getIdentifier()} - * values. + * specified by the {@link au.csiro.doiclient.business.AndsDoiIdentity#getAppId()} value. If the owner is not known + * to the handle system. * <p> * String arguments should already be URL encoded when calling this method. * @@ -289,9 +284,9 @@ * @param doiDTO * doiDTO with the values for the meta-data update. * @param debug - * Optional parameter. Activates debug flag for WS call false => debug=false will be passed true => - * debug=true will be passed If ommitted no debug flag will be added to request - * See {@link AndsDoiClient} general documentation for details + * Optional parameter. Activates debug flag for WS call debug=false will be passed true debug=true will + * be passed If ommitted no debug flag will be added to request See {@link AndsDoiClient} general + * documentation for details * @return AndsDoiResponse {@link AndsDoiResponse} Response object holding the components of the response. * @throws IllegalStateException * thrown if the parameters need to call the ANDS DOI service have not been provided. @@ -334,8 +329,8 @@ * the url pointing to the landing page of the data collection. * @param debug * Optional parameter. Activates debug flag for WS call - * false => debug=false will be passed - * true => debug=true will be passed + * false = debug=false will be passed + * true = debug=true will be passed * If ommitted no debug flag will be added to request * See {@link AndsDoiClient} general documentation for details * @return AndsDoiResponse {@link AndsDoiResponse} Response object holding the components of the response. @@ -369,8 +364,8 @@ * doiDTO with the values for the meta-data update. * @param debug * Optional parameter. Activates debug flag for WS call - * false => debug=false will be passed - * true => debug=true will be passed + * debug=false will be passed + * debug=true will be passed * If ommitted no debug flag will be added to request * See {@link AndsDoiClient} general documentation for details * @return AndsDoiResponse {@link AndsDoiResponse} Response object holding the components of the response. @@ -407,8 +402,8 @@ * doiDTO with the values for the meta-data update. * @param debug * Optional parameter. Activates debug flag for WS call - * false => debug=false will be passed - * true => debug=true will be passed + * debug=false will be passed + * debug=true will be passed * If ommitted no debug flag will be added to request * See {@link AndsDoiClient} general documentation for details * @return AndsDoiResponse {@link AndsDoiResponse} Response object holding the components of the response. @@ -460,8 +455,8 @@ * that needs to be activated/ deactivated. * @param debug * Optional parameter. Activates debug flag for WS call - * false => debug=false will be passed - * true => debug=true will be passed + * debug=false will be passed + * debug=true will be passed * If ommitted no debug flag will be added to request * See {@link AndsDoiClient} general documentation for details * @return AndsDoiResponse {@link AndsDoiResponse} Response object holding the components of the response. @@ -494,8 +489,8 @@ /** * Adds "debug" key to params according to the value of debug parameter * - * false => debug="false" will be passed - * true => debug="true" will be passed + * debug="false" will be passed + * debug="true" will be passed * If ommitted no debug flag will be added to request * * @param params The list of parameters @@ -519,12 +514,10 @@ * * @param doi * that needs to be activated/ deactivated. - * @param activate - * boolean flag indicating whether to activate or deactivate. * @param debug Optional parameter. * Activates debug flag for WS call - * false => debug=false will be passed - * true => debug=true will be passed + * debug=false will be passed + * debug=true will be passed * If ommitted no debug flag will be added to request * See {@link AndsDoiClient} general documentation for details * @return AndsDoiResponse {@link AndsDoiResponse} Response object holding the components of the response. @@ -560,14 +553,12 @@ * @param doi * DOI for which the meta-data is requested. * @param encodeParams - * whether to URL encode the input parameters or not. Use false if the input parameters - * are already URL encoded. + * whether to URL encode the input parameters or not. Use false if the input parameters are already URL + * encoded. * @param debug - * Optional parameter. Activates debug flag for WS call - * false => debug=false will be passed - * true => debug=true will be passed - * If ommitted no debug flag will be added to request - * See {@link AndsDoiClient} general documentation for details + * Optional parameter. Activates debug flag for WS call debug=false will be passed debug=true will be + * passed If ommitted no debug flag will be added to request See {@link AndsDoiClient} general + * documentation for details * @throws IllegalStateException * thrown if the parameters need to call the ANDS DOI service have not been provided. * @throws IllegalArgumentException @@ -576,6 +567,7 @@ * thrown when attempting to read response. * @throws HttpException * thrown when attempting to execute method call. + * @return AndsDoiResponse DOI Response */ public AndsDoiResponse requestMetaDataOfDOI(String doi, boolean encodeParams, boolean ...debug) throws HttpException, IOException { @@ -596,8 +588,8 @@ * @param debug * Optional parameter. * Activates debug flag for WS call - * false => debug=false will be passed - * true => debug=true will be passed + * debug=false will be passed + * debug=true will be passed * If ommitted no debug flag will be added to request * See {@link AndsDoiClient} general documentation for details * @throws IllegalStateException @@ -608,6 +600,7 @@ * thrown when attempting to read response. * @throws HttpException * thrown when attempting to execute method call. + * @return AndsDoiResponse AndsDoiResponse */ public AndsDoiResponse requestMetaDataOfDOI(String doi, boolean... debug) throws HttpException, IOException { Modified: trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java =================================================================== --- trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java 2014-12-09 06:05:29 UTC (rev 179) +++ trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java 2016-02-18 07:01:34 UTC (rev 180) @@ -160,7 +160,8 @@ * * @param doiDto * the bean representation of an OPAL record to be converted to a VOResource XML document - * @return a String representation of the DOIMetaData XML + * @param metaDataDocument the metadata document as a String + * @return String A string representation of the DOIMetaData XML * @throws IOException * if the XML Document access fails * @throws JDOMException @@ -225,7 +226,8 @@ * @param doi * The Digital Object Identifier that needs to be set into the xml. * @param xmlDocument - * XML document that neews to be updated. + * XML document that needs to be updated. + * @return string response. * @throws IOException * if the XML Document access fails * @throws JDOMException @@ -245,6 +247,7 @@ /** * Formats the DOI meta-data information into a XML format that the ANDS Digital Object Identifier service * understands. + * @param doiDTO the DTO carrying the DOI information. * * @return String representation of the XML metadata. * Modified: trunk/src/main/java/au/csiro/pidclient/AndsPidClient.java =================================================================== --- trunk/src/main/java/au/csiro/pidclient/AndsPidClient.java 2014-12-09 06:05:29 UTC (rev 179) +++ trunk/src/main/java/au/csiro/pidclient/AndsPidClient.java 2016-02-18 07:01:34 UTC (rev 180) @@ -42,6 +42,8 @@ import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.RequestEntity; import org.apache.commons.httpclient.methods.StringRequestEntity; +import org.apache.commons.httpclient.protocol.Protocol; +import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -950,8 +952,18 @@ { LOG.debug("Post method URL: " + postMethodURL); LOG.debug("Identity XML: " + identityXML); + + String scheme = "https"; + Protocol baseHttps = Protocol.getProtocol(scheme); + int defaultPort = getPidServicePort(); + ProtocolSocketFactory baseFactory = baseHttps.getSocketFactory(); + ProtocolSocketFactory customFactory = new CustomHttpsSocketFactory(baseFactory); + Protocol customHttps = new Protocol(scheme, customFactory, defaultPort); + Protocol.registerProtocol(scheme, customHttps); + HttpClient client = new HttpClient(); + client.getHostConfiguration().setHost(getPidServiceHost(), getPidServicePort(), customHttps); client.getParams().setParameter("http.useragent", applicationName); client.getParams().setParameter("Content-Type", "text/xml; charset=UTF-8"); Added: trunk/src/main/java/au/csiro/pidclient/CustomHttpsSocketFactory.java =================================================================== --- trunk/src/main/java/au/csiro/pidclient/CustomHttpsSocketFactory.java (rev 0) +++ trunk/src/main/java/au/csiro/pidclient/CustomHttpsSocketFactory.java 2016-02-18 07:01:34 UTC (rev 180) @@ -0,0 +1,115 @@ +/** + * Copyright 2010, CSIRO Australia. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package au.csiro.pidclient; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.Socket; +import java.net.UnknownHostException; + +import javax.net.ssl.SSLSocket; + +import org.apache.commons.httpclient.ConnectTimeoutException; +import org.apache.commons.httpclient.params.HttpConnectionParams; +import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; +import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; + +/** + * This class creates a CustomHttpsSocketFactory that returns a Socket that uses TLSv1.2 only. + * + * Copyright 2016, CSIRO Australia All rights reserved. + * + * @author John Page on 18/02/2016 + * @version $Revision$ $Date$ + */ +public class CustomHttpsSocketFactory implements SecureProtocolSocketFactory +{ + + private final SecureProtocolSocketFactory base; + + /** + * Constructor for creating a CustomHttpsSocketFactory + * + * @param base + * ProtocolSocketFactory + */ + public CustomHttpsSocketFactory(ProtocolSocketFactory base) + { + if (base == null || !(base instanceof SecureProtocolSocketFactory)) + { + throw new IllegalArgumentException(); + } + this.base = (SecureProtocolSocketFactory) base; + } + + private Socket acceptOnlyTLS12(Socket socket) + { + if (!(socket instanceof SSLSocket)) + { + return socket; + } + SSLSocket sslSocket = (SSLSocket) socket; + sslSocket.setEnabledProtocols(new String[] { "TLSv1.2" }); + return sslSocket; + } + + /* + * (non-Javadoc) + * + * @see org.apache.commons.httpclient.protocol.ProtocolSocketFactory#createSocket(java.lang.String, int, + * java.net.InetAddress, int) + */ + public Socket createSocket(String host, int port, InetAddress localAddress, int localPort) throws IOException, + UnknownHostException + { + return acceptOnlyTLS12(base.createSocket(host, port, localAddress, localPort)); + } + + /* + * (non-Javadoc) + * + * @see org.apache.commons.httpclient.protocol.ProtocolSocketFactory#createSocket(java.lang.String, int, + * java.net.InetAddress, int, org.apache.commons.httpclient.params.HttpConnectionParams) + */ + public Socket createSocket(String host, int port, InetAddress localAddress, int localPort, + HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException + { + return acceptOnlyTLS12(base.createSocket(host, port, localAddress, localPort, params)); + } + + /* + * (non-Javadoc) + * + * @see org.apache.commons.httpclient.protocol.ProtocolSocketFactory#createSocket(java.lang.String, int) + */ + public Socket createSocket(String host, int port) throws IOException, UnknownHostException + { + return acceptOnlyTLS12(base.createSocket(host, port)); + } + + /* + * (non-Javadoc) + * + * @see org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory#createSocket(java.net.Socket, + * java.lang.String, int, boolean) + */ + public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, + UnknownHostException + { + return acceptOnlyTLS12(base.createSocket(socket, host, port, autoClose)); + } + +} Property changes on: trunk/src/main/java/au/csiro/pidclient/CustomHttpsSocketFactory.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Revision Date Id \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jde...@us...> - 2014-12-09 06:05:36
|
Revision: 179 http://sourceforge.net/p/andspidclient/code/179 Author: jdempsey Date: 2014-12-09 06:05:29 +0000 (Tue, 09 Dec 2014) Log Message: ----------- CASDA-3585 - Mint DOI - Update library to use slf4j rather than log4j for logging. Modified Paths: -------------- trunk/pom.xml trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java trunk/src/main/java/au/csiro/pidclient/AndsPidClient.java Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2013-10-03 01:12:26 UTC (rev 178) +++ trunk/pom.xml 2014-12-09 06:05:29 UTC (rev 179) @@ -387,24 +387,10 @@ <artifactId>commons-httpclient</artifactId> <version>3.1</version> </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.15</version> - <exclusions> - <exclusion> - <groupId>com.sun.jmx</groupId> - <artifactId>jmxri</artifactId> - </exclusion> - <exclusion> - <groupId>com.sun.jdmk</groupId> - <artifactId>jmxtools</artifactId> - </exclusion> - <exclusion> - <groupId>javax.jms</groupId> - <artifactId>jms</artifactId> - </exclusion> - </exclusions> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.7.7</version> </dependency> <dependency> <groupId>commons-lang</groupId> Modified: trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java =================================================================== --- trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java 2013-10-03 01:12:26 UTC (rev 178) +++ trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java 2014-12-09 06:05:29 UTC (rev 179) @@ -43,7 +43,8 @@ import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.lang.StringUtils; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This is the main interface to the ANDS DOI Client library. It allows the caller to interact with the <a @@ -96,7 +97,7 @@ * * It's name is au.csiro.doiclient.AndsDoiClient */ - public static final Logger LOG = Logger.getLogger(AndsDoiClient.class.getName()); + public static final Logger LOG = LoggerFactory.getLogger(AndsDoiClient.class); /** * Constant that defines the name of properties file to be used. @@ -203,7 +204,7 @@ } catch (IOException e) { - LOG.error(e); + LOG.error("Error closing stream.", e); } } } @@ -867,7 +868,7 @@ } catch (IOException e) { - LOG.error(e); + LOG.error("Error closing reader", e); } } Modified: trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java =================================================================== --- trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java 2013-10-03 01:12:26 UTC (rev 178) +++ trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java 2014-12-09 06:05:29 UTC (rev 179) @@ -26,9 +26,10 @@ import java.io.InputStream; import org.apache.commons.lang.StringUtils; -import org.apache.log4j.Logger; import org.jdom.Document; import org.jdom.JDOMException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import au.csiro.doiclient.business.DoiDTO; @@ -84,7 +85,7 @@ /** * Constant that defines the logger to be used. */ - private static final Logger LOG = Logger.getLogger(DoiMetaDataGenerator.class.getName()); + private static final Logger LOG = LoggerFactory.getLogger(DoiMetaDataGenerator.class); /** * Create a String representation of a DOIMetaData XML document from an DoiDTO bean using a template. Modified: trunk/src/main/java/au/csiro/pidclient/AndsPidClient.java =================================================================== --- trunk/src/main/java/au/csiro/pidclient/AndsPidClient.java 2013-10-03 01:12:26 UTC (rev 178) +++ trunk/src/main/java/au/csiro/pidclient/AndsPidClient.java 2014-12-09 06:05:29 UTC (rev 179) @@ -43,7 +43,8 @@ import org.apache.commons.httpclient.methods.RequestEntity; import org.apache.commons.httpclient.methods.StringRequestEntity; import org.apache.commons.lang.StringUtils; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -98,7 +99,7 @@ /** * Constant that defines the logger to be used. */ - private static final Logger LOG = Logger.getLogger(AndsPidClient.class.getName()); + private static final Logger LOG = LoggerFactory.getLogger(AndsPidClient.class); /** * Constant that defines the name of properties file to be used. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jav...@us...> - 2013-10-03 01:12:27
|
Revision: 178 http://sourceforge.net/p/andspidclient/code/178 Author: javinovich Date: 2013-10-03 01:12:26 +0000 (Thu, 03 Oct 2013) Log Message: ----------- Update urls for our new CI server. Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2012-08-03 04:09:06 UTC (rev 177) +++ trunk/pom.xml 2013-10-03 01:12:26 UTC (rev 178) @@ -78,7 +78,7 @@ <snapshotRepository> <id>snapshots</id> - <url>http://junk-yf:8085/nexus/content/repositories/snapshots</url> + <url>http://jenkins-cdc.it.csiro.au:8085/nexus/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement> <properties> @@ -354,7 +354,7 @@ <ciManagement> <system>hudson</system> - <url>http://junk-yf:8082/</url> + <url>http://jenkins-cdc.it.csiro.au:8080/</url> <notifiers> <notifier> <type>mail</type> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <csi...@us...> - 2012-08-03 04:09:12
|
Revision: 177 http://andspidclient.svn.sourceforge.net/andspidclient/?rev=177&view=rev Author: csirobuilduser Date: 2012-08-03 04:09:06 +0000 (Fri, 03 Aug 2012) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2012-08-03 04:08:55 UTC (rev 176) +++ trunk/pom.xml 2012-08-03 04:09:06 UTC (rev 177) @@ -52,7 +52,7 @@ <groupId>net.sourceforge.andspidclient</groupId> <artifactId>ands-pid-client</artifactId> <packaging>jar</packaging> - <version>1.0.30</version> + <version>1.0.31-SNAPSHOT</version> <name>ands-pid-client</name> <description>A generic client library for accessing the ANDS Persistent Identifier and the DOI services. See the Javadoc report for full details on usage.</description> <url>http://andspidclient.sourceforge.net/</url> @@ -61,9 +61,9 @@ <url>https://sourceforge.net/apps/trac/andspidclient/</url> </issueManagement> <scm> - <connection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/tags/ands-pid-client-1.0.30</connection> - <developerConnection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/tags/ands-pid-client-1.0.30</developerConnection> - <url>http://andspidclient.svn.sourceforge.net/viewvc/andspidclient/tags/ands-pid-client-1.0.30</url> + <connection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/trunk</connection> + <developerConnection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/trunk/</developerConnection> + <url>http://andspidclient.svn.sourceforge.net/viewvc/andspidclient/trunk</url> </scm> <distributionManagement> <site> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <csi...@us...> - 2012-08-03 04:09:01
|
Revision: 176 http://andspidclient.svn.sourceforge.net/andspidclient/?rev=176&view=rev Author: csirobuilduser Date: 2012-08-03 04:08:55 +0000 (Fri, 03 Aug 2012) Log Message: ----------- [maven-release-plugin] copy for tag ands-pid-client-1.0.30 Added Paths: ----------- tags/ands-pid-client-1.0.30/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <csi...@us...> - 2012-08-03 04:08:30
|
Revision: 175 http://andspidclient.svn.sourceforge.net/andspidclient/?rev=175&view=rev Author: csirobuilduser Date: 2012-08-03 04:08:24 +0000 (Fri, 03 Aug 2012) Log Message: ----------- [maven-release-plugin] prepare release ands-pid-client-1.0.30 Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2012-08-03 04:04:35 UTC (rev 174) +++ trunk/pom.xml 2012-08-03 04:08:24 UTC (rev 175) @@ -52,7 +52,7 @@ <groupId>net.sourceforge.andspidclient</groupId> <artifactId>ands-pid-client</artifactId> <packaging>jar</packaging> - <version>1.0.30-SNAPSHOT</version> + <version>1.0.30</version> <name>ands-pid-client</name> <description>A generic client library for accessing the ANDS Persistent Identifier and the DOI services. See the Javadoc report for full details on usage.</description> <url>http://andspidclient.sourceforge.net/</url> @@ -61,9 +61,9 @@ <url>https://sourceforge.net/apps/trac/andspidclient/</url> </issueManagement> <scm> - <connection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/trunk</connection> - <developerConnection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/trunk/</developerConnection> - <url>http://andspidclient.svn.sourceforge.net/viewvc/andspidclient/trunk</url> + <connection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/tags/ands-pid-client-1.0.30</connection> + <developerConnection>scm:svn:https://andspidclient.svn.sourceforge.net/svnroot/andspidclient/tags/ands-pid-client-1.0.30</developerConnection> + <url>http://andspidclient.svn.sourceforge.net/viewvc/andspidclient/tags/ands-pid-client-1.0.30</url> </scm> <distributionManagement> <site> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jav...@us...> - 2012-08-03 04:04:42
|
Revision: 174 http://andspidclient.svn.sourceforge.net/andspidclient/?rev=174&view=rev Author: javinovich Date: 2012-08-03 04:04:35 +0000 (Fri, 03 Aug 2012) Log Message: ----------- DMSTECH-3819: - Use brute force to ignore this unit tests that depend on ANDS PID service. Modified Paths: -------------- trunk/src/test/java/au/csiro/pidclient/TestAndsPidClient.java Modified: trunk/src/test/java/au/csiro/pidclient/TestAndsPidClient.java =================================================================== --- trunk/src/test/java/au/csiro/pidclient/TestAndsPidClient.java 2012-08-03 03:58:27 UTC (rev 173) +++ trunk/src/test/java/au/csiro/pidclient/TestAndsPidClient.java 2012-08-03 04:04:35 UTC (rev 174) @@ -31,7 +31,8 @@ * @author Rita Chen on 8/02/2010 * @version $Revision: 7131 $ $Date: 2010-06-09 14:25:15 +1000 (Wed, 09 Jun 2010) $ */ -public class TestAndsPidClient extends TestCase +public class TestAndsPidClient +//extends TestCase { // /** CSIRO requester info: values required for connecting to PID Service */ // private static final String ANDS_HOST = "test.ands.org.au"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jav...@us...> - 2012-08-03 03:58:34
|
Revision: 173 http://andspidclient.svn.sourceforge.net/andspidclient/?rev=173&view=rev Author: javinovich Date: 2012-08-03 03:58:27 +0000 (Fri, 03 Aug 2012) Log Message: ----------- DMSTECH-3819: - Use brute force to ignore this unit tests that depend on ANDS PID service. Modified Paths: -------------- trunk/src/test/java/au/csiro/pidclient/TestAndsPidClient.java Modified: trunk/src/test/java/au/csiro/pidclient/TestAndsPidClient.java =================================================================== --- trunk/src/test/java/au/csiro/pidclient/TestAndsPidClient.java 2012-08-03 03:11:20 UTC (rev 172) +++ trunk/src/test/java/au/csiro/pidclient/TestAndsPidClient.java 2012-08-03 03:58:27 UTC (rev 173) @@ -33,589 +33,589 @@ */ public class TestAndsPidClient extends TestCase { - /** CSIRO requester info: values required for connecting to PID Service */ - private static final String ANDS_HOST = "test.ands.org.au"; - private static final int ANDS_PORT = 8443; - private static final String ANDS_PATH = "/pids"; - private static final String APPID = "29bbb99a7a2446df5bf38a59631b2ca497730c9a"; - private static final String IDENTIFIER = "wron-repository-unit-tests"; - private static final String AUTHDOMAIN = "csiro.au"; - private static String TESTING_HANDLE = ""; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception - { - super.setUp(); - // create a new handle, since we may run into a limit on the number of values we can associate with the one - // handle. - if ("".equals(TESTING_HANDLE)) // limit the number of handles we make - { - AndsPidClient client = this.createDummyANDPIDClient(); - AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, - "http://test.org.au"); - TESTING_HANDLE = response.getHandle(); - } - } - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() throws Exception - { - super.tearDown(); - } - - /** - * Create a ANDPersistentIdentifierClient using CSIRO requester info - * - * @return a valid ANDPersistentIdentifierClient - */ - private AndsPidClient createDummyANDPIDClient() - { - return new AndsPidClient(ANDS_HOST, ANDS_PORT, ANDS_PATH, APPID, IDENTIFIER, AUTHDOMAIN); - } - - /** - * Creates a dummy index value associated with the testing handle - * - * @param client - * client class for calling the ANDS Persistent Identifier service - * @return the index of the dummy value added to the handle, -1 if a dummy value was not added. - */ - private int createDummyIndexValue(AndsPidClient client) throws Exception - { - AndsPidResponse response = client.addValueFormattedResponse(TESTING_HANDLE, HandleType.URL, - "http://test.org.au/createDummyIndex"); - - for (AndsPidResponseProperty responseProperty : response.getProperties()) - { - if ("http://test.org.au/createDummyIndex".equals(responseProperty.getValue())) - { - return responseProperty.getIndex(); - } - } - return -1; - } - - /** - * Finds an unused index of the testing handle, an used index is one with no associated value - * - * @param client - * client class for calling the ANDS Persistent Identifier service - * @return an index with no associated value - */ - private int findUnusedIndex(AndsPidClient client) throws Exception - { - AndsPidResponse response = client.getHandleFormattedResponse(TESTING_HANDLE); - - // create a set of all the indexes associated with our testing handle. - Set<Integer> set = new HashSet<Integer>(); - for (AndsPidResponseProperty property : response.getProperties()) - { - set.add(new Integer(property.getIndex())); - } - - // find the first index from 0->99 that is not in our set (i.e. not associated with our testing handle) - int unusedIndex = 0; - for (; unusedIndex < 100; unusedIndex++) - { - if (set.contains(new Integer(unusedIndex)) == false) - { - break; - } - } - - return unusedIndex; - } - - /** - * Test connection cannot be established with invalid appId - * - * @throws Exception - */ - public final void testInvalidAppId() throws Exception - { - AndsPidClient client = new AndsPidClient(ANDS_HOST, ANDS_PORT, ANDS_PATH, APPID - + "123", IDENTIFIER, AUTHDOMAIN); - - String response = client.mintHandle(HandleType.URL, "http://test.org.au"); - - // we should not be able to mint a handle with an invalid appId. - assertTrue("Operation failure expectd, but response indicated success", response - .indexOf("Authentication Failed") != -1); - } - - /** - * Test connection can be established with valid appId - * - * @throws Exception - */ - public final void testValidAppId() throws Exception - { - AndsPidClient client = createDummyANDPIDClient(); - - AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, - "http://test.org.au"); - - // should succeed - assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); - } - - /** - * Test mint service: method responsible for the creation of a handle - * - * @throws Exception - */ - public final void testMintValue() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, - "http://test.org.au"); - - // should succeed - assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); - - // handle should be minted - assertTrue("Response didn't contain handle info", !(response.getHandle() - .equals(AndsPidResponse.NO_HANDLE_FOUND))); - - // whether value we specified was actually minted - boolean found = false; - for (AndsPidResponseProperty responseProperty : response.getProperties()) - { - if ("http://test.org.au".equals(responseProperty.getValue())) - { - found = true; - } - } - assertTrue("Could not find the value that was added in the response", found); - } - - /** - * Test mint service without specifying a value: method responsible for the creation of a handle - * - * @throws Exception - */ - public final void testMintValueWithoutValue() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.EMPTY, - ""); - - // should succeed - assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); - - // handle should be minted - assertTrue("Response didn't contain handle info", !(response.getHandle() - .equals(AndsPidResponse.NO_HANDLE_FOUND))); - - // handle should not have a value - assertTrue("Response contained index info", response.getProperties().size() == 0); - } - - /** - * Test mint service: method responsible for the creation of a handle with - * an invalid URL. - * - * @throws Exception - */ - public final void testMintHandleInvalidUrlValue() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, - "www.test.org.au"); - - // should fail - assertFalse("Operation failure expected, but response indicated success", response.isSuccess()); - - // check response message - assertTrue("Response message incorrect - " + response.getMessage(), response.getMessage() - .equals("The URL provided is invalid or not supported by this service")); - } - - /** - * Test mint service: method responsible for the creation of a handle - * with a valid URL. - * @throws Exception - */ - public final void testMintHandleValidUrlValue() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, - "http://test.org.au"); - - // should fail - assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); - - // check response message - assertTrue("Response message incorrect - " + response.getMessage(), response.getMessage() - .equals("Successfully authenticated and created handle")); - } - - /** - * Test mint service with an invalid index: method responsible for the creation of a handle with - * an invalid index. - * - * @throws Exception - */ - public final void testMintHandleInvalidIndexValue() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - int index = -1; // negative indexes are invalid - - AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, index, - "http://test.org.au"); - - // should fail. - assertFalse("Operation failure expected, but response indicated success", response.isSuccess()); - - // check response message - assertTrue("Response message incorrect - " + response.getMessage(), response.getMessage() - .equals("Index must be numeric")); - } - - /** - * Test mint service with a valid index: method responsible for the creation of a handle with - * and invalid index. - * - * @throws Exception - */ - public final void testMintHandleValidIndexValue() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - // ensure we don't have a value at some given index, e.g. 1 - int index = 1; - client.deleteValueByIndex(TESTING_HANDLE, index); - - AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, index, - "http://test.org.au"); - - // we should be able to mint a value at an index that does not contain a value. - assertTrue("Operation should not succeed, but response indicated success", response.isSuccess()); - - // whether value we specified was actually minted - boolean found = false; - for (AndsPidResponseProperty responseProperty : response.getProperties()) - { - if ("http://test.org.au".equals(responseProperty.getValue())) - { - found = true; - } - } - assertTrue("Could not find the value that was added in the response", found); - } - - /** - * Test addValue service: method responsible for adding a value to an existing handle - * - * @throws Exception - */ - public final void testAddValue() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - AndsPidResponse response = client.addValueFormattedResponse(TESTING_HANDLE, HandleType.URL, - "http://test.org.au/addValue"); - - // should succeed - assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); - - // handle should not alter - assertEquals("Response didn't have the same handle", response.getHandle(), TESTING_HANDLE); - - // whether value we specified was actually added - boolean found = false; - for (AndsPidResponseProperty responseProperty : response.getProperties()) - { - if ("http://test.org.au/addValue".equals(responseProperty.getValue())) - { - found = true; - } - } - assertTrue("Could not find the value that was added in the response", found); - } - - /** - * Test addValueByIndex service with an invalid index: method responsible for adding a value to the index of an - * existing handle - * - * @throws Exception - */ - public final void testAddValueByIndexInvalidIndex() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - int index = createDummyIndexValue(client); // get an index with a value associated with it - - AndsPidResponse response = client.addValueByIndexFormattedResponse(TESTING_HANDLE, index, HandleType.URL, - "http://test.org.au/addValueByIndex"); - - // we should not be able to add a value at an index that already contains a value. - assertFalse("Operation should not succeed, but response indicated success", response.isSuccess()); - - // check response message - // assertTrue("Response message incorrect - " + response.getMessage(), - // response.getMessage().equals("Request Failed. Index is reserved or in use")); - } - - /** - * Test addValueByIndex service with a valid index: method responsible for adding a value to the index of an - * existing handle - * - * @throws Exception - */ - public final void testAddValueByIndexValidIndex() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - // ensure we don't have a value at the some given index, e.g. 1 - int index = 1; - client.deleteValueByIndex(TESTING_HANDLE, index); - - AndsPidResponse response = client.addValueByIndexFormattedResponse(TESTING_HANDLE, index, HandleType.URL, - "http://test.org.au/addValueByIndex"); - - // we should be able to add a value at an index that does not contains a value. - assertTrue("Operation should not succeed, but response indicated success", response.isSuccess()); - - // handle should not alter - assertEquals("Response didn't have the same handle", response.getHandle(), TESTING_HANDLE); - - // whether value we specified was actually added - boolean found = false; - for (AndsPidResponseProperty responseProperty : response.getProperties()) - { - if ("http://test.org.au/addValueByIndex".equals(responseProperty.getValue())) - { - found = true; - } - } - assertTrue("Could not find the value that was added in the response", found); - } - - /** - * Test modifyValueByIndex service: method responsible for changing a value associated with an existing handle - * - * @throws Exception - */ - public final void XXtestModifyValueByIndex() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - int index = createDummyIndexValue(client); // get an index with a value associated with it - - String goodValue = "http://javatest2.vm.csiro.au:8080/muradora/objectView.action?parentId=procite%3ApublicData&type=1&pid=csiro%3ADocument004"; - - AndsPidResponse response = client.modifyValueByIndexFormattedResponse(TESTING_HANDLE, index, - goodValue); - - // should succeed - assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); - - // handle should not alter - assertEquals("Response didn't have the same handle", response.getHandle(), TESTING_HANDLE); - - // whether index value was changed - boolean found = false; - for (AndsPidResponseProperty property : response.getProperties()) - { - if (property.getIndex() == index) - { - found = true; - assertEquals("The value associated with index: " + index + " was not updated by modifyValueByIndex", - property.getValue(), goodValue); - } - } - if (!found) - { - fail("Could not find index that was updated by modifyValueByIndex"); - } - } - - /** - * Test modifyValueByIndex service with an invalid index: method responsible for changing a value associated with an existing handle - * - * @throws Exception - */ - public final void testModifyValueByInvalidIndex() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - int index = this.findUnusedIndex(client); // get an index with no value associated with it - - AndsPidResponse response = client.modifyValueByIndexFormattedResponse(TESTING_HANDLE, index, - "http://test.org.au/modifyValueByIndex"); - - // we should not be able to modify a value at an index that does not contains a value. - assertFalse("Operation should not succeed, but response indicated success", response.isSuccess()); - - // check response message - assertTrue("Response message incorrect - " + response.getMessage(), response.getMessage() - .equals("Either this type of value is not allowed to be modified, a value does not exist at the provided index, or the value is not valid for the type")); - } - - /** - * Test deleteValueByIndex service: method responsible for deleting a value associated with an existing handle - * - * @throws Exception - */ - public final void XXtestDeleteValueByIndex() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - int index = createDummyIndexValue(client); // get an index with a value associated with it - - AndsPidResponse response = client.deleteValueByIndexFormattedResponse(TESTING_HANDLE, index); - - // should succeed - // assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); - - // handle should not alter - assertEquals("Response didn't have the same handle", response.getHandle(), TESTING_HANDLE); - - // whether index was deleted - boolean found = false; - for (AndsPidResponseProperty property : response.getProperties()) - { - if (property.getIndex() == index) - { - found = true; - } - } - assertFalse("Index and value still exist after they were deleted by modifyValueByIndex", found); - } - - /** - * Test deleteValueByIndex service with an invalid index: method responsible for deleting a value associated with an existing handle - * - * @throws Exception - */ - public final void testDeleteValueByInvalidIndex() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - int index = this.findUnusedIndex(client); // get an index with no value associated with it - - AndsPidResponse response = client.deleteValueByIndexFormattedResponse(TESTING_HANDLE, index); - - // we should not be able to delete a value at an index that does not contains a value. - assertFalse("Operation should not succeed, but response indicated success", response.isSuccess()); - - // check response message - assertTrue( - "Response message incorrect - " + response.getMessage(), - response - .getMessage() - .equals( - "Either this type of value is not allowed to be deleted, or a value does not exist at the provided index")); - } - -// This test has been removed, it does not provide us with much and can take up to 10 min+ to run. +// /** CSIRO requester info: values required for connecting to PID Service */ +// private static final String ANDS_HOST = "test.ands.org.au"; +// private static final int ANDS_PORT = 8443; +// private static final String ANDS_PATH = "/pids"; +// private static final String APPID = "29bbb99a7a2446df5bf38a59631b2ca497730c9a"; +// private static final String IDENTIFIER = "wron-repository-unit-tests"; +// private static final String AUTHDOMAIN = "csiro.au"; +// private static String TESTING_HANDLE = ""; +// +// /* +// * (non-Javadoc) +// * +// * @see junit.framework.TestCase#setUp() +// */ +// protected void setUp() throws Exception +// { +// super.setUp(); +// // create a new handle, since we may run into a limit on the number of values we can associate with the one +// // handle. +// if ("".equals(TESTING_HANDLE)) // limit the number of handles we make +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, +// "http://test.org.au"); +// TESTING_HANDLE = response.getHandle(); +// } +// } +// +// /* +// * (non-Javadoc) +// * +// * @see junit.framework.TestCase#tearDown() +// */ +// protected void tearDown() throws Exception +// { +// super.tearDown(); +// } +// // /** -// * Test listHandles service: method responsible for listing the handles owned by the requestor. -// * <p> -// * Note: this test may take awhile to run. +// * Create a ANDPersistentIdentifierClient using CSIRO requester info // * +// * @return a valid ANDPersistentIdentifierClient +// */ +// private AndsPidClient createDummyANDPIDClient() +// { +// return new AndsPidClient(ANDS_HOST, ANDS_PORT, ANDS_PATH, APPID, IDENTIFIER, AUTHDOMAIN); +// } +// +// /** +// * Creates a dummy index value associated with the testing handle +// * +// * @param client +// * client class for calling the ANDS Persistent Identifier service +// * @return the index of the dummy value added to the handle, -1 if a dummy value was not added. +// */ +// private int createDummyIndexValue(AndsPidClient client) throws Exception +// { +// AndsPidResponse response = client.addValueFormattedResponse(TESTING_HANDLE, HandleType.URL, +// "http://test.org.au/createDummyIndex"); +// +// for (AndsPidResponseProperty responseProperty : response.getProperties()) +// { +// if ("http://test.org.au/createDummyIndex".equals(responseProperty.getValue())) +// { +// return responseProperty.getIndex(); +// } +// } +// return -1; +// } +// +// /** +// * Finds an unused index of the testing handle, an used index is one with no associated value +// * +// * @param client +// * client class for calling the ANDS Persistent Identifier service +// * @return an index with no associated value +// */ +// private int findUnusedIndex(AndsPidClient client) throws Exception +// { +// AndsPidResponse response = client.getHandleFormattedResponse(TESTING_HANDLE); +// +// // create a set of all the indexes associated with our testing handle. +// Set<Integer> set = new HashSet<Integer>(); +// for (AndsPidResponseProperty property : response.getProperties()) +// { +// set.add(new Integer(property.getIndex())); +// } +// +// // find the first index from 0->99 that is not in our set (i.e. not associated with our testing handle) +// int unusedIndex = 0; +// for (; unusedIndex < 100; unusedIndex++) +// { +// if (set.contains(new Integer(unusedIndex)) == false) +// { +// break; +// } +// } +// +// return unusedIndex; +// } +// +// /** +// * Test connection cannot be established with invalid appId +// * // * @throws Exception // */ -// public final void testListHandles() throws Exception +// public final void testInvalidAppId() throws Exception // { +// AndsPidClient client = new AndsPidClient(ANDS_HOST, ANDS_PORT, ANDS_PATH, APPID +// + "123", IDENTIFIER, AUTHDOMAIN); +// +// String response = client.mintHandle(HandleType.URL, "http://test.org.au"); +// +// // we should not be able to mint a handle with an invalid appId. +// assertTrue("Operation failure expectd, but response indicated success", response +// .indexOf("Authentication Failed") != -1); +// } +// +// /** +// * Test connection can be established with valid appId +// * +// * @throws Exception +// */ +// public final void testValidAppId() throws Exception +// { +// AndsPidClient client = createDummyANDPIDClient(); +// +// AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, +// "http://test.org.au"); +// +// // should succeed +// assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); +// } +// +// /** +// * Test mint service: method responsible for the creation of a handle +// * +// * @throws Exception +// */ +// public final void testMintValue() throws Exception +// { // AndsPidClient client = this.createDummyANDPIDClient(); // -// AndsPidResponse response = client.listHandlesFormattedResponse(); +// AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, +// "http://test.org.au"); +// +// // should succeed +// assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); +// +// // handle should be minted +// assertTrue("Response didn't contain handle info", !(response.getHandle() +// .equals(AndsPidResponse.NO_HANDLE_FOUND))); +// +// // whether value we specified was actually minted +// boolean found = false; +// for (AndsPidResponseProperty responseProperty : response.getProperties()) +// { +// if ("http://test.org.au".equals(responseProperty.getValue())) +// { +// found = true; +// } +// } +// assertTrue("Could not find the value that was added in the response", found); +// } +// +// /** +// * Test mint service without specifying a value: method responsible for the creation of a handle +// * +// * @throws Exception +// */ +// public final void testMintValueWithoutValue() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); // +// AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.EMPTY, +// ""); +// // // should succeed // assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); // -// // there must be at least 1 handle associated with the current requestor (i.e. we minted a handle in setUp() method) -// assertTrue("Response didn't have a handle", !response.getHandles().isEmpty()); +// // handle should be minted +// assertTrue("Response didn't contain handle info", !(response.getHandle() +// .equals(AndsPidResponse.NO_HANDLE_FOUND))); +// +// // handle should not have a value +// assertTrue("Response contained index info", response.getProperties().size() == 0); // } - - /** - * Test getHandle service: method responsible for retrieving the values associated with a handle - * - * @throws Exception - */ - public final void testGetHandle() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - AndsPidResponse response = client.getHandleFormattedResponse(TESTING_HANDLE); - - // should succeed - assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); - - // handle should not alter - assertEquals("Response didn't have the same handle", response.getHandle(), TESTING_HANDLE); - } - - /** - * Test getHandle service with an invalid handle: method responsible for retrieving the values associated with a handle - * - * @throws Exception - */ - public final void testGetInvalidHandle() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - AndsPidResponse response = client.getHandleFormattedResponse("XXXXXX"); // an invalid handle - - // we should not be able to retrieve a handle that does not exist - assertFalse("Operation should not succeed, but response indicated success", response.isSuccess()); - - // check response message - assertTrue("Response message incorrect - " + response.getMessage(), response.getMessage() - .equals("The handle: XXXXXX was not found")); - } - - /** - * Test connection with an invalid AndsPidClient - * - * @throws Exception - */ - public final void testInvalidConnection() throws Exception - { - AndsPidClient client = new AndsPidClient(); - - try - { - client.mintHandle(HandleType.URL, "http://test.org.au"); - fail("Expected IllegalStateException when using no-args AndsPidClient constructor"); - } - catch (IllegalStateException ise) - { - // ignore this because it means the test passed! - } - } - - /** - * Test connection with an invalid Handle - * - * @throws Exception - */ - public final void testInvalidHandle() throws Exception - { - AndsPidClient client = this.createDummyANDPIDClient(); - - try - { - client.mintHandle(null, "http://test.org.au"); // null is an invalid handle - fail("Expected IllegalStateException when using no-args AndsPidClient constructor"); - } - catch (IllegalArgumentException iae) - { - // ignore this because it means the test passed! - } - } +// +// /** +// * Test mint service: method responsible for the creation of a handle with +// * an invalid URL. +// * +// * @throws Exception +// */ +// public final void testMintHandleInvalidUrlValue() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, +// "www.test.org.au"); +// +// // should fail +// assertFalse("Operation failure expected, but response indicated success", response.isSuccess()); +// +// // check response message +// assertTrue("Response message incorrect - " + response.getMessage(), response.getMessage() +// .equals("The URL provided is invalid or not supported by this service")); +// } +// +// /** +// * Test mint service: method responsible for the creation of a handle +// * with a valid URL. +// * @throws Exception +// */ +// public final void testMintHandleValidUrlValue() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, +// "http://test.org.au"); +// +// // should fail +// assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); +// +// // check response message +// assertTrue("Response message incorrect - " + response.getMessage(), response.getMessage() +// .equals("Successfully authenticated and created handle")); +// } +// +// /** +// * Test mint service with an invalid index: method responsible for the creation of a handle with +// * an invalid index. +// * +// * @throws Exception +// */ +// public final void testMintHandleInvalidIndexValue() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// int index = -1; // negative indexes are invalid +// +// AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, index, +// "http://test.org.au"); +// +// // should fail. +// assertFalse("Operation failure expected, but response indicated success", response.isSuccess()); +// +// // check response message +// assertTrue("Response message incorrect - " + response.getMessage(), response.getMessage() +// .equals("Index must be numeric")); +// } +// +// /** +// * Test mint service with a valid index: method responsible for the creation of a handle with +// * and invalid index. +// * +// * @throws Exception +// */ +// public final void testMintHandleValidIndexValue() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// // ensure we don't have a value at some given index, e.g. 1 +// int index = 1; +// client.deleteValueByIndex(TESTING_HANDLE, index); +// +// AndsPidResponse response = client.mintHandleFormattedResponse(HandleType.URL, index, +// "http://test.org.au"); +// +// // we should be able to mint a value at an index that does not contain a value. +// assertTrue("Operation should not succeed, but response indicated success", response.isSuccess()); +// +// // whether value we specified was actually minted +// boolean found = false; +// for (AndsPidResponseProperty responseProperty : response.getProperties()) +// { +// if ("http://test.org.au".equals(responseProperty.getValue())) +// { +// found = true; +// } +// } +// assertTrue("Could not find the value that was added in the response", found); +// } +// +// /** +// * Test addValue service: method responsible for adding a value to an existing handle +// * +// * @throws Exception +// */ +// public final void testAddValue() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// AndsPidResponse response = client.addValueFormattedResponse(TESTING_HANDLE, HandleType.URL, +// "http://test.org.au/addValue"); +// +// // should succeed +// assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); +// +// // handle should not alter +// assertEquals("Response didn't have the same handle", response.getHandle(), TESTING_HANDLE); +// +// // whether value we specified was actually added +// boolean found = false; +// for (AndsPidResponseProperty responseProperty : response.getProperties()) +// { +// if ("http://test.org.au/addValue".equals(responseProperty.getValue())) +// { +// found = true; +// } +// } +// assertTrue("Could not find the value that was added in the response", found); +// } +// +// /** +// * Test addValueByIndex service with an invalid index: method responsible for adding a value to the index of an +// * existing handle +// * +// * @throws Exception +// */ +// public final void testAddValueByIndexInvalidIndex() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// int index = createDummyIndexValue(client); // get an index with a value associated with it +// +// AndsPidResponse response = client.addValueByIndexFormattedResponse(TESTING_HANDLE, index, HandleType.URL, +// "http://test.org.au/addValueByIndex"); +// +// // we should not be able to add a value at an index that already contains a value. +// assertFalse("Operation should not succeed, but response indicated success", response.isSuccess()); +// +// // check response message +// // assertTrue("Response message incorrect - " + response.getMessage(), +// // response.getMessage().equals("Request Failed. Index is reserved or in use")); +// } +// +// /** +// * Test addValueByIndex service with a valid index: method responsible for adding a value to the index of an +// * existing handle +// * +// * @throws Exception +// */ +// public final void testAddValueByIndexValidIndex() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// // ensure we don't have a value at the some given index, e.g. 1 +// int index = 1; +// client.deleteValueByIndex(TESTING_HANDLE, index); +// +// AndsPidResponse response = client.addValueByIndexFormattedResponse(TESTING_HANDLE, index, HandleType.URL, +// "http://test.org.au/addValueByIndex"); +// +// // we should be able to add a value at an index that does not contains a value. +// assertTrue("Operation should not succeed, but response indicated success", response.isSuccess()); +// +// // handle should not alter +// assertEquals("Response didn't have the same handle", response.getHandle(), TESTING_HANDLE); +// +// // whether value we specified was actually added +// boolean found = false; +// for (AndsPidResponseProperty responseProperty : response.getProperties()) +// { +// if ("http://test.org.au/addValueByIndex".equals(responseProperty.getValue())) +// { +// found = true; +// } +// } +// assertTrue("Could not find the value that was added in the response", found); +// } +// +// /** +// * Test modifyValueByIndex service: method responsible for changing a value associated with an existing handle +// * +// * @throws Exception +// */ +// public final void XXtestModifyValueByIndex() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// int index = createDummyIndexValue(client); // get an index with a value associated with it +// +// String goodValue = "http://javatest2.vm.csiro.au:8080/muradora/objectView.action?parentId=procite%3ApublicData&type=1&pid=csiro%3ADocument004"; +// +// AndsPidResponse response = client.modifyValueByIndexFormattedResponse(TESTING_HANDLE, index, +// goodValue); +// +// // should succeed +// assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); +// +// // handle should not alter +// assertEquals("Response didn't have the same handle", response.getHandle(), TESTING_HANDLE); +// +// // whether index value was changed +// boolean found = false; +// for (AndsPidResponseProperty property : response.getProperties()) +// { +// if (property.getIndex() == index) +// { +// found = true; +// assertEquals("The value associated with index: " + index + " was not updated by modifyValueByIndex", +// property.getValue(), goodValue); +// } +// } +// if (!found) +// { +// fail("Could not find index that was updated by modifyValueByIndex"); +// } +// } +// +// /** +// * Test modifyValueByIndex service with an invalid index: method responsible for changing a value associated with an existing handle +// * +// * @throws Exception +// */ +// public final void testModifyValueByInvalidIndex() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// int index = this.findUnusedIndex(client); // get an index with no value associated with it +// +// AndsPidResponse response = client.modifyValueByIndexFormattedResponse(TESTING_HANDLE, index, +// "http://test.org.au/modifyValueByIndex"); +// +// // we should not be able to modify a value at an index that does not contains a value. +// assertFalse("Operation should not succeed, but response indicated success", response.isSuccess()); +// +// // check response message +// assertTrue("Response message incorrect - " + response.getMessage(), response.getMessage() +// .equals("Either this type of value is not allowed to be modified, a value does not exist at the provided index, or the value is not valid for the type")); +// } +// +// /** +// * Test deleteValueByIndex service: method responsible for deleting a value associated with an existing handle +// * +// * @throws Exception +// */ +// public final void XXtestDeleteValueByIndex() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// int index = createDummyIndexValue(client); // get an index with a value associated with it +// +// AndsPidResponse response = client.deleteValueByIndexFormattedResponse(TESTING_HANDLE, index); +// +// // should succeed +// // assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); +// +// // handle should not alter +// assertEquals("Response didn't have the same handle", response.getHandle(), TESTING_HANDLE); +// +// // whether index was deleted +// boolean found = false; +// for (AndsPidResponseProperty property : response.getProperties()) +// { +// if (property.getIndex() == index) +// { +// found = true; +// } +// } +// assertFalse("Index and value still exist after they were deleted by modifyValueByIndex", found); +// } +// +// /** +// * Test deleteValueByIndex service with an invalid index: method responsible for deleting a value associated with an existing handle +// * +// * @throws Exception +// */ +// public final void testDeleteValueByInvalidIndex() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// int index = this.findUnusedIndex(client); // get an index with no value associated with it +// +// AndsPidResponse response = client.deleteValueByIndexFormattedResponse(TESTING_HANDLE, index); +// +// // we should not be able to delete a value at an index that does not contains a value. +// assertFalse("Operation should not succeed, but response indicated success", response.isSuccess()); +// +// // check response message +// assertTrue( +// "Response message incorrect - " + response.getMessage(), +// response +// .getMessage() +// .equals( +// "Either this type of value is not allowed to be deleted, or a value does not exist at the provided index")); +// } +// +//// This test has been removed, it does not provide us with much and can take up to 10 min+ to run. +//// /** +//// * Test listHandles service: method responsible for listing the handles owned by the requestor. +//// * <p> +//// * Note: this test may take awhile to run. +//// * +//// * @throws Exception +//// */ +//// public final void testListHandles() throws Exception +//// { +//// AndsPidClient client = this.createDummyANDPIDClient(); +//// +//// AndsPidResponse response = client.listHandlesFormattedResponse(); +//// +//// // should succeed +//// assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); +//// +//// // there must be at least 1 handle associated with the current requestor (i.e. we minted a handle in setUp() method) +//// assertTrue("Response didn't have a handle", !response.getHandles().isEmpty()); +//// } +// +// /** +// * Test getHandle service: method responsible for retrieving the values associated with a handle +// * +// * @throws Exception +// */ +// public final void testGetHandle() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// AndsPidResponse response = client.getHandleFormattedResponse(TESTING_HANDLE); +// +// // should succeed +// assertTrue("Operation success expected, but response indicated failure", response.isSuccess()); +// +// // handle should not alter +// assertEquals("Response didn't have the same handle", response.getHandle(), TESTING_HANDLE); +// } +// +// /** +// * Test getHandle service with an invalid handle: method responsible for retrieving the values associated with a handle +// * +// * @throws Exception +// */ +// public final void testGetInvalidHandle() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// AndsPidResponse response = client.getHandleFormattedResponse("XXXXXX"); // an invalid handle +// +// // we should not be able to retrieve a handle that does not exist +// assertFalse("Operation should not succeed, but response indicated success", response.isSuccess()); +// +// // check response message +// assertTrue("Response message incorrect - " + response.getMessage(), response.getMessage() +// .equals("The handle: XXXXXX was not found")); +// } +// +// /** +// * Test connection with an invalid AndsPidClient +// * +// * @throws Exception +// */ +// public final void testInvalidConnection() throws Exception +// { +// AndsPidClient client = new AndsPidClient(); +// +// try +// { +// client.mintHandle(HandleType.URL, "http://test.org.au"); +// fail("Expected IllegalStateException when using no-args AndsPidClient constructor"); +// } +// catch (IllegalStateException ise) +// { +// // ignore this because it means the test passed! +// } +// } +// +// /** +// * Test connection with an invalid Handle +// * +// * @throws Exception +// */ +// public final void testInvalidHandle() throws Exception +// { +// AndsPidClient client = this.createDummyANDPIDClient(); +// +// try +// { +// client.mintHandle(null, "http://test.org.au"); // null is an invalid handle +// fail("Expected IllegalStateException when using no-args AndsPidClient constructor"); +// } +// catch (IllegalArgumentException iae) +// { +// // ignore this because it means the test passed! +// } +// } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jav...@us...> - 2012-08-03 03:11:26
|
Revision: 172 http://andspidclient.svn.sourceforge.net/andspidclient/?rev=172&view=rev Author: javinovich Date: 2012-08-03 03:11:20 +0000 (Fri, 03 Aug 2012) Log Message: ----------- DMSTECH-3819: - Update javadoc as per DAPCRU-152 Review Modified Paths: -------------- trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java Modified: trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java =================================================================== --- trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java 2012-08-02 02:17:06 UTC (rev 171) +++ trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java 2012-08-03 03:11:20 UTC (rev 172) @@ -290,6 +290,7 @@ * @param debug * Optional parameter. Activates debug flag for WS call false => debug=false will be passed true => * debug=true will be passed If ommitted no debug flag will be added to request + * See {@link AndsDoiClient} general documentation for details * @return AndsDoiResponse {@link AndsDoiResponse} Response object holding the components of the response. * @throws IllegalStateException * thrown if the parameters need to call the ANDS DOI service have not been provided. @@ -335,6 +336,7 @@ * false => debug=false will be passed * true => debug=true will be passed * If ommitted no debug flag will be added to request + * See {@link AndsDoiClient} general documentation for details * @return AndsDoiResponse {@link AndsDoiResponse} Response object holding the components of the response. * @throws IllegalStateException * thrown if the parameters need to call the ANDS DOI service have not been provided. @@ -369,6 +371,7 @@ * false => debug=false will be passed * true => debug=true will be passed * If ommitted no debug flag will be added to request + * See {@link AndsDoiClient} general documentation for details * @return AndsDoiResponse {@link AndsDoiResponse} Response object holding the components of the response. * @throws IllegalStateException * thrown if the parameters need to call the ANDS DOI service have not been provided. @@ -406,6 +409,7 @@ * false => debug=false will be passed * true => debug=true will be passed * If ommitted no debug flag will be added to request + * See {@link AndsDoiClient} general documentation for details * @return AndsDoiResponse {@link AndsDoiResponse} Response object holding the components of the response. * @throws IllegalStateException * thrown if the parameters need to call the ANDS DOI service have not been provided. @@ -458,6 +462,7 @@ * false => debug=false will be passed * true => debug=true will be passed * If ommitted no debug flag will be added to request + * See {@link AndsDoiClient} general documentation for details * @return AndsDoiResponse {@link AndsDoiResponse} Response object holding the components of the response. * @throws IllegalStateException * thrown if the parameters need to call the ANDS DOI service have not been provided. @@ -514,10 +519,13 @@ * @param doi * that needs to be activated/ deactivated. * @param activate - * boolean flag indicating whether to activate or deactivate. * @param debug Optional parameter. - * Activates debug flag for WS call false => debug=false will be passed true => debug=true will be passed + * boolean flag indicating whether to activate or deactivate. + * @param debug Optional parameter. + * Activates debug flag for WS call + * false => debug=false will be passed + * true => debug=true will be passed * If ommitted no debug flag will be added to request - * + * See {@link AndsDoiClient} general documentation for details * @return AndsDoiResponse {@link AndsDoiResponse} Response object holding the components of the response. * @throws IllegalStateException * thrown if the parameters need to call the ANDS DOI service have not been provided. @@ -557,7 +565,8 @@ * Optional parameter. Activates debug flag for WS call * false => debug=false will be passed * true => debug=true will be passed - * If ommitted no debug flag will be added to request + * If ommitted no debug flag will be added to request + * See {@link AndsDoiClient} general documentation for details * @throws IllegalStateException * thrown if the parameters need to call the ANDS DOI service have not been provided. * @throws IllegalArgumentException @@ -584,8 +593,12 @@ * @param doi * DOI for which the meta-data is requested. * @param debug - * Optional parameter. Activates debug flag for WS call false => debug=false will be passed true => - * debug=true will be passed If ommitted no debug flag will be added to request + * Optional parameter. + * Activates debug flag for WS call + * false => debug=false will be passed + * true => debug=true will be passed + * If ommitted no debug flag will be added to request + * See {@link AndsDoiClient} general documentation for details * @throws IllegalStateException * thrown if the parameters need to call the ANDS DOI service have not been provided. * @throws IllegalArgumentException This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jav...@us...> - 2012-08-02 02:17:14
|
Revision: 171 http://andspidclient.svn.sourceforge.net/andspidclient/?rev=171&view=rev Author: javinovich Date: 2012-08-02 02:17:06 +0000 (Thu, 02 Aug 2012) Log Message: ----------- DMSTECH-3773: - Update DOI client to be compliant with XML interface for ANDS DOI Service 1.1 - XML request used in minting and updating DOI is now validated against DataCite Metadata Schema v 2.2 before being sent to ANDS DOI service. - Response codes are now used to determine if an operation completed successfully. Modified Paths: -------------- trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java trunk/src/main/java/au/csiro/doiclient/AndsDoiResponse.java trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java trunk/src/main/resources/DoiMetadataTemplate.xml trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java Added Paths: ----------- trunk/src/main/resources/schema/ trunk/src/main/resources/schema/include/ trunk/src/main/resources/schema/include/datacite-contributorType-v2.xsd trunk/src/main/resources/schema/include/datacite-dateType-v2.xsd trunk/src/main/resources/schema/include/datacite-descriptionType-v2.xsd trunk/src/main/resources/schema/include/datacite-relatedIdentifierType-v2.xsd trunk/src/main/resources/schema/include/datacite-relationType-v2.xsd trunk/src/main/resources/schema/include/datacite-resourceType-v2.xsd trunk/src/main/resources/schema/include/datacite-titleType-v2.xsd trunk/src/main/resources/schema/metadata.xsd Modified: trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java =================================================================== --- trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java 2012-07-30 07:46:49 UTC (rev 170) +++ trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java 2012-08-02 02:17:06 UTC (rev 171) @@ -15,6 +15,11 @@ */ package au.csiro.doiclient; +import au.csiro.doiclient.business.AndsDoiIdentity; +import au.csiro.doiclient.business.DoiDTO; +import au.csiro.doiclient.utils.DoiMetaDataGenerator; +import au.csiro.doiclient.utils.HttpUtil; +import au.csiro.pidclient.AndsPidClient.HandleType; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -22,14 +27,16 @@ import java.net.URLEncoder; import java.text.MessageFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; - import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.HttpMethod; +import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.HttpURL; import org.apache.commons.httpclient.HttpsURL; import org.apache.commons.httpclient.NameValuePair; @@ -38,12 +45,6 @@ import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import au.csiro.doiclient.business.AndsDoiIdentity; -import au.csiro.doiclient.business.DoiDTO; -import au.csiro.doiclient.utils.DoiMetaDataGenerator; -import au.csiro.doiclient.utils.HttpUtil; -import au.csiro.pidclient.AndsPidClient.HandleType; - /** * This is the main interface to the ANDS DOI Client library. It allows the caller to interact with the <a * href="http://www.ands.org.au/services/doi-m2m-identifiers.html">Digital Object IDentifier Service</a> provided by the @@ -66,8 +67,22 @@ * </UL> * <p> * This class has methods for (a)minting DOIs, (b)updating DOIs, (c) activating and deactivating DOIs. + * </p> + * <b>Debug:</b> + * <p> + * The methods requestMetaDataOfDOI, mintDOI, activateDOI, deactivateDOI and upDateDOI have an optional debug parameter. + * This is only meant to be used to diagnose problems while calling the ANDS web services. + * </p> + * <p> + * When activating the debug flag you must also activate this class logger (LOG) to print trace statements. The output + * from this logger will generally be requested when opening a ticket with the ANDS service desk. + * </p> + * <p> + * <b>Warning:</b> Enabling the debug flag will most likely break the method calls, as the response format + * won't be XML as it is expected under normal operation. + * Don't rely in the responses coming from the method calls when debug is enabled. + * </p> * - * </p> * Copyright 2012, CSIRO Australia All rights reserved. * * @author Robert Bridle on 05/02/2010 @@ -77,7 +92,9 @@ public class AndsDoiClient { /** - * Constant that defines the logger to be used. + * The logger used by this class. + * + * It's name is au.csiro.doiclient.AndsDoiClient */ public static final Logger LOG = Logger.getLogger(AndsDoiClient.class.getName()); @@ -150,6 +167,10 @@ /** + * The list of valid success response codes + */ + private static final List<String> successCodes = Arrays.asList("MT001", "MT002", "MT003", "MT004"); + /** * Loads the specified properties file. */ static @@ -375,7 +396,9 @@ * @param doi * that needs to be updated. * @param updatedUrl - * the url pointing to the landing page of the data collection. + * The url pointing to the landing page of the data collection. + * It is very important that the base domain for updatedUrl is the list of registered + * domains in ANDS otherwise the method will fail * @param doiDTO * doiDTO with the values for the meta-data update. * @param debug @@ -415,7 +438,7 @@ AndsDoiResponse existingMetaDataXML = requestMetaDataOfDOI(doi); return executeMethod(params, updateMethodName, - existingMetaDataXML.getMetaData(), doiDTO); + existingMetaDataXML.getMessage(), doiDTO); } /** @@ -687,8 +710,8 @@ if (LOG.isDebugEnabled()) { - LOG.debug("ExecuteMethod : Query String : ->" + queryStringParams); - LOG.debug("ExecuteMethod : Method Name : ->" + methodName); + LOG.debug("Query String: " + queryStringParams); + LOG.debug("Method Name: " + methodName); } HttpsURL url = new HttpsURL(this.getDoiServiceHost(), this.getDoiServicePort(), this.getDoiServicePath()); @@ -814,6 +837,11 @@ } doiResponse = new AndsDoiResponse(); doiResponse.setMessage(outputBuffer.toString()); + if(LOG.isTraceEnabled()) + { + LOG.trace("Response Message:" + doiResponse.getMessage()); + } + setResponseFlag(method.getStatusCode(), doiResponse); } finally @@ -840,36 +868,26 @@ } /** - * Sets a boolean flag indicating success or failure based on the returned code. + * Sets the success flag in doiResponse indicating success or failure based on httpResponseCode + * and doiResponse.getResponseCode() + * If the response code is HttpStatus.SC_OK and doiResponse.getResponseCode() is one of "MT001", "MT002", "MT003", + * "MT004" then doiResponse.isSuccess will be true, otherwise it will be false * - * @param responseCode - * code returned from the web service invocation. - * @param responseMessage - * message returned from the web service invocation. + * @param httpResponseCode + * http code returned from the web service invocation. * @param doiResponse - * response to be sent back to the client. + * contains the response code and success flag * */ - private static void setResponseFlag(int responseCode, AndsDoiResponse doiResponse) + private static void setResponseFlag(int httpResponseCode, AndsDoiResponse doiResponse) { - switch (responseCode) + if(httpResponseCode == HttpStatus.SC_OK) { - case 200: - if ((doiResponse.getMessage().contains("successfully")) - || doiResponse.getMessage().contains("<?xml version=")) - { - doiResponse.setSuccess(true); - } - else - { - doiResponse.setSuccess(false); - } - break; - case 415: - case 500: - default: + doiResponse.setSuccess( + successCodes.contains(doiResponse.getResponseCode())); + } else + { doiResponse.setSuccess(false); - break; } } @@ -972,5 +990,4 @@ { this.metadataTemplatePath = metadataTemplatePath; } - } Modified: trunk/src/main/java/au/csiro/doiclient/AndsDoiResponse.java =================================================================== --- trunk/src/main/java/au/csiro/doiclient/AndsDoiResponse.java 2012-07-30 07:46:49 UTC (rev 170) +++ trunk/src/main/java/au/csiro/doiclient/AndsDoiResponse.java 2012-08-02 02:17:06 UTC (rev 171) @@ -43,6 +43,11 @@ * Whether an ANDS DOI service call was successful. */ private boolean success; + + /** + * Any of the response codes from Cite My Data M2M service + */ + private String responseCode; /** @@ -93,9 +98,10 @@ /** * ANDs has requested us to change the schema version to 2.1 for all meta-data sent to ANDs even though they send * meta-data pertaining to version 2.2 in a GET Meta-data request. - * + * @deprecated The version received should be used as it is to call back ANDS DOI services * @return the metaData if it has been retrieved, null otherwise */ + @Deprecated public String getMetaData() { if (getMessage() != null) @@ -106,7 +112,6 @@ { return null; } - } /** @@ -132,20 +137,71 @@ */ private void extractDOI() { - doi = null; if (isSuccess()) { - int startIndex = getMessage().indexOf("DOI"); - int endIndex = getMessage().indexOf("was"); + doi = extractElementFromXmlMessage("doi"); + } + } + + /** + * Extracts the response code into responseCode from the DOI service response body, if no response code could be extracted + * from the response body then null is set + */ + private void extractResponseCode() + { + responseCode = extractElementFromXmlMessage("responsecode"); + } - if (startIndex > 0 && endIndex > 0) + + /** + * Very basic parser to extract values for xml elements inside getMessage() + * @param elementName The XML Element name we want to extract + * @return the value for elementName or null if not found + */ + private String extractElementFromXmlMessage(String elementName) + { + String xmlPrefix = "<" + elementName + ">"; + String xmlPostfix = "</" + elementName + ">"; + + String value = null; + int startIndex = getMessage().indexOf(xmlPrefix); + int endIndex = getMessage().indexOf(xmlPostfix); + + if (startIndex > 0 && endIndex > 0) + { + try { - doi = getMessage().substring(startIndex + 3, endIndex).trim(); + value = getMessage().substring(startIndex + xmlPrefix.length() , endIndex).trim(); + } + catch (IndexOutOfBoundsException e) + { + return null; } } + return value; } + + /** + * @return the responseCode + */ + public String getResponseCode() + { + extractResponseCode(); + return responseCode; + } + + + /** + * @param responseCode the responseCode to set + */ + public void setResponseCode(String responseCode) + { + this.responseCode = responseCode; + } + + /* (non-Javadoc) * @see java.lang.Object#toString() */ @@ -157,12 +213,13 @@ if (doi != null) builder.append("doi=").append(doi).append(", "); builder.append("success=").append(success).append(", "); + if (responseCode != null) + builder.append("responseCode=").append(responseCode).append(", "); if (message != null) - builder.append("\nmessage=").append(message); - builder.append("\n]"); + builder.append("\nmessage=\n").append(message); + builder.append("]"); return builder.toString(); } - } Modified: trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java =================================================================== --- trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java 2012-07-30 07:46:49 UTC (rev 170) +++ trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java 2012-08-02 02:17:06 UTC (rev 171) @@ -1,5 +1,5 @@ /** - * Copyright 2012, CSIRO Australia. + * Copyright 2010, CSIRO Australia. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,10 @@ */ package au.csiro.doiclient.utils; +import java.io.StringReader; + +import org.jdom.input.SAXBuilder; + import java.io.IOException; import java.io.InputStream; @@ -73,6 +77,9 @@ /** Constant giving the path to the meta-data template **/ private static final String metadataTemplatePath = "/DoiMetadataTemplate.xml"; + + /** Constant giving the path to the local copy of DataCite Metadata Schema **/ + private static final String SCHEMA_LOCALTION = "/schema/metadata.xsd"; /** * Constant that defines the logger to be used. @@ -89,14 +96,21 @@ * if the XML Document access fails * @throws JDOMException * when invalid XML parsing/access occurs + * @throws IllegalArgumentException If a parameter in doiDTO would violate the restrictions set on + * <a href="http://schema.datacite.org/meta/kernel-2.2/index.html">DataCite Metadata Schema v 2.2</a> */ public static String createDoiMetaDataXML(DoiDTO doiDTO) throws IOException, JDOMException { InputStream is = DoiMetaDataGenerator.class.getResourceAsStream(metadataTemplatePath); + + + + SAXBuilder builder = createValidationSAXBuilder(SCHEMA_LOCALTION); - Document document = ConverterUtils.getXmlDocument(is, "DoiMetadataTemplate.xml"); + // Implicit validation, it should not happen if the template is properly built + Document document = builder.build(is); ConverterUtils.updateElementValues(document, NAME_SPACE, CREATOR_NAME_XPATH, doiDTO.getCreators()); @@ -107,10 +121,39 @@ ConverterUtils.updateElementValue(document, NAME_SPACE, DoiMetaDataGenerator.PUBLICATIONYEAR_NAME_XPATH, doiDTO.getPublicationYear()); - return ConverterUtils.outputTheXml(document); + String result = ConverterUtils.outputTheXml(document); + + try + { + document = builder.build(new StringReader(result)); + } + catch (JDOMException e) + { + throw new IllegalArgumentException("It is most likely that one parameter in DoiDTO is invalid", e); + } + + return result; } /** + * @param schemaLocation + * @return + */ + private static SAXBuilder createValidationSAXBuilder(String schemaLocation) + { + java.net.URL url = + DoiMetaDataGenerator.class.getResource(schemaLocation); + + SAXBuilder builder = new SAXBuilder(true); + builder.setFeature("http://apache.org/xml/features/validation/schema", true); + + builder.setProperty( + "http://apache.org/xml/properties/schema/external-schemaLocation", + url.toString()); + return builder; + } + + /** * Updates a String representation of a DOIMetaData XML document from an DoiDTO bean using an existing metadata * document. * @@ -126,8 +169,12 @@ JDOMException { - Document document = ConverterUtils.xmlToDoc(metaDataDocument); + SAXBuilder builder = createValidationSAXBuilder(SCHEMA_LOCALTION); + // Implicit validation, it should not happen if the template is properly built + Document document = builder.build(new StringReader(metaDataDocument)); + + if ((doiDto.getCreators() != null) && (doiDto.getCreators().size() > 0)) { ConverterUtils.updateElementValues(document, NAME_SPACE, CREATOR_NAME_XPATH, doiDto.getCreators()); @@ -155,8 +202,19 @@ { ConverterUtils.updateElementValue(document, NAME_SPACE, IDENTIFIER_NAME_XPATH, doiDto.getIdentifier()); } + + String result = ConverterUtils.outputTheXml(document); - return ConverterUtils.outputTheXml(document); + try + { + document = builder.build(new StringReader(result)); + } + catch (JDOMException e) + { + throw new IllegalArgumentException("It is most likely that one parameter in DoiDTO is invalid", e); + } + + return result; } Modified: trunk/src/main/resources/DoiMetadataTemplate.xml =================================================================== --- trunk/src/main/resources/DoiMetadataTemplate.xml 2012-07-30 07:46:49 UTC (rev 170) +++ trunk/src/main/resources/DoiMetadataTemplate.xml 2012-08-02 02:17:06 UTC (rev 171) @@ -15,10 +15,10 @@ limitations under the License. --> -<resource xmlns="http://datacite.org/schema/kernel-2.1" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://datacite.org/schema/kernel-2.1 -http://schema.datacite.org/meta/kernel-2.1/metadata.xsd"> +<resource xmlns="http://datacite.org/schema/kernel-2.2" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xsi:schemaLocation="http://datacite.org/schema/kernel-2.2 +http://schema.datacite.org/meta/kernel-2.2/metadata.xsd"> <identifier identifierType="DOI">10.2312/meyniana.2005.57.101</identifier> <creators> <creator> Added: trunk/src/main/resources/schema/include/datacite-contributorType-v2.xsd =================================================================== --- trunk/src/main/resources/schema/include/datacite-contributorType-v2.xsd (rev 0) +++ trunk/src/main/resources/schema/include/datacite-contributorType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany --> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified"> + <xs:simpleType name="contributorType"> + <xs:annotation> + <xs:documentation>The type of contributor of the resource.</xs:documentation> + </xs:annotation> + <xs:restriction base="xs:string"> + <xs:enumeration value="ContactPerson"/> + <xs:enumeration value="DataCollector"/> + <xs:enumeration value="DataManager"/> + <xs:enumeration value="Distributor"/> + <xs:enumeration value="Editor"/> + <xs:enumeration value="Funder"/> + <xs:enumeration value="HostingInstitution"/> + <xs:enumeration value="Producer"/> + <xs:enumeration value="ProjectLeader"/> + <xs:enumeration value="ProjectMember"/> + <xs:enumeration value="RegistrationAgency"/> + <xs:enumeration value="RegistrationAuthority"/> + <xs:enumeration value="RelatedPerson"/> + <xs:enumeration value="RightsHolder"/> + <xs:enumeration value="Researcher"/> + <xs:enumeration value="Sponsor"/> + <xs:enumeration value="Supervisor"/> + <xs:enumeration value="WorkPackageLeader"/> + </xs:restriction> + </xs:simpleType> +</xs:schema> Added: trunk/src/main/resources/schema/include/datacite-dateType-v2.xsd =================================================================== --- trunk/src/main/resources/schema/include/datacite-dateType-v2.xsd (rev 0) +++ trunk/src/main/resources/schema/include/datacite-dateType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany --> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified"> + <xs:simpleType name="dateType"> + <xs:annotation> + <xs:documentation>The type of date. To indicate a date period, provide two dates, specifying the StartDate and the EndDate. To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.</xs:documentation> + </xs:annotation> + <xs:restriction base="xs:string"> + <xs:enumeration value="Accepted"/><!--The date that the publisher accepted the resource into their system.--> + <xs:enumeration value="Available"/><!--The date the resource is made publicly available. May be a range.--> + <xs:enumeration value="Copyrighted"/><!--The specific, documented date at which the resource receives a copyrighted status, if applicable.--> + <xs:enumeration value="Created"/><!--The date the resource itself was put together; this could be a date range or a single date for a final component, e.g., the finalised file with all of the data.--> + <xs:enumeration value="EndDate"/><!--Use if any other date type covers a range--> + <xs:enumeration value="Issued"/><!--The date that the resource is published or distributed e.g. to a data center.--> + <xs:enumeration value="StartDate"/><!--Use if any other date type covers a range.--> + <xs:enumeration value="Submitted"/><!--The date the creator submits the resource to the publisher. This could be different from Accepted if the publisher then applies a selection process.--> + <xs:enumeration value="Updated"/><!--The date of the last update to the resource, when the resource is being added to. May be a range.--> + <xs:enumeration value="Valid"/><!--The date or date range during which the dataset or resources are accurate. May be a range.--> + </xs:restriction> + </xs:simpleType> +</xs:schema> Added: trunk/src/main/resources/schema/include/datacite-descriptionType-v2.xsd =================================================================== --- trunk/src/main/resources/schema/include/datacite-descriptionType-v2.xsd (rev 0) +++ trunk/src/main/resources/schema/include/datacite-descriptionType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171) @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany --> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified"> + <xs:simpleType name="descriptionType"> + <xs:annotation> + <xs:documentation>The type of the description.</xs:documentation> + </xs:annotation> + <xs:restriction base="xs:string"> + <xs:enumeration value="Abstract"/> + <xs:enumeration value="SeriesInformation"/> + <xs:enumeration value="TableOfContents"/> + <xs:enumeration value="Other"/> + </xs:restriction> + </xs:simpleType> +</xs:schema> Added: trunk/src/main/resources/schema/include/datacite-relatedIdentifierType-v2.xsd =================================================================== --- trunk/src/main/resources/schema/include/datacite-relatedIdentifierType-v2.xsd (rev 0) +++ trunk/src/main/resources/schema/include/datacite-relatedIdentifierType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171) @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany --> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified"> + <xs:simpleType name="relatedIdentifierType"> + <xs:annotation> + <xs:documentation>The type of the RelatedIdentifier.</xs:documentation> + </xs:annotation> + <xs:restriction base="xs:string"> + <xs:enumeration value="ARK"/> + <xs:enumeration value="DOI"/> + <xs:enumeration value="EAN13"/> + <xs:enumeration value="EISSN"/> + <xs:enumeration value="Handle"/> + <xs:enumeration value="ISBN"/> + <xs:enumeration value="ISSN"/> + <xs:enumeration value="ISTC"/> + <xs:enumeration value="LISSN"/> + <xs:enumeration value="LSID"/> + <xs:enumeration value="PURL"/> + <xs:enumeration value="UPC"/> + <xs:enumeration value="URL"/> + <xs:enumeration value="URN"/> + </xs:restriction> + </xs:simpleType> +</xs:schema> Added: trunk/src/main/resources/schema/include/datacite-relationType-v2.xsd =================================================================== --- trunk/src/main/resources/schema/include/datacite-relationType-v2.xsd (rev 0) +++ trunk/src/main/resources/schema/include/datacite-relationType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany --> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified"> + <xs:simpleType name="relationType"> + <xs:annotation> + <xs:documentation>Description of the relationship of the resource being registered (A) and the related resource (B).</xs:documentation> + </xs:annotation> + <xs:restriction base="xs:string"> + <xs:enumeration value="IsCitedBy"/><!--indicates that B includes A in a citation--> + <xs:enumeration value="Cites"/><!--indicates that A includes B in a citation--> + <xs:enumeration value="IsSupplementTo"/><!--indicates that A is a supplement to B--> + <xs:enumeration value="IsSupplementedBy"/><!--indicates that B is a supplement to A--> + <xs:enumeration value="IsContinuedBy"/><!--indicates A is continued by the work B--> + <xs:enumeration value="Continues"/><!--indicates A is a continuation of the work B--> + <xs:enumeration value="IsNewVersionOf"/><!--indicates B is a new edition of A, where the new edition has been modified or updated--> + <xs:enumeration value="IsPreviousVersionOf"/><!--indicates B is a previous edition of A--> + <xs:enumeration value="IsPartOf"/><!--indicates A is a portion of B--> + <xs:enumeration value="HasPart"/><!--indicates A includes the part B--> + <xs:enumeration value="IsReferencedBy"/><!--indicates A is used as a source of information by B--> + <xs:enumeration value="References"/><!--indicates B is used as a source of information for A--> + <xs:enumeration value="IsDocumentedBy"/><!--indicates B is documentation about/explaining A--> + <xs:enumeration value="Documents"/><!--indicates A is documentation about/explaining B--> + <xs:enumeration value="IsCompiledBy"/><!--indicates B is used to compile or create A--> + <xs:enumeration value="Compiles"/><!--indicates B is the result of a compile or creation event using A--> + <xs:enumeration value="IsVariantFormOf"/><!--indicates B is a variant or different form of A, e.g. calculated or calibrated form or different packaging--> + <xs:enumeration value="IsOriginalFormOf"/><!--indicates B is the original form of A--> + </xs:restriction> + </xs:simpleType> +</xs:schema> Added: trunk/src/main/resources/schema/include/datacite-resourceType-v2.xsd =================================================================== --- trunk/src/main/resources/schema/include/datacite-resourceType-v2.xsd (rev 0) +++ trunk/src/main/resources/schema/include/datacite-resourceType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany --> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified"> + <xs:simpleType name="resourceType"> + <xs:annotation> + <xs:documentation>The general type of a resource.</xs:documentation> + </xs:annotation> + <xs:restriction base="xs:string"> + <xs:enumeration value="Collection"/> + <xs:enumeration value="Dataset"/> + <xs:enumeration value="Event"/> + <xs:enumeration value="Film"/> + <xs:enumeration value="Image"/> + <xs:enumeration value="InteractiveResource"/> + <xs:enumeration value="Model"/> + <xs:enumeration value="PhysicalObject"/> + <xs:enumeration value="Service"/> + <xs:enumeration value="Software"/> + <xs:enumeration value="Sound"/> + <xs:enumeration value="Text"/> + </xs:restriction> + </xs:simpleType> +</xs:schema> Added: trunk/src/main/resources/schema/include/datacite-titleType-v2.xsd =================================================================== --- trunk/src/main/resources/schema/include/datacite-titleType-v2.xsd (rev 0) +++ trunk/src/main/resources/schema/include/datacite-titleType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany --><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified"> + <xs:simpleType name="titleType"> + <xs:restriction base="xs:string"> + <xs:enumeration value="AlternativeTitle"/> + <xs:enumeration value="Subtitle"/> + <xs:enumeration value="TranslatedTitle"/> + </xs:restriction> + </xs:simpleType> +</xs:schema> Added: trunk/src/main/resources/schema/metadata.xsd =================================================================== --- trunk/src/main/resources/schema/metadata.xsd (rev 0) +++ trunk/src/main/resources/schema/metadata.xsd 2012-08-02 02:17:06 UTC (rev 171) @@ -0,0 +1,316 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Revision history + 2010-08-26 Complete revision according to new common specification by the metadata work group after review. AJH, DTIC + 2010-11-17 Revised to current state of kernel review, FZ, TIB + 2011-01-17 Complete revsion after community review. FZ, TIB + 2011-03-17 Release of v2.1: added a namespace; mandatory properties got minLength; changes in the definitions of relationTypes + IsDocumentedBy/Documents and isCompiledBy/Compiles; changes type of property "Date" from xs:date to xs:string. FZ, TIB + 2011-06-27 v2.2: namespace: kernel-2.2, additions to controlled lists "resourceType", "contributorType", "relatedIdentifierType", and "descriptionType". Removal of intermediate include-files. +--> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified" xml:lang="EN"> + <xs:include schemaLocation="include/datacite-titleType-v2.xsd"/> + <xs:include schemaLocation="include/datacite-contributorType-v2.xsd"/> + <xs:include schemaLocation="include/datacite-dateType-v2.xsd"/> + <xs:include schemaLocation="include/datacite-resourceType-v2.xsd"/> + <xs:include schemaLocation="include/datacite-relationType-v2.xsd"/> + <xs:include schemaLocation="include/datacite-relatedIdentifierType-v2.xsd"/> + <xs:include schemaLocation="include/datacite-descriptionType-v2.xsd"/> + <xs:element name="resource"> + <xs:annotation> + <xs:documentation> + Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard. + Note: This is the case for any wrapper element within this schema!</xs:documentation> + <xs:documentation>No content in this wrapper element.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <!--REQUIRED FIELDS--> + <xs:element name="identifier"> + <xs:annotation> + <xs:documentation>A persistent identifier that identifies a resource.</xs:documentation> + <xs:documentation>Currently, only DOI is allowed.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="doiType"> + <xs:attribute name="identifierType" use="required" fixed="DOI"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + <xs:element name="creators"> + <xs:complexType> + <xs:sequence> + <xs:element name="creator" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.</xs:documentation> + <xs:documentation>Format: Family, Given.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element name="creatorName"> + <xs:simpleType> + <xs:restriction base="nonemptycontentStringType"/> + </xs:simpleType> + </xs:element> + <xs:element name="nameIdentifier" minOccurs="0"> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="nonemptycontentStringType"> + <xs:attribute name="nameIdentifierScheme" use="required"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="titles"> + <xs:complexType> + <xs:sequence> + <xs:element name="title" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>A name or title by which a resource is known.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="nonemptycontentStringType"> + <xs:attribute name="titleType" type="titleType" use="optional"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="publisher"> + <xs:annotation> + <xs:documentation>A holder of the data (including archives as appropriate) or institution which submitted the work. Any others may be listed as contributors. This property will be used to formulate the citation, so consider the prominence of the role.</xs:documentation> + <xs:documentation>Examples: World Data Center for Climate (WDCC); GeoForschungsZentrum Potsdam (GFZ); Geological Institute, University of Tokyo </xs:documentation> + <xs:documentation>In the case of datasets, "publish" is understood to mean making the data available to the community of researchers.</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="nonemptycontentStringType"/> + </xs:simpleType> + </xs:element> + <xs:element name="publicationYear"> + <xs:annotation> + <xs:documentation>Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.</xs:documentation> + <xs:documentation>YYYY</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="yearType"/> + </xs:simpleType> + </xs:element> + <!--OPTIONAL FIELDS--> + <xs:element name="subjects" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:element name="subject" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>Subject, keywords, classification codes, or key phrases describing the resource.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="subjectScheme" use="optional"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="contributors" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:element name="contributor" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.</xs:documentation> + <xs:documentation>The personal name format should be: Family, Given.</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:sequence> + <xs:element name="contributorName"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nameIdentifier" minOccurs="0"> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="nameIdentifierScheme" use="required"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + </xs:sequence> + <xs:attribute name="contributorType" type="contributorType" use="required"/> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="dates" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:element name="date" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>Different dates relevant to the work.</xs:documentation> + <xs:documentation>YYYY or YYYY-MM-DD or any other format described in W3CDTF (http://www.w3.org/TR/NOTE-datetime) </xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="dateType" type="dateType" use="required"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="language" type="xs:language" minOccurs="0"> + <xs:annotation> + <xs:documentation>Primary language of the resource. Allowed values from: ISO 639-2/B, ISO 639-3</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="resourceType" minOccurs="0"> + <xs:annotation> + <xs:documentation>The type of a resource. You may enter an additional free text description.</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:annotation> + <xs:documentation>Use this attribute to choose the general type of the resource from the controlled list.</xs:documentation> + </xs:annotation> + <xs:attribute name="resourceTypeGeneral" type="resourceType" use="required"/> + </xs:complexType> + </xs:element> + <xs:element name="alternateIdentifiers" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:element name="alternateIdentifier" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>An identifier other than the primary identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. The format is open</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="alternateIdentifierType" use="required"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="relatedIdentifiers" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:element name="relatedIdentifier" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="relatedIdentifierType" type="relatedIdentifierType" use="required"/> + <xs:attribute name="relationType" type="relationType" use="required"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="sizes" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:element name="size" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>Unstructures size information about the resource. </xs:documentation> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="formats" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:element name="format" maxOccurs="unbounded"> + <xs:annotation> + <xs:documentation>Technical format of the resource.</xs:documentation> + <xs:documentation>Use file extension or MIME type where possible.</xs:documentation> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:documentation>Version number of the resource. If the primary resource has changed the version number increases.</xs:documentation> + <xs:documentation>Register a new DOI (or primary identifier) when the version of the resource changes to enable the citation of the exact version of a research dataset (or other resource). May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates.</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="rights" minOccurs="0"> + <xs:annotation> + <xs:documentation>Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable. + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="descriptions" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:element name="description" maxOccurs="unbounded"> + <xs:complexType mixed="true"> + <xs:choice> + <xs:element name="br" minOccurs="0" maxOccurs="unbounded"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:length value="0"/> + </xs:restriction> + </xs:simpleType> + </xs:element> + </xs:choice> + <xs:attribute name="descriptionType" type="descriptionType" use="required"/> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + <xs:attribute name="lastMetadataUpdate" type="xs:date" use="optional"/> + <xs:attribute name="metadataVersionNumber" type="xs:integer" use="optional"/> + <!--ADMINISTRATIVE FIELDS--> + </xs:complexType> + </xs:element> + <!-- TYPE DECLARATIONS --> + <!-- defines the value for a DOI: DOI must start with "10." --> + <xs:simpleType name="doiType"> + <xs:restriction base="xs:token"> + <xs:pattern value="[1][0][/.].*"/> + </xs:restriction> + </xs:simpleType> + <!-- defines value for mandatory fields --> + <xs:simpleType name="nonemptycontentStringType"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + </xs:restriction> + </xs:simpleType> + <xs:attributeGroup name="nameId"> + <xs:attribute name="nameIdentifier" type="xs:string" use="optional"/> + <xs:attribute name="nameIdentifierScheme" type="xs:string" use="optional"/> + </xs:attributeGroup> + <!-- defines the value for a year --> + <xs:simpleType name="yearType"> + <xs:restriction base="xs:token"> + <xs:pattern value="[\d]{4}"/> + </xs:restriction> + </xs:simpleType> +</xs:schema> Modified: trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java =================================================================== --- trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java 2012-07-30 07:46:49 UTC (rev 170) +++ trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java 2012-08-02 02:17:06 UTC (rev 171) @@ -1,5 +1,5 @@ /** - * Copyright 2012, CSIRO Australia. + * Copyright 2010, CSIRO Australia. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,14 @@ */ package au.csiro.doiclient.utils; +import au.csiro.doiclient.business.DoiDTO; import java.util.ArrayList; import java.util.List; - import junit.framework.TestCase; - import org.jdom.Document; import org.jdom.Element; import org.jdom.xpath.XPath; -import au.csiro.doiclient.business.DoiDTO; - /** * Test case for the DoiMetaDataGenerator * @@ -107,6 +104,7 @@ Document document = ConverterUtils.xmlToDoc(doiMetaDataXML); XPath xPath = XPath.newInstance(CREATOR_NAME_XPATH); xPath.addNamespace("xsi", document.getRootElement().getNamespaceURI()); + @SuppressWarnings("rawtypes") List nodes = xPath.selectNodes(document); assertEquals(6, nodes.size()); @@ -115,7 +113,67 @@ assertEquals("Phillips,David", ((Element) nodes.get(0)).getText()); } + /** + * Tests the validation of generation of DoiMetaData XML when invalid parameters are introduced + * + * @throws Exception + */ + public final void testCreateDoiMetaDataXMLWithInvalidData() throws Exception + { + DoiDTO doiDTO = populateDummydoiDTO(); + doiDTO.setPublicationYear("234"); + try + { + DoiMetaDataGenerator.createDoiMetaDataXML(doiDTO); + fail("Validation for Publication Year passed even when we expected to fail"); + } + catch (IllegalArgumentException ex) + { + // This is expected + } + + doiDTO = populateDummydoiDTO(); + doiDTO.setTitle(null); + + try + { + DoiMetaDataGenerator.createDoiMetaDataXML(doiDTO); + fail("Validation for Title passed even when we expected to fail"); + } + catch (IllegalArgumentException ex) + { + // This is expected + } + + doiDTO = populateDummydoiDTO(); + doiDTO.getCreators().clear(); + doiDTO.getCreators().add(0, ""); + + try + { + DoiMetaDataGenerator.createDoiMetaDataXML(doiDTO); + fail("Validation for Creator passed even when we expected to fail"); + } + catch (IllegalArgumentException ex) + { + // This is expected + } + + doiDTO = populateDummydoiDTO(); + doiDTO.setPublisher(null); + + try + { + DoiMetaDataGenerator.createDoiMetaDataXML(doiDTO); + fail("Validation for Publisher passed even when we expected to fail"); + } + catch (IllegalArgumentException ex) + { + // This is expected + } + } + /** * Tests the updation of the identifier * @@ -135,6 +193,7 @@ Document document = ConverterUtils.xmlToDoc(updatedMetaData); XPath xPath = XPath.newInstance(IDENTIFIER_NAME_XPATH); xPath.addNamespace("xsi", document.getRootElement().getNamespaceURI()); + @SuppressWarnings("rawtypes") List nodes = xPath.selectNodes(document); assertEquals(1, nodes.size()); @@ -153,7 +212,6 @@ DoiDTO dto = populateDummydoiDTO(); String doiMetaDataXML = DoiMetaDataGenerator.createDoiMetaDataXML(dto); - String doi = "10.5072/08/4F5838BF44E5A"; List<String> creators = dto.getCreators(); creators.remove(3); @@ -168,6 +226,7 @@ Document document = ConverterUtils.xmlToDoc(updatedMetaData); XPath xPath = XPath.newInstance(CREATOR_NAME_XPATH); xPath.addNamespace("xsi", document.getRootElement().getNamespaceURI()); + @SuppressWarnings("rawtypes") List nodes = xPath.selectNodes(document); assertEquals(4, nodes.size()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jav...@us...> - 2012-07-30 07:46:58
|
Revision: 170 http://andspidclient.svn.sourceforge.net/andspidclient/?rev=170&view=rev Author: javinovich Date: 2012-07-30 07:46:49 +0000 (Mon, 30 Jul 2012) Log Message: ----------- DMSTECH-3819: - Implementing DoiDTO.toString() Modified Paths: -------------- trunk/src/main/java/au/csiro/doiclient/business/DoiDTO.java Modified: trunk/src/main/java/au/csiro/doiclient/business/DoiDTO.java =================================================================== --- trunk/src/main/java/au/csiro/doiclient/business/DoiDTO.java 2012-07-30 07:46:04 UTC (rev 169) +++ trunk/src/main/java/au/csiro/doiclient/business/DoiDTO.java 2012-07-30 07:46:49 UTC (rev 170) @@ -1,5 +1,5 @@ /** - * Copyright 2012, CSIRO Australia. + * Copyright 2010, CSIRO Australia. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -180,4 +180,32 @@ this.identifier = identifier; } + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() + { + final int maxLen = 1; + StringBuilder builder = new StringBuilder(); + builder.append("DoiDTO ["); + if (identifier != null) + builder.append("identifier=").append(identifier).append(", "); + if (title != null) + builder.append("title=").append(title).append(", "); + if (creators != null) + builder.append("creators=").append(creators.subList(0, Math.min(creators.size(), maxLen))).append(", "); + if (publicationYear != null) + builder.append("publicationYear=").append(publicationYear).append(", "); + if (publisher != null) + builder.append("publisher=").append(publisher).append(", "); + if (subject != null) + builder.append("subject=").append(subject).append(", "); + if (language != null) + builder.append("language=").append(language); + builder.append("]"); + return builder.toString(); + } + + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |