Cleanup and fixed some potential problems.
parent
55b2f6c6ba
commit
ca87bcb6af
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@librecms/ccm-cms",
|
"name": "@librecms/ccm-cms",
|
||||||
"version": "7.0.0-SNAPSHOT.2023-01-18T182914",
|
"version": "7.0.0-SNAPSHOT.2023-01-19T185030",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@librecms/ccm-cms",
|
"name": "@librecms/ccm-cms",
|
||||||
"version": "7.0.0-SNAPSHOT.2023-01-18T182914",
|
"version": "7.0.0-SNAPSHOT.2023-01-19T185030",
|
||||||
"license": "LGPL-3.0-or-later",
|
"license": "LGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tiptap/core": "^2.0.0-beta.127",
|
"@tiptap/core": "^2.0.0-beta.127",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@librecms/ccm-cms",
|
"name": "@librecms/ccm-cms",
|
||||||
"version": "7.0.0-SNAPSHOT.2023-01-18T182914",
|
"version": "7.0.0-SNAPSHOT.2023-01-19T185030",
|
||||||
"description": "JavaScript stuff for ccm-cms",
|
"description": "JavaScript stuff for ccm-cms",
|
||||||
"main": "target/generated-resources/assets/@content-sections/cms-admin.js",
|
"main": "target/generated-resources/assets/@content-sections/cms-admin.js",
|
||||||
"types": "target/generated-resources/assets/@content-sections/cms-admin.d.ts",
|
"types": "target/generated-resources/assets/@content-sections/cms-admin.d.ts",
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,13 @@ public abstract class AbstractAssetImExporter<T extends Asset>
|
||||||
protected final void updateExistingEntity(
|
protected final void updateExistingEntity(
|
||||||
final T existingEntity, final T importedEntity
|
final T existingEntity, final T importedEntity
|
||||||
) {
|
) {
|
||||||
|
if (!Objects.equals(
|
||||||
|
existingEntity.getDisplayName(),
|
||||||
|
importedEntity.getDisplayName()
|
||||||
|
)) {
|
||||||
|
existingEntity.setDisplayName(importedEntity.getDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getTitle(),
|
existingEntity.getTitle(),
|
||||||
importedEntity.getTitle()
|
importedEntity.getTitle()
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.assets;
|
package org.librecms.assets;
|
||||||
|
|
||||||
|
|
||||||
import org.librecms.contentsection.Asset;
|
import org.librecms.contentsection.Asset;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -67,11 +66,12 @@ public class Bookmark extends Asset implements Serializable {
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "BOOKMARK_DESCRIPTIONS",
|
joinTable = @JoinTable(
|
||||||
schema = DB_SCHEMA,
|
name = "BOOKMARK_DESCRIPTIONS",
|
||||||
joinColumns = {
|
schema = DB_SCHEMA,
|
||||||
@JoinColumn(name = "ASSET_ID")
|
joinColumns = {
|
||||||
}
|
@JoinColumn(name = "ASSET_ID")
|
||||||
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
private LocalizedString description;
|
private LocalizedString description;
|
||||||
|
|
|
||||||
|
|
@ -96,12 +96,10 @@ public class ContactableEntity extends Asset {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addContactEntry(final ContactEntry contactEntry) {
|
protected void addContactEntry(final ContactEntry contactEntry) {
|
||||||
|
|
||||||
contactEntries.add(contactEntry);
|
contactEntries.add(contactEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void removeContactEntry(final ContactEntry contactEntry) {
|
protected void removeContactEntry(final ContactEntry contactEntry) {
|
||||||
|
|
||||||
contactEntries.remove(contactEntry);
|
contactEntries.remove(contactEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,7 +125,6 @@ public class ContactableEntity extends Asset {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
|
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -158,13 +155,15 @@ public class ContactableEntity extends Asset {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString(final String data) {
|
public String toString(final String data) {
|
||||||
|
return super.toString(
|
||||||
return super.toString(String.format(
|
String.format(
|
||||||
"contactEntries = { %s }, "
|
"contactEntries = { %s }, "
|
||||||
+ "postalAddress = %s%s",
|
+ "postalAddress = %s%s",
|
||||||
Objects.toString(contactEntries),
|
Objects.toString(contactEntries),
|
||||||
Objects.toString(postalAddress),
|
Objects.toString(postalAddress),
|
||||||
data));
|
data
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,31 +87,6 @@ public class Person extends ContactableEntity {
|
||||||
)
|
)
|
||||||
private List<PersonName> personNames;
|
private List<PersonName> personNames;
|
||||||
|
|
||||||
// /**
|
|
||||||
// * The surname/familyname of the person
|
|
||||||
// */
|
|
||||||
// @Column(name = "SURNAME")
|
|
||||||
// private String surname;
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * The given name of the person.
|
|
||||||
// */
|
|
||||||
// @Column(name = "GIVEN_NAME")
|
|
||||||
// private String givenName;
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * Any prefixes to the name of the person. Examples are Prof. or Dr.
|
|
||||||
// */
|
|
||||||
// @Column(name = "NAME_PREFIX")
|
|
||||||
// private String prefix;
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * Any suffixes to the name of the person. Examples for suffixes are
|
|
||||||
// * PhD, or especially for Great Britain the membership in various orders,
|
|
||||||
// * for example KBE or CBE.
|
|
||||||
// */
|
|
||||||
// @Column(name = "SUFFIX")
|
|
||||||
// private String suffix;
|
|
||||||
/**
|
/**
|
||||||
* The birthdate of the person.
|
* The birthdate of the person.
|
||||||
*/
|
*/
|
||||||
|
|
@ -125,37 +100,6 @@ public class Person extends ContactableEntity {
|
||||||
personNames = new ArrayList<>();
|
personNames = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// public String getSurname() {
|
|
||||||
// return surname;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void setSurname(final String surname) {
|
|
||||||
// this.surname = surname;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public String getGivenName() {
|
|
||||||
// return givenName;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void setGivenName(final String givenName) {
|
|
||||||
// this.givenName = givenName;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public String getPrefix() {
|
|
||||||
// return prefix;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void setPrefix(final String prefix) {
|
|
||||||
// this.prefix = prefix;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public String getSuffix() {
|
|
||||||
// return suffix;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void setSuffix(final String suffix) {
|
|
||||||
// this.suffix = suffix;
|
|
||||||
// }
|
|
||||||
public List<PersonName> getPersonNames() {
|
public List<PersonName> getPersonNames() {
|
||||||
|
|
||||||
return Collections.unmodifiableList(personNames);
|
return Collections.unmodifiableList(personNames);
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.assets;
|
package org.librecms.assets;
|
||||||
|
|
||||||
|
|
||||||
import org.librecms.contentsection.Asset;
|
import org.librecms.contentsection.Asset;
|
||||||
import org.hibernate.envers.Audited;
|
import org.hibernate.envers.Audited;
|
||||||
import org.libreccm.l10n.LocalizedString;
|
import org.libreccm.l10n.LocalizedString;
|
||||||
|
|
@ -64,11 +63,12 @@ public class SideNote extends Asset implements Serializable {
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "SIDE_NOTE_TEXTS",
|
joinTable = @JoinTable(
|
||||||
schema = DB_SCHEMA,
|
name = "SIDE_NOTE_TEXTS",
|
||||||
joinColumns = {
|
schema = DB_SCHEMA,
|
||||||
@JoinColumn(name = "SIDE_NOTE_ID")
|
joinColumns = {
|
||||||
}
|
@JoinColumn(name = "SIDE_NOTE_ID")
|
||||||
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
private LocalizedString text;
|
private LocalizedString text;
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,14 @@ public class VideoAssetImExporter
|
||||||
final VideoAsset existingAsset,
|
final VideoAsset existingAsset,
|
||||||
final VideoAsset importedAsset
|
final VideoAsset importedAsset
|
||||||
) {
|
) {
|
||||||
|
if (existingAsset.getWidth() != importedAsset.getWidth()) {
|
||||||
|
existingAsset.setWidth(importedAsset.getWidth());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existingAsset.getHeight() != importedAsset.getHeight()) {
|
||||||
|
existingAsset.setHeight(importedAsset.getHeight());
|
||||||
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingAsset.getLegalMetadata(),
|
existingAsset.getLegalMetadata(),
|
||||||
importedAsset.getLegalMetadata()
|
importedAsset.getLegalMetadata()
|
||||||
|
|
|
||||||
|
|
@ -122,13 +122,6 @@ public abstract class AbstractContentItemImExporter<T extends ContentItem>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getContentType(),
|
|
||||||
importedEntity.getContentType()
|
|
||||||
)) {
|
|
||||||
existingEntity.setContentType(importedEntity.getContentType());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getTitle(),
|
existingEntity.getTitle(),
|
||||||
importedEntity.getTitle()
|
importedEntity.getTitle()
|
||||||
|
|
|
||||||
|
|
@ -650,7 +650,8 @@ public class ContentItem extends CcmObject implements Serializable, Exportable {
|
||||||
name = "CONTENT_ITEM_DESCRIPTIONS",
|
name = "CONTENT_ITEM_DESCRIPTIONS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "OBJECT_ID")}
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
|
}
|
||||||
))
|
))
|
||||||
@IndexedEmbedded
|
@IndexedEmbedded
|
||||||
@XmlElement(name = "description", namespace = CMS_XML_NS)
|
@XmlElement(name = "description", namespace = CMS_XML_NS)
|
||||||
|
|
|
||||||
|
|
@ -78,13 +78,6 @@ public class ContentTypeImExporter
|
||||||
existingEntity.setDisplayName(importedEntity.getDisplayName());
|
existingEntity.setDisplayName(importedEntity.getDisplayName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getContentSection(),
|
|
||||||
importedEntity.getContentSection()
|
|
||||||
)) {
|
|
||||||
existingEntity.setContentSection(importedEntity.getContentSection());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getLabel(),
|
existingEntity.getLabel(),
|
||||||
importedEntity.getLabel()
|
importedEntity.getLabel()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package org.librecms.contentsection;
|
package org.librecms.contentsection;
|
||||||
|
|
||||||
import net.bytebuddy.build.Plugin;
|
|
||||||
import org.libreccm.categorization.Category;
|
import org.libreccm.categorization.Category;
|
||||||
import org.libreccm.categorization.CategoryManager;
|
import org.libreccm.categorization.CategoryManager;
|
||||||
import org.libreccm.categorization.Domain;
|
import org.libreccm.categorization.Domain;
|
||||||
|
|
@ -14,7 +13,6 @@ import java.util.Set;
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.transaction.Transactional;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 LibreCCM Foundation.
|
* Copyright (C) 2022 LibreCCM Foundation.
|
||||||
|
|
@ -122,28 +120,6 @@ public class FolderImExporter extends AbstractEntityImExporter<Folder> {
|
||||||
existingEntity.setName(withImportedEntity.getName());
|
existingEntity.setName(withImportedEntity.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getParentCategory(),
|
|
||||||
withImportedEntity.getParentCategory()
|
|
||||||
)) {
|
|
||||||
categoryManager.removeSubCategoryFromCategory(
|
|
||||||
existingEntity,
|
|
||||||
existingEntity.getParentCategory()
|
|
||||||
);
|
|
||||||
|
|
||||||
categoryManager.addSubCategoryToCategory(
|
|
||||||
withImportedEntity.getParentCategory(),
|
|
||||||
existingEntity
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getSection(),
|
|
||||||
withImportedEntity.getSection()
|
|
||||||
)) {
|
|
||||||
existingEntity.setSection(withImportedEntity.getSection());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getTitle(),
|
existingEntity.getTitle(),
|
||||||
withImportedEntity.getTitle()
|
withImportedEntity.getTitle()
|
||||||
|
|
|
||||||
|
|
@ -67,11 +67,14 @@ public class Article extends ContentItem implements Serializable {
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "ARTICLE_TEXTS",
|
joinTable = @JoinTable(
|
||||||
schema = DB_SCHEMA,
|
name = "ARTICLE_TEXTS",
|
||||||
joinColumns = {
|
schema = DB_SCHEMA,
|
||||||
@JoinColumn(name = "OBJECT_ID")}
|
joinColumns = {
|
||||||
))
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
private LocalizedString text;
|
private LocalizedString text;
|
||||||
|
|
||||||
public Article() {
|
public Article() {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contenttypes;
|
package org.librecms.contenttypes;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
@ -71,11 +70,14 @@ public class Event extends ContentItem implements Serializable {
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "EVENT_TEXTS",
|
joinTable = @JoinTable(
|
||||||
schema = DB_SCHEMA,
|
name = "EVENT_TEXTS",
|
||||||
joinColumns = {
|
schema = DB_SCHEMA,
|
||||||
@JoinColumn(name = "OBJECT_ID")}
|
joinColumns = {
|
||||||
))
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
private LocalizedString text;
|
private LocalizedString text;
|
||||||
|
|
||||||
@Column(name = "START_DATE")
|
@Column(name = "START_DATE")
|
||||||
|
|
@ -92,11 +94,14 @@ public class Event extends ContentItem implements Serializable {
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "EVENT_DATES",
|
joinTable = @JoinTable(
|
||||||
schema = DB_SCHEMA,
|
name = "EVENT_DATES",
|
||||||
joinColumns = {
|
schema = DB_SCHEMA,
|
||||||
@JoinColumn(name = "OBJECT_ID")}
|
joinColumns = {
|
||||||
))
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
private LocalizedString eventDate;
|
private LocalizedString eventDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -105,11 +110,14 @@ public class Event extends ContentItem implements Serializable {
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "EVENT_LOCATIONS",
|
joinTable = @JoinTable(
|
||||||
schema = DB_SCHEMA,
|
name = "EVENT_LOCATIONS",
|
||||||
joinColumns = {
|
schema = DB_SCHEMA,
|
||||||
@JoinColumn(name = "OBJECT_ID")}
|
joinColumns = {
|
||||||
))
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
private LocalizedString location;
|
private LocalizedString location;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -118,21 +126,27 @@ public class Event extends ContentItem implements Serializable {
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "EVENT_MAIN_CONTRIBUTORS",
|
joinTable = @JoinTable(
|
||||||
schema = DB_SCHEMA,
|
name = "EVENT_MAIN_CONTRIBUTORS",
|
||||||
joinColumns = {
|
schema = DB_SCHEMA,
|
||||||
@JoinColumn(name = "OBJECT_ID")}
|
joinColumns = {
|
||||||
))
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
private LocalizedString mainContributor;
|
private LocalizedString mainContributor;
|
||||||
|
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "EVENT_TYPES",
|
joinTable = @JoinTable(
|
||||||
schema = DB_SCHEMA,
|
name = "EVENT_TYPES",
|
||||||
joinColumns = {
|
schema = DB_SCHEMA,
|
||||||
@JoinColumn(name = "OBJECT_ID")}
|
joinColumns = {
|
||||||
))
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
private LocalizedString eventType;
|
private LocalizedString eventType;
|
||||||
|
|
||||||
//ToDo: check if this is necessary or can be better handled using related links.
|
//ToDo: check if this is necessary or can be better handled using related links.
|
||||||
|
|
@ -145,11 +159,14 @@ public class Event extends ContentItem implements Serializable {
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "EVENT_COSTS",
|
joinTable = @JoinTable(
|
||||||
schema = DB_SCHEMA,
|
name = "EVENT_COSTS",
|
||||||
joinColumns = {
|
schema = DB_SCHEMA,
|
||||||
@JoinColumn(name = "OBJECT_ID")}
|
joinColumns = {
|
||||||
))
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
private LocalizedString cost;
|
private LocalizedString cost;
|
||||||
|
|
||||||
public Event() {
|
public Event() {
|
||||||
|
|
|
||||||
|
|
@ -82,16 +82,19 @@ public class MultiPartArticleImExporter
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<MultiPartArticleSection> missingSections = importedContentItem
|
final List<MultiPartArticleSection> missingSections
|
||||||
.getSections()
|
= importedContentItem
|
||||||
.stream()
|
.getSections()
|
||||||
.filter(
|
.stream()
|
||||||
section -> existingContentItem.getSections().contains(section)
|
.filter(
|
||||||
)
|
section -> existingContentItem.getSections().contains(
|
||||||
.collect(Collectors.toList());
|
section)
|
||||||
|
)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
for(final MultiPartArticleSection missingSection : missingSections) {
|
for (final MultiPartArticleSection missingSection : missingSections) {
|
||||||
final MultiPartArticleSection newSection = new MultiPartArticleSection();
|
final MultiPartArticleSection newSection
|
||||||
|
= new MultiPartArticleSection();
|
||||||
newSection.setPageBreak(missingSection.isPageBreak());
|
newSection.setPageBreak(missingSection.isPageBreak());
|
||||||
newSection.setRank(missingSection.getRank());
|
newSection.setRank(missingSection.getRank());
|
||||||
syncLocalizedStrings(
|
syncLocalizedStrings(
|
||||||
|
|
@ -105,7 +108,7 @@ public class MultiPartArticleImExporter
|
||||||
|
|
||||||
sectionManager.addSectionToMultiPartArticle(
|
sectionManager.addSectionToMultiPartArticle(
|
||||||
newSection,
|
newSection,
|
||||||
existingContentItem
|
existingContentItem
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,13 +102,6 @@ public class LifecycleDefinitionImExporter
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (final PhaseDefinition phaseDef : importedEntity
|
|
||||||
.getPhaseDefinitions()) {
|
|
||||||
if (!existingEntity.getPhaseDefinitions().contains(phaseDef)) {
|
|
||||||
existingEntity.addPhaseDefinition(phaseDef);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lifecycleDefRepo.save(existingEntity);
|
lifecycleDefRepo.save(existingEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,7 @@ public class PhaseDefinition implements Exportable, Serializable {
|
||||||
this.definitionId = definitionId;
|
this.definitionId = definitionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getUuid() {
|
public String getUuid() {
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,15 @@ public class PhaseDefinitionImExporter
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Objects.equals(
|
||||||
|
existingEntity.getDefaultListener(),
|
||||||
|
importedEntity.getDefaultListener()
|
||||||
|
)) {
|
||||||
|
existingEntity.setDefaultListener(
|
||||||
|
importedEntity.getDefaultListener()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
phaseDefinitionRepo.save(existingEntity);
|
phaseDefinitionRepo.save(existingEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,20 +95,6 @@ public class PhaseImExporter
|
||||||
existingEntity.setFinished(importedEntity.isFinished());
|
existingEntity.setFinished(importedEntity.isFinished());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getLifecycle(),
|
|
||||||
importedEntity.getLifecycle()
|
|
||||||
)) {
|
|
||||||
existingEntity.setLifecycle(importedEntity.getLifecycle());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getDefinition(),
|
|
||||||
importedEntity.getDefinition()
|
|
||||||
)) {
|
|
||||||
existingEntity.setDefinition(importedEntity.getDefinition());
|
|
||||||
}
|
|
||||||
|
|
||||||
phaseRepo.save(existingEntity);
|
phaseRepo.save(existingEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,21 +76,6 @@ public class CategorizationImExporter
|
||||||
protected void updateExistingEntity(
|
protected void updateExistingEntity(
|
||||||
final Categorization existingEntity, final Categorization importedEntity
|
final Categorization existingEntity, final Categorization importedEntity
|
||||||
) {
|
) {
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getCategory(), importedEntity.getCategory()
|
|
||||||
)) {
|
|
||||||
existingEntity.setCategory(importedEntity.getCategory());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getCategorizedObject(),
|
|
||||||
importedEntity.getCategorizedObject()
|
|
||||||
)) {
|
|
||||||
existingEntity.setCategorizedObject(
|
|
||||||
importedEntity.getCategorizedObject()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (existingEntity.isIndexObject() != importedEntity.isIndexObject()) {
|
if (existingEntity.isIndexObject() != importedEntity.isIndexObject()) {
|
||||||
existingEntity.setIndexObject(importedEntity.isIndexObject());
|
existingEntity.setIndexObject(importedEntity.isIndexObject());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,45 +115,6 @@ public class CategoryImExporter extends AbstractEntityImExporter<Category> {
|
||||||
existingEntity.setName(importedEntity.getName());
|
existingEntity.setName(importedEntity.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getParentCategory(),
|
|
||||||
importedEntity.getParentCategory()
|
|
||||||
)) {
|
|
||||||
final Category oldParentCategory = existingEntity
|
|
||||||
.getParentCategory();
|
|
||||||
final Category newParentCategory = importedEntity
|
|
||||||
.getParentCategory();
|
|
||||||
|
|
||||||
categoryManager.removeSubCategoryFromCategory(
|
|
||||||
existingEntity,
|
|
||||||
oldParentCategory
|
|
||||||
);
|
|
||||||
|
|
||||||
categoryManager.addSubCategoryToCategory(
|
|
||||||
existingEntity,
|
|
||||||
newParentCategory
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getSubCategories(),
|
|
||||||
importedEntity.getSubCategories()
|
|
||||||
)) {
|
|
||||||
final Set<Category> subCategoriesToAdd = importedEntity
|
|
||||||
.getSubCategories()
|
|
||||||
.stream()
|
|
||||||
.filter(
|
|
||||||
category -> !existingEntity.getSubCategories().contains(
|
|
||||||
category
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
|
|
||||||
for(final Category category : subCategoriesToAdd) {
|
|
||||||
existingEntity.addSubCategory(category);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getTitle(),
|
existingEntity.getTitle(),
|
||||||
importedEntity.getTitle()
|
importedEntity.getTitle()
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,13 @@ public class DomainImExporter extends AbstractEntityImExporter<Domain> {
|
||||||
final Domain existingEntity,
|
final Domain existingEntity,
|
||||||
final Domain importedEntity
|
final Domain importedEntity
|
||||||
) {
|
) {
|
||||||
|
if (!Objects.equals(
|
||||||
|
existingEntity.getDisplayName(),
|
||||||
|
importedEntity.getDisplayName()
|
||||||
|
)) {
|
||||||
|
importedEntity.setDisplayName(importedEntity.getDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getDomainKey(),
|
existingEntity.getDomainKey(),
|
||||||
importedEntity.getDomainKey()
|
importedEntity.getDomainKey()
|
||||||
|
|
@ -116,24 +123,6 @@ public class DomainImExporter extends AbstractEntityImExporter<Domain> {
|
||||||
existingEntity.setReleased(importedEntity.getReleased());
|
existingEntity.setReleased(importedEntity.getReleased());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getOwners(),
|
|
||||||
importedEntity.getOwners()
|
|
||||||
)) {
|
|
||||||
final Set<DomainOwnership> ownersToAdd = importedEntity
|
|
||||||
.getOwners()
|
|
||||||
.stream()
|
|
||||||
.filter(owner -> !existingEntity.getOwners().contains(owner))
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
|
|
||||||
for (final DomainOwnership toAdd : ownersToAdd) {
|
|
||||||
domainManager.addDomainOwner(toAdd.getOwner(),
|
|
||||||
existingEntity,
|
|
||||||
toAdd.getContext()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
domainRepository.save(existingEntity);
|
domainRepository.save(existingEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,6 @@ public class DomainOwnershipImExporter
|
||||||
domainOwnershipRepo.save(entity);
|
domainOwnershipRepo.save(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected DomainOwnership reloadEntity(final DomainOwnership entity) {
|
protected DomainOwnership reloadEntity(final DomainOwnership entity) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -83,47 +83,7 @@ public class GroupMembershipImExporter
|
||||||
final GroupMembership existingEntity,
|
final GroupMembership existingEntity,
|
||||||
final GroupMembership importedEntity
|
final GroupMembership importedEntity
|
||||||
) {
|
) {
|
||||||
if (!Objects.equals(
|
// Nothing to update in a GroupMembership
|
||||||
existingEntity.getGroup(),
|
|
||||||
importedEntity.getGroup()
|
|
||||||
) && !Objects.equals(
|
|
||||||
existingEntity.getMember(),
|
|
||||||
importedEntity.getMember()
|
|
||||||
)) {
|
|
||||||
final Group oldGroup = existingEntity.getGroup();
|
|
||||||
final User oldMember = existingEntity.getMember();
|
|
||||||
final Group newGroup = importedEntity.getGroup();
|
|
||||||
final User newMember = importedEntity.getMember();
|
|
||||||
|
|
||||||
groupManager.removeMemberFromGroup(oldMember, oldGroup);
|
|
||||||
groupManager.addMemberToGroup(newMember, newGroup);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getGroup(),
|
|
||||||
importedEntity.getGroup()
|
|
||||||
)) {
|
|
||||||
final Group oldGroup = existingEntity.getGroup();
|
|
||||||
final Group newGroup = importedEntity.getGroup();
|
|
||||||
final User member = existingEntity.getMember();
|
|
||||||
|
|
||||||
groupManager.removeMemberFromGroup(member, oldGroup);
|
|
||||||
groupManager.addMemberToGroup(member, newGroup);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getMember(),
|
|
||||||
importedEntity.getMember()
|
|
||||||
)) {
|
|
||||||
final User oldMember = existingEntity.getMember();
|
|
||||||
final User newMember = importedEntity.getMember();
|
|
||||||
final Group group = existingEntity.getGroup();
|
|
||||||
|
|
||||||
groupManager.removeMemberFromGroup(oldMember, group);
|
|
||||||
groupManager.addMemberToGroup(newMember, group);
|
|
||||||
}
|
|
||||||
|
|
||||||
groupMembershipRepo.save(existingEntity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -105,13 +105,6 @@ public class PermissionImExporter extends AbstractEntityImExporter<Permission> {
|
||||||
existingEntity.setInherited(importedEntity.isInherited());
|
existingEntity.setInherited(importedEntity.isInherited());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getInheritedFrom(),
|
|
||||||
importedEntity.getInheritedFrom()
|
|
||||||
)) {
|
|
||||||
existingEntity.setInheritedFrom(importedEntity.getInheritedFrom());
|
|
||||||
}
|
|
||||||
|
|
||||||
permissionRepository.save(existingEntity);
|
permissionRepository.save(existingEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,20 +82,7 @@ public class RoleMembershipImExporter
|
||||||
final RoleMembership existingEntity,
|
final RoleMembership existingEntity,
|
||||||
final RoleMembership importedEntity
|
final RoleMembership importedEntity
|
||||||
) {
|
) {
|
||||||
if (!Objects.equals(
|
// Nothing to update in a RoleMembership
|
||||||
existingEntity.getRole(),
|
|
||||||
importedEntity.getRole()
|
|
||||||
)) {
|
|
||||||
existingEntity.setRole(importedEntity.getRole());
|
|
||||||
}
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getMember(),
|
|
||||||
importedEntity.getMember()
|
|
||||||
)) {
|
|
||||||
existingEntity.setMember(importedEntity.getMember());
|
|
||||||
}
|
|
||||||
|
|
||||||
membershipRepo.save(existingEntity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ public class AssignableTaskImExporter
|
||||||
final AssignableTask existingEntity,
|
final AssignableTask existingEntity,
|
||||||
final AssignableTask importedEntity
|
final AssignableTask importedEntity
|
||||||
) {
|
) {
|
||||||
if(!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getLabel(),
|
existingEntity.getLabel(),
|
||||||
importedEntity.getLabel()
|
importedEntity.getLabel()
|
||||||
)) {
|
)) {
|
||||||
|
|
@ -91,7 +91,7 @@ public class AssignableTaskImExporter
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getDescription(),
|
existingEntity.getDescription(),
|
||||||
importedEntity.getDescription()
|
importedEntity.getDescription()
|
||||||
)) {
|
)) {
|
||||||
|
|
@ -105,17 +105,48 @@ public class AssignableTaskImExporter
|
||||||
existingEntity.setActive(importedEntity.isActive());
|
existingEntity.setActive(importedEntity.isActive());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (existingEntity.getTaskState() != importedEntity.getTaskState()) {
|
||||||
|
existingEntity.setTaskState(importedEntity.getTaskState());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existingEntity.isLocked() != importedEntity.isLocked()) {
|
||||||
|
existingEntity.setLocked(importedEntity.isLocked());
|
||||||
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getWorkflow(),
|
existingEntity.getLockingUser(),
|
||||||
importedEntity.getWorkflow()
|
importedEntity.getLockingUser()
|
||||||
)) {
|
)) {
|
||||||
taskManager.removeTask(
|
existingEntity.setLockingUser(importedEntity.getLockingUser());
|
||||||
existingEntity.getWorkflow(),
|
}
|
||||||
existingEntity
|
|
||||||
|
if (!Objects.equals(
|
||||||
|
existingEntity.getStartDate(),
|
||||||
|
importedEntity.getStartDate()
|
||||||
|
)) {
|
||||||
|
existingEntity.setStartDate(importedEntity.getStartDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Objects.equals(
|
||||||
|
existingEntity.getDueDate(),
|
||||||
|
importedEntity.getDueDate()
|
||||||
|
)) {
|
||||||
|
existingEntity.setDueDate(importedEntity.getDueDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existingEntity.getDurationMinutes() != importedEntity
|
||||||
|
.getDurationMinutes()) {
|
||||||
|
existingEntity.setDurationMinutes(
|
||||||
|
importedEntity.getDurationMinutes()
|
||||||
);
|
);
|
||||||
taskManager.addTask(
|
}
|
||||||
importedEntity.getWorkflow(),
|
|
||||||
existingEntity
|
if (!Objects.equals(
|
||||||
|
existingEntity.getNotificationSender(),
|
||||||
|
importedEntity.getNotificationSender()
|
||||||
|
)) {
|
||||||
|
existingEntity.setNotificationSender(
|
||||||
|
importedEntity.getNotificationSender()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.NoResultException;
|
import javax.persistence.NoResultException;
|
||||||
import javax.transaction.Transactional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exporter/Importer for {@link TaskDependency} entities.
|
* Exporter/Importer for {@link TaskDependency} entities.
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,6 @@ import org.libreccm.imexport.Processes;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
|
@ -78,13 +76,6 @@ public class WorkflowImExporter extends AbstractEntityImExporter<Workflow> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getTemplate(),
|
|
||||||
importedEntity.getTemplate()
|
|
||||||
)) {
|
|
||||||
existingEntity.setTemplate(importedEntity.getTemplate());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getName(),
|
existingEntity.getName(),
|
||||||
importedEntity.getName()
|
importedEntity.getName()
|
||||||
|
|
@ -117,30 +108,7 @@ public class WorkflowImExporter extends AbstractEntityImExporter<Workflow> {
|
||||||
existingEntity.setTasksState(importedEntity.getTasksState());
|
existingEntity.setTasksState(importedEntity.getTasksState());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getObject(),
|
|
||||||
importedEntity.getObject()
|
|
||||||
)) {
|
|
||||||
existingEntity.setObject(importedEntity.getObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
workflowRepository.save(importedEntity);
|
workflowRepository.save(importedEntity);
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getTasks(),
|
|
||||||
importedEntity.getTasks()
|
|
||||||
)) {
|
|
||||||
|
|
||||||
final Set<Task> tasksToAdd = importedEntity
|
|
||||||
.getTasks()
|
|
||||||
.stream()
|
|
||||||
.filter(task -> !existingEntity.getTasks().contains(task))
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
|
|
||||||
for (final Task task : tasksToAdd) {
|
|
||||||
taskManager.addTask(existingEntity, task);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ import javax.annotation.PostConstruct;
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.transaction.Transactional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Im/Exporter for importing and exporting {@code File}s from the system into a
|
* Im/Exporter for importing and exporting {@code File}s from the system into a
|
||||||
|
|
@ -84,7 +83,7 @@ public class FileImExporter extends AbstractEntityImExporter<File> {
|
||||||
existingEntity.setDescription(importedEntity.getDescription());
|
existingEntity.setDescription(importedEntity.getDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getPath(),
|
existingEntity.getPath(),
|
||||||
importedEntity.getPath()
|
importedEntity.getPath()
|
||||||
)) {
|
)) {
|
||||||
|
|
@ -150,20 +149,6 @@ public class FileImExporter extends AbstractEntityImExporter<File> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getParent(),
|
|
||||||
importedEntity.getParent()
|
|
||||||
)) {
|
|
||||||
existingEntity.setParent(importedEntity.getParent());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getRepository(),
|
|
||||||
importedEntity.getRepository()
|
|
||||||
)) {
|
|
||||||
existingEntity.setRepository(importedEntity.getRepository());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getContent(),
|
existingEntity.getContent(),
|
||||||
importedEntity.getContent()
|
importedEntity.getContent()
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ public class FolderImExporter extends AbstractResourceImExporter<Folder> {
|
||||||
final Folder existingEntity,
|
final Folder existingEntity,
|
||||||
final Folder importedEntity
|
final Folder importedEntity
|
||||||
) {
|
) {
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getName(),
|
existingEntity.getName(),
|
||||||
importedEntity.getName()
|
importedEntity.getName()
|
||||||
)) {
|
)) {
|
||||||
|
|
@ -81,7 +81,7 @@ public class FolderImExporter extends AbstractResourceImExporter<Folder> {
|
||||||
existingEntity.setDescription(importedEntity.getDescription());
|
existingEntity.setDescription(importedEntity.getDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getPath(),
|
existingEntity.getPath(),
|
||||||
importedEntity.getPath()
|
importedEntity.getPath()
|
||||||
)) {
|
)) {
|
||||||
|
|
@ -147,29 +147,6 @@ public class FolderImExporter extends AbstractResourceImExporter<Folder> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getParent(),
|
|
||||||
importedEntity.getParent()
|
|
||||||
)) {
|
|
||||||
existingEntity.setParent(importedEntity.getParent());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getRepository(),
|
|
||||||
importedEntity.getRepository()
|
|
||||||
)) {
|
|
||||||
existingEntity.setRepository(importedEntity.getRepository());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getRootAssignedRepository(),
|
|
||||||
importedEntity.getRootAssignedRepository()
|
|
||||||
)) {
|
|
||||||
existingEntity.setRootAssignedRepository(
|
|
||||||
importedEntity.getRootAssignedRepository()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
folderRepository.save(importedEntity);
|
folderRepository.save(importedEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,13 +117,6 @@ public class RepositoryImExporter extends AbstractEntityImExporter<Repository> {
|
||||||
existingEntity.setName(importedEntity.getName());
|
existingEntity.setName(importedEntity.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(
|
|
||||||
existingEntity.getRootFolder(),
|
|
||||||
importedEntity.getRootFolder()
|
|
||||||
)) {
|
|
||||||
existingEntity.setRootFolder(importedEntity.getRootFolder());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
existingEntity.getOwner(),
|
existingEntity.getOwner(),
|
||||||
importedEntity.getOwner()
|
importedEntity.getOwner()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue