Skip to content

Commit

Permalink
Merge pull request #5 from jorizci/EE-504
Browse files Browse the repository at this point in the history
EE-504 accessioning alpha application
  • Loading branch information
jorizci authored Aug 29, 2018
2 parents 1bec8ac + 2d0abd2 commit 53e4fac
Show file tree
Hide file tree
Showing 166 changed files with 4,879 additions and 2,428 deletions.
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# IntelliJ files
*.iml
.idea

# Maven target directory
target
/.project
9 changes: 7 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@
<dependencies>
<dependency>
<groupId>uk.ac.ebi.ampt2d</groupId>
<artifactId>accessioning-commons</artifactId>
<version>1.0-SNAPSHOT</version>
<artifactId>accession-commons-jpa</artifactId>
<version>0.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>uk.ac.ebi.ampt2d</groupId>
<artifactId>accession-commons-monotonic-generator-jpa</artifactId>
<version>0.6-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
import org.springframework.boot.web.support.SpringBootServletInitializer;

@SpringBootApplication
public class EGAAccessioningApplication extends SpringBootServletInitializer {
public class EgaAccessioningApplication extends SpringBootServletInitializer {

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(EGAAccessioningApplication.class);
return application.sources(EgaAccessioningApplication.class);
}

public static void main(String[] args) throws Exception {
SpringApplication.run(EGAAccessioningApplication.class, args);
public static void main(String[] args) {
SpringApplication.run(EgaAccessioningApplication.class, args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
* limitations under the License.
*
*/
package uk.ac.ebi.ega.accession.analysis.model;

package uk.ac.ebi.ega.accession.study;
public interface Analysis {

import java.util.Map;
String getSubmissionAccount();

String getAlias();

public interface StudyModel {
Map<String, String> getStudyProperties();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
*
* Copyright 2018 EMBL - European Bioinformatics Institute
*
* 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 uk.ac.ebi.ega.accession.analysis.persistence;

import uk.ac.ebi.ampt2d.commons.accession.core.models.AccessionWrapper;
import uk.ac.ebi.ampt2d.commons.accession.persistence.jpa.entities.AccessionedEntity;
import uk.ac.ebi.ega.accession.analysis.model.Analysis;

import javax.persistence.Column;
import javax.persistence.Entity;

@Entity
public class AnalysisEntity extends AccessionedEntity<Analysis, Long> implements Analysis {

@Column(nullable = false)
private String submissionAccount;

@Column(nullable = false)
private String alias;

AnalysisEntity() {
super(null, null, -1);
}

public AnalysisEntity(Analysis analysis, Long accession, String hashedMessage, int version) {
super(hashedMessage, accession, version);
this.submissionAccount = analysis.getSubmissionAccount();
this.alias = analysis.getAlias();
}

public AnalysisEntity(AccessionWrapper<Analysis, String, Long> wrapper) {
this(wrapper.getData(), wrapper.getAccession(), wrapper.getHash(), wrapper.getVersion());
}

@Override
public Analysis getModel() {
return this;
}

@Override
public String getSubmissionAccount() {
return submissionAccount;
}

@Override
public String getAlias() {
return alias;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
*
* Copyright 2018 EMBL - European Bioinformatics Institute
*
* 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 uk.ac.ebi.ega.accession.analysis.persistence;

import org.springframework.stereotype.Repository;
import uk.ac.ebi.ampt2d.commons.accession.persistence.repositories.IAccessionedObjectRepository;

@Repository
public interface AnalysisEntityRepository extends IAccessionedObjectRepository<AnalysisEntity, Long> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
*
* Copyright 2018 EMBL - European Bioinformatics Institute
*
* 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 uk.ac.ebi.ega.accession.analysis.persistence;

import org.springframework.transaction.PlatformTransactionManager;
import uk.ac.ebi.ampt2d.commons.accession.persistence.jpa.repositories.BasicJpaAccessionedObjectCustomRepositoryImpl;

import javax.persistence.EntityManager;

public class AnalysisEntityRepositoryImpl extends BasicJpaAccessionedObjectCustomRepositoryImpl<Long, AnalysisEntity> {

public AnalysisEntityRepositoryImpl(PlatformTransactionManager platformTransactionManager, EntityManager entityManager) {
super(AnalysisEntity.class, platformTransactionManager, entityManager);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
*
* Copyright 2018 EMBL - European Bioinformatics Institute
*
* 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 uk.ac.ebi.ega.accession.analysis.persistence;

import uk.ac.ebi.ampt2d.commons.accession.persistence.jpa.entities.InactiveAccessionEntity;
import uk.ac.ebi.ega.accession.analysis.model.Analysis;

import javax.persistence.Column;
import javax.persistence.Entity;

@Entity
public class HistoricAnalysisEntity extends InactiveAccessionEntity<Analysis, Long> implements Analysis {

@Column(nullable = false)
private String submissionAccount;

@Column(nullable = false)
private String alias;

HistoricAnalysisEntity() {
super();
}

public HistoricAnalysisEntity(AnalysisEntity entity) {
super(entity);
this.submissionAccount = entity.getSubmissionAccount();
this.alias = entity.getAlias();
}

@Override
public Analysis getModel() {
return this;
}

@Override
public String getSubmissionAccount() {
return submissionAccount;
}

@Override
public String getAlias() {
return alias;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
*
* Copyright 2018 EMBL - European Bioinformatics Institute
*
* 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 uk.ac.ebi.ega.accession.analysis.persistence;

import org.springframework.stereotype.Repository;
import uk.ac.ebi.ampt2d.commons.accession.persistence.jpa.repositories.InactiveAccessionRepository;

@Repository
public interface HistoricAnalysisRepository extends InactiveAccessionRepository<HistoricAnalysisEntity> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
*
* Copyright 2018 EMBL - European Bioinformatics Institute
*
* 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 uk.ac.ebi.ega.accession.analysis.persistence;

import uk.ac.ebi.ampt2d.commons.accession.persistence.jpa.entities.OperationEntity;

import javax.persistence.Entity;

@Entity
public class HistoricLogAnalysisEntity extends OperationEntity<Long> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
*
* Copyright 2018 EMBL - European Bioinformatics Institute
*
* 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 uk.ac.ebi.ega.accession.analysis.persistence;

import org.springframework.stereotype.Repository;
import uk.ac.ebi.ampt2d.commons.accession.persistence.repositories.IHistoryRepository;

@Repository
public interface HistoricLogAnalysisRepository extends IHistoryRepository<Long, HistoricLogAnalysisEntity, Long> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
*
* Copyright 2018 EMBL - European Bioinformatics Institute
*
* 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 uk.ac.ebi.ega.accession.analysis.rest;

import uk.ac.ebi.ega.accession.analysis.model.Analysis;

import javax.persistence.Column;

public class AnalysisDTO implements Analysis {

@Column(nullable = false)
private String submissionAccount;

@Column(nullable = false)
private String alias;

AnalysisDTO(){
}

public AnalysisDTO(Analysis analysis) {
this(analysis.getSubmissionAccount(), analysis.getAlias());
}

public AnalysisDTO(String submissionAccount, String alias) {
this.submissionAccount = submissionAccount;
this.alias = alias;
}

@Override
public String getSubmissionAccount() {
return submissionAccount;
}

@Override
public String getAlias() {
return alias;
}

}
Loading

0 comments on commit 53e4fac

Please sign in to comment.