[CCM][UPDATE]
- adds all missing serialVersionUIDs to import/export classes (e.g. Manager, Repository, Marshaller, IdGenerator, IdResolver) - marks Marshaller-class (interface import/export to gui) as deprecated, to force review when implementing gui for import/export git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5216 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
4aa96fdfcd
commit
863e026034
|
|
@ -25,6 +25,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerator;
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
public class CategorizationIdGenerator extends ObjectIdGenerator<String> {
|
public class CategorizationIdGenerator extends ObjectIdGenerator<String> {
|
||||||
|
private static final long serialVersionUID = 3013739402534056286L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<?> getScope() {
|
public Class<?> getScope() {
|
||||||
return Categorization.class;
|
return Categorization.class;
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
|
|
@ -32,7 +33,9 @@ import javax.transaction.Transactional;
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Marshals(Categorization.class)
|
@Marshals(Categorization.class)
|
||||||
public class CategorizationMarshaller extends AbstractMarshaller<Categorization>{
|
public class CategorizationMarshaller extends AbstractMarshaller<Categorization> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -4388218720510005447L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class CategoryIdResolver implements ObjectIdResolver {
|
public class CategoryIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = -5750627754502675522L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(ObjectIdGenerator.IdKey idKey,
|
public void bindItem(ObjectIdGenerator.IdKey idKey,
|
||||||
Object pojo) {
|
Object pojo) {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ import javax.transaction.Transactional;
|
||||||
import static org.libreccm.categorization.CategorizationConstants.PRIVILEGE_MANAGE_CATEGORY;
|
import static org.libreccm.categorization.CategorizationConstants.PRIVILEGE_MANAGE_CATEGORY;
|
||||||
import static org.libreccm.categorization.CategorizationConstants.PRIVILEGE_MANAGE_CATEGORY_OBJECTS;
|
import static org.libreccm.categorization.CategorizationConstants.PRIVILEGE_MANAGE_CATEGORY_OBJECTS;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -51,7 +52,8 @@ import java.util.StringJoiner;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class CategoryManager {
|
public class CategoryManager implements Serializable {
|
||||||
|
private static final long serialVersionUID = -3354487547729008811L;
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger(
|
private static final Logger LOGGER = LogManager.getLogger(
|
||||||
CategoryManager.class);
|
CategoryManager.class);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import org.libreccm.portation.Marshals;
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
|
||||||
|
|
@ -33,6 +34,8 @@ import javax.transaction.Transactional;
|
||||||
@Marshals(Category.class)
|
@Marshals(Category.class)
|
||||||
public class CategoryMarshaller extends AbstractMarshaller<Category> {
|
public class CategoryMarshaller extends AbstractMarshaller<Category> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -9089135773302229477L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private CategoryRepository categoryRepository;
|
private CategoryRepository categoryRepository;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||||
* @version created the 8/2/17
|
* @version created the 8/2/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class DomainIdResolver implements ObjectIdResolver {
|
public class DomainIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = -8504371142795445708L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(ObjectIdGenerator.IdKey idKey, Object o) {
|
public void bindItem(ObjectIdGenerator.IdKey idKey, Object o) {
|
||||||
// According to the Jackson JavaDoc, this method can be used to keep
|
// According to the Jackson JavaDoc, this method can be used to keep
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import javax.inject.Inject;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.TypedQuery;
|
import javax.persistence.TypedQuery;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
|
@ -38,7 +39,9 @@ import java.util.Optional;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class DomainManager {
|
public class DomainManager implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -8921596414159020455L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ApplicationRepository applicationRepo;
|
private ApplicationRepository applicationRepo;
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import org.libreccm.portation.Marshals;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||||
|
|
@ -32,6 +33,8 @@ import javax.inject.Inject;
|
||||||
@Marshals(Domain.class)
|
@Marshals(Domain.class)
|
||||||
public class DomainMarshaller extends AbstractMarshaller<Domain> {
|
public class DomainMarshaller extends AbstractMarshaller<Domain> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -2435714410695539890L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private DomainRepository domainRepository;
|
private DomainRepository domainRepository;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerator;
|
||||||
* @version created the 8/10/17
|
* @version created the 8/10/17
|
||||||
*/
|
*/
|
||||||
public class DomainOwnershipIdGenerator extends ObjectIdGenerator<String> {
|
public class DomainOwnershipIdGenerator extends ObjectIdGenerator<String> {
|
||||||
|
private static final long serialVersionUID = -5651368736214980681L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<?> getScope() {
|
public Class<?> getScope() {
|
||||||
return DomainOwnership.class;
|
return DomainOwnership.class;
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ import javax.persistence.EntityManager;
|
||||||
@Marshals(DomainOwnership.class)
|
@Marshals(DomainOwnership.class)
|
||||||
public class DomainOwnershipMarshaller extends AbstractMarshaller<DomainOwnership> {
|
public class DomainOwnershipMarshaller extends AbstractMarshaller<DomainOwnership> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 6743023023790517330L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ import java.util.UUID;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class DomainRepository extends AbstractEntityRepository<Long, Domain> {
|
public class DomainRepository extends AbstractEntityRepository<Long, Domain> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -924664711844102643L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<Domain> getEntityClass() {
|
public Class<Domain> getEntityClass() {
|
||||||
return Domain.class;
|
return Domain.class;
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class CcmObjectIdResolver implements ObjectIdResolver {
|
public class CcmObjectIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = 246452778202614974L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(ObjectIdGenerator.IdKey idKey,
|
public void bindItem(ObjectIdGenerator.IdKey idKey,
|
||||||
Object pojo) {
|
Object pojo) {
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ import static org.libreccm.core.CoreConstants.ACCESS_DENIED;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class CcmObjectRepository extends AbstractEntityRepository<Long, CcmObject> {
|
public class CcmObjectRepository extends AbstractEntityRepository<Long, CcmObject> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 5033157795875521195L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<CcmObject> getEntityClass() {
|
public Class<CcmObject> getEntityClass() {
|
||||||
return CcmObject.class;
|
return CcmObject.class;
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||||
* @version created the 8/10/17
|
* @version created the 8/10/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class ResourceIdResolver implements ObjectIdResolver {
|
public class ResourceIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = -402304483886269532L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(ObjectIdGenerator.IdKey idKey, Object o) {
|
public void bindItem(ObjectIdGenerator.IdKey idKey, Object o) {
|
||||||
// According to the Jackson JavaDoc, this method can be used to keep
|
// According to the Jackson JavaDoc, this method can be used to keep
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ import java.util.UUID;
|
||||||
public class ResourceRepository extends AbstractEntityRepository<Long,
|
public class ResourceRepository extends AbstractEntityRepository<Long,
|
||||||
Resource> {
|
Resource> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 4593206445936878071L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<Resource> getEntityClass() {
|
public Class<Resource> getEntityClass() {
|
||||||
return Resource.class;
|
return Resource.class;
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||||
* @version created the 8/10/17
|
* @version created the 8/10/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class ResourceTypeIdResolver implements ObjectIdResolver {
|
public class ResourceTypeIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = -3756063950193704821L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(ObjectIdGenerator.IdKey idKey, Object o) {
|
public void bindItem(ObjectIdGenerator.IdKey idKey, Object o) {
|
||||||
// According to the Jackson JavaDoc, this method can be used to keep
|
// According to the Jackson JavaDoc, this method can be used to keep
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ import javax.inject.Inject;
|
||||||
@Marshals(ResourceType.class)
|
@Marshals(ResourceType.class)
|
||||||
public class ResourceTypeMarshaller extends AbstractMarshaller<ResourceType> {
|
public class ResourceTypeMarshaller extends AbstractMarshaller<ResourceType> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 79174993117568181L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ResourceTypeRepository resourceTypeRepository;
|
private ResourceTypeRepository resourceTypeRepository;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ import java.util.Optional;
|
||||||
public class ResourceTypeRepository extends AbstractEntityRepository<Long,
|
public class ResourceTypeRepository extends AbstractEntityRepository<Long,
|
||||||
ResourceType> {
|
ResourceType> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -6313169146990554867L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<ResourceType> getEntityClass() {
|
public Class<ResourceType> getEntityClass() {
|
||||||
return ResourceType.class;
|
return ResourceType.class;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import org.apache.logging.log4j.Logger;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -42,7 +43,9 @@ import java.util.List;
|
||||||
* @version created the 2/10/16
|
* @version created the 2/10/16
|
||||||
* @param <P>
|
* @param <P>
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractMarshaller<P extends Portable> {
|
public abstract class AbstractMarshaller<P extends Portable> implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -5796378713915256691L;
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger(
|
private static final Logger LOGGER = LogManager.getLogger(
|
||||||
AbstractMarshaller.class);
|
AbstractMarshaller.class);
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import javax.enterprise.inject.Instance;
|
||||||
import javax.enterprise.util.AnnotationLiteral;
|
import javax.enterprise.util.AnnotationLiteral;
|
||||||
import javax.faces.bean.RequestScoped;
|
import javax.faces.bean.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -41,7 +42,10 @@ import java.util.Map;
|
||||||
* @version created the 03.02.2016
|
* @version created the 03.02.2016
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class Marshaller {
|
@Deprecated /*needs to be reviewed when integrating import/export in gui*/
|
||||||
|
public class Marshaller implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 6769177147719834999L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Any
|
@Any
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class GroupIdResolver implements ObjectIdResolver {
|
public class GroupIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = 3700628942920771114L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(final ObjectIdGenerator.IdKey id,
|
public void bindItem(final ObjectIdGenerator.IdKey id,
|
||||||
final Object pojo) {
|
final Object pojo) {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import javax.persistence.EntityManager;
|
||||||
import javax.persistence.NoResultException;
|
import javax.persistence.NoResultException;
|
||||||
import javax.persistence.TypedQuery;
|
import javax.persistence.TypedQuery;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -35,7 +36,8 @@ import java.util.List;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class GroupManager {
|
public class GroupManager implements Serializable {
|
||||||
|
private static final long serialVersionUID = 8001182420672016296L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private GroupRepository groupRepository;
|
private GroupRepository groupRepository;
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ import javax.transaction.Transactional;
|
||||||
@Marshals(Group.class)
|
@Marshals(Group.class)
|
||||||
public class GroupMarshaller extends AbstractMarshaller<Group> {
|
public class GroupMarshaller extends AbstractMarshaller<Group> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 5004457104585052013L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private GroupRepository groupRepository;
|
private GroupRepository groupRepository;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerator;
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
public class GroupMembershipIdGenerator extends ObjectIdGenerator<String> {
|
public class GroupMembershipIdGenerator extends ObjectIdGenerator<String> {
|
||||||
|
private static final long serialVersionUID = 5256221797846627835L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<?> getScope() {
|
public Class<?> getScope() {
|
||||||
return GroupMembership.class;
|
return GroupMembership.class;
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ import javax.transaction.Transactional;
|
||||||
@Marshals(GroupMembership.class)
|
@Marshals(GroupMembership.class)
|
||||||
public class GroupMembershipMarshaller extends AbstractMarshaller<GroupMembership> {
|
public class GroupMembershipMarshaller extends AbstractMarshaller<GroupMembership> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -1920271635191667015L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@ import java.util.Optional;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class GroupRepository extends AbstractEntityRepository<Long, Group> {
|
public class GroupRepository extends AbstractEntityRepository<Long, Group> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 115864505126792697L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<Group> getEntityClass() {
|
public Class<Group> getEntityClass() {
|
||||||
return Group.class;
|
return Group.class;
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class PartyIdResolver implements ObjectIdResolver {
|
public class PartyIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = -1208121020457080214L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(final ObjectIdGenerator.IdKey id,
|
public void bindItem(final ObjectIdGenerator.IdKey id,
|
||||||
final Object pojo) {
|
final Object pojo) {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerator;
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
public class PermissionIdGenerator extends ObjectIdGenerator<String> {
|
public class PermissionIdGenerator extends ObjectIdGenerator<String> {
|
||||||
|
private static final long serialVersionUID = -8762745860290577542L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<?> getScope() {
|
public Class<?> getScope() {
|
||||||
return Permission.class;
|
return Permission.class;
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import org.libreccm.core.CcmObjectRepository;
|
||||||
import org.libreccm.core.UnexpectedErrorException;
|
import org.libreccm.core.UnexpectedErrorException;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -33,7 +34,9 @@ import java.util.Optional;
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class PermissionIdResolver implements ObjectIdResolver {
|
public class PermissionIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = -8397366681202009916L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(final ObjectIdGenerator.IdKey id,
|
public void bindItem(final ObjectIdGenerator.IdKey id,
|
||||||
final Object pojo) {
|
final Object pojo) {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import javax.persistence.EntityManager;
|
||||||
import javax.persistence.Query;
|
import javax.persistence.Query;
|
||||||
import javax.persistence.TypedQuery;
|
import javax.persistence.TypedQuery;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -45,7 +46,8 @@ import java.util.stream.Collectors;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class PermissionManager {
|
public class PermissionManager implements Serializable {
|
||||||
|
private static final long serialVersionUID = -6068575941173342106L;
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager
|
private static final Logger LOGGER = LogManager
|
||||||
.getLogger(PermissionManager.class);
|
.getLogger(PermissionManager.class);
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ import javax.transaction.Transactional;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Marshals(Permission.class)
|
@Marshals(Permission.class)
|
||||||
public class PermissionMarshaller extends AbstractMarshaller<Permission> {
|
public class PermissionMarshaller extends AbstractMarshaller<Permission> {
|
||||||
|
private static final long serialVersionUID = -5145925775270121916L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@ import java.util.Optional;
|
||||||
public class PermissionRepository
|
public class PermissionRepository
|
||||||
extends AbstractEntityRepository<Long, Permission> {
|
extends AbstractEntityRepository<Long, Permission> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -4240674229117593486L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<Permission> getEntityClass() {
|
public Class<Permission> getEntityClass() {
|
||||||
return Permission.class;
|
return Permission.class;
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class RoleIdResolver implements ObjectIdResolver {
|
public class RoleIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = -1651704701257277011L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(final ObjectIdGenerator.IdKey id,
|
public void bindItem(final ObjectIdGenerator.IdKey id,
|
||||||
final Object pojo) {
|
final Object pojo) {
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import javax.transaction.Transactional;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Marshals(Role.class)
|
@Marshals(Role.class)
|
||||||
public class RoleMarshaller extends AbstractMarshaller<Role> {
|
public class RoleMarshaller extends AbstractMarshaller<Role> {
|
||||||
|
private static final long serialVersionUID = -2150833120444479902L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private RoleRepository roleRepository;
|
private RoleRepository roleRepository;
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerator;
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
public class RoleMembershipIdGenerator extends ObjectIdGenerator<String> {
|
public class RoleMembershipIdGenerator extends ObjectIdGenerator<String> {
|
||||||
|
private static final long serialVersionUID = 801410727263488529L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<?> getScope() {
|
public Class<?> getScope() {
|
||||||
return RoleMembership.class;
|
return RoleMembership.class;
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,10 @@ import javax.transaction.Transactional;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Marshals(RoleMembership.class)
|
@Marshals(RoleMembership.class)
|
||||||
public class RoleMembershipMarshaller extends AbstractMarshaller<RoleMembership> {
|
public class RoleMembershipMarshaller extends AbstractMarshaller<RoleMembership> {
|
||||||
|
private static final long serialVersionUID = 1304404004268502935L;
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger(RoleMembershipMarshaller.class);
|
private static final Logger LOGGER = LogManager.getLogger(RoleMembershipMarshaller.class);
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class UserIdResolver implements ObjectIdResolver {
|
public class UserIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = -2541656707906049331L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(final ObjectIdGenerator.IdKey id,
|
public void bindItem(final ObjectIdGenerator.IdKey id,
|
||||||
final Object pojo) {
|
final Object pojo) {
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ import javax.inject.Inject;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import javax.validation.executable.ValidateOnExecution;
|
import javax.validation.executable.ValidateOnExecution;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides various operations for user objects.
|
* Provides various operations for user objects.
|
||||||
|
|
@ -47,7 +48,8 @@ import javax.validation.executable.ValidateOnExecution;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class UserManager {
|
public class UserManager implements Serializable {
|
||||||
|
private static final long serialVersionUID = -5457302841422810115L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private UserRepository userRepository;
|
private UserRepository userRepository;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import javax.transaction.Transactional;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Marshals(User.class)
|
@Marshals(User.class)
|
||||||
public class UserMarshaller extends AbstractMarshaller<User> {
|
public class UserMarshaller extends AbstractMarshaller<User> {
|
||||||
|
private static final long serialVersionUID = -7857346915894246160L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private UserRepository userRepository;
|
private UserRepository userRepository;
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||||
* @version created the 8/10/17
|
* @version created the 8/10/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class ApplicationIdResolver implements ObjectIdResolver {
|
public class ApplicationIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = 464933392877186401L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(ObjectIdGenerator.IdKey idKey, Object o) {
|
public void bindItem(ObjectIdGenerator.IdKey idKey, Object o) {
|
||||||
// According to the Jackson JavaDoc, this method can be used to keep
|
// According to the Jackson JavaDoc, this method can be used to keep
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ import javax.persistence.TypedQuery;
|
||||||
import javax.servlet.annotation.WebServlet;
|
import javax.servlet.annotation.WebServlet;
|
||||||
import javax.servlet.http.HttpServlet;
|
import javax.servlet.http.HttpServlet;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -44,10 +45,11 @@ import java.util.*;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class ApplicationManager {
|
public class ApplicationManager implements Serializable {
|
||||||
|
private static final long serialVersionUID = -4623791386536335252L;
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger(
|
private static final Logger LOGGER = LogManager.getLogger(
|
||||||
ApplicationManager.class);
|
ApplicationManager.class);
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
@ -60,11 +62,11 @@ public class ApplicationManager {
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
private void loadApplicationTypes() {
|
private void loadApplicationTypes() {
|
||||||
final ServiceLoader<CcmModule> modules = ServiceLoader.load(
|
final ServiceLoader<CcmModule> modules = ServiceLoader.load(
|
||||||
CcmModule.class);
|
CcmModule.class);
|
||||||
|
|
||||||
for (CcmModule module : modules) {
|
for (CcmModule module : modules) {
|
||||||
final Module moduleData = module.getClass().getAnnotation(
|
final Module moduleData = module.getClass().getAnnotation(
|
||||||
Module.class);
|
Module.class);
|
||||||
|
|
||||||
final ApplicationType[] appTypes = moduleData.applicationTypes();
|
final ApplicationType[] appTypes = moduleData.applicationTypes();
|
||||||
|
|
||||||
|
|
@ -88,12 +90,12 @@ public class ApplicationManager {
|
||||||
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||||
@Transactional(Transactional.TxType.REQUIRED)
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
public <T extends CcmApplication> T createInstance(
|
public <T extends CcmApplication> T createInstance(
|
||||||
final ApplicationType type,
|
final ApplicationType type,
|
||||||
final String path,
|
final String path,
|
||||||
final Class<T> applicationClass) throws ApplicationCreateException {
|
final Class<T> applicationClass) throws ApplicationCreateException {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
final ApplicationCreator<T> creator = CdiUtil.createCdiUtil().findBean(
|
final ApplicationCreator<T> creator = CdiUtil.createCdiUtil().findBean(
|
||||||
type.creator());
|
type.creator());
|
||||||
final T application = creator.createInstance(path, type);
|
final T application = creator.createInstance(path, type);
|
||||||
|
|
||||||
entityManager.persist(application);
|
entityManager.persist(application);
|
||||||
|
|
@ -110,7 +112,7 @@ public class ApplicationManager {
|
||||||
|
|
||||||
public CcmApplication findApplicationByPath(final String path) {
|
public CcmApplication findApplicationByPath(final String path) {
|
||||||
final TypedQuery<CcmApplication> query = entityManager.createNamedQuery(
|
final TypedQuery<CcmApplication> query = entityManager.createNamedQuery(
|
||||||
"CcmApplication.retrieveApplicationForPath", CcmApplication.class);
|
"CcmApplication.retrieveApplicationForPath", CcmApplication.class);
|
||||||
query.setParameter("path", path);
|
query.setParameter("path", path);
|
||||||
final List<CcmApplication> result = query.getResultList();
|
final List<CcmApplication> result = query.getResultList();
|
||||||
if (result.isEmpty()) {
|
if (result.isEmpty()) {
|
||||||
|
|
@ -129,26 +131,26 @@ public class ApplicationManager {
|
||||||
|
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
throw new IllegalArgumentException(String.format(
|
throw new IllegalArgumentException(String.format(
|
||||||
"Unknown application type \"%s\".", typeName));
|
"Unknown application type \"%s\".", typeName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.servletPath().isEmpty()) {
|
if (type.servletPath().isEmpty()) {
|
||||||
if (type.servlet().equals(HttpServlet.class)) {
|
if (type.servlet().equals(HttpServlet.class)) {
|
||||||
throw new IllegalArgumentException(String.format(
|
throw new IllegalArgumentException(String.format(
|
||||||
"Application type \"%s\" can no servlet path nor a serlet "
|
"Application type \"%s\" can no servlet path nor a serlet "
|
||||||
+ "definition.",
|
+ "definition.",
|
||||||
typeName));
|
typeName));
|
||||||
} else {
|
} else {
|
||||||
final Class<? extends HttpServlet> servletClass = type.servlet();
|
final Class<? extends HttpServlet> servletClass = type.servlet();
|
||||||
|
|
||||||
if (servletClass.isAnnotationPresent(WebServlet.class)) {
|
if (servletClass.isAnnotationPresent(WebServlet.class)) {
|
||||||
return servletClass.getAnnotation(WebServlet.class)
|
return servletClass.getAnnotation(WebServlet.class)
|
||||||
.urlPatterns()[0];
|
.urlPatterns()[0];
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException(String.format(
|
throw new IllegalArgumentException(String.format(
|
||||||
"Provided servlet for application type \"%s\" has not "
|
"Provided servlet for application type \"%s\" has not "
|
||||||
+ "@WebServlet annotation.",
|
+ "@WebServlet annotation.",
|
||||||
typeName));
|
typeName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -157,7 +159,7 @@ public class ApplicationManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getApplicationTypeTitle(
|
public String getApplicationTypeTitle(
|
||||||
final ApplicationType applicationType) {
|
final ApplicationType applicationType) {
|
||||||
|
|
||||||
final String descBundle;
|
final String descBundle;
|
||||||
if (Strings.isBlank(applicationType.descBundle())) {
|
if (Strings.isBlank(applicationType.descBundle())) {
|
||||||
|
|
@ -169,7 +171,7 @@ public class ApplicationManager {
|
||||||
final ResourceBundle bundle;
|
final ResourceBundle bundle;
|
||||||
try {
|
try {
|
||||||
bundle = ResourceBundle.getBundle(
|
bundle = ResourceBundle.getBundle(
|
||||||
descBundle, globalizationHelper.getNegotiatedLocale());
|
descBundle, globalizationHelper.getNegotiatedLocale());
|
||||||
return bundle.getString(applicationType.titleKey());
|
return bundle.getString(applicationType.titleKey());
|
||||||
} catch (MissingResourceException ex) {
|
} catch (MissingResourceException ex) {
|
||||||
LOGGER.warn("Failed to find resource bundle '{}'.", ex);
|
LOGGER.warn("Failed to find resource bundle '{}'.", ex);
|
||||||
|
|
@ -179,7 +181,7 @@ public class ApplicationManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getApplicationTypeDescription(
|
public String getApplicationTypeDescription(
|
||||||
final ApplicationType applicationType) {
|
final ApplicationType applicationType) {
|
||||||
|
|
||||||
final String descBundle;
|
final String descBundle;
|
||||||
if (Strings.isBlank(applicationType.descBundle())) {
|
if (Strings.isBlank(applicationType.descBundle())) {
|
||||||
|
|
@ -191,7 +193,7 @@ public class ApplicationManager {
|
||||||
final ResourceBundle bundle;
|
final ResourceBundle bundle;
|
||||||
try {
|
try {
|
||||||
bundle = ResourceBundle.getBundle(
|
bundle = ResourceBundle.getBundle(
|
||||||
descBundle, globalizationHelper.getNegotiatedLocale());
|
descBundle, globalizationHelper.getNegotiatedLocale());
|
||||||
return bundle.getString(applicationType.descKey());
|
return bundle.getString(applicationType.descKey());
|
||||||
} catch (MissingResourceException ex) {
|
} catch (MissingResourceException ex) {
|
||||||
LOGGER.warn("Failed to find resource bundle '{}'.", ex);
|
LOGGER.warn("Failed to find resource bundle '{}'.", ex);
|
||||||
|
|
@ -201,3 +203,4 @@ public class ApplicationManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import javax.inject.Inject;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Marshals(CcmApplication.class)
|
@Marshals(CcmApplication.class)
|
||||||
public class ApplicationMarshaller extends AbstractMarshaller<CcmApplication> {
|
public class ApplicationMarshaller extends AbstractMarshaller<CcmApplication> {
|
||||||
|
private static final long serialVersionUID = -342978428750991072L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ApplicationRepository applicationRepository;
|
private ApplicationRepository applicationRepository;
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,17 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class AssignableTaskIdResolver implements ObjectIdResolver {
|
public class AssignableTaskIdResolver implements Serializable,
|
||||||
|
ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = -4634332219001315735L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(final ObjectIdGenerator.IdKey id,
|
public void bindItem(final ObjectIdGenerator.IdKey id,
|
||||||
final Object pojo) {
|
final Object pojo) {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import javax.inject.Inject;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.TypedQuery;
|
import javax.persistence.TypedQuery;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
@ -36,7 +37,8 @@ import java.util.stream.Collectors;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class AssignableTaskManager {
|
public class AssignableTaskManager implements Serializable {
|
||||||
|
private static final long serialVersionUID = -4364893854116452485L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import javax.transaction.Transactional;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Marshals(AssignableTask.class)
|
@Marshals(AssignableTask.class)
|
||||||
public class AssignableTaskMarshaller extends AbstractMarshaller<AssignableTask> {
|
public class AssignableTaskMarshaller extends AbstractMarshaller<AssignableTask> {
|
||||||
|
private static final long serialVersionUID = -2787744872933470651L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AssignableTaskRepository assignableTaskRepository;
|
private AssignableTaskRepository assignableTaskRepository;
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ import java.util.stream.Collectors;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class AssignableTaskRepository extends AbstractEntityRepository<Long,
|
public class AssignableTaskRepository extends AbstractEntityRepository<Long,
|
||||||
AssignableTask> {
|
AssignableTask> {
|
||||||
|
private static final long serialVersionUID = 2657793145163510103L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<AssignableTask> getEntityClass() {
|
public Class<AssignableTask> getEntityClass() {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerator;
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
public class TaskAssignmentIdGenerator extends ObjectIdGenerator<String> {
|
public class TaskAssignmentIdGenerator extends ObjectIdGenerator<String> {
|
||||||
|
private static final long serialVersionUID = -5493483256068253010L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<?> getScope() {
|
public Class<?> getScope() {
|
||||||
return TaskAssignment.class;
|
return TaskAssignment.class;
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ import javax.transaction.Transactional;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Marshals(TaskAssignment.class)
|
@Marshals(TaskAssignment.class)
|
||||||
public class TaskAssignmentMarshaller extends AbstractMarshaller<TaskAssignment> {
|
public class TaskAssignmentMarshaller extends AbstractMarshaller<TaskAssignment> {
|
||||||
|
private static final long serialVersionUID = 3717946510122661215L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,15 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerator;
|
||||||
import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||||
* @version created the 9/27/17
|
* @version created the 9/27/17
|
||||||
*/
|
*/
|
||||||
public class TaskCommentIdResolver implements ObjectIdResolver {
|
public class TaskCommentIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = 1057961565308988397L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(ObjectIdGenerator.IdKey id,
|
public void bindItem(ObjectIdGenerator.IdKey id,
|
||||||
Object pojo) {
|
Object pojo) {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import javax.inject.Inject;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Marshals(TaskComment.class)
|
@Marshals(TaskComment.class)
|
||||||
public class TaskCommentMarshaller extends AbstractMarshaller<TaskComment> {
|
public class TaskCommentMarshaller extends AbstractMarshaller<TaskComment> {
|
||||||
|
private static final long serialVersionUID = -3259560130798503811L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private TaskCommentRepository taskCommentRepository;
|
private TaskCommentRepository taskCommentRepository;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ import java.util.Optional;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class TaskCommentRepository extends AbstractEntityRepository<Long,
|
public class TaskCommentRepository extends AbstractEntityRepository<Long,
|
||||||
TaskComment> {
|
TaskComment> {
|
||||||
|
private static final long serialVersionUID = -420902242220205847L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<TaskComment> getEntityClass() {
|
public Class<TaskComment> getEntityClass() {
|
||||||
return TaskComment.class;
|
return TaskComment.class;
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerator;
|
||||||
* @version created the 12/12/17
|
* @version created the 12/12/17
|
||||||
*/
|
*/
|
||||||
public class TaskDependencyIdGenerator extends ObjectIdGenerator<String> {
|
public class TaskDependencyIdGenerator extends ObjectIdGenerator<String> {
|
||||||
|
private static final long serialVersionUID = -419865429626554749L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<?> getScope() {
|
public Class<?> getScope() {
|
||||||
return TaskDependency.class;
|
return TaskDependency.class;
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import javax.transaction.Transactional;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Marshals(TaskDependency.class)
|
@Marshals(TaskDependency.class)
|
||||||
public class TaskDependencyMarshaller extends AbstractMarshaller<TaskDependency> {
|
public class TaskDependencyMarshaller extends AbstractMarshaller<TaskDependency> {
|
||||||
|
private static final long serialVersionUID = 2753329911463298832L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class TaskIdResolver implements ObjectIdResolver {
|
public class TaskIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = 6444989953192198987L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(final ObjectIdGenerator.IdKey id,
|
public void bindItem(final ObjectIdGenerator.IdKey id,
|
||||||
final Object pojo) {
|
final Object pojo) {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import org.libreccm.security.RequiresPrivilege;
|
||||||
import org.libreccm.security.Shiro;
|
import org.libreccm.security.Shiro;
|
||||||
import org.libreccm.security.User;
|
import org.libreccm.security.User;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
|
@ -46,7 +47,8 @@ import javax.persistence.TypedQuery;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class TaskManager {
|
public class TaskManager implements Serializable {
|
||||||
|
private static final long serialVersionUID = -5605541655413527137L;
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger(TaskManager.class);
|
private static final Logger LOGGER = LogManager.getLogger(TaskManager.class);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class TaskRepository extends AbstractEntityRepository<Long, Task> {
|
public class TaskRepository extends AbstractEntityRepository<Long, Task> {
|
||||||
|
private static final long serialVersionUID = -8366096936911158514L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<Task> getEntityClass() {
|
public Class<Task> getEntityClass() {
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.fasterxml.jackson.annotation.ObjectIdResolver;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
* @version created on 3/23/17
|
* @version created on 3/23/17
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class WorkflowIdResolver implements ObjectIdResolver {
|
public class WorkflowIdResolver implements Serializable, ObjectIdResolver {
|
||||||
|
private static final long serialVersionUID = 1951611806946125510L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(final ObjectIdGenerator.IdKey id,
|
public void bindItem(final ObjectIdGenerator.IdKey id,
|
||||||
final Object pojo) {
|
final Object pojo) {
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ import java.beans.BeanInfo;
|
||||||
import java.beans.IntrospectionException;
|
import java.beans.IntrospectionException;
|
||||||
import java.beans.Introspector;
|
import java.beans.Introspector;
|
||||||
import java.beans.PropertyDescriptor;
|
import java.beans.PropertyDescriptor;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
@ -69,7 +70,8 @@ import java.util.Optional;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class WorkflowManager {
|
public class WorkflowManager implements Serializable {
|
||||||
|
private static final long serialVersionUID = -6939804120313699606L;
|
||||||
|
|
||||||
private final static Logger LOGGER = LogManager.getLogger(
|
private final static Logger LOGGER = LogManager.getLogger(
|
||||||
WorkflowManager.class);
|
WorkflowManager.class);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import javax.transaction.Transactional;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Marshals(Workflow.class)
|
@Marshals(Workflow.class)
|
||||||
public class WorkflowMarshaller extends AbstractMarshaller<Workflow> {
|
public class WorkflowMarshaller extends AbstractMarshaller<Workflow> {
|
||||||
|
private static final long serialVersionUID = 9126827334328274556L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private WorkflowRepository workflowRepository;
|
private WorkflowRepository workflowRepository;
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class WorkflowRepository extends AbstractEntityRepository<Long, Workflow> {
|
public class WorkflowRepository extends AbstractEntityRepository<Long, Workflow> {
|
||||||
|
private static final long serialVersionUID = -8811728904958517569L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<Workflow> getEntityClass() {
|
public Class<Workflow> getEntityClass() {
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,6 @@ public class CoreDataImportTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreDataImportTest() {
|
public CoreDataImportTest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue