From db7807dd6acf67e1baecf304dd88c53867bd0727 Mon Sep 17 00:00:00 2001 From: tosmers Date: Fri, 16 Mar 2018 15:28:10 +0000 Subject: [PATCH] [CCM][UPDATE] - moves all ng-classes related to Domain and CcmApplication from ldn-terms over to core -> provides better dependency managment between packages - adds part I of ng's cms classes for later portation git-svn-id: https://svn.libreccm.org/ccm/trunk@5348 8810af33-2d31-482b-a856-94f89814c4df --- .../src/com/arsdigita/cms/ContentSection.java | 4 +- .../portation/conversion/CmsConverter.java | 33 +-- .../portation/conversion/NgCmsCollection.java | 59 +++++ .../cms/portation/modules/CmsExporter.java | 50 ++++ .../modules/contentsection/Asset.java | 86 +++++++ .../contentsection/AttachmentList.java | 139 +++++++++++ .../modules/contentsection/ContentItem.java | 227 ++++++++++++++++++ .../contentsection/ContentItemVersion.java | 48 ++++ .../contentsection/ContentSection.java | 214 +++++++++++++++++ .../modules/contentsection/ContentType.java | 145 +++++++++++ .../contentsection/ContentTypeMode.java | 30 +++ .../modules/contentsection/Folder.java | 66 +++++ .../modules/contentsection/FolderType.java | 29 +++ .../contentsection/ItemAttachment.java | 99 ++++++++ .../util/ContentItemVersionMapper.java | 41 ++++ .../util/ContentTypeModeMapper.java | 40 +++ .../contentsection/util/FolderTypeMapper.java | 35 +++ .../modules/lifecycle/Lifecycle.java | 134 +++++++++++ .../lifecycle/LifecycleDefinition.java | 107 +++++++++ .../portation/modules/lifecycle/Phase.java | 123 ++++++++++ .../modules/lifecycle/PhaseDefinition.java | 106 ++++++++ .../portation/AbstractConverter.java | 2 +- .../arsdigita/portation/AbstractExporter.java | 3 + .../arsdigita/portation/cmd/ExportLogger.java | 70 ++++++ .../portation/cmd/RootConverter.java | 8 +- .../arsdigita/portation/cmd/RootExporter.java | 4 +- .../portation/conversion/CoreConverter.java | 17 +- .../conversion/NgCoreCollection.java | 49 ++-- .../categorization/CategoryConversion.java | 24 +- .../core/categorization/DomainConversion.java | 71 +++--- .../core/core/ResourceTypeConversion.java | 13 +- .../core/security/GroupConversion.java | 19 +- .../core/security/PermissionConversion.java | 47 ++-- .../core/security/RoleConversion.java | 18 +- .../core/security/UserConversion.java | 9 +- .../core/web/CcmApplicationConversion.java | 31 ++- .../workflow/AssignableTaskConversion.java | 54 ++--- .../core/workflow/TaskCommentConversion.java | 10 +- .../core/workflow/WorkflowConversion.java | 21 +- .../portation/modules/CoreExporter.java | 13 + .../CategorizationMarshaller.java | 4 +- .../modules/core/categorization/Category.java | 26 +- .../categorization/CategoryMarshaller.java | 4 +- .../modules/core/categorization/Domain.java | 34 +-- .../core/categorization/DomainIdResolver.java | 2 +- .../core/categorization/DomainMarshaller.java | 8 +- .../core/categorization/DomainOwnership.java | 11 +- .../DomainOwnershipIdGenerator.java | 2 +- .../DomainOwnershipMarshaller.java | 8 +- .../util/CategoryInformation.java | 104 ++++++++ .../modules/core/core/CcmObject.java | 5 +- .../portation/modules/core/core/Resource.java | 7 +- .../modules/core/core/ResourceIdResolver.java | 2 +- .../modules/core/core/ResourceType.java | 4 +- .../core/core/ResourceTypeIdResolver.java | 2 +- .../core/core/ResourceTypeMarshaller.java | 8 +- .../core/security/GroupMarshaller.java | 4 +- .../security/GroupMembershipMarshaller.java | 4 +- .../core/security/PermissionMarshaller.java | 4 +- .../modules/core/security/RoleMarshaller.java | 4 +- .../security/RoleMembershipMarshaller.java | 4 +- .../modules/core/security/UserMarshaller.java | 4 +- .../modules/core/web/CcmApplication.java | 8 +- .../core/web/CcmApplicationIdResolver.java | 2 +- .../core/web/CcmApplicationMarshaller.java | 8 +- .../workflow/AssignableTaskMarshaller.java | 4 +- .../workflow/TaskAssignmentMarshaller.java | 5 +- .../core/workflow/TaskCommentMarshaller.java | 4 +- .../workflow/TaskDependencyMarshaller.java | 4 +- .../core/workflow/WorkflowMarshaller.java | 4 +- .../core/workflow/util/StateMapper.java | 3 +- .../conversion/NgCoreCollection.java | 52 ---- .../portation/modules/LdnTermsExporter.java | 70 ------ 73 files changed, 2275 insertions(+), 442 deletions(-) rename ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/LdnTermsConverter.java => ccm-cms/src/com/arsdigita/cms/portation/conversion/CmsConverter.java (51%) create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/CmsExporter.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/Asset.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/AttachmentList.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentItem.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentItemVersion.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentSection.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentType.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentTypeMode.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/Folder.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/FolderType.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ItemAttachment.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/util/ContentItemVersionMapper.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/util/ContentTypeModeMapper.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/util/FolderTypeMapper.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/lifecycle/Lifecycle.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/lifecycle/LifecycleDefinition.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/lifecycle/Phase.java create mode 100644 ccm-cms/src/com/arsdigita/cms/portation/modules/lifecycle/PhaseDefinition.java create mode 100644 ccm-core/src/com/arsdigita/portation/cmd/ExportLogger.java rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/conversion/core/categorization/DomainConversion.java (68%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/conversion/core/core/ResourceTypeConversion.java (84%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/conversion/core/web/CcmApplicationConversion.java (86%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/categorization/Domain.java (79%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/categorization/DomainIdResolver.java (95%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/categorization/DomainMarshaller.java (90%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/categorization/DomainOwnership.java (89%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/categorization/DomainOwnershipIdGenerator.java (96%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/categorization/DomainOwnershipMarshaller.java (90%) create mode 100644 ccm-core/src/com/arsdigita/portation/modules/core/categorization/util/CategoryInformation.java rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/core/Resource.java (93%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/core/ResourceIdResolver.java (96%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/core/ResourceType.java (96%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/core/ResourceTypeIdResolver.java (96%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/core/ResourceTypeMarshaller.java (90%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/web/CcmApplication.java (89%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/web/CcmApplicationIdResolver.java (96%) rename {ccm-ldn-terms/src/com/arsdigita/london/terms => ccm-core/src/com/arsdigita}/portation/modules/core/web/CcmApplicationMarshaller.java (90%) delete mode 100644 ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/NgCoreCollection.java delete mode 100644 ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/LdnTermsExporter.java diff --git a/ccm-cms/src/com/arsdigita/cms/ContentSection.java b/ccm-cms/src/com/arsdigita/cms/ContentSection.java index 0fda49a85..78eca25d1 100755 --- a/ccm-cms/src/com/arsdigita/cms/ContentSection.java +++ b/ccm-cms/src/com/arsdigita/cms/ContentSection.java @@ -224,8 +224,8 @@ public class ContentSection extends Application { * @return The name of the content section */ public String getName() { - //return (String) get(NAME); - return getTitle(); + return (String) get(NAME); + //return getTitle(); } /** diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/LdnTermsConverter.java b/ccm-cms/src/com/arsdigita/cms/portation/conversion/CmsConverter.java similarity index 51% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/LdnTermsConverter.java rename to ccm-cms/src/com/arsdigita/cms/portation/conversion/CmsConverter.java index 0b8d03e1d..2a36b27d8 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/LdnTermsConverter.java +++ b/ccm-cms/src/com/arsdigita/cms/portation/conversion/CmsConverter.java @@ -16,36 +16,27 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.conversion; +package com.arsdigita.cms.portation.conversion; -import com.arsdigita.london.terms.portation.conversion.core.categorization.DomainConversion; -import com.arsdigita.london.terms.portation.conversion.core.core.ResourceTypeConversion; -import com.arsdigita.london.terms.portation.conversion.core.web.CcmApplicationConversion; import com.arsdigita.portation.AbstractConverter; /** - * This core converter class calls all the conversions from trunk-objects - * to ng-objects in a specific order to guarantee a correct dependency - * recreation in the ng-objects. All the created objects are going to be - * stored in maps as -pairs in the {@link NgCoreCollection}-class. - * * @author Tobias Osmers<\a> + * @version created the 2/12/18 + */ +public class NgCmsCollection { + public static Map assets = new HashMap<>(); + public static Map itemAttachments = new HashMap<>(); + public static Map attachmentLists = new HashMap<>(); + public static Map contentItems = new HashMap<>(); + + public static Map contentTypes = new HashMap<>(); + public static Map contentSections = new HashMap<>(); + + public static Map phases = new HashMap<>(); + + public static Map lifecycles = new HashMap<>(); + public static Map lifecycleDefinitions = new + HashMap<>(); + public static Map phaseDefinitions = new HashMap<>(); + + /** + * Private constructor to prevent the instantiation of this class. + */ + private NgCmsCollection() {} +} diff --git a/ccm-cms/src/com/arsdigita/cms/portation/modules/CmsExporter.java b/ccm-cms/src/com/arsdigita/cms/portation/modules/CmsExporter.java new file mode 100644 index 000000000..e15082522 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/portation/modules/CmsExporter.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.modules; + +import com.arsdigita.portation.AbstractExporter; + +/** + * @author Tobias Osmers<\a> + * @version created the 2/21/18 + */ +public class Asset extends CcmObject implements Portable { + @JsonIgnore + private List> itemAttachments; + private LocalizedString title; + + /** + * Constructor for the ng-object. + * + * @param trunkAsset the old trunk object + */ + public Asset(final com.arsdigita.cms.Asset trunkAsset) { + super(trunkAsset); + + this.itemAttachments = new ArrayList<>(); + + this.title = new LocalizedString(); + final Locale locale = Locale.getDefault(); + title.addValue(locale, (String) trunkAsset.get("name")); + + NgCmsCollection.assets.put(this.getObjectId(), this); + } + + + public List> getItemAttachments() { + return itemAttachments; + } + + public void setItemAttachments(final List> + itemAttachments) { + this.itemAttachments = itemAttachments; + } + + public void addItemAttachment(final ItemAttachment itemAttachment) { + this.itemAttachments.add(itemAttachment); + } + + public void removeItemAttachment(final ItemAttachment itemAttachment) { + this.itemAttachments.remove(itemAttachment); + } + + public LocalizedString getTitle() { + return title; + } + + public void setTitle(final LocalizedString title) { + this.title = title; + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/AttachmentList.java b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/AttachmentList.java new file mode 100644 index 000000000..1545f3013 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/AttachmentList.java @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.modules.contentsection; + +import com.arsdigita.cms.portation.conversion.NgCmsCollection; +import com.arsdigita.kernel.ACSObject; +import com.arsdigita.portation.Portable; +import com.arsdigita.portation.modules.core.l10n.LocalizedString; +import com.fasterxml.jackson.annotation.JsonIdentityReference; +import com.fasterxml.jackson.annotation.JsonIgnore; + +import java.util.List; +import java.util.UUID; + +/** + * @author > getAttachments() { + return attachments; + } + + public void setAttachments(final List> attachments) { + this.attachments = attachments; + } + + public void addAttachment(final ItemAttachment attachment) { + this.attachments.add(attachment); + } + + public void removeAttachment(final ItemAttachment attachment) { + this.attachments.remove(attachment); + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentItem.java b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentItem.java new file mode 100644 index 000000000..803f775ab --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentItem.java @@ -0,0 +1,227 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.modules.contentsection; + +import com.arsdigita.cms.portation.conversion.NgCmsCollection; +import com.arsdigita.cms.portation.modules.contentsection.util.ContentItemVersionMapper; +import com.arsdigita.cms.portation.modules.lifecycle.Lifecycle; +import com.arsdigita.portation.Portable; +import com.arsdigita.portation.modules.core.core.CcmObject; +import com.arsdigita.portation.modules.core.l10n.LocalizedString; +import com.arsdigita.portation.modules.core.workflow.Workflow; +import com.fasterxml.jackson.annotation.JsonIdentityReference; +import com.fasterxml.jackson.annotation.JsonIgnore; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.UUID; + +/** + * @author Tobias Osmers<\a> + * @version created the 2/21/18 + */ +public enum ContentItemVersion { + /** + * A draft version is only visible to authenticated users with the + * appropriate permissions. The draft version is also the version which is + * edited by the authors. + */ + DRAFT, + /** + * This version is assigned to the live copy by the + * {@code ContentItemManager} while the item is published. + */ + PUBLISHING, + /** + * A published version which is not yet visible because its lifecycle + * defines a later date. + */ + PENDING, + /** + * The live version of a content item is the one which is visible to + * most/all users. The live version is basically a copy of the state of the + * draft version of a content item on a specific time. + */ + LIVE +} diff --git a/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentSection.java b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentSection.java new file mode 100644 index 000000000..ec25710f3 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentSection.java @@ -0,0 +1,214 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.modules.contentsection; + +import com.arsdigita.cms.portation.conversion.NgCmsCollection; +import com.arsdigita.cms.portation.modules.lifecycle.LifecycleDefinition; +import com.arsdigita.portation.modules.core.web.CcmApplication; +import com.arsdigita.portation.modules.core.security.Role; +import com.arsdigita.portation.modules.core.workflow.Workflow; +import com.fasterxml.jackson.annotation.JsonIdentityReference; +import com.fasterxml.jackson.annotation.JsonIgnore; + +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + +/** + * @author Tobias Osmers<\a> + * @version created the 2/21/18 + */ +public class ContentType extends CcmObject implements Portable { + private String contentItemClass; + @JsonIdentityReference(alwaysAsId = true) + private ContentSection contentSection; + private LocalizedString label; + private LocalizedString description; + private String ancestors; + private String descendents; + private ContentTypeMode mode; + @JsonIdentityReference(alwaysAsId = true) + private LifecycleDefinition defaultLifecycle; + @JsonIdentityReference(alwaysAsId = true) + private Workflow defaultWorkflow; + + public ContentType(final com.arsdigita.cms.ContentType trunkContentType) { + super(trunkContentType); + + this.contentItemClass = trunkContentType.getClassName(); + //this.contentSection + + this.label = new LocalizedString(); + this.description = new LocalizedString(); + final Locale locale = Locale.getDefault(); + label.addValue(locale, + (String) trunkContentType.getLabel().localize(locale)); + description.addValue(locale, trunkContentType.getDescription()); + + this.ancestors = trunkContentType.getAncestors(); + this.descendents = trunkContentType.getDescendants(); + + this.mode = ContentTypeModeMapper + .mapContentTypeMode(trunkContentType.getMode()); + //this.defaultLifecycle + //this.defaultWorkflow + + NgCmsCollection.contentTypes.put(this.getObjectId(), this); + } + + public String getContentItemClass() { + return contentItemClass; + } + + public void setContentItemClass(final String contentItemClass) { + this.contentItemClass = contentItemClass; + } + + public ContentSection getContentSection() { + return contentSection; + } + + public void setContentSection(final ContentSection contentSection) { + this.contentSection = contentSection; + } + + public LocalizedString getLabel() { + return label; + } + + public void setLabel(final LocalizedString label) { + this.label = label; + } + + public LocalizedString getDescription() { + return description; + } + + public void setDescription(final LocalizedString description) { + this.description = description; + } + + public String getAncestors() { + return ancestors; + } + + public void setAncestors(final String ancestors) { + this.ancestors = ancestors; + } + + public String getDescendents() { + return descendents; + } + + public void setDescendents(final String descendents) { + this.descendents = descendents; + } + + public ContentTypeMode getMode() { + return mode; + } + + public void setMode(final ContentTypeMode mode) { + this.mode = mode; + } + + public LifecycleDefinition getDefaultLifecycle() { + return defaultLifecycle; + } + + public void setDefaultLifecycle(final LifecycleDefinition defaultLifecycle) { + this.defaultLifecycle = defaultLifecycle; + } + + public Workflow getDefaultWorkflow() { + return defaultWorkflow; + } + + public void setDefaultWorkflow(final Workflow defaultWorkflow) { + this.defaultWorkflow = defaultWorkflow; + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentTypeMode.java b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentTypeMode.java new file mode 100644 index 000000000..07b05270d --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentTypeMode.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.modules.contentsection; + +/** + * @author Tobias Osmers<\a> + * @version created the 3/2/18 + */ +public class Folder extends Category { + @JsonIgnore + private ContentSection section; + private FolderType type; + + public Folder(final com.arsdigita.cms.Folder trunkFolder) { + super(new CategoryInformation( + trunkFolder.getDisplayName(), + trunkFolder.getID().toString(), + trunkFolder.getName(), + trunkFolder.getLabel(), + trunkFolder.getAdditionalInfo(), + true, + true, + false, + 0) + ); + + //this.section + //this.type + } + + public ContentSection getSection() { + return section; + } + + public void setSection(final ContentSection section) { + this.section = section; + } + + public FolderType getType() { + return type; + } + + public void setType(final FolderType type) { + this.type = type; + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/FolderType.java b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/FolderType.java new file mode 100644 index 000000000..f8953c12a --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/FolderType.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.modules.contentsection; + +/** + * @author Tobias Osmers<\a> + * @version created the 2/21/18 + */ +public class ItemAttachment implements Portable { + private long attachmentId; + private String uuid; + @JsonIdentityReference(alwaysAsId = true) + private T asset; + @JsonIdentityReference(alwaysAsId = true) + private AttachmentList attachmentList; + private long sortkey; + + /** + * Constructor for the ng-object. + * + * @param asset a ng-asset + * @param attachmentList the corresponding ng-attachmentList + */ + public ItemAttachment(final T asset, final AttachmentList attachmentList) { + this.attachmentId = ACSObject.generateID().longValue();; + this.uuid = UUID.randomUUID().toString(); + + this.asset = asset; + this.attachmentList = attachmentList; + + this.sortkey = 0; + + NgCmsCollection.itemAttachments.put(this.attachmentId, this); + } + + + public long getAttachmentId() { + return attachmentId; + } + + public void setAttachmentId(final long attachmentId) { + this.attachmentId = attachmentId; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(final String uuid) { + this.uuid = uuid; + } + + public T getAsset() { + return asset; + } + + public void setAsset(final T asset) { + this.asset = asset; + } + + public AttachmentList getAttachmentList() { + return attachmentList; + } + + public void setAttachmentList(final AttachmentList attachmentList) { + this.attachmentList = attachmentList; + } + + public long getSortkey() { + return sortkey; + } + + public void setSortkey(final long sortkey) { + this.sortkey = sortkey; + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/util/ContentItemVersionMapper.java b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/util/ContentItemVersionMapper.java new file mode 100644 index 000000000..a8a73f5f3 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/util/ContentItemVersionMapper.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.modules.contentsection.util; + +import com.arsdigita.cms.portation.modules.contentsection.ContentItemVersion; + +/** + * @author Tobias Osmers<\a> + * @version created the 3/5/18 + */ +public class Lifecycle implements Portable { + private long lifecycleId; + private Date startDateTime; + private Date endDateTime; + private String listener; + private boolean started; + private boolean finished; + @JsonIdentityReference(alwaysAsId = true) + private LifecycleDefinition lifecycleDefinition; + @JsonIgnore + private List phases; + + public Lifecycle(final com.arsdigita.cms.lifecycle.Lifecycle + trunkLifecycle) { + this.lifecycleId = trunkLifecycle.getID().longValue(); + + this.startDateTime = trunkLifecycle.getStartDate(); + this.endDateTime = trunkLifecycle.getEndDate(); + + this.listener = trunkLifecycle.getListenerClassName(); + this.started = trunkLifecycle.hasBegun(); + this.finished = trunkLifecycle.hasEnded(); + + //this.lifecycleDefinition + this.phases = new ArrayList<>(); + + NgCmsCollection.lifecycles.put(this.lifecycleId, this); + } + + public long getLifecycleId() { + return lifecycleId; + } + + public void setLifecycleId(final long lifecycleId) { + this.lifecycleId = lifecycleId; + } + + public Date getStartDateTime() { + return startDateTime; + } + + public void setStartDateTime(final Date startDateTime) { + this.startDateTime = startDateTime; + } + + public Date getEndDateTime() { + return endDateTime; + } + + public void setEndDateTime(final Date endDateTime) { + this.endDateTime = endDateTime; + } + + public String getListener() { + return listener; + } + + public void setListener(final String listener) { + this.listener = listener; + } + + public boolean isStarted() { + return started; + } + + public void setStarted(final boolean started) { + this.started = started; + } + + public boolean isFinished() { + return finished; + } + + public void setFinished(final boolean finished) { + this.finished = finished; + } + + public LifecycleDefinition getLifecycleDefinition() { + return lifecycleDefinition; + } + + public void setLifecycleDefinition(final LifecycleDefinition lifecycleDefinition) { + this.lifecycleDefinition = lifecycleDefinition; + } + + public List getPhases() { + return phases; + } + + public void setPhases(final List phases) { + this.phases = phases; + } + + public void addPhase(final Phase phase) { + this.phases.add(phase); + } + + public void removePhase(final Phase phase) { + this.phases.remove(phase); + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/portation/modules/lifecycle/LifecycleDefinition.java b/ccm-cms/src/com/arsdigita/cms/portation/modules/lifecycle/LifecycleDefinition.java new file mode 100644 index 000000000..5634e5933 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/portation/modules/lifecycle/LifecycleDefinition.java @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.modules.lifecycle; + +import com.arsdigita.cms.portation.conversion.NgCmsCollection; +import com.arsdigita.portation.Portable; +import com.arsdigita.portation.modules.core.l10n.LocalizedString; +import com.fasterxml.jackson.annotation.JsonIdentityReference; + +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + +/** + * @author Tobias Osmers<\a> + * @version created the 3/5/18 + */ +public class Phase implements Portable { + private long phaseId; + private Date startDateTime; + private Date endDateTime; + private String listener; + private boolean started; + private boolean finished; + @JsonIdentityReference(alwaysAsId = true) + private Lifecycle lifecycle; + @JsonIdentityReference(alwaysAsId = true) + private PhaseDefinition phaseDefinition; + + public Phase(final com.arsdigita.cms.lifecycle.Phase trunkPhase) { + this.phaseId = trunkPhase.getID().longValue(); + + this.startDateTime = trunkPhase.getStartDate(); + this.endDateTime = trunkPhase.getEndDate(); + + this.listener = trunkPhase.getListenerClassName(); + + this.started = trunkPhase.hasBegun(); + this.finished = trunkPhase.hasEnded(); + + //this.lifecycle + //this.phaseDefinition + + NgCmsCollection.phases.put(this.phaseId, this); + } + + public long getPhaseId() { + return phaseId; + } + + public void setPhaseId(final long phaseId) { + this.phaseId = phaseId; + } + + public Date getStartDateTime() { + return startDateTime; + } + + public void setStartDateTime(final Date startDateTime) { + this.startDateTime = startDateTime; + } + + public Date getEndDateTime() { + return endDateTime; + } + + public void setEndDateTime(final Date endDateTime) { + this.endDateTime = endDateTime; + } + + public String getListener() { + return listener; + } + + public void setListener(final String listener) { + this.listener = listener; + } + + public boolean isStarted() { + return started; + } + + public void setStarted(final boolean started) { + this.started = started; + } + + public boolean isFinished() { + return finished; + } + + public void setFinished(final boolean finished) { + this.finished = finished; + } + + public Lifecycle getLifecycle() { + return lifecycle; + } + + public void setLifecycle(final Lifecycle lifecycle) { + this.lifecycle = lifecycle; + } + + public PhaseDefinition getPhaseDefinition() { + return phaseDefinition; + } + + public void setPhaseDefinition(final PhaseDefinition phaseDefinition) { + this.phaseDefinition = phaseDefinition; + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/portation/modules/lifecycle/PhaseDefinition.java b/ccm-cms/src/com/arsdigita/cms/portation/modules/lifecycle/PhaseDefinition.java new file mode 100644 index 000000000..c6069351b --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/portation/modules/lifecycle/PhaseDefinition.java @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.modules.lifecycle; + +import com.arsdigita.cms.portation.conversion.NgCmsCollection; +import com.arsdigita.portation.Portable; +import com.arsdigita.portation.modules.core.l10n.LocalizedString; + +import java.util.Locale; + +/** + * @author Tobias Osmers<\a> + * @version created the 3/5/18 + */ +public class ExportLogger { + + public static void fetching(final String classNames) { + System.out.println(String.format( + "\tFetching %s from database...", classNames)); + } + + public static void converting(final String classNames) { + System.out.println(String.format( + "\tConverting %s...", classNames)); + } + + public static void created(final String className, + final int count) { + System.out.println(String.format( + "\t\tCreated %d %s.", count, className)); + } + public static void skipped(final String className, + final int count) { + System.out.println(String.format( + "\t\tSkipped %d %s.", count, className)); + } + public static void found(final String className, + final int count) { + System.out.println(String.format( + "\t\tFound %d %s.", count, className)); + } + + public static void sorting(final String classNames) { + System.out.println(String.format( + "\tSorting %s...", classNames)); + } + + public static void ranSort(final String className, + final int runs) { + System.out.println(String.format( + "\t\tSorted %s in %d runs.", className, runs)); + } + + + + public static void exporting(final String className) { + System.out.println(String.format( + "\tExporting %s...", className)); + } +} diff --git a/ccm-core/src/com/arsdigita/portation/cmd/RootConverter.java b/ccm-core/src/com/arsdigita/portation/cmd/RootConverter.java index 202be4537..50df93ef2 100644 --- a/ccm-core/src/com/arsdigita/portation/cmd/RootConverter.java +++ b/ccm-core/src/com/arsdigita/portation/cmd/RootConverter.java @@ -38,17 +38,17 @@ public class RootConverter { @SuppressWarnings("unchecked") public static void rootConversionExecution() throws Exception { // Core conversions - CoreConverter.getInstance().startConversion(); + CoreConverter.getInstance().startConversions(); // Lnd-Terms conversions - Class cls = Class + /*Class cls = Class .forName("com.arsdigita.london.terms.portation" + ".conversion.LdnTermsConverter"); if (cls != null) { Method startConversionToNg = cls - .getDeclaredMethod("startConversion"); + .getDeclaredMethod("startConversions"); startConversionToNg.invoke(cls.newInstance()); - } + }*/ // ... } diff --git a/ccm-core/src/com/arsdigita/portation/cmd/RootExporter.java b/ccm-core/src/com/arsdigita/portation/cmd/RootExporter.java index 679085c69..e06331762 100644 --- a/ccm-core/src/com/arsdigita/portation/cmd/RootExporter.java +++ b/ccm-core/src/com/arsdigita/portation/cmd/RootExporter.java @@ -41,14 +41,14 @@ public class RootExporter { CoreExporter.getInstance().startMarshaller(); // Ldn-Terms - Class cls = Class + /*Class cls = Class .forName("com.arsdigita.london.terms.portation.modules" + ".LdnTermsExporter"); if (cls != null) { Method startExport = cls .getDeclaredMethod("startMarshaller"); startExport.invoke(cls.newInstance()); - } + }*/ // ... } diff --git a/ccm-core/src/com/arsdigita/portation/conversion/CoreConverter.java b/ccm-core/src/com/arsdigita/portation/conversion/CoreConverter.java index ffd35a4e8..716ea2bed 100644 --- a/ccm-core/src/com/arsdigita/portation/conversion/CoreConverter.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/CoreConverter.java @@ -20,10 +20,13 @@ package com.arsdigita.portation.conversion; import com.arsdigita.portation.AbstractConverter; import com.arsdigita.portation.conversion.core.categorization.CategoryConversion; +import com.arsdigita.portation.conversion.core.categorization.DomainConversion; +import com.arsdigita.portation.conversion.core.core.ResourceTypeConversion; import com.arsdigita.portation.conversion.core.security.GroupConversion; import com.arsdigita.portation.conversion.core.security.PermissionConversion; import com.arsdigita.portation.conversion.core.security.RoleConversion; import com.arsdigita.portation.conversion.core.security.UserConversion; +import com.arsdigita.portation.conversion.core.web.CcmApplicationConversion; import com.arsdigita.portation.conversion.core.workflow.AssignableTaskConversion; import com.arsdigita.portation.conversion.core.workflow.TaskCommentConversion; import com.arsdigita.portation.conversion.core.workflow.WorkflowConversion; @@ -62,7 +65,7 @@ public class CoreConverter extends AbstractConverter { * already been created. */ @Override - public void startConversion() { + public void startConversions() { UserConversion.getInstance().convertAll(); GroupConversion.getInstance().convertAll(); RoleConversion.getInstance().convertAll(); @@ -70,17 +73,13 @@ public class CoreConverter extends AbstractConverter { CategoryConversion.getInstance().convertAll(); PermissionConversion.getInstance().convertAll(); - // Verify permissions - for (Permission permission : NgCoreCollection.permissions.values()) { - if (permission.getGrantee() == null) { - System.err.printf("CoreConverter: Grantee for permission %d " + - "is null.%n", permission.getPermissionId()); - System.exit(-1); - } - } WorkflowConversion.getInstance().convertAll(); TaskCommentConversion.getInstance().convertAll(); AssignableTaskConversion.getInstance().convertAll(); + + ResourceTypeConversion.getInstance().convertAll(); + CcmApplicationConversion.getInstance().convertAll(); + DomainConversion.getInstance().convertAll(); } } diff --git a/ccm-core/src/com/arsdigita/portation/conversion/NgCoreCollection.java b/ccm-core/src/com/arsdigita/portation/conversion/NgCoreCollection.java index c0da29a28..89bc04a4f 100644 --- a/ccm-core/src/com/arsdigita/portation/conversion/NgCoreCollection.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/NgCoreCollection.java @@ -20,7 +20,11 @@ package com.arsdigita.portation.conversion; import com.arsdigita.portation.modules.core.categorization.Categorization; import com.arsdigita.portation.modules.core.categorization.Category; +import com.arsdigita.portation.modules.core.categorization.Domain; +import com.arsdigita.portation.modules.core.categorization.DomainOwnership; import com.arsdigita.portation.modules.core.core.CcmObject; +import com.arsdigita.portation.modules.core.core.Resource; +import com.arsdigita.portation.modules.core.core.ResourceType; import com.arsdigita.portation.modules.core.security.Group; import com.arsdigita.portation.modules.core.security.GroupMembership; import com.arsdigita.portation.modules.core.security.Party; @@ -28,6 +32,7 @@ import com.arsdigita.portation.modules.core.security.Permission; import com.arsdigita.portation.modules.core.security.Role; import com.arsdigita.portation.modules.core.security.RoleMembership; import com.arsdigita.portation.modules.core.security.User; +import com.arsdigita.portation.modules.core.web.CcmApplication; import com.arsdigita.portation.modules.core.workflow.AssignableTask; import com.arsdigita.portation.modules.core.workflow.Task; import com.arsdigita.portation.modules.core.workflow.TaskAssignment; @@ -59,6 +64,8 @@ public class NgCoreCollection { public static Map categories = new HashMap<>(); public static Map categorizations = new HashMap<>(); + public static Map permissions = new HashMap<>(); + public static Map workflows = new HashMap<>(); public static Map taskComments = new HashMap<>(); public static Map tasks = new HashMap<>(); @@ -66,48 +73,22 @@ public class NgCoreCollection { public static Map taskDependencies = new HashMap<>(); public static Map taskAssignments = new HashMap<>(); - public static Map permissions = new HashMap<>(); + public static Map resourceTypes = new HashMap<>(); + public static Map resources = new HashMap<>(); + public static Map ccmApplications = new HashMap<>(); + + public static Map domains = new HashMap<>(); + public static Map domainOwnerships = new HashMap<>(); + // in case maps need to be sorted for export public static ArrayList sortedCategories; public static ArrayList sortedWorkflows; public static ArrayList sortedAssignableTasks; + public static ArrayList sortedCcmApplications; /** * Private constructor to prevent the instantiation of this class. */ private NgCoreCollection() {} - - /* - * Sorts values of task-map to ensure that the dependsOn-tasks will - * be listed before their dependant task in the export file. - * - * Runs once over the unsorted list and iterates over each their parents - * to add them to the sorted list. After being added to the sorted list the - * task will be removed from the unsorted list and therefore ignored - * in this foreach run. - * - public static void sortAssignableTasks() { - ArrayList unsortedAssignableTasks = - new ArrayList<>(assignableTasks.values()); - sortedAssignableTasks = new ArrayList<>(unsortedAssignableTasks.size()); - - int runs = 0; - for (AssignableTask anUnsorted : unsortedAssignableTasks) { - addDependencyTasks(anUnsorted); - runs++; - } - System.err.printf("\t\tSorted categories in %d runs.\n", runs); - } - - private static void addDependencyTasks(AssignableTask anUnsorted) { - List dependencies = anUnsorted.getDependsOn(); - - for (Task task : dependencies) { - AssignableTask assignableTask = (AssignableTask) task; - - } - - } - */ } diff --git a/ccm-core/src/com/arsdigita/portation/conversion/core/categorization/CategoryConversion.java b/ccm-core/src/com/arsdigita/portation/conversion/core/categorization/CategoryConversion.java index 03a0e4676..2168137b9 100644 --- a/ccm-core/src/com/arsdigita/portation/conversion/core/categorization/CategoryConversion.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/core/categorization/CategoryConversion.java @@ -21,6 +21,7 @@ package com.arsdigita.portation.conversion.core.categorization; import com.arsdigita.categorization.CategorizedCollection; import com.arsdigita.kernel.ACSObject; import com.arsdigita.portation.AbstractConversion; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import com.arsdigita.portation.modules.core.categorization.Categorization; import com.arsdigita.portation.modules.core.categorization.Category; @@ -53,18 +54,16 @@ public class CategoryConversion extends AbstractConversion { */ @Override public void convertAll() { - System.out.print("\tFetching categories from database..."); + ExportLogger.fetching("categories"); List trunkCategories = com .arsdigita.categorization.Category.getAllObjectCategories(); - System.out.println("done."); - System.out.print("\tConverting categories and categorizations...\n"); + ExportLogger.converting("categories and categorizations"); createCategoryAndCategorizations(trunkCategories); setRingAssociations(trunkCategories); - System.out.print("\tSorting categories...\n"); - sortCategoryMap(); - System.out.println("\tdone.\n"); + ExportLogger.sorting("categories"); + sortCategoryMap(); } /** @@ -95,9 +94,10 @@ public class CategoryConversion extends AbstractConversion { processedCategories++; } - System.out.printf("\t\tCreated %d categories and\n" + - "\t\tcreated %d categorizations.\n", - processedCategories, processedCategorizations); + ExportLogger.created("categories", + processedCategories); + ExportLogger.created("categorizations", + processedCategorizations); } /** @@ -112,8 +112,8 @@ public class CategoryConversion extends AbstractConversion { * @return Number of how many {@link Categorization}s have been processed. */ private long createCategorizations(Category category, - CategorizedCollection - categorizedObjects) { + CategorizedCollection + categorizedObjects) { int processed = 0; while (categorizedObjects.next()) { @@ -197,7 +197,7 @@ public class CategoryConversion extends AbstractConversion { } NgCoreCollection.sortedCategories = sortedList; - System.out.printf("\t\tSorted categories in %d runs.\n", runs); + ExportLogger.ranSort("categories", runs); } /** diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/core/categorization/DomainConversion.java b/ccm-core/src/com/arsdigita/portation/conversion/core/categorization/DomainConversion.java similarity index 68% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/core/categorization/DomainConversion.java rename to ccm-core/src/com/arsdigita/portation/conversion/core/categorization/DomainConversion.java index 3471a9b73..7bc2bde70 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/core/categorization/DomainConversion.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/core/categorization/DomainConversion.java @@ -16,22 +16,23 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.conversion.core.categorization; +package com.arsdigita.portation.conversion.core.categorization; import com.arsdigita.domain.DomainCollection; import com.arsdigita.domain.DomainObject; import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.london.terms.portation.conversion.NgCoreCollection; -import com.arsdigita.london.terms.portation.modules.core.categorization.Domain; -import com.arsdigita.london.terms.portation.modules.core.categorization.DomainOwnership; -import com.arsdigita.london.terms.portation.modules.core.web.CcmApplication; +import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.SessionManager; import com.arsdigita.portation.AbstractConversion; +import com.arsdigita.portation.cmd.ExportLogger; +import com.arsdigita.portation.conversion.NgCoreCollection; import com.arsdigita.portation.modules.core.categorization.Category; +import com.arsdigita.portation.modules.core.categorization.Domain; +import com.arsdigita.portation.modules.core.categorization.DomainOwnership; +import com.arsdigita.portation.modules.core.web.CcmApplication; import com.arsdigita.web.Application; -import java.util.List; - /** * Class for converting all trunk-{@link com.arsdigita.london.terms.Domain}s * into ng-{@link Domain}s as preparation for a successful export of all trunk @@ -55,14 +56,12 @@ public class DomainConversion extends AbstractConversion { */ @Override public void convertAll() { - System.out.print("\tFetching domains from database..."); - List trunkDomains = com - .arsdigita.london.terms.Domain.getAllObjectDomains(); - System.out.println("done."); + ExportLogger.fetching("domains"); + DataCollection trunkDomains = SessionManager.getSession() + .retrieve("com.arsdigita.london.terms.Domain"); - System.out.print("\tConverting domains and domain ownerships...\n"); + ExportLogger.converting("doamins and domain ownerships"); createDomainsAndSetAssociations(trunkDomains); - System.out.println("\tdone.\n"); } /** @@ -72,35 +71,43 @@ public class DomainConversion extends AbstractConversion { * @param trunkDomains List of all {@link com.arsdigita.london.terms.Domain}s * from this old trunk-system. */ - private void createDomainsAndSetAssociations( - List trunkDomains) { + private void createDomainsAndSetAssociations(DataCollection trunkDomains) { int processedDomains = 0, processedDomainOwnerships = 0; - for(com.arsdigita.london.terms.Domain trunkDomain : trunkDomains) { + while(trunkDomains.next()) { + DataObject trunkDomain = trunkDomains.getDataObject(); + // create domains Domain domain = new Domain(trunkDomain); - // set root (category) association - com.arsdigita.categorization.Category trunkModel = trunkDomain - .getModel(); + + com.arsdigita.categorization.Category trunkModel = + (com.arsdigita.categorization.Category) DomainObjectFactory + .newInstance((DataObject) trunkDomain + .get("model")); if (trunkModel != null) { - Category root = com.arsdigita.portation.conversion - .NgCoreCollection + // set root (category) association + Category root = NgCoreCollection .categories .get(trunkModel.getID().longValue()); domain.setRoot(root); - } - // create domain ownerships - DomainCollection useContexts = trunkDomain.getUseContexts(); - processedDomainOwnerships += createDomainOwnerships(domain, - useContexts); + // create domain ownerships + DataCollection useContexts = SessionManager + .getSession() + .retrieve("com.arsdigita." + + "categorization.UseContext"); + useContexts.addEqualsFilter( + "rootCategory.id", trunkModel.getID()); + + processedDomainOwnerships += createDomainOwnerships( + domain, (DomainCollection) useContexts); + } processedDomains++; } - System.out.printf("\t\tCreated %d domains and\n" + - "\t\tcreated %d domain ownerships.\n", - processedDomains, processedDomainOwnerships); + ExportLogger.created("domains", processedDomains); + ExportLogger.created("domain ownerships", processedDomainOwnerships); } /** @@ -115,7 +122,7 @@ public class DomainConversion extends AbstractConversion { * @return Number of how many {@link DomainOwnership}s have been processed. */ private long createDomainOwnerships(Domain domain, - DomainCollection useContexts) { + DomainCollection useContexts) { int processed = 0; while (useContexts.next()) { @@ -126,9 +133,7 @@ public class DomainConversion extends AbstractConversion { if (obj instanceof Application) { CcmApplication owner = NgCoreCollection .ccmApplications - .get(((Application) obj) - .getID() - .longValue()); + .get(((Application) obj).getID().longValue()); String context = (String) useContexts .getDomainObject() .get("useContext"); diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/core/core/ResourceTypeConversion.java b/ccm-core/src/com/arsdigita/portation/conversion/core/core/ResourceTypeConversion.java similarity index 84% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/core/core/ResourceTypeConversion.java rename to ccm-core/src/com/arsdigita/portation/conversion/core/core/ResourceTypeConversion.java index 7e456fc2b..374173315 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/core/core/ResourceTypeConversion.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/core/core/ResourceTypeConversion.java @@ -16,10 +16,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.conversion.core.core; +package com.arsdigita.portation.conversion.core.core; -import com.arsdigita.london.terms.portation.modules.core.core.ResourceType; import com.arsdigita.portation.AbstractConversion; +import com.arsdigita.portation.cmd.ExportLogger; +import com.arsdigita.portation.modules.core.core.ResourceType; import java.util.List; @@ -46,12 +47,11 @@ public class ResourceTypeConversion extends AbstractConversion { */ @Override public void convertAll() { - System.out.print("\tFetching resource types from database..."); + ExportLogger.fetching("resource types"); List trunkResourceTypes = com .arsdigita.kernel.ResourceType.getAllObjectResourceTypes(); - System.out.println("done."); - System.out.print("\tConverting domains...\n"); + ExportLogger.converting("resource types"); // create resource types int processed = 0; for (com.arsdigita.kernel.ResourceType trunkResourceType : @@ -59,8 +59,7 @@ public class ResourceTypeConversion extends AbstractConversion { new ResourceType(trunkResourceType); processed++; } - System.out.printf("\t\tCreated %d resource types.\n", processed); - System.out.println("\tdone.\n"); + ExportLogger.created("resource types", processed); } /** diff --git a/ccm-core/src/com/arsdigita/portation/conversion/core/security/GroupConversion.java b/ccm-core/src/com/arsdigita/portation/conversion/core/security/GroupConversion.java index 8a9652912..64fdf068c 100644 --- a/ccm-core/src/com/arsdigita/portation/conversion/core/security/GroupConversion.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/core/security/GroupConversion.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.conversion.core.security; import com.arsdigita.kernel.UserCollection; import com.arsdigita.portation.AbstractConversion; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import com.arsdigita.portation.modules.core.security.Group; import com.arsdigita.portation.modules.core.security.GroupMembership; @@ -51,14 +52,12 @@ public class GroupConversion extends AbstractConversion { */ @Override public void convertAll() { - System.out.print("\tFetching groups from database..."); + ExportLogger.fetching("groups"); List trunkGroups = com.arsdigita.kernel .Group.getAllObjectGroups(); - System.out.println("done."); - System.out.print("\tConverting groups and group memberships...\n"); + ExportLogger.converting("groups and group memberships"); createGroupsAndSetAssociations(trunkGroups); - System.out.println("\tdone.\n"); } /** @@ -82,9 +81,8 @@ public class GroupConversion extends AbstractConversion { pGroups++; } - System.out.printf("\t\tCreated %d groups and\n" + - "\t\tcreated %d group memberships.\n", - pGroups, pMemberships); + ExportLogger.created("groups", pGroups); + ExportLogger.created("group memberships", pMemberships); } /** @@ -102,8 +100,9 @@ public class GroupConversion extends AbstractConversion { int processed = 0; while (userCollection.next()) { - User member = NgCoreCollection.users.get(userCollection.getUser() - .getID().longValue()); + User member = NgCoreCollection + .users + .get(userCollection.getUser().getID().longValue()); if (group != null && member != null) { // create groupMemeberships @@ -116,9 +115,7 @@ public class GroupConversion extends AbstractConversion { processed++; } - } - return processed; } diff --git a/ccm-core/src/com/arsdigita/portation/conversion/core/security/PermissionConversion.java b/ccm-core/src/com/arsdigita/portation/conversion/core/security/PermissionConversion.java index badfa646a..fa337f71e 100644 --- a/ccm-core/src/com/arsdigita/portation/conversion/core/security/PermissionConversion.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/core/security/PermissionConversion.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.conversion.core.security; import com.arsdigita.kernel.RoleCollection; import com.arsdigita.portation.AbstractConversion; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import com.arsdigita.portation.modules.core.core.CcmObject; import com.arsdigita.portation.modules.core.security.*; @@ -57,13 +58,12 @@ public class PermissionConversion extends AbstractConversion { */ @Override public void convertAll() { - System.out.print("\tFetching permissions from database..."); + ExportLogger.fetching("permissions"); List trunkPermissions = com.arsdigita.kernel.permissions.Permission .getAllObjectPermissions(); - System.out.println("done."); - System.out.print("\tConverting permissions...\n"); + ExportLogger.converting("permissions"); createPermissionsAndSetAssociations(trunkPermissions); try { @@ -75,7 +75,14 @@ public class PermissionConversion extends AbstractConversion { System.exit(-1); } - System.out.println("\tdone.\n"); + // Verify permissions + for (Permission permission : NgCoreCollection.permissions.values()) { + if (permission.getGrantee() == null) { + System.err.printf("CoreConverter: Grantee for permission %d " + + "is null.%n", permission.getPermissionId()); + System.exit(-1); + } + } } /** @@ -112,8 +119,10 @@ public class PermissionConversion extends AbstractConversion { Permission permission = new Permission(trunkPermission); // set object and opposed associations - CcmObject object = NgCoreCollection.ccmObjects.get(((BigDecimal) - trunkPermission.getACSObject().get("id")).longValue()); + CcmObject object = NgCoreCollection + .ccmObjects + .get(((BigDecimal) trunkPermission.getACSObject().get("id")) + .longValue()); if (object != null) { permission.setObject(object); object.addPermission(permission); @@ -123,8 +132,9 @@ public class PermissionConversion extends AbstractConversion { com.arsdigita.kernel.User trunkCreationUser = trunkPermission .getCreationUser(); if (trunkCreationUser != null) { - User creationUser = NgCoreCollection.users.get(trunkCreationUser - .getID().longValue()); + User creationUser = NgCoreCollection + .users + .get(trunkCreationUser.getID().longValue()); if (creationUser != null) permission.setCreationUser(creationUser); @@ -132,8 +142,8 @@ public class PermissionConversion extends AbstractConversion { processed++; } - System.out.printf("\t\tCreated %d permissions and skipped: %d.\n", - processed, skipped); + ExportLogger.created("permissions", processed); + ExportLogger.skipped("permissions", skipped); } /** @@ -177,8 +187,8 @@ public class PermissionConversion extends AbstractConversion { final String oldId = Permission.genOldId(trunkPermission); final long permissionId = PermissionIdMapper.map.get(oldId); // get ng permission - final Permission permission = NgCoreCollection.permissions.get( - permissionId); + final Permission permission = NgCoreCollection + .permissions.get(permissionId); // get all parties serving as the grantee of this permission final BigDecimal trunkGranteeId = (BigDecimal) trunkPermission @@ -222,8 +232,8 @@ public class PermissionConversion extends AbstractConversion { } } // new Role for this group - final Group member = NgCoreCollection.groups.get - (trunkGranteeGroup.getID().longValue()); + final Group member = NgCoreCollection + .groups.get(trunkGranteeGroup.getID().longValue()); final Role granteeRole = getRoleIfExists(member); // set grantee and opposed association @@ -235,8 +245,8 @@ public class PermissionConversion extends AbstractConversion { // new Role for this user final com.arsdigita.kernel.User trunkGranteeUser = (com .arsdigita.kernel.User) trunkGranteeParty; - final User member = NgCoreCollection.users.get - (trunkGranteeUser.getID().longValue()); + final User member = NgCoreCollection + .users.get(trunkGranteeUser.getID().longValue()); final Role granteeRole = getRoleIfExists(member); // set grantee and opposed association @@ -255,8 +265,8 @@ public class PermissionConversion extends AbstractConversion { trunkPermission.getACSObject().get("id")).longValue()); } } - System.out.printf("\t\t(Created %d duplicates and created %d new " + - "roles.)\n", duplicates, rolesCreated); + ExportLogger.created("dublice Permissions", duplicates); + ExportLogger.created("new roles", rolesCreated); } /** @@ -285,7 +295,6 @@ public class PermissionConversion extends AbstractConversion { granteeRole.addMembership(roleMembership); return granteeRole; - } /** diff --git a/ccm-core/src/com/arsdigita/portation/conversion/core/security/RoleConversion.java b/ccm-core/src/com/arsdigita/portation/conversion/core/security/RoleConversion.java index 881c318ee..e139dc987 100644 --- a/ccm-core/src/com/arsdigita/portation/conversion/core/security/RoleConversion.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/core/security/RoleConversion.java @@ -21,6 +21,7 @@ package com.arsdigita.portation.conversion.core.security; import com.arsdigita.kernel.PartyCollection; import com.arsdigita.portation.AbstractConversion; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import com.arsdigita.portation.modules.core.security.Party; import com.arsdigita.portation.modules.core.security.Role; @@ -51,14 +52,12 @@ public class RoleConversion extends AbstractConversion{ */ @Override public void convertAll() { - System.out.print("\tFetching roles from database..."); + ExportLogger.fetching("roles"); List trunkRoles = com.arsdigita.kernel .Role.getAllObjectRoles(); - System.out.println("done."); - System.out.print("\tCreating roles and role memberships...\n"); + ExportLogger.converting("roles and role memberships"); createRolesAndSetAssociations(trunkRoles); - System.out.println("\tdone.\n"); } /** @@ -82,9 +81,8 @@ public class RoleConversion extends AbstractConversion{ pRoles++; } - System.out.printf("\t\tCreated %d roles and\n" + - "\t\tcreated %d role memberships.\n", - pRoles, pMemberships); + ExportLogger.created("roles", pRoles); + ExportLogger.created("role memberships", pMemberships); } /** @@ -102,8 +100,9 @@ public class RoleConversion extends AbstractConversion{ int processed = 0; while (partyCollection.next()) { - Party member = NgCoreCollection.parties.get(partyCollection.getParty() - .getID().longValue()); + Party member = NgCoreCollection + .parties + .get(partyCollection.getParty().getID().longValue()); if (role != null && member != null) { // create roleMemberships @@ -116,7 +115,6 @@ public class RoleConversion extends AbstractConversion{ processed++; } } - return processed; } diff --git a/ccm-core/src/com/arsdigita/portation/conversion/core/security/UserConversion.java b/ccm-core/src/com/arsdigita/portation/conversion/core/security/UserConversion.java index 2af6daed3..2f7738249 100644 --- a/ccm-core/src/com/arsdigita/portation/conversion/core/security/UserConversion.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/core/security/UserConversion.java @@ -19,6 +19,7 @@ package com.arsdigita.portation.conversion.core.security; import com.arsdigita.portation.AbstractConversion; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.modules.core.security.User; import java.util.List; @@ -45,20 +46,18 @@ public class UserConversion extends AbstractConversion { */ @Override public void convertAll() { - System.out.print("\tFetching users from database..."); + ExportLogger.fetching("users"); List trunkUsers = com.arsdigita.kernel .User.getAllObjectUsers(); - System.out.println("done."); - System.out.print("\tConverting users...\n"); + ExportLogger.converting("users"); // create users int processed = 0; for (com.arsdigita.kernel.User trunkUser : trunkUsers) { new User(trunkUser); processed++; } - System.out.printf("\t\tCreated %d users.\n", processed); - System.out.println("\tdone.\n"); + ExportLogger.created("users", processed); } /** diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/core/web/CcmApplicationConversion.java b/ccm-core/src/com/arsdigita/portation/conversion/core/web/CcmApplicationConversion.java similarity index 86% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/core/web/CcmApplicationConversion.java rename to ccm-core/src/com/arsdigita/portation/conversion/core/web/CcmApplicationConversion.java index 265bf97b2..39bd4e44b 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/core/web/CcmApplicationConversion.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/core/web/CcmApplicationConversion.java @@ -16,14 +16,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.conversion.core.web; +package com.arsdigita.portation.conversion.core.web; -import com.arsdigita.london.terms.portation.conversion.NgCoreCollection; -import com.arsdigita.london.terms.portation.modules.core.core.Resource; -import com.arsdigita.london.terms.portation.modules.core.core.ResourceType; -import com.arsdigita.london.terms.portation.modules.core.web.CcmApplication; import com.arsdigita.portation.AbstractConversion; +import com.arsdigita.portation.cmd.ExportLogger; +import com.arsdigita.portation.conversion.NgCoreCollection; +import com.arsdigita.portation.modules.core.core.Resource; +import com.arsdigita.portation.modules.core.core.ResourceType; +import com.arsdigita.portation.modules.core.web.CcmApplication; import com.arsdigita.web.Application; import java.util.ArrayList; @@ -52,21 +53,17 @@ public class CcmApplicationConversion extends AbstractConversion { */ @Override public void convertAll() { - System.out.print("\tFetching ccm applications from database..."); + ExportLogger.fetching("applications"); List trunkApplications = Application .getAllApplicationObjects(); - System.out.println("done."); - System.out.print("\tConverting ccm applications...\n"); - // create ccm applications + ExportLogger.converting("ccm applications"); createCcmApplicationsAndSetAssociations(trunkApplications); setRingAssociations(trunkApplications); - System.out.print("\tSorting ccm applications...\n"); + ExportLogger.sorting("ccm applications"); sortCcmApplications(); - - System.out.println("\tdone.\n"); - } + } /** * Creates the equivalent ng-class of the {@code Application} and restores @@ -96,7 +93,7 @@ public class CcmApplicationConversion extends AbstractConversion { processed++; } - System.out.printf("\t\tCreated %d ccm applications.\n", processed); + ExportLogger.created("ccm applications", processed); } /** @@ -140,8 +137,8 @@ public class CcmApplicationConversion extends AbstractConversion { ArrayList sortedList = new ArrayList<>(); int runs = 0; - for (CcmApplication application : NgCoreCollection.ccmApplications - .values()) { + for (CcmApplication application : + NgCoreCollection.ccmApplications.values()) { addResourceParent(sortedList, application); if (!sortedList.contains(application)) @@ -151,7 +148,7 @@ public class CcmApplicationConversion extends AbstractConversion { } NgCoreCollection.sortedCcmApplications = sortedList; - System.out.printf("\t\tSorted ccm applications in %d runs.\n", runs); + ExportLogger.ranSort("ccm applications", runs); } /** diff --git a/ccm-core/src/com/arsdigita/portation/conversion/core/workflow/AssignableTaskConversion.java b/ccm-core/src/com/arsdigita/portation/conversion/core/workflow/AssignableTaskConversion.java index 2b3b1293d..35f58518a 100644 --- a/ccm-core/src/com/arsdigita/portation/conversion/core/workflow/AssignableTaskConversion.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/core/workflow/AssignableTaskConversion.java @@ -22,6 +22,7 @@ package com.arsdigita.portation.conversion.core.workflow; import com.arsdigita.kernel.GroupCollection; import com.arsdigita.kernel.RoleCollection; import com.arsdigita.portation.AbstractConversion; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import com.arsdigita.portation.modules.core.security.Role; import com.arsdigita.portation.modules.core.security.User; @@ -59,19 +60,15 @@ public class AssignableTaskConversion extends AbstractConversion { */ @Override public void convertAll() { - System.out.print("\tFetching assignable tasks from database..."); + ExportLogger.fetching("assignable tasks"); List trunkUserTasks = com .arsdigita.workflow.simple.UserTask.getAllObjectUserTasks(); - System.out.println("done."); - System.out.print("\tConverting assignable tasks, task dependencies " + - "and task assignments...\n"); + ExportLogger.converting("assignable tasks"); createAssignableTasksAndSetAssociations(trunkUserTasks); - System.out.print("\tSorting task assignments...\n"); + + ExportLogger.sorting("assignable tasks"); sortAssignableTaskMap(); - - System.out.println("\tdone.\n"); - } /** @@ -99,8 +96,9 @@ public class AssignableTaskConversion extends AbstractConversion { try { userTaskWorkflow = trunkUserTask.getWorkflow(); if (userTaskWorkflow != null) { - Workflow workflow = NgCoreCollection.workflows.get( - userTaskWorkflow.getID().longValue()); + Workflow workflow = NgCoreCollection + .workflows + .get(userTaskWorkflow.getID().longValue()); if (workflow != null) { assignableTask.setWorkflow(workflow); workflow.addTask(assignableTask); @@ -119,8 +117,9 @@ public class AssignableTaskConversion extends AbstractConversion { .arsdigita.workflow.simple.TaskComment) commentsIt.next(); TaskComment taskComment = new TaskComment(trunkTaskComment); - User author = NgCoreCollection.users.get( - trunkTaskComment.getUser().getID().longValue()); + User author = NgCoreCollection + .users + .get(trunkTaskComment.getUser().getID().longValue()); taskComment.setAuthor(author); assignableTask.addComment(taskComment); @@ -131,15 +130,17 @@ public class AssignableTaskConversion extends AbstractConversion { // set lockingUser and notificationSender if (trunkUserTask.getLockedUser() != null) { - User lockingUser = NgCoreCollection.users.get(trunkUserTask - .getLockedUser() - .getID().longValue()); + User lockingUser = NgCoreCollection + .users + .get(trunkUserTask.getLockedUser().getID().longValue()); if (lockingUser != null) assignableTask.setLockingUser(lockingUser); } if (trunkUserTask.getNotificationSender() != null) { - User notificationSender = NgCoreCollection.users.get(trunkUserTask - .getNotificationSender().getID().longValue()); + User notificationSender = NgCoreCollection + .users + .get(trunkUserTask.getNotificationSender().getID() + .longValue()); if (notificationSender != null) assignableTask.setNotificationSender(notificationSender); } @@ -159,10 +160,9 @@ public class AssignableTaskConversion extends AbstractConversion { pTasks, pDependencies, pAssignments);*/ } - System.out.printf("\t\tCreated %d assignable tasks and\n" + - "\t\tCreated %d task dependencies and\n" + - "\t\tcreated %d task assignments.\n", - pTasks, pDependencies, pAssignments); + ExportLogger.created("assignable tasks", pTasks); + ExportLogger.created("task dependencies", pDependencies); + ExportLogger.created("task assignments", pAssignments); } /** @@ -186,9 +186,7 @@ public class AssignableTaskConversion extends AbstractConversion { AssignableTask dependency = NgCoreCollection .assignableTasks .get(((com.arsdigita.workflow.simple - .Task) dependencyIt.next()) - .getID() - .longValue()); + .Task) dependencyIt.next()).getID().longValue()); if (assignableTask != null && dependency != null) { TaskDependency taskDependency = @@ -223,8 +221,9 @@ public class AssignableTaskConversion extends AbstractConversion { while (groupCollection.next()) { RoleCollection roleCollection = groupCollection.getGroup().getRoles(); while (roleCollection.next()) { - Role role = NgCoreCollection.roles.get(roleCollection.getRole() - .getID().longValue()); + Role role = NgCoreCollection + .roles + .get(roleCollection.getRole().getID().longValue()); if (assignableTask != null && role != null) { // create taskAssignments @@ -239,7 +238,6 @@ public class AssignableTaskConversion extends AbstractConversion { } } } - return processed; } @@ -267,7 +265,7 @@ public class AssignableTaskConversion extends AbstractConversion { } NgCoreCollection.sortedAssignableTasks = sortedList; - System.out.printf("\t\tSorted assignable tasks in %d runs.\n", runs); + ExportLogger.ranSort("assignable tasts", runs); } /** diff --git a/ccm-core/src/com/arsdigita/portation/conversion/core/workflow/TaskCommentConversion.java b/ccm-core/src/com/arsdigita/portation/conversion/core/workflow/TaskCommentConversion.java index 2d810199e..19505a0d7 100644 --- a/ccm-core/src/com/arsdigita/portation/conversion/core/workflow/TaskCommentConversion.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/core/workflow/TaskCommentConversion.java @@ -19,6 +19,7 @@ package com.arsdigita.portation.conversion.core.workflow; import com.arsdigita.portation.AbstractConversion; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import com.arsdigita.portation.modules.core.security.User; import com.arsdigita.portation.modules.core.workflow.TaskComment; @@ -49,15 +50,12 @@ public class TaskCommentConversion extends AbstractConversion { */ @Override public void convertAll() { - System.out.print("\tFetching task comments from database..."); + ExportLogger.fetching("task comments"); List trunkTaskComments = com .arsdigita.workflow.simple.TaskComment.getAllTaskComments(); - System.out.println("done."); - System.out.print("\tConverting task comments...\n"); + ExportLogger.converting("task comments"); createTaskCommentsAndSetAssociations(trunkTaskComments); - System.out.println("\tdone.\n"); - } /** @@ -89,7 +87,7 @@ public class TaskCommentConversion extends AbstractConversion { processed++; } - System.out.printf("\t\tCreated %d task comments.\n", processed); + ExportLogger.created("task comments", processed); } /** diff --git a/ccm-core/src/com/arsdigita/portation/conversion/core/workflow/WorkflowConversion.java b/ccm-core/src/com/arsdigita/portation/conversion/core/workflow/WorkflowConversion.java index 6abc990ea..032e9598b 100644 --- a/ccm-core/src/com/arsdigita/portation/conversion/core/workflow/WorkflowConversion.java +++ b/ccm-core/src/com/arsdigita/portation/conversion/core/workflow/WorkflowConversion.java @@ -20,16 +20,14 @@ package com.arsdigita.portation.conversion.core.workflow; import com.arsdigita.kernel.ACSObject; import com.arsdigita.portation.AbstractConversion; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; -import com.arsdigita.portation.modules.core.categorization.Category; import com.arsdigita.portation.modules.core.core.CcmObject; import com.arsdigita.portation.modules.core.workflow.Workflow; import com.arsdigita.workflow.simple.WorkflowTemplate; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * Class for converting all @@ -54,18 +52,16 @@ public class WorkflowConversion extends AbstractConversion { */ @Override public void convertAll() { - System.out.print("\tFetching workflows from database..."); + ExportLogger.fetching("workflows"); List trunkWorkflows = com.arsdigita.workflow.simple.Workflow.getAllObjectWorkflows(); - System.out.println("done."); - System.out.print("\tConverting workflows...\n"); + ExportLogger.converting("workflows"); createWorkflowAndSetAssociations(trunkWorkflows); setTemplateAssociations(trunkWorkflows); - System.out.print("\tSorting workflows...\n"); - sortWorkflowMap(); - System.out.println("\tdone.\n"); + ExportLogger.sorting("workflows"); + sortWorkflowMap(); } /** @@ -96,8 +92,7 @@ public class WorkflowConversion extends AbstractConversion { processed++; } - - System.out.printf("\t\tCreated %d workflows.\n", processed); + ExportLogger.created("workflows", processed); } /** @@ -130,7 +125,7 @@ public class WorkflowConversion extends AbstractConversion { } else processed++; } - System.out.printf("\t\tFound %d templates.\n", processed); + ExportLogger.found("templates", processed); } /** @@ -157,7 +152,7 @@ public class WorkflowConversion extends AbstractConversion { } NgCoreCollection.sortedWorkflows = sortedList; - System.out.printf("\t\tSorted workflows in %d runs.\n", runs); + ExportLogger.ranSort("workflows", runs); } /** diff --git a/ccm-core/src/com/arsdigita/portation/modules/CoreExporter.java b/ccm-core/src/com/arsdigita/portation/modules/CoreExporter.java index 8fa517e7e..8967d8887 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/CoreExporter.java +++ b/ccm-core/src/com/arsdigita/portation/modules/CoreExporter.java @@ -23,7 +23,11 @@ import com.arsdigita.portation.Format; import com.arsdigita.portation.conversion.NgCoreCollection; import com.arsdigita.portation.modules.core.categorization.CategorizationMarshaller; import com.arsdigita.portation.modules.core.categorization.CategoryMarshaller; +import com.arsdigita.portation.modules.core.categorization.DomainMarshaller; +import com.arsdigita.portation.modules.core.categorization.DomainOwnershipMarshaller; +import com.arsdigita.portation.modules.core.core.ResourceTypeMarshaller; import com.arsdigita.portation.modules.core.security.*; +import com.arsdigita.portation.modules.core.web.CcmApplicationMarshaller; import com.arsdigita.portation.modules.core.workflow.*; import java.util.ArrayList; @@ -83,5 +87,14 @@ public class CoreExporter extends AbstractExporter { marshallAll(format, pathName, indentation); TaskAssignmentMarshaller.getInstance(). marshallAll(format, pathName, indentation); + + ResourceTypeMarshaller.getInstance(). + marshallAll(format, pathName, indentation); + CcmApplicationMarshaller.getInstance(). + marshallAll(format, pathName, indentation); + DomainMarshaller.getInstance(). + marshallAll(format, pathName, indentation); + DomainOwnershipMarshaller.getInstance(). + marshallAll(format, pathName, indentation); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/categorization/CategorizationMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/CategorizationMarshaller.java index 25bfa9039..eb2550897 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/categorization/CategorizationMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/CategorizationMarshaller.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.modules.core.categorization; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -59,9 +60,8 @@ public class CategorizationMarshaller extends AbstractMarshaller public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting categorizations..."); + ExportLogger.exporting("categorizations"); prepare(format, pathName, "categorizations", indentation); exportList(new ArrayList<>(NgCoreCollection.categorizations.values())); - System.out.print("\tdone.\n"); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/categorization/Category.java b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/Category.java index 2e78359ad..3efcb0c64 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/categorization/Category.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/Category.java @@ -22,6 +22,7 @@ import com.arsdigita.categorization.CategoryLocalization; import com.arsdigita.categorization.CategoryLocalizationCollection; import com.arsdigita.portation.Portable; import com.arsdigita.portation.conversion.NgCoreCollection; +import com.arsdigita.portation.modules.core.categorization.util.CategoryInformation; import com.arsdigita.portation.modules.core.core.CcmObject; import com.arsdigita.portation.modules.core.l10n.LocalizedString; import com.fasterxml.jackson.annotation.JsonIdentityInfo; @@ -100,7 +101,7 @@ public class Category extends CcmObject implements Portable { com.arsdigita.categorization.Category defaultParent = null; try { defaultParent = trunkCategory.getDefaultParentCategory(); - } catch (Exception e) {} + } catch (Exception ignored) {} this.categoryOrder = defaultParent != null ? defaultParent.getNumberOfChildCategories() + 1 : 0; @@ -108,6 +109,29 @@ public class Category extends CcmObject implements Portable { NgCoreCollection.categories.put(this.getObjectId(), this); } + // specific constructor for subclasses of category + // e.g. Folder + public Category(final CategoryInformation categoryInformation) { + super(categoryInformation.getDisplayName()); + + this.uniqueId = categoryInformation.getUniqueId(); + this.name = categoryInformation.getName(); + + this.title = categoryInformation.getTitle(); + this.description = categoryInformation.getDescription(); + + this.enabled = categoryInformation.isEnabled(); + this.visible = categoryInformation.isVisible(); + this.abstractCategory = categoryInformation.isAbstractCategory(); + + this.objects = new ArrayList<>(); + this.subCategories = new ArrayList<>(); + + //this.parentCategory + + this.categoryOrder = categoryInformation.getCategoryOrder(); + } + public String getUniqueId() { return uniqueId; diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/categorization/CategoryMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/CategoryMarshaller.java index c5a2db698..d0159bb14 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/categorization/CategoryMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/CategoryMarshaller.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.modules.core.categorization; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; /** @@ -57,9 +58,8 @@ public class CategoryMarshaller extends AbstractMarshaller { public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting categories..."); + ExportLogger.exporting("categories"); prepare(format, pathName, "categories", indentation); exportList(NgCoreCollection.sortedCategories); - System.out.print("\t\tdone.\n"); } } diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/Domain.java b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/Domain.java similarity index 79% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/Domain.java rename to ccm-core/src/com/arsdigita/portation/modules/core/categorization/Domain.java index 0ce4c1e7d..c9a8132c4 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/Domain.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/Domain.java @@ -16,16 +16,18 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.categorization; +package com.arsdigita.portation.modules.core.categorization; -import com.arsdigita.kernel.ACSObject; -import com.arsdigita.london.terms.portation.conversion.NgCoreCollection; -import com.arsdigita.london.terms.portation.modules.core.web.CcmApplication; +import com.arsdigita.persistence.DataObject; import com.arsdigita.portation.Portable; -import com.arsdigita.portation.modules.core.categorization.Category; +import com.arsdigita.portation.conversion.NgCoreCollection; import com.arsdigita.portation.modules.core.core.CcmObject; import com.arsdigita.portation.modules.core.l10n.LocalizedString; -import com.fasterxml.jackson.annotation.*; +import com.arsdigita.portation.modules.core.web.CcmApplication; +import com.fasterxml.jackson.annotation.JsonIdentityInfo; +import com.fasterxml.jackson.annotation.JsonIdentityReference; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.ObjectIdGenerators; import java.util.ArrayList; import java.util.Date; @@ -63,21 +65,21 @@ public class Domain extends CcmObject implements Portable { private List owners; - public Domain(com.arsdigita.london.terms.Domain trunkDomain) { - super(trunkDomain.getKey()); + public Domain(DataObject trunkDomain) { + super(trunkDomain.get("key").toString() + "_DName"); - - this.domainKey = trunkDomain.getKey(); - this.uri = trunkDomain.getURL().toString(); + this.domainKey = trunkDomain.get("key").toString(); + this.uri = trunkDomain.get("url").toString(); this.title = new LocalizedString(); - this.title.addValue(Locale.getDefault(), trunkDomain.getTitle()); + this.title.addValue(Locale.getDefault(), + trunkDomain.get("title").toString()); this.description = new LocalizedString(); - this.description - .addValue(Locale.getDefault(), trunkDomain.getDescription()); + this.description.addValue(Locale.getDefault(), + trunkDomain.get("description").toString()); - this.version = trunkDomain.getVersion(); - this.released = trunkDomain.getReleased(); + this.version = trunkDomain.get("version").toString(); + this.released = (Date) trunkDomain.get("released"); //this.root diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainIdResolver.java b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainIdResolver.java similarity index 95% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainIdResolver.java rename to ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainIdResolver.java index 72a629a2f..22246ecb1 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainIdResolver.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainIdResolver.java @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.categorization; +package com.arsdigita.portation.modules.core.categorization; import com.fasterxml.jackson.annotation.ObjectIdGenerator; import com.fasterxml.jackson.annotation.ObjectIdResolver; diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainMarshaller.java similarity index 90% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainMarshaller.java rename to ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainMarshaller.java index 995b33535..1a386e3ca 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainMarshaller.java @@ -16,11 +16,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.categorization; +package com.arsdigita.portation.modules.core.categorization; -import com.arsdigita.london.terms.portation.conversion.NgCoreCollection; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; +import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -59,9 +60,8 @@ public class DomainMarshaller extends AbstractMarshaller { public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting domains..."); + ExportLogger.exporting("domains"); prepare(format, pathName, "domains", indentation); exportList(new ArrayList<>(NgCoreCollection.domains.values())); - System.out.print("\t\tdone.\n"); } } diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainOwnership.java b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainOwnership.java similarity index 89% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainOwnership.java rename to ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainOwnership.java index f1d7b701f..70d501ec7 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainOwnership.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainOwnership.java @@ -16,14 +16,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.categorization; +package com.arsdigita.portation.modules.core.categorization; import com.arsdigita.kernel.ACSObject; -import com.arsdigita.london.terms.portation.conversion.NgCoreCollection; -import com.arsdigita.london.terms.portation.modules.core.web.CcmApplication; import com.arsdigita.portation.Portable; +import com.arsdigita.portation.conversion.NgCoreCollection; import com.arsdigita.portation.modules.core.core.CcmObject; -import com.arsdigita.web.Application; +import com.arsdigita.portation.modules.core.web.CcmApplication; import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.JsonIdentityReference; @@ -49,8 +48,8 @@ public class DomainOwnership implements Portable { private long ownerOrder; private long domainOrder; - public DomainOwnership(Domain domain, CcmApplication owner, String - context) { + public DomainOwnership(Domain domain, CcmApplication owner, + String context) { this.ownershipId = ACSObject.generateID().longValue(); this.domain = domain; diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainOwnershipIdGenerator.java b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainOwnershipIdGenerator.java similarity index 96% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainOwnershipIdGenerator.java rename to ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainOwnershipIdGenerator.java index 023c8e4e0..4ea2af677 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainOwnershipIdGenerator.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainOwnershipIdGenerator.java @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.categorization; +package com.arsdigita.portation.modules.core.categorization; import com.fasterxml.jackson.annotation.ObjectIdGenerator; diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainOwnershipMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainOwnershipMarshaller.java similarity index 90% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainOwnershipMarshaller.java rename to ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainOwnershipMarshaller.java index fa4f87844..0627ead31 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/categorization/DomainOwnershipMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/DomainOwnershipMarshaller.java @@ -16,11 +16,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.categorization; +package com.arsdigita.portation.modules.core.categorization; -import com.arsdigita.london.terms.portation.conversion.NgCoreCollection; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; +import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -59,9 +60,8 @@ public class DomainOwnershipMarshaller extends AbstractMarshaller(NgCoreCollection.domainOwnerships.values())); - System.out.print("\tdone.\n"); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/categorization/util/CategoryInformation.java b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/util/CategoryInformation.java new file mode 100644 index 000000000..4a8349c8b --- /dev/null +++ b/ccm-core/src/com/arsdigita/portation/modules/core/categorization/util/CategoryInformation.java @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.portation.modules.core.categorization.util; + +import com.arsdigita.portation.modules.core.l10n.LocalizedString; + +import java.util.Locale; + +/** + * Helper class for cms folder. + * + * @author (); this.categories = new ArrayList<>(); diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/Resource.java b/ccm-core/src/com/arsdigita/portation/modules/core/core/Resource.java similarity index 93% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/Resource.java rename to ccm-core/src/com/arsdigita/portation/modules/core/core/Resource.java index dd35dabf0..c8eaeccec 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/Resource.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/core/Resource.java @@ -16,12 +16,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.core; +package com.arsdigita.portation.modules.core.core; -import com.arsdigita.london.terms.portation.conversion.NgCoreCollection; -import com.arsdigita.london.terms.portation.modules.core.web.CcmApplication; -import com.arsdigita.portation.modules.core.core.CcmObject; +import com.arsdigita.portation.conversion.NgCoreCollection; import com.arsdigita.portation.modules.core.l10n.LocalizedString; +import com.arsdigita.portation.modules.core.web.CcmApplication; import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.JsonIdentityReference; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/ResourceIdResolver.java b/ccm-core/src/com/arsdigita/portation/modules/core/core/ResourceIdResolver.java similarity index 96% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/ResourceIdResolver.java rename to ccm-core/src/com/arsdigita/portation/modules/core/core/ResourceIdResolver.java index 8d0b1c2ad..0f2a27da8 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/ResourceIdResolver.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/core/ResourceIdResolver.java @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.core; +package com.arsdigita.portation.modules.core.core; import com.fasterxml.jackson.annotation.ObjectIdGenerator; import com.fasterxml.jackson.annotation.ObjectIdResolver; diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/ResourceType.java b/ccm-core/src/com/arsdigita/portation/modules/core/core/ResourceType.java similarity index 96% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/ResourceType.java rename to ccm-core/src/com/arsdigita/portation/modules/core/core/ResourceType.java index 4e5db1504..56269c770 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/ResourceType.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/core/ResourceType.java @@ -16,10 +16,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.core; +package com.arsdigita.portation.modules.core.core; -import com.arsdigita.london.terms.portation.conversion.NgCoreCollection; import com.arsdigita.portation.Portable; +import com.arsdigita.portation.conversion.NgCoreCollection; import com.arsdigita.portation.modules.core.l10n.LocalizedString; import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.ObjectIdGenerators; diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/ResourceTypeIdResolver.java b/ccm-core/src/com/arsdigita/portation/modules/core/core/ResourceTypeIdResolver.java similarity index 96% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/ResourceTypeIdResolver.java rename to ccm-core/src/com/arsdigita/portation/modules/core/core/ResourceTypeIdResolver.java index c56f45baf..29f2060dd 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/ResourceTypeIdResolver.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/core/ResourceTypeIdResolver.java @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.core; +package com.arsdigita.portation.modules.core.core; import com.fasterxml.jackson.annotation.ObjectIdGenerator; import com.fasterxml.jackson.annotation.ObjectIdResolver; diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/ResourceTypeMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/core/ResourceTypeMarshaller.java similarity index 90% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/ResourceTypeMarshaller.java rename to ccm-core/src/com/arsdigita/portation/modules/core/core/ResourceTypeMarshaller.java index 0ff31ef0b..36a9a1480 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/core/ResourceTypeMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/core/ResourceTypeMarshaller.java @@ -16,11 +16,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.core; +package com.arsdigita.portation.modules.core.core; -import com.arsdigita.london.terms.portation.conversion.NgCoreCollection; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; +import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -59,9 +60,8 @@ public class ResourceTypeMarshaller extends AbstractMarshaller { public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting resourceTypes..."); + ExportLogger.exporting("resource types"); prepare(format, pathName, "resourceTypes", indentation); exportList(new ArrayList<>(NgCoreCollection.resourceTypes.values())); - System.out.print("\tdone.\n"); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/security/GroupMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/security/GroupMarshaller.java index 5ac84ef17..ac1ee472b 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/security/GroupMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/security/GroupMarshaller.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.modules.core.security; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -59,9 +60,8 @@ public class GroupMarshaller extends AbstractMarshaller { public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting groups..."); + ExportLogger.exporting("groups"); prepare(format, pathName, "groups", indentation); exportList(new ArrayList<>(NgCoreCollection.groups.values())); - System.out.print("\t\tdone.\n"); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/security/GroupMembershipMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/security/GroupMembershipMarshaller.java index db7301cdf..9d7eafe02 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/security/GroupMembershipMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/security/GroupMembershipMarshaller.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.modules.core.security; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -59,9 +60,8 @@ public class GroupMembershipMarshaller extends AbstractMarshaller(NgCoreCollection.groupMemberships.values())); - System.out.print("\tdone.\n"); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/security/PermissionMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/security/PermissionMarshaller.java index e6db0c74f..c76ebd0d1 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/security/PermissionMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/security/PermissionMarshaller.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.modules.core.security; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -59,9 +60,8 @@ public class PermissionMarshaller extends AbstractMarshaller { public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting permissions..."); + ExportLogger.exporting("permissions"); prepare(format, pathName, "permissions", indentation); exportList(new ArrayList<>(NgCoreCollection.permissions.values())); - System.out.print("\tdone.\n"); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/security/RoleMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/security/RoleMarshaller.java index 6f899bff0..325e0f4a1 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/security/RoleMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/security/RoleMarshaller.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.modules.core.security; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -59,9 +60,8 @@ public class RoleMarshaller extends AbstractMarshaller { public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting roles..."); + ExportLogger.exporting("roles"); prepare(format, pathName, "roles", indentation); exportList(new ArrayList<>(NgCoreCollection.roles.values())); - System.out.print("\t\tdone.\n"); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/security/RoleMembershipMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/security/RoleMembershipMarshaller.java index 0308e7939..e138cd86b 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/security/RoleMembershipMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/security/RoleMembershipMarshaller.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.modules.core.security; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -59,9 +60,8 @@ public class RoleMembershipMarshaller extends AbstractMarshaller public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting role memberships..."); + ExportLogger.exporting("role memberships"); prepare(format, pathName, "roleMemberships", indentation); exportList(new ArrayList<>(NgCoreCollection.roleMemberships.values())); - System.out.print("\tdone.\n"); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/security/UserMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/security/UserMarshaller.java index e8ef9c147..f58400526 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/security/UserMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/security/UserMarshaller.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.modules.core.security; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -58,9 +59,8 @@ public class UserMarshaller extends AbstractMarshaller { public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting users..."); + ExportLogger.exporting("users"); prepare(format, pathName, "users", indentation); exportList(new ArrayList<>(NgCoreCollection.users.values())); - System.out.print("\t\tdone.\n"); } } diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/web/CcmApplication.java b/ccm-core/src/com/arsdigita/portation/modules/core/web/CcmApplication.java similarity index 89% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/web/CcmApplication.java rename to ccm-core/src/com/arsdigita/portation/modules/core/web/CcmApplication.java index d030da006..fff679f7c 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/web/CcmApplication.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/web/CcmApplication.java @@ -16,12 +16,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.web; +package com.arsdigita.portation.modules.core.web; -import com.arsdigita.london.terms.portation.conversion.NgCoreCollection; -import com.arsdigita.london.terms.portation.modules.core.categorization.DomainOwnership; -import com.arsdigita.london.terms.portation.modules.core.core.Resource; import com.arsdigita.portation.Portable; +import com.arsdigita.portation.conversion.NgCoreCollection; +import com.arsdigita.portation.modules.core.categorization.DomainOwnership; +import com.arsdigita.portation.modules.core.core.Resource; import com.arsdigita.web.Application; import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/web/CcmApplicationIdResolver.java b/ccm-core/src/com/arsdigita/portation/modules/core/web/CcmApplicationIdResolver.java similarity index 96% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/web/CcmApplicationIdResolver.java rename to ccm-core/src/com/arsdigita/portation/modules/core/web/CcmApplicationIdResolver.java index a2464079e..cb66825fd 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/web/CcmApplicationIdResolver.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/web/CcmApplicationIdResolver.java @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.web; +package com.arsdigita.portation.modules.core.web; import com.fasterxml.jackson.annotation.ObjectIdGenerator; import com.fasterxml.jackson.annotation.ObjectIdResolver; diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/web/CcmApplicationMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/web/CcmApplicationMarshaller.java similarity index 90% rename from ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/web/CcmApplicationMarshaller.java rename to ccm-core/src/com/arsdigita/portation/modules/core/web/CcmApplicationMarshaller.java index d2f8c29c6..99d63b945 100644 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/modules/core/web/CcmApplicationMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/web/CcmApplicationMarshaller.java @@ -16,11 +16,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ -package com.arsdigita.london.terms.portation.modules.core.web; +package com.arsdigita.portation.modules.core.web; -import com.arsdigita.london.terms.portation.conversion.NgCoreCollection; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; +import com.arsdigita.portation.conversion.NgCoreCollection; /** * @author public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting assignable tasks..."); + ExportLogger.exporting("assignable tasks"); prepare(format, pathName, "assignableTasks", indentation); exportList(NgCoreCollection.sortedAssignableTasks); - System.out.print("\tdone.\n"); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/workflow/TaskAssignmentMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/workflow/TaskAssignmentMarshaller.java index 33829275f..e12f8981a 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/workflow/TaskAssignmentMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/workflow/TaskAssignmentMarshaller.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.modules.core.workflow; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -59,10 +60,8 @@ public class TaskAssignmentMarshaller extends AbstractMarshaller public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting task assignments..."); + ExportLogger.exporting("task assignments"); prepare(format, pathName, "taskAssignments", indentation); exportList(new ArrayList<>(NgCoreCollection.taskAssignments.values())); - System.out.print("\tdone.\n"); - } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/workflow/TaskCommentMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/workflow/TaskCommentMarshaller.java index c5bfe6eb3..c53f54a35 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/workflow/TaskCommentMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/workflow/TaskCommentMarshaller.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.modules.core.workflow; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -59,9 +60,8 @@ public class TaskCommentMarshaller extends AbstractMarshaller { public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting task comments..."); + ExportLogger.exporting("task comments"); prepare(format, pathName, "taskComments", indentation); exportList(new ArrayList<>(NgCoreCollection.taskComments.values())); - System.out.print("\tdone.\n"); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/workflow/TaskDependencyMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/workflow/TaskDependencyMarshaller.java index f052ada87..959e3bf49 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/workflow/TaskDependencyMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/workflow/TaskDependencyMarshaller.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.modules.core.workflow; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; import java.util.ArrayList; @@ -60,9 +61,8 @@ public class TaskDependencyMarshaller extends public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting task dependencies..."); + ExportLogger.exporting("task dependencies"); prepare(format, pathName, "taskDependencies", indentation); exportList(new ArrayList<>(NgCoreCollection.taskDependencies.values())); - System.out.print("\tdone.\n"); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/workflow/WorkflowMarshaller.java b/ccm-core/src/com/arsdigita/portation/modules/core/workflow/WorkflowMarshaller.java index dbcf9f400..1708cf9c6 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/workflow/WorkflowMarshaller.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/workflow/WorkflowMarshaller.java @@ -20,6 +20,7 @@ package com.arsdigita.portation.modules.core.workflow; import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.Format; +import com.arsdigita.portation.cmd.ExportLogger; import com.arsdigita.portation.conversion.NgCoreCollection; /** @@ -57,9 +58,8 @@ public class WorkflowMarshaller extends AbstractMarshaller { public void marshallAll(final Format format, final String pathName, final boolean indentation) { - System.out.print("\tExporting workflows..."); + ExportLogger.exporting("workflows"); prepare(format, pathName, "workflows", indentation); exportList(NgCoreCollection.sortedWorkflows); - System.out.print("\t\tdone.\n"); } } diff --git a/ccm-core/src/com/arsdigita/portation/modules/core/workflow/util/StateMapper.java b/ccm-core/src/com/arsdigita/portation/modules/core/workflow/util/StateMapper.java index 4d9be1f78..5ad43385f 100644 --- a/ccm-core/src/com/arsdigita/portation/modules/core/workflow/util/StateMapper.java +++ b/ccm-core/src/com/arsdigita/portation/modules/core/workflow/util/StateMapper.java @@ -28,8 +28,7 @@ import com.arsdigita.workflow.simple.Workflow; * @version created on 11/21/16 */ public class StateMapper { - - public static WorkflowState mapWorkflowState(int processState) { + public static WorkflowState mapWorkflowState(final int processState) { switch (processState) { case Workflow.STARTED: return WorkflowState.STARTED; diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/NgCoreCollection.java b/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/NgCoreCollection.java deleted file mode 100644 index 0e614fecf..000000000 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/portation/conversion/NgCoreCollection.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2015 LibreCCM Foundation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ -package com.arsdigita.london.terms.portation.conversion; - -import com.arsdigita.london.terms.portation.modules.core.categorization.Domain; -import com.arsdigita.london.terms.portation.modules.core.categorization.DomainOwnership; -import com.arsdigita.london.terms.portation.modules.core.core.Resource; -import com.arsdigita.london.terms.portation.modules.core.core.ResourceType; -import com.arsdigita.london.terms.portation.modules.core.web.CcmApplication; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -/** - * @author Tobias Osmers<\a> - * @version created the 7/28/17 - */ -public class LdnTermsExporter extends AbstractExporter { - - private static LdnTermsExporter instance; - - static { - instance = new LdnTermsExporter(); - } - - /** - * Getter for the instance of the singleton. - * - * @return instance of this singleton - */ - public static LdnTermsExporter getInstance() { - return instance; - } - - @Override - public void startMarshaller() { - ResourceTypeMarshaller.getInstance(). - marshallAll(format, pathName, indentation); - CcmApplicationMarshaller.getInstance(). - marshallAll(format, pathName, indentation); - DomainMarshaller.getInstance(). - marshallAll(format, pathName, indentation); - DomainOwnershipMarshaller.getInstance(). - marshallAll(format, pathName, indentation); - } -}