diff --git a/.gitignore b/.gitignore index 5e64b96..c555cfb 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ .settings/ .gradle/ .idea/ +/build.gradle +/~ diff --git a/build.gradle b/build.gradle index e8a5713..4267bcc 100644 --- a/build.gradle +++ b/build.gradle @@ -85,4 +85,4 @@ task listJars { doLast { configurations.compile.each { File file -> println file.name } } -} +} \ No newline at end of file diff --git a/src/integration-test/java/com/researchspace/dataverse/http/AbstractIntegrationTest.java b/src/integration-test/java/com/researchspace/dataverse/http/AbstractIntegrationTest.java index a82b64a..f28b8f3 100644 --- a/src/integration-test/java/com/researchspace/dataverse/http/AbstractIntegrationTest.java +++ b/src/integration-test/java/com/researchspace/dataverse/http/AbstractIntegrationTest.java @@ -1,23 +1,3 @@ -/* - * - */ -package com.researchspace.dataverse.http; - -import com.researchspace.dataverse.api.v1.*; -import com.researchspace.dataverse.spring.config.DataverseSpringConfig; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.Validate; -import org.junit.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; - -import java.net.URL; - -import static org.junit.Assert.assertTrue; /**
Copyright 2016 ResearchSpace @@ -33,60 +13,83 @@ See the License for the specific language governing permissions and limitations under the License.-*/ + */ +package com.researchspace.dataverse.http; + +import java.net.URL; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Validate; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; + +import com.researchspace.dataverse.api.v1.DatasetOperations; +import com.researchspace.dataverse.api.v1.DataverseAPI; +import com.researchspace.dataverse.api.v1.DataverseConfig; +import com.researchspace.dataverse.api.v1.DataverseOperations; +import com.researchspace.dataverse.api.v1.InfoOperations; +import com.researchspace.dataverse.api.v1.MetadataOperations; +import com.researchspace.dataverse.api.v1.SearchOperations; +import com.researchspace.dataverse.spring.config.DataverseSpringConfig; + +/** + * Integration tests. + */ @TestPropertySource(locations = "classpath:/test.properties") @ContextConfiguration(classes = { DataverseSpringConfig.class }) -@Slf4j public class AbstractIntegrationTest extends AbstractJUnit4SpringContextTests { - DatasetOperations datasetOps; - DataverseOperations dataverseOps; - MetadataOperations metadataOPs; - InfoOperations infoOps; - SearchOperations searchOps; - @Autowired - DataverseAPI dataverseAPI; - @Value("#{systemProperties['dataverseAlias']}") - protected String dataverseAlias; - @Value("#{systemProperties['dataverseApiKey']}") - protected String apiKey; - @Value("#{systemProperties['dataverseServerURL']}") - protected String serverURL; + DatasetOperations datasetOps; + DataverseOperations dataverseOps; + MetadataOperations metadataOPs; + InfoOperations infoOps; + SearchOperations searchOps; + @Autowired + DataverseAPI dataverseAPI; + @Value("#{systemProperties['dataverseAlias']}") + protected String dataverseAlias; + @Value("#{systemProperties['dataverseApiKey']}") + protected String apiKey; + @Value("#{systemProperties['dataverseServerURL']}") + protected String serverURL; - // defaults from test.properties - @Value("${dataverseAlias}") - protected String dataverseAliasdefault; - @Value("${dataverseServerURL}") - protected String serverURLDevault; + // defaults from test.properties + @Value("${dataverseAlias}") + protected String dataverseAliasdefault; + @Value("${dataverseServerURL}") + protected String serverURLDevault; - protected static final String ERROR_MSG = "ERROR"; + protected static final String ERROR_MSG = "ERROR"; - public void setUp() throws Exception { - validateServerCredentials(); - // log.info("serverURL: [{}], apiKey: [{}], dataverseId=[{}]", serverURL, apiKey, dataverseAlias); - URL uri = new URL(serverURL); - DataverseConfig cfg = new DataverseConfig(uri, apiKey, dataverseAlias); - dataverseAPI.configure(cfg); - datasetOps = dataverseAPI.getDatasetOperations(); - dataverseOps = dataverseAPI.getDataverseOperations(); - metadataOPs = dataverseAPI.getMetadataOperations(); - infoOps = dataverseAPI.getInfoOperations(); - searchOps = dataverseAPI.getSearchOperations(); - } + public void setUp() throws Exception { + validateServerCredentials(); + final URL uri = new URL(serverURL); + final DataverseConfig cfg = new DataverseConfig(uri, apiKey, dataverseAlias); + dataverseAPI.configure(cfg); + datasetOps = dataverseAPI.getDatasetOperations(); + dataverseOps = dataverseAPI.getDataverseOperations(); + metadataOPs = dataverseAPI.getMetadataOperations(); + infoOps = dataverseAPI.getInfoOperations(); + searchOps = dataverseAPI.getSearchOperations(); + } - private void validateServerCredentials() { - Validate.notEmpty(apiKey, "ApiKey must be set via command line -DdataverseApiKey option"); - dataverseAlias = (StringUtils.isEmpty(dataverseAlias)) ? dataverseAliasdefault : dataverseAlias; - serverURL = (StringUtils.isEmpty(serverURL)) ? serverURLDevault : serverURL; - Validate.notEmpty(dataverseAlias, - "Dataverse alias must be set via command line -DdataverseAlias option or in test.properties"); - Validate.notEmpty(serverURL, - "Dataverse server URL must be set via command line -DdataverseServerURL option or in test.properties)"); - } + private void validateServerCredentials() { + Validate.notEmpty(apiKey, "ApiKey must be set via command line -DdataverseApiKey option"); + dataverseAlias = StringUtils.isEmpty(dataverseAlias) ? dataverseAliasdefault : dataverseAlias; + serverURL = StringUtils.isEmpty(serverURL) ? serverURLDevault : serverURL; + Validate.notEmpty(dataverseAlias, + "Dataverse alias must be set via command line -DdataverseAlias option or in test.properties"); + Validate.notEmpty(serverURL, + "Dataverse server URL must be set via command line -DdataverseServerURL option or in test.properties)"); + } - @Test - public void test() { - assertTrue(1 == 1);// stop complaints about no methods - } + @Test + public void test() { + // stop complaints about no methods + } } diff --git a/src/integration-test/java/com/researchspace/dataverse/http/DatasetOperationsTest.java b/src/integration-test/java/com/researchspace/dataverse/http/DatasetOperationsTest.java index bfbb43b..0cd7a78 100644 --- a/src/integration-test/java/com/researchspace/dataverse/http/DatasetOperationsTest.java +++ b/src/integration-test/java/com/researchspace/dataverse/http/DatasetOperationsTest.java @@ -1,28 +1,3 @@ -/* - * - */ -package com.researchspace.dataverse.http; - -import com.researchspace.dataverse.entities.*; -import com.researchspace.dataverse.entities.facade.DatasetFacade; -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang.RandomStringUtils; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.util.Arrays; -import java.util.List; - -import static com.researchspace.dataverse.entities.facade.DatasetTestFactory.createFacade; -import static org.junit.Assert.*; - - /**
Copyright 2016 ResearchSpace @@ -38,113 +13,159 @@ See the License for the specific language governing permissions and limitations under the License.-*/ + */ +package com.researchspace.dataverse.http; + +import static com.researchspace.dataverse.entities.facade.DatasetTestFactory.createFacade; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.util.Arrays; +import java.util.List; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.RandomStringUtils; +import org.junit.Before; +import org.junit.Test; + +import com.researchspace.dataverse.entities.Dataset; +import com.researchspace.dataverse.entities.DatasetFile; +import com.researchspace.dataverse.entities.DatasetFileList; +import com.researchspace.dataverse.entities.DatasetVersion; +import com.researchspace.dataverse.entities.DataverseObject; +import com.researchspace.dataverse.entities.DataversePost; +import com.researchspace.dataverse.entities.DataverseResponse; +import com.researchspace.dataverse.entities.Identifier; +import com.researchspace.dataverse.entities.PublishedDataset; +import com.researchspace.dataverse.entities.Version; +import com.researchspace.dataverse.entities.facade.DatasetFacade; +import com.researchspace.springrest.ext.RestClientException; + +/** + * Dataset operations tests. + */ public class DatasetOperationsTest extends AbstractIntegrationTest { - - @Before - public void setup() throws Exception { - super.setUp(); - } - - File exampleDatasetJson = new File("src/integration-test/resources/dataset-create-new-all-default-fields.json"); - @Test - public void testListDatasets() { - List
Copyright 2016 ResearchSpace @@ -28,69 +13,126 @@ See the License for the specific language governing permissions and limitations under the License.-*/ + */ +package com.researchspace.dataverse.http; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; + +import org.apache.commons.lang.RandomStringUtils; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import com.researchspace.dataverse.entities.DataverseContacts; +import com.researchspace.dataverse.entities.DataverseGet; +import com.researchspace.dataverse.entities.DataversePost; +import com.researchspace.dataverse.entities.DataverseResponse; +import com.researchspace.dataverse.entities.DvMessage; +import com.researchspace.springrest.ext.RestClientException; + +/** + * Dataverse operations tests. + */ public class DataverseOperationsTest extends AbstractIntegrationTest { - - - @Before - public void setup() throws Exception { - super.setUp(); - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void createPublishAndDeleteNewDataverse(){ - String dvName = RandomStringUtils.randomAlphabetic(10); - DataversePost dv = createADataverse(dvName); - DataverseResponse
Copyright 2016 ResearchSpace @@ -28,26 +13,41 @@ See the License for the specific language governing permissions and limitations under the License.-*/ + */ +package com.researchspace.dataverse.http; + +import static org.junit.Assert.assertTrue; + +import org.apache.commons.lang.StringUtils; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import com.researchspace.dataverse.entities.DvMessage; + +/** + * Info operations tests. + */ public class InfoOperationsTest extends AbstractIntegrationTest { - private static final String PUBLISH_TEXT = "By default datasets are published with the"; + private static final String PUBLISH_TEXT = "By default datasets are published with the"; + + @Override + @Before + public void setUp() throws Exception { + super.setUp(); + } - @Before - public void setUp() throws Exception { - super.setUp(); - } + @After + public void tearDown() throws Exception { + } - @After - public void tearDown() throws Exception { - } + @Test + public void testGetDatasetPublishPopupCustomText() { + final DvMessage originalText = infoOps.getDatasetPublishPopupCustomText(); + assertTrue("Message text was empty", !StringUtils.isEmpty(originalText.getMessage())); + assertTrue(originalText.getMessage().contains(PUBLISH_TEXT)); - @Test - public void testGetDatasetPublishPopupCustomText() { - DvMessage originalText = infoOps.getDatasetPublishPopupCustomText(); - assertTrue("Message text was empty", !StringUtils.isEmpty(originalText.getMessage())); - assertTrue(originalText.getMessage().contains(PUBLISH_TEXT)); - - } + } } diff --git a/src/integration-test/java/com/researchspace/dataverse/http/MetadataOperationsTest.java b/src/integration-test/java/com/researchspace/dataverse/http/MetadataOperationsTest.java index 4511018..e6d488b 100644 --- a/src/integration-test/java/com/researchspace/dataverse/http/MetadataOperationsTest.java +++ b/src/integration-test/java/com/researchspace/dataverse/http/MetadataOperationsTest.java @@ -1,18 +1,3 @@ -/* - * - */ -package com.researchspace.dataverse.http; - -import com.researchspace.dataverse.entities.DVField; -import com.researchspace.dataverse.entities.MetadataBlock; -import lombok.extern.slf4j.Slf4j; -import org.junit.Before; -import org.junit.Test; -import org.springframework.web.client.RestClientException; - -import java.io.IOException; - -import static org.junit.Assert.assertTrue; /**
Copyright 2016 ResearchSpace @@ -28,33 +13,52 @@ See the License for the specific language governing permissions and limitations under the License.-*/ -@Slf4j + */ +package com.researchspace.dataverse.http; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; + +import com.researchspace.dataverse.entities.DVField; +import com.researchspace.dataverse.entities.MetadataBlock; +import com.researchspace.springrest.ext.RestClientException; + + +/** + * Metadata operations tests. + */ public class MetadataOperationsTest extends AbstractIntegrationTest { - private static final int MIN_BLOCK_SIZE = 6; - - @Before - public void setup() throws Exception { - super.setUp(); - } - - @Test - public void testGetMetdataBlockInfo() throws IOException { - // metadat block size is variable - assertTrue( metadataOPs.getMetadataBlockInfo().size() >= MIN_BLOCK_SIZE); - } - - @Test(expected = RestClientException.class) - public void testGetMetdataByIdBlockInfoWithInvalidId() throws IOException { - metadataOPs.getMetadataById("abcde"); - } - - @Test - public void testGetMetdataByIdBlockInfo() throws IOException { - MetadataBlock block = metadataOPs.getMetadataById("biomedical"); - for (DVField fld : block.getFields().values()) { - // log.info(fld.toString()); - } - } + private static final int MIN_BLOCK_SIZE = 6; + + @Override + @Before + public void setUp() throws Exception { + super.setUp(); + } + + @Test + public void testGetMetdataBlockInfo() { + // metadat block size is variable + assertTrue(metadataOPs.getMetadataBlockInfo().size() >= MIN_BLOCK_SIZE); + } + + @Test(expected = RestClientException.class) + public void testGetMetdataByIdBlockInfoWithInvalidId() { + metadataOPs.getMetadataById("abcde"); + } + + @Test + public void testGetMetdataByIdBlockInfo() throws IOException { + final MetadataBlock block = metadataOPs.getMetadataById("biomedical"); + for (final DVField fld : block.getFields().values()) { + assertNotNull(fld); + // log.info(fld.toString()); + } + } } diff --git a/src/integration-test/java/com/researchspace/dataverse/http/SearchOperationsIntegrationTest.java b/src/integration-test/java/com/researchspace/dataverse/http/SearchOperationsIntegrationTest.java index 12d14ff..67be798 100644 --- a/src/integration-test/java/com/researchspace/dataverse/http/SearchOperationsIntegrationTest.java +++ b/src/integration-test/java/com/researchspace/dataverse/http/SearchOperationsIntegrationTest.java @@ -1,5 +1,18 @@ -/* - * +/**
+Copyright 2016 ResearchSpace + + 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 com.researchspace.dataverse.http; @@ -15,60 +28,44 @@ import com.researchspace.dataverse.search.entities.SearchResults; import com.researchspace.dataverse.search.entities.SortBy; import com.researchspace.dataverse.search.entities.SortOrder; -/** - * /**
-Copyright 2016 ResearchSpace - - 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. -+/** * The results of these tests will vary depnding on the Dataverse instance used for testing. * @author rspace - * */ public class SearchOperationsIntegrationTest extends AbstractIntegrationTest { - private static final String FILE_SEARCH_TERM = "documentSchema.xsd"; - private static final String NEW_TEXT = "Do you want to publish"; + private static final String FILE_SEARCH_TERM = "documentSchema.xsd"; + + @Override + @Before + public void setUp() throws Exception { + super.setUp(); + } - @Before - public void setUp() throws Exception { - super.setUp(); - } + @After + public void tearDown() throws Exception { + } - @After - public void tearDown() throws Exception { - } + @Test + public void testBasicSearchByTermOnly() { + final SearchConfig cfg = searchOps.builder().q(FILE_SEARCH_TERM).build(); + final DataverseResponse
Copyright 2016 ResearchSpace
@@ -26,86 +14,135 @@
See the License for the specific language governing permissions and
limitations under the License.
-
- * @author richard
- *
+ */
+package com.researchspace.dataverse.api.v1;
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.util.List;
+
+import com.researchspace.dataverse.entities.Dataset;
+import com.researchspace.dataverse.entities.DatasetFileList;
+import com.researchspace.dataverse.entities.DatasetVersion;
+import com.researchspace.dataverse.entities.DataverseResponse;
+import com.researchspace.dataverse.entities.DvMessage;
+import com.researchspace.dataverse.entities.Identifier;
+import com.researchspace.dataverse.entities.PublishedDataset;
+import com.researchspace.dataverse.entities.Version;
+import com.researchspace.dataverse.entities.facade.DatasetFacade;
+import com.researchspace.dataverse.http.FileUploadMetadata;
+import com.researchspace.springrest.ext.RestClientException;
+import com.researchspace.springrest.ext.SWORDException;
+
+/**
* Operations on Datasets
- *
- *
+ * @author richard
*/
public interface DatasetOperations {
- /**
- * @param facade The {@link DatasetFacade} containing the updated DataSet data.
- * @param id The {@link DataSetMetadataBlock} identifier
- * @return A {@link DatasetVersion}
- */
- DatasetVersion updateDataset(DatasetFacade facade, Identifier id);
-
- /**
- * Retrieves a {@link Dataset} based on its Id.
- * @param dsIdentifier
- * @return
- */
- Dataset getDataset(Identifier dsIdentifier);
-
- /**
- * Gets list of metadata about different Dataset versions.
- * @param dsIdentifier
- * @return
- */
- List+Copyright 2016 ResearchSpace Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,43 +14,57 @@ See the License for the specific language governing permissions and limitations under the License.- Top-level entry point into the Dataverse Level1 API + */ +package com.researchspace.dataverse.api.v1; + +/** + * Top-level entry point into the Dataverse Level1 API * @author rspace * */ public interface DataverseAPI { - /** - * Gets class for performing DatasetOperations - * @return - */ - DatasetOperations getDatasetOperations (); - - /** - * Gets class for performing Metadata Operations - * @return - */ - MetadataOperations getMetadataOperations (); - /** - * Gets class for performing Dataverse Operations - * @return - */ - DataverseOperations getDataverseOperations (); - - /** - * Configures the connection settings. - * @param config - */ - void configure (DataverseConfig config); - - InfoOperations getInfoOperations(); - - /** - * Accesses the Search API - * @return - */ - SearchOperations getSearchOperations(); + * Gets class for performing DatasetOperations + * @return DatasetOperations + */ + DatasetOperations getDatasetOperations(); + + /** + * Gets class for performing Metadata Operations + * @return MetadataOperations + */ + MetadataOperations getMetadataOperations(); + + /** + * Gets class for performing Dataverse Operations + * @return DataverseOperations + */ + DataverseOperations getDataverseOperations(); + + /** + * Configures the connection settings. + * @param config + */ + void configure(DataverseConfig config); + + /** + * Get class for performing Info Operations. + * @return InfoOperations + */ + InfoOperations getInfoOperations(); + + /** + * Get class for performing Search Operations. + * @return SearchOperations + */ + SearchOperations getSearchOperations(); + + /** + * Get class for performing Users Operations. + * @return UsersOperations + */ + UsersOperations getUsersOperations(); } \ No newline at end of file diff --git a/src/main/java/com/researchspace/dataverse/api/v1/DataverseConfig.java b/src/main/java/com/researchspace/dataverse/api/v1/DataverseConfig.java index 357116e..8bb44ff 100644 --- a/src/main/java/com/researchspace/dataverse/api/v1/DataverseConfig.java +++ b/src/main/java/com/researchspace/dataverse/api/v1/DataverseConfig.java @@ -1,16 +1,5 @@ -/* - * - */ -package com.researchspace.dataverse.api.v1; - -import java.net.URL; - -import lombok.AllArgsConstructor; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.ToString; /** -+Copyright 2016 ResearchSpace Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,22 +14,34 @@ See the License for the specific language governing permissions and limitations under the License.+ */ +package com.researchspace.dataverse.api.v1; + +import java.net.URL; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.ToString; +/** * Configures the server, apikey and root dataverse alias * @author rspace - * */ @EqualsAndHashCode(of={"serverURL"}) @AllArgsConstructor @ToString() public class DataverseConfig { - private @Getter URL serverURL; - - /** - * The API Key provided from Dataverse account - * @return the apiKey - */ - private @Getter String apiKey; - private @Getter String repositoryName; + private @Getter + final URL serverURL; + + /** + * The API Key provided from Dataverse account + * @return the apiKey + */ + private @Getter + final String apiKey; + private @Getter + final String repositoryName; } diff --git a/src/main/java/com/researchspace/dataverse/api/v1/DataverseOperations.java b/src/main/java/com/researchspace/dataverse/api/v1/DataverseOperations.java index 6c4a31d..ea5ee5c 100644 --- a/src/main/java/com/researchspace/dataverse/api/v1/DataverseOperations.java +++ b/src/main/java/com/researchspace/dataverse/api/v1/DataverseOperations.java @@ -1,20 +1,5 @@ -/* - * - */ -package com.researchspace.dataverse.api.v1; - -import java.io.IOException; -import java.util.List; - -import com.researchspace.dataverse.entities.DataversePost; -import com.researchspace.dataverse.entities.DataverseGet; -import com.researchspace.dataverse.entities.DataverseObject; -import com.researchspace.dataverse.entities.DataverseResponse; -import com.researchspace.dataverse.entities.DvMessage; -import com.researchspace.dataverse.entities.Identifier; -import com.researchspace.dataverse.entities.facade.DatasetFacade; -/** - *+/** +Copyright 2016 ResearchSpace Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,62 +14,95 @@ See the License for the specific language governing permissions and limitations under the License.+ */ +package com.researchspace.dataverse.api.v1; -*/ +import java.io.IOException; +import java.util.List; + +import com.researchspace.dataverse.entities.DataverseGet; +import com.researchspace.dataverse.entities.DataverseObject; +import com.researchspace.dataverse.entities.DataversePost; +import com.researchspace.dataverse.entities.DataverseResponse; +import com.researchspace.dataverse.entities.DvMessage; +import com.researchspace.dataverse.entities.Identifier; +import com.researchspace.dataverse.entities.facade.DatasetFacade; +import com.researchspace.springrest.ext.RestClientException; +import com.researchspace.springrest.ext.SWORDException; +/** + * Operations on the Dataverse. + */ public interface DataverseOperations { - - - /** - * Create a new dataverse. The supplied {@link DataversePost} must contain as a minimum: - *
null
- */
- public DataverseResponsenull
+ * @throws RestClientException
+ */
+ DataverseResponse+ Copyright 2016 ResearchSpace + + 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 com.researchspace.dataverse.api.v1; import com.researchspace.dataverse.entities.DataverseResponse; import com.researchspace.dataverse.entities.DvMessage; -/** + +/** + * Wrapper for InfoOperations: *
- * Copyright 2016 ResearchSpace - -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. -- -* -*Wrapper for InfoOperations: -*
-*GET http://$SERVER/api/info/settings/:DatasetPublishPopupCustomText -*and -*url -X PUT -d "publish" https://demo.dataverse.org/api/admin/settings/:DatasetPublishPopupCustomText -*-*and -* -*/ + * GET http://$SERVER/api/info/settings/:DatasetPublishPopupCustomText + * and + * url -X PUT -d "publish" https://demo.dataverse.org/api/admin/settings/:DatasetPublishPopupCustomText + * + */ public interface InfoOperations { - - DvMessage getDatasetPublishPopupCustomText () ; - - /** - * Deprecated, does not work for client calls from non-Localhost URLs from Dataverse 4.8 onwards - */ - DataverseResponse