[UPDATE]
- adds modified files for import testing - adds annotations @RequestScoped and @Marshals(<classname>) to all Marshaller classes - adds annotation @JsonIgnore to getter in LocalizedString.java git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4526 8810af33-2d31-482b-a856-94f89814c4dfccm-docs
parent
4c77ec6e7c
commit
26455a2ae4
|
|
@ -19,7 +19,9 @@
|
||||||
package org.libreccm.categorization;
|
package org.libreccm.categorization;
|
||||||
|
|
||||||
import org.libreccm.portation.AbstractMarshaller;
|
import org.libreccm.portation.AbstractMarshaller;
|
||||||
|
import org.libreccm.portation.Marshals;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
@ -28,6 +30,8 @@ import javax.transaction.Transactional;
|
||||||
* @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 11/7/16
|
* @version created on 11/7/16
|
||||||
*/
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Marshals(Categorization.class)
|
||||||
public class CategorizationMarshaller extends AbstractMarshaller<Categorization>{
|
public class CategorizationMarshaller extends AbstractMarshaller<Categorization>{
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@
|
||||||
package org.libreccm.categorization;
|
package org.libreccm.categorization;
|
||||||
|
|
||||||
import org.libreccm.portation.AbstractMarshaller;
|
import org.libreccm.portation.AbstractMarshaller;
|
||||||
|
import org.libreccm.portation.Marshals;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
||||||
* @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 11/7/16
|
* @version created on 11/7/16
|
||||||
*/
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Marshals(Category.class)
|
||||||
public class CategoryMarshaller extends AbstractMarshaller<Category> {
|
public class CategoryMarshaller extends AbstractMarshaller<Category> {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ import javax.persistence.MapKeyColumn;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
import org.hibernate.search.annotations.Field;
|
import org.hibernate.search.annotations.Field;
|
||||||
|
|
||||||
|
|
@ -60,13 +62,13 @@ public class LocalizedString implements Serializable {
|
||||||
*/
|
*/
|
||||||
@ElementCollection(fetch = FetchType.EAGER)
|
@ElementCollection(fetch = FetchType.EAGER)
|
||||||
@MapKeyColumn(name = "LOCALE")
|
@MapKeyColumn(name = "LOCALE")
|
||||||
@Column(name = "LOCALIZED_VALUE")
|
@Column(name = "LOCALIZED_VALUES")
|
||||||
@Basic
|
@Basic
|
||||||
@Lob
|
@Lob
|
||||||
@Type(type = "org.hibernate.type.TextType")
|
@Type(type = "org.hibernate.type.TextType")
|
||||||
@Field
|
@Field
|
||||||
@XmlElementWrapper(name = "values", namespace = L10N_XML_NS)
|
@XmlElementWrapper(name = "values", namespace = L10N_XML_NS)
|
||||||
@XmlElement(name = "value", namespace = L10N_XML_NS)
|
@XmlElement(name = "values", namespace = L10N_XML_NS)
|
||||||
private Map<Locale, String> values;
|
private Map<Locale, String> values;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -161,6 +163,7 @@ public class LocalizedString implements Serializable {
|
||||||
* @return A {@link Set} containing all locales for which this localised
|
* @return A {@link Set} containing all locales for which this localised
|
||||||
* string has values.
|
* string has values.
|
||||||
*/
|
*/
|
||||||
|
@JsonIgnore
|
||||||
public Set<Locale> getAvailableLocales() {
|
public Set<Locale> getAvailableLocales() {
|
||||||
return values.keySet();
|
return values.keySet();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,7 @@ public abstract class AbstractMarshaller<P extends Portable> {
|
||||||
|
|
||||||
List<P> objects = new ArrayList<>();
|
List<P> objects = new ArrayList<>();
|
||||||
if (lines != null) {
|
if (lines != null) {
|
||||||
|
int emptyObjects = 0;
|
||||||
for (String line : lines) {
|
for (String line : lines) {
|
||||||
P object = null;
|
P object = null;
|
||||||
switch (format) {
|
switch (format) {
|
||||||
|
|
@ -206,9 +207,13 @@ public abstract class AbstractMarshaller<P extends Portable> {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert object != null;
|
if (object != null) {
|
||||||
insertIntoDb(object);
|
insertIntoDb(object);
|
||||||
objects.add(object);
|
objects.add(object);
|
||||||
|
} else {
|
||||||
|
emptyObjects+=1;
|
||||||
|
LOGGER.info("Count of empty objects: {}", emptyObjects);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return objects;
|
return objects;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import org.libreccm.portation.AbstractMarshaller;
|
import org.libreccm.portation.AbstractMarshaller;
|
||||||
|
import org.libreccm.portation.Marshals;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
||||||
* @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 11/7/16
|
* @version created on 11/7/16
|
||||||
*/
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Marshals(Group.class)
|
||||||
public class GroupMarshaller extends AbstractMarshaller<Group> {
|
public class GroupMarshaller extends AbstractMarshaller<Group> {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import org.libreccm.portation.AbstractMarshaller;
|
import org.libreccm.portation.AbstractMarshaller;
|
||||||
|
import org.libreccm.portation.Marshals;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
@ -28,6 +30,8 @@ import javax.transaction.Transactional;
|
||||||
* @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 11/7/16
|
* @version created on 11/7/16
|
||||||
*/
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Marshals(Permission.class)
|
||||||
public class PermissionMarshaller extends AbstractMarshaller<Permission> {
|
public class PermissionMarshaller extends AbstractMarshaller<Permission> {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import org.libreccm.portation.AbstractMarshaller;
|
import org.libreccm.portation.AbstractMarshaller;
|
||||||
|
import org.libreccm.portation.Marshals;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
||||||
* @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 11/7/16
|
* @version created on 11/7/16
|
||||||
*/
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Marshals(Role.class)
|
||||||
public class RoleMarshaller extends AbstractMarshaller<Role> {
|
public class RoleMarshaller extends AbstractMarshaller<Role> {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import org.libreccm.portation.AbstractMarshaller;
|
import org.libreccm.portation.AbstractMarshaller;
|
||||||
|
import org.libreccm.portation.Marshals;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
@ -28,6 +30,8 @@ import javax.transaction.Transactional;
|
||||||
* @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 11/7/16
|
* @version created on 11/7/16
|
||||||
*/
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Marshals(RoleMembership.class)
|
||||||
public class RoleMembershipMarshaller extends AbstractMarshaller<RoleMembership> {
|
public class RoleMembershipMarshaller extends AbstractMarshaller<RoleMembership> {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import org.libreccm.portation.AbstractMarshaller;
|
import org.libreccm.portation.AbstractMarshaller;
|
||||||
|
import org.libreccm.portation.Marshals;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
||||||
* @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 11/7/16
|
* @version created on 11/7/16
|
||||||
*/
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Marshals(User.class)
|
||||||
public class UserMarshaller extends AbstractMarshaller<User> {
|
public class UserMarshaller extends AbstractMarshaller<User> {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@
|
||||||
package org.libreccm.workflow;
|
package org.libreccm.workflow;
|
||||||
|
|
||||||
import org.libreccm.portation.AbstractMarshaller;
|
import org.libreccm.portation.AbstractMarshaller;
|
||||||
|
import org.libreccm.portation.Marshals;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
||||||
* @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 11/18/16
|
* @version created on 11/18/16
|
||||||
*/
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Marshals(AssignableTask.class)
|
||||||
public class AssignableTaskMarshaller extends AbstractMarshaller<AssignableTask> {
|
public class AssignableTaskMarshaller extends AbstractMarshaller<AssignableTask> {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@
|
||||||
package org.libreccm.workflow;
|
package org.libreccm.workflow;
|
||||||
|
|
||||||
import org.libreccm.portation.AbstractMarshaller;
|
import org.libreccm.portation.AbstractMarshaller;
|
||||||
|
import org.libreccm.portation.Marshals;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
@ -28,6 +30,8 @@ import javax.transaction.Transactional;
|
||||||
* @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 11/7/16
|
* @version created on 11/7/16
|
||||||
*/
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Marshals(TaskAssignment.class)
|
||||||
public class TaskAssignmentMarshaller extends AbstractMarshaller<TaskAssignment> {
|
public class TaskAssignmentMarshaller extends AbstractMarshaller<TaskAssignment> {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@
|
||||||
package org.libreccm.workflow;
|
package org.libreccm.workflow;
|
||||||
|
|
||||||
import org.libreccm.portation.AbstractMarshaller;
|
import org.libreccm.portation.AbstractMarshaller;
|
||||||
|
import org.libreccm.portation.Marshals;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
||||||
* @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 11/7/16
|
* @version created on 11/7/16
|
||||||
*/
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Marshals(Workflow.class)
|
||||||
public class WorkflowMarshaller extends AbstractMarshaller<Workflow> {
|
public class WorkflowMarshaller extends AbstractMarshaller<Workflow> {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@
|
||||||
package org.libreccm.workflow;
|
package org.libreccm.workflow;
|
||||||
|
|
||||||
import org.libreccm.portation.AbstractMarshaller;
|
import org.libreccm.portation.AbstractMarshaller;
|
||||||
|
import org.libreccm.portation.Marshals;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
||||||
* @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 11/21/16
|
* @version created on 11/21/16
|
||||||
*/
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Marshals(WorkflowTemplate.class)
|
||||||
public class WorkflowTemplateMarshaller extends
|
public class WorkflowTemplateMarshaller extends
|
||||||
AbstractMarshaller<WorkflowTemplate> {
|
AbstractMarshaller<WorkflowTemplate> {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue