Commit 51967aa8 authored by Matija Obreza's avatar Matija Obreza

Java package organization

parent d1f12782
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest;
package org.genesys2.server;
public class ApplicationException extends Exception {
private static final long serialVersionUID = 7077761656242902954L;
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.aspect;
package org.genesys2.server.common.aspect;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
......
......@@ -15,14 +15,14 @@
**/
package org.genesys2.rest.common.aspect;
package org.genesys2.server.common.aspect;
import java.util.Arrays;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.genesys2.rest.common.model.UserRole;
import org.genesys2.server.common.model.UserRole;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.Authentication;
......@@ -43,8 +43,8 @@ public class AsAdminAspect {
Arrays.asList(new SimpleGrantedAuthority(UserRole.ADMINISTRATOR.getName()))
);
@Around("org.genesys2.rest.common.aspect.SystemArchitecture.allServices()" +
" && @annotation(org.genesys2.rest.common.aspect.AsAdmin)")
@Around("org.genesys2.server.common.aspect.SystemArchitecture.allServices()" +
" && @annotation(org.genesys2.server.common.aspect.AsAdmin)")
public Object authenticateAsAdmin(ProceedingJoinPoint pjp) throws Throwable {
//store previous version of auth (if any exists)
Authentication prevAuth = SecurityContextHolder.getContext().getAuthentication();
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.aspect;
package org.genesys2.server.common.aspect;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
......@@ -31,19 +31,19 @@ public class SystemArchitecture {
public void allServices(){
}
@Pointcut("execution(* org.genesys2.rest.common.service.*.*(..))")
@Pointcut("execution(* org.genesys2.server.common.service.*.*(..))")
public void businessServices(){
}
@Pointcut("execution(* org.genesys2.rest.common.listener.sample.*.*(..))")
@Pointcut("execution(* org.genesys2.server.common.listener.sample.*.*(..))")
public void sampleServices(){
}
@Pointcut("execution(* org.genesys2.rest.common.security.*.*(..))")
@Pointcut("execution(* org.genesys2.server.common.security.*.*(..))")
public void securityServices(){
}
@Pointcut("execution(* org.genesys2.rest.servlet.controller.*.*(..))")
@Pointcut("execution(* org.genesys2.server.servlet.controller.*.*(..))")
public void controllers(){
}
......@@ -52,15 +52,15 @@ public class SystemArchitecture {
*/
//USER
@Pointcut("execution(* org.genesys2.rest.common.service.impl.UserServiceImpl.addUser(..))")
@Pointcut("execution(* org.genesys2.server.common.service.impl.UserServiceImpl.addUser(..))")
public void addUserModel(){
}
@Pointcut("execution(* org.genesys2.rest.common.service.impl.UserServiceImpl.updateUser(..))")
@Pointcut("execution(* org.genesys2.server.common.service.impl.UserServiceImpl.updateUser(..))")
public void changeUserModel(){
}
@Pointcut("execution(* org.genesys2.rest.common.service.impl.UserServiceImpl.removeUser(..))")
@Pointcut("execution(* org.genesys2.server.common.service.impl.UserServiceImpl.removeUser(..))")
public void removeUserModel(){
}
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.config;
package org.genesys2.server.common.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.exception;
package org.genesys2.server.common.exception;
public class NoUserFoundException extends UserException {
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.exception;
package org.genesys2.server.common.exception;
public class NotUniqueUserException extends UserException {
......
......@@ -15,9 +15,9 @@
**/
package org.genesys2.rest.common.exception;
package org.genesys2.server.common.exception;
import org.genesys2.rest.ApplicationException;
import org.genesys2.server.ApplicationException;
public class UserException extends ApplicationException {
/**
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.factory;
package org.genesys2.server.common.factory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
......
......@@ -15,11 +15,11 @@
**/
package org.genesys2.rest.common.listener;
package org.genesys2.server.common.listener;
import java.util.concurrent.Callable;
import org.genesys2.rest.common.security.AsAdminInvoker;
import org.genesys2.server.common.security.AsAdminInvoker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
......
......@@ -14,15 +14,15 @@
* limitations under the License.
**/
package org.genesys2.rest.common.listener.sample;
package org.genesys2.server.common.listener.sample;
import java.util.HashSet;
import java.util.Set;
import org.genesys2.rest.common.listener.RunAsAdminListener;
import org.genesys2.rest.common.model.UserRole;
import org.genesys2.rest.common.model.impl.User;
import org.genesys2.rest.common.service.UserService;
import org.genesys2.server.common.listener.RunAsAdminListener;
import org.genesys2.server.common.model.UserRole;
import org.genesys2.server.common.model.impl.User;
import org.genesys2.server.common.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......
package org.genesys2.rest.common.lucene.genesys;
package org.genesys2.server.common.lucene.genesys;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.genesys2.rest.common.model.genesys.Accession;
import org.genesys2.rest.common.model.genesys.AllAccnames;
import org.genesys2.rest.common.model.genesys.AllAcqBreeding;
import org.genesys2.rest.common.model.genesys.AllAcqCollect;
import org.genesys2.rest.common.model.genesys.AllAcqExchange;
import org.genesys2.rest.common.model.genesys.Taxonomy;
import org.genesys2.rest.common.model.impl.Country;
import org.genesys2.rest.common.model.impl.FaoInstitute;
import org.genesys2.server.common.model.genesys.Accession;
import org.genesys2.server.common.model.genesys.AllAccnames;
import org.genesys2.server.common.model.genesys.AllAcqBreeding;
import org.genesys2.server.common.model.genesys.AllAcqCollect;
import org.genesys2.server.common.model.genesys.AllAcqExchange;
import org.genesys2.server.common.model.genesys.Taxonomy;
import org.genesys2.server.common.model.impl.Country;
import org.genesys2.server.common.model.impl.FaoInstitute;
import org.hibernate.search.bridge.FieldBridge;
import org.hibernate.search.bridge.LuceneOptions;
......
package org.genesys2.rest.common.lucene.genesys;
package org.genesys2.server.common.lucene.genesys;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.genesys2.rest.common.model.impl.FaoInstitute;
import org.genesys2.server.common.model.impl.FaoInstitute;
import org.hibernate.search.bridge.FieldBridge;
import org.hibernate.search.bridge.LuceneOptions;
......
package org.genesys2.rest.common.lucene.genesys;
package org.genesys2.server.common.lucene.genesys;
import org.apache.commons.lang.StringUtils;
......
......@@ -14,13 +14,13 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model;
package org.genesys2.server.common.model;
import java.util.Date;
import javax.persistence.MappedSuperclass;
import org.genesys2.rest.common.model.impl.User;
import org.genesys2.server.common.model.impl.User;
@MappedSuperclass
public abstract class AuditedModel extends OwnedModel {
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.model;
package org.genesys2.server.common.model;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.model;
package org.genesys2.server.common.model;
import java.io.Serializable;
......
......@@ -14,12 +14,12 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model;
package org.genesys2.server.common.model;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import org.genesys2.rest.common.model.impl.User;
import org.genesys2.server.common.model.impl.User;
@MappedSuperclass
public abstract class OwnedModel extends BusinessModel {
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.model;
package org.genesys2.server.common.model;
public enum Permissions {
CREATE("Create"),
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.model;
package org.genesys2.server.common.model;
public enum UserRole {
USER("User"),
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
// Generated Apr 24, 2013 10:08:59 AM by Hibernate Tools 4.0.0
......@@ -29,9 +29,9 @@ import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.genesys2.rest.common.lucene.genesys.AccessionBridge;
import org.genesys2.rest.common.model.impl.Country;
import org.genesys2.rest.common.model.impl.FaoInstitute;
import org.genesys2.server.common.lucene.genesys.AccessionBridge;
import org.genesys2.server.common.model.impl.Country;
import org.genesys2.server.common.model.impl.FaoInstitute;
import org.hibernate.search.annotations.ClassBridge;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Indexed;
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
import java.io.Serializable;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
// Generated Apr 24, 2013 10:08:59 AM by Hibernate Tools 4.0.0
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
// Generated Apr 24, 2013 10:08:59 AM by Hibernate Tools 4.0.0
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
// Generated Apr 24, 2013 10:08:59 AM by Hibernate Tools 4.0.0
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
// Generated Apr 24, 2013 10:08:59 AM by Hibernate Tools 4.0.0
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
// Generated Apr 24, 2013 10:08:59 AM by Hibernate Tools 4.0.0
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
public class ExperimentTrait {
private long experimentId;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
// Generated Apr 24, 2013 10:08:59 AM by Hibernate Tools 4.0.0
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
import java.io.Serializable;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
import javax.persistence.Column;
import javax.persistence.Entity;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -25,7 +25,7 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.genesys2.rest.common.model.impl.Crop;
import org.genesys2.server.common.model.impl.Crop;
@Entity
@Table(name = "parameters")
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
import java.text.MessageFormat;
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.model.genesys;
package org.genesys2.server.common.model.genesys;
import java.text.MessageFormat;
import java.util.ArrayList;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.impl;
package org.genesys2.server.common.model.impl;
import java.util.Calendar;
......@@ -25,7 +25,7 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.genesys2.rest.common.model.BusinessModel;
import org.genesys2.server.common.model.BusinessModel;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;
......
......@@ -15,7 +15,7 @@
**/
package org.genesys2.rest.common.model.impl;
package org.genesys2.server.common.model.impl;
import java.util.Calendar;
......@@ -26,7 +26,7 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.genesys2.rest.common.model.BusinessModel;
import org.genesys2.server.common.model.BusinessModel;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.impl;
package org.genesys2.server.common.model.impl;
import java.util.ArrayList;
import java.util.List;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.rest.common.model.impl;
package org.genesys2.server.common.model.impl;
import java.text.MessageFormat;
......