[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;
|
||||
|
||||
import org.libreccm.portation.AbstractMarshaller;
|
||||
import org.libreccm.portation.Marshals;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.transaction.Transactional;
|
||||
|
|
@ -28,6 +30,8 @@ import javax.transaction.Transactional;
|
|||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||
* @version created on 11/7/16
|
||||
*/
|
||||
@RequestScoped
|
||||
@Marshals(Categorization.class)
|
||||
public class CategorizationMarshaller extends AbstractMarshaller<Categorization>{
|
||||
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
package org.libreccm.categorization;
|
||||
|
||||
import org.libreccm.portation.AbstractMarshaller;
|
||||
import org.libreccm.portation.Marshals;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
|||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||
* @version created on 11/7/16
|
||||
*/
|
||||
@RequestScoped
|
||||
@Marshals(Category.class)
|
||||
public class CategoryMarshaller extends AbstractMarshaller<Category> {
|
||||
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ import javax.persistence.MapKeyColumn;
|
|||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.hibernate.annotations.Type;
|
||||
import org.hibernate.search.annotations.Field;
|
||||
|
||||
|
|
@ -60,13 +62,13 @@ public class LocalizedString implements Serializable {
|
|||
*/
|
||||
@ElementCollection(fetch = FetchType.EAGER)
|
||||
@MapKeyColumn(name = "LOCALE")
|
||||
@Column(name = "LOCALIZED_VALUE")
|
||||
@Column(name = "LOCALIZED_VALUES")
|
||||
@Basic
|
||||
@Lob
|
||||
@Type(type = "org.hibernate.type.TextType")
|
||||
@Field
|
||||
@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;
|
||||
|
||||
/**
|
||||
|
|
@ -161,6 +163,7 @@ public class LocalizedString implements Serializable {
|
|||
* @return A {@link Set} containing all locales for which this localised
|
||||
* string has values.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Set<Locale> getAvailableLocales() {
|
||||
return values.keySet();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ public abstract class AbstractMarshaller<P extends Portable> {
|
|||
|
||||
List<P> objects = new ArrayList<>();
|
||||
if (lines != null) {
|
||||
int emptyObjects = 0;
|
||||
for (String line : lines) {
|
||||
P object = null;
|
||||
switch (format) {
|
||||
|
|
@ -206,9 +207,13 @@ public abstract class AbstractMarshaller<P extends Portable> {
|
|||
break;
|
||||
}
|
||||
|
||||
assert object != null;
|
||||
if (object != null) {
|
||||
insertIntoDb(object);
|
||||
objects.add(object);
|
||||
} else {
|
||||
emptyObjects+=1;
|
||||
LOGGER.info("Count of empty objects: {}", emptyObjects);
|
||||
}
|
||||
}
|
||||
}
|
||||
return objects;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
package org.libreccm.security;
|
||||
|
||||
import org.libreccm.portation.AbstractMarshaller;
|
||||
import org.libreccm.portation.Marshals;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
|||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||
* @version created on 11/7/16
|
||||
*/
|
||||
@RequestScoped
|
||||
@Marshals(Group.class)
|
||||
public class GroupMarshaller extends AbstractMarshaller<Group> {
|
||||
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
package org.libreccm.security;
|
||||
|
||||
import org.libreccm.portation.AbstractMarshaller;
|
||||
import org.libreccm.portation.Marshals;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.transaction.Transactional;
|
||||
|
|
@ -28,6 +30,8 @@ import javax.transaction.Transactional;
|
|||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||
* @version created on 11/7/16
|
||||
*/
|
||||
@RequestScoped
|
||||
@Marshals(Permission.class)
|
||||
public class PermissionMarshaller extends AbstractMarshaller<Permission> {
|
||||
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
package org.libreccm.security;
|
||||
|
||||
import org.libreccm.portation.AbstractMarshaller;
|
||||
import org.libreccm.portation.Marshals;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
|||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||
* @version created on 11/7/16
|
||||
*/
|
||||
@RequestScoped
|
||||
@Marshals(Role.class)
|
||||
public class RoleMarshaller extends AbstractMarshaller<Role> {
|
||||
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
package org.libreccm.security;
|
||||
|
||||
import org.libreccm.portation.AbstractMarshaller;
|
||||
import org.libreccm.portation.Marshals;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.transaction.Transactional;
|
||||
|
|
@ -28,6 +30,8 @@ import javax.transaction.Transactional;
|
|||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||
* @version created on 11/7/16
|
||||
*/
|
||||
@RequestScoped
|
||||
@Marshals(RoleMembership.class)
|
||||
public class RoleMembershipMarshaller extends AbstractMarshaller<RoleMembership> {
|
||||
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
package org.libreccm.security;
|
||||
|
||||
import org.libreccm.portation.AbstractMarshaller;
|
||||
import org.libreccm.portation.Marshals;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
|||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||
* @version created on 11/7/16
|
||||
*/
|
||||
@RequestScoped
|
||||
@Marshals(User.class)
|
||||
public class UserMarshaller extends AbstractMarshaller<User> {
|
||||
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
package org.libreccm.workflow;
|
||||
|
||||
import org.libreccm.portation.AbstractMarshaller;
|
||||
import org.libreccm.portation.Marshals;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
|||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||
* @version created on 11/18/16
|
||||
*/
|
||||
@RequestScoped
|
||||
@Marshals(AssignableTask.class)
|
||||
public class AssignableTaskMarshaller extends AbstractMarshaller<AssignableTask> {
|
||||
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
package org.libreccm.workflow;
|
||||
|
||||
import org.libreccm.portation.AbstractMarshaller;
|
||||
import org.libreccm.portation.Marshals;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.transaction.Transactional;
|
||||
|
|
@ -28,6 +30,8 @@ import javax.transaction.Transactional;
|
|||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||
* @version created on 11/7/16
|
||||
*/
|
||||
@RequestScoped
|
||||
@Marshals(TaskAssignment.class)
|
||||
public class TaskAssignmentMarshaller extends AbstractMarshaller<TaskAssignment> {
|
||||
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
package org.libreccm.workflow;
|
||||
|
||||
import org.libreccm.portation.AbstractMarshaller;
|
||||
import org.libreccm.portation.Marshals;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
|||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||
* @version created on 11/7/16
|
||||
*/
|
||||
@RequestScoped
|
||||
@Marshals(Workflow.class)
|
||||
public class WorkflowMarshaller extends AbstractMarshaller<Workflow> {
|
||||
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
package org.libreccm.workflow;
|
||||
|
||||
import org.libreccm.portation.AbstractMarshaller;
|
||||
import org.libreccm.portation.Marshals;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
|
|
@ -27,6 +29,8 @@ import javax.transaction.Transactional;
|
|||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||
* @version created on 11/21/16
|
||||
*/
|
||||
@RequestScoped
|
||||
@Marshals(WorkflowTemplate.class)
|
||||
public class WorkflowTemplateMarshaller extends
|
||||
AbstractMarshaller<WorkflowTemplate> {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue