diff --git a/oaipmh-core/pom.xml b/oaipmh-core/pom.xml index f928af2d369df5f830dab4f3d00972e016a5b314..3c8be6ffc9bb6ecde55d114aab995b35d8b99260 100644 --- a/oaipmh-core/pom.xml +++ b/oaipmh-core/pom.xml @@ -38,21 +38,11 @@ <artifactId>cxf-rt-frontend-jaxrs</artifactId> <version>${cxf.version}</version> </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-frontend-jaxws</artifactId> - <version>${cxf.version}</version> - </dependency> <dependency> <groupId>javax.ws.rs</groupId> <artifactId>jsr311-api</artifactId> <version>1.0</version> </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-transports-http</artifactId> - <version>${cxf.version}</version> - </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> @@ -74,8 +64,6 @@ <artifactId>httpclients</artifactId> <version>${textgrid.httpclients.version}</version> </dependency> - <!-- >dependency> <groupId>org.openrdf.sesame</groupId> <artifactId>sesame-runtime</artifactId> - <version>2.5.0</version> </dependency --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> @@ -111,8 +99,6 @@ <enabled>true</enabled> </snapshots> </repository> - <!-- repository> <id>aduna</id> <name>Aduna Software</name> <url>http://repo.aduna-software.org/maven2/releases/</url> - </repository --> </repositories> <build> <pluginManagement> @@ -156,53 +142,6 @@ </execution> </executions> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <version>1.3</version> - <executions> - <execution> - <id>do-get</id> - <phase>initialize</phase> - <goals> - <goal>run</goal> - </goals> - <configuration> - <tasks> - <!-- download wsdl task --> - <get usetimestamp="true" src="${tgauth.wsdl}" dest="tgextra.wsdl" /> - <!--get usetimestamp="true" src="https://develop.sub.uni-goettingen.de/repos/textgrid/trunk/middleware/tgauth/info.textgrid.middleware.tgauth.rbac/rbacSoap/wsdl-productive/tgextra.wsdl" - dest="tgextra.wsdl"/ --> - </tasks> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-codegen-plugin</artifactId> - <version>${cxf.version}</version> - <executions> - <execution> - <id>generate-sources</id> - <phase>generate-sources</phase> - <configuration> - <wsdlOptions> - <wsdlOption> - <wsdl>tgextra.wsdl</wsdl> - <extraargs> - <extraarg>-fe</extraarg> - <extraarg>jaxws21</extraarg> - </extraargs> - </wsdlOption> - </wsdlOptions> - </configuration> - <goals> - <goal>wsdl2java</goal> - </goals> - </execution> - </executions> - </plugin> </plugins> </build> </project> diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDeliverer.java b/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDeliverer.java index 2c0df359182ca7d06c86816c544ff6d65d096899..f3a09229aa0c473fab04373ddfa687bd68514108 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDeliverer.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDeliverer.java @@ -1,5 +1,11 @@ package info.textgrid.middleware; + + +import info.textgrid.middleware.oaipmh.HeaderType; +import info.textgrid.middleware.oaipmh.ListIdentifiersType; +import info.textgrid.middleware.oaipmh.RequestType; + import java.text.ParseException; import javax.xml.datatype.DatatypeConfigurationException; @@ -11,9 +17,7 @@ import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; -import info.textgrid.middleware.oaipmh.HeaderType; -import info.textgrid.middleware.oaipmh.ListIdentifiersType; -import info.textgrid.middleware.oaipmh.RequestType; + /** * Class to build the Element for a ListIdentifiers request @@ -173,18 +177,18 @@ public class IdentifierListDeliverer { if (this.textgrid && hit.getFields().get(formatField).getValue() .toString().equals(formatToFilter)) { - System.out.println("textgrid!!!!"); + datestamp = hit.getFields().get(dateOfObjectCreation) .getValue().toString(); - /*try { + try { // XMLGregorianCalendar convertedDateFormat= // OAIPMHUtillities.convertDateFormat(datestamp); datestamp = OAIPMHUtillities.convertDateFormat( datestamp).toXMLFormat(); } catch (DatatypeConfigurationException e) { log.debug(e); - }*/ + } try { diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/oaipmh/auth/AuthClient.java b/oaipmh-core/src/main/java/info/textgrid/middleware/oaipmh/auth/AuthClient.java deleted file mode 100644 index 9a202a3fd7de065166c73e69e72f7e3e69887b89..0000000000000000000000000000000000000000 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/oaipmh/auth/AuthClient.java +++ /dev/null @@ -1,14 +0,0 @@ -package info.textgrid.middleware.oaipmh.auth; - -import java.util.List; - -public interface AuthClient { - - List<String> filterUris(String sessionId, List<String> uris); - - List<String> getUrisForProject(String sid, String id); - - List<String> getProjectsForSID(String sid); - - boolean isProjectAuth(); -} diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/oaipmh/auth/TGAuthClient.java b/oaipmh-core/src/main/java/info/textgrid/middleware/oaipmh/auth/TGAuthClient.java deleted file mode 100644 index 2f2f4c5e871a4b2bfe89f695378f32787f9c4199..0000000000000000000000000000000000000000 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/oaipmh/auth/TGAuthClient.java +++ /dev/null @@ -1,97 +0,0 @@ -package info.textgrid.middleware.oaipmh.auth; - -import info.textgrid.namespaces.middleware.tgauth.AuthenticationFault; -import info.textgrid.namespaces.middleware.tgauth.FilterBySidRequest; -import info.textgrid.namespaces.middleware.tgauth.FilterResponse; -import info.textgrid.namespaces.middleware.tgauth.GetObjectsRequest; -import info.textgrid.namespaces.middleware.tgauth.PortTgextra; -import info.textgrid.namespaces.middleware.tgauth.ResourcesetResponse; -import info.textgrid.namespaces.middleware.tgauth.RolesetResponse; -import info.textgrid.namespaces.middleware.tgauth.TgAssignedProjectsRequest; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -public class TGAuthClient implements AuthClient { - - static final boolean PROJECT_AUTH = true; - - private PortTgextra tgp; - private Log log = LogFactory.getLog(TGAuthClient.class); - - - public TGAuthClient(PortTgextra tgExtraClient){ - tgp = tgExtraClient; - } - - /** - * - */ - @Override - public List<String> filterUris(String sessionId, List<String> uris) { - - // do not modify incoming list, copy for retainAll operation - List<String> response = new ArrayList<String>(uris); - - FilterBySidRequest filterBySidInput = new FilterBySidRequest(); - filterBySidInput.setAuth(sessionId); - filterBySidInput.setOperation("read"); - //TODO: set logstring - filterBySidInput.setLog(""); - filterBySidInput.getResource().addAll(response); - - List<String> allowed = null; - try { - log.debug("start filterUris: "+ new Date()); - FilterResponse res = tgp.filterBySid(filterBySidInput); - allowed = res.getResource(); - log.debug("end filterUris: "+ new Date()); - } catch (AuthenticationFault e) { - //log.error(e); - log.error("filterUris: Failure regarding to sid ", e); - } - - // we need to keep the order of the list, tgauth doesn't guarantee this, so intersect - response.retainAll(allowed); - return response; - - } - - @Override - public List<String> getUrisForProject(String sessionId, String projectId) { - - GetObjectsRequest getObjectsInput = new GetObjectsRequest(); - getObjectsInput.setAuth(sessionId); - //getObjectsInput.setLog(tglog.getLoginfo()); - getObjectsInput.setProject(projectId); - - log.debug("start getObjects: "+ new Date()); - ResourcesetResponse res = tgp.getObjects(getObjectsInput); - log.debug("end getObjects: "+ new Date()); - List<String> uris = new ArrayList<String>(res.getResource()); - - return uris; - } - - @Override - public List<String> getProjectsForSID(String sid) { - - TgAssignedProjectsRequest tgAssignedProjectsInput = new TgAssignedProjectsRequest(); - tgAssignedProjectsInput.setAuth(sid); - RolesetResponse res = tgp.tgAssignedProjects(tgAssignedProjectsInput); - - return res.getRole(); - - } - - @Override - public boolean isProjectAuth() { - // TODO Auto-generated method stub - return TGAuthClient.PROJECT_AUTH; - } - -} diff --git a/oaipmh-webapp/pom.xml b/oaipmh-webapp/pom.xml index 8e1a13c497acf13ed704b4cdf7cb965747859613..ed94d36a089be6a04d4e30895bd5b7184519425f 100644 --- a/oaipmh-webapp/pom.xml +++ b/oaipmh-webapp/pom.xml @@ -46,21 +46,8 @@ <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-frontend-jaxws</artifactId> - <version>${cxf.version}</version> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-transports-http</artifactId> - <version>${cxf.version}</version> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-rs-security-cors</artifactId> - <version>${cxf.version}</version> - </dependency> + + <dependency> <groupId>info.textgrid.middleware</groupId> <artifactId>oaipmh-core</artifactId> diff --git a/pom.xml b/pom.xml index 75c8de2c641463cc1b8f9bad56df43467688946e..d9eb6e80b8e3a714b1dfa7af5129691ce2923341 100644 --- a/pom.xml +++ b/pom.xml @@ -7,9 +7,7 @@ <packaging>pom</packaging> <name>TextGrid :: TG-OAI-PMH :: Parent</name> <properties> - <tgauth.wsdl>https://textgridlab.org/1.0/tgauth/rbacSoap/wsdl/tgextra.wsdl</tgauth.wsdl> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <sonar.host.url>https://ci.bibforge.org/sonar</sonar.host.url> <cxf.version>3.0.3</cxf.version> <tgcrud.version>5.5.9-SNAPSHOT</tgcrud.version> <spring.version>4.0.2.RELEASE</spring.version>