[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-94f89814c4dfmaster
parent
43f97e1ad3
commit
db7807dd6a
|
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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 <id, object>-pairs in the {@link NgCoreCollection}-class.
|
||||
*
|
||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 7/28/17
|
||||
* @version created the 2/12/18
|
||||
*/
|
||||
public class LdnTermsConverter extends AbstractConverter {
|
||||
|
||||
private static LdnTermsConverter instance;
|
||||
public class CmsConverter extends AbstractConverter {
|
||||
private static CmsConverter instance;
|
||||
|
||||
static {
|
||||
instance = new LdnTermsConverter();
|
||||
instance = new CmsConverter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for the instance of the singleton.
|
||||
* Getter for the instance of this singleton.
|
||||
*
|
||||
* @return instance of this singleton
|
||||
* @return instance of the singleton
|
||||
*/
|
||||
public static LdnTermsConverter getInstance() {
|
||||
public static CmsConverter getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
|
@ -55,9 +46,7 @@ public class LdnTermsConverter extends AbstractConverter {
|
|||
* already been created.
|
||||
*/
|
||||
@Override
|
||||
public void startConversion() {
|
||||
ResourceTypeConversion.getInstance().convertAll();
|
||||
CcmApplicationConversion.getInstance().convertAll();
|
||||
DomainConversion.getInstance().convertAll();
|
||||
public void startConversions() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* 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.conversion;
|
||||
|
||||
import com.arsdigita.cms.portation.modules.contentsection.Asset;
|
||||
import com.arsdigita.cms.portation.modules.contentsection.AttachmentList;
|
||||
import com.arsdigita.cms.portation.modules.contentsection.ContentItem;
|
||||
import com.arsdigita.cms.portation.modules.contentsection.ContentSection;
|
||||
import com.arsdigita.cms.portation.modules.contentsection.ContentType;
|
||||
import com.arsdigita.cms.portation.modules.contentsection.ItemAttachment;
|
||||
import com.arsdigita.cms.portation.modules.lifecycle.Lifecycle;
|
||||
import com.arsdigita.cms.portation.modules.lifecycle.LifecycleDefinition;
|
||||
import com.arsdigita.cms.portation.modules.lifecycle.Phase;
|
||||
import com.arsdigita.cms.portation.modules.lifecycle.PhaseDefinition;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 2/12/18
|
||||
*/
|
||||
public class NgCmsCollection {
|
||||
public static Map<Long, Asset> assets = new HashMap<>();
|
||||
public static Map<Long, ItemAttachment> itemAttachments = new HashMap<>();
|
||||
public static Map<Long, AttachmentList> attachmentLists = new HashMap<>();
|
||||
public static Map<Long, ContentItem> contentItems = new HashMap<>();
|
||||
|
||||
public static Map<Long, ContentType> contentTypes = new HashMap<>();
|
||||
public static Map<Long, ContentSection> contentSections = new HashMap<>();
|
||||
|
||||
public static Map<Long, Phase> phases = new HashMap<>();
|
||||
|
||||
public static Map<Long, Lifecycle> lifecycles = new HashMap<>();
|
||||
public static Map<Long, LifecycleDefinition> lifecycleDefinitions = new
|
||||
HashMap<>();
|
||||
public static Map<Long, PhaseDefinition> phaseDefinitions = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Private constructor to prevent the instantiation of this class.
|
||||
*/
|
||||
private NgCmsCollection() {}
|
||||
}
|
||||
|
|
@ -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 <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 2/12/18
|
||||
*/
|
||||
public class CmsExporter extends AbstractExporter {
|
||||
private static CmsExporter instance;
|
||||
|
||||
static {
|
||||
instance = new CmsExporter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for the instance of this singleton.
|
||||
*
|
||||
* @return instance of the singleton
|
||||
*/
|
||||
public static CmsExporter getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to start all the different marshaller classes.
|
||||
*/
|
||||
@Override
|
||||
public void startMarshaller() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* 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.portation.Portable;
|
||||
import com.arsdigita.portation.modules.core.core.CcmObject;
|
||||
import com.arsdigita.portation.modules.core.l10n.LocalizedString;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Base class for all assets providing common fields. This class is
|
||||
* <strong>not</strong> indented for direct use. Only to sub classes should be
|
||||
* used.
|
||||
*
|
||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 2/21/18
|
||||
*/
|
||||
public class Asset extends CcmObject implements Portable {
|
||||
@JsonIgnore
|
||||
private List<ItemAttachment<?>> 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<ItemAttachment<?>> getItemAttachments() {
|
||||
return itemAttachments;
|
||||
}
|
||||
|
||||
public void setItemAttachments(final List<ItemAttachment<?>>
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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 <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 2/21/18
|
||||
*/
|
||||
public class AttachmentList implements Portable {
|
||||
private long listId;
|
||||
private String uuid;
|
||||
@JsonIdentityReference(alwaysAsId = true)
|
||||
private ContentItem item;
|
||||
private String name;
|
||||
private long order;
|
||||
private LocalizedString title;
|
||||
private LocalizedString description;
|
||||
@JsonIgnore
|
||||
private List<ItemAttachment<?>> attachments;
|
||||
|
||||
/**
|
||||
* Constructor for the ng-object.
|
||||
*
|
||||
* @param item a ng-item
|
||||
* @param attachments the corresponding ng-attachments
|
||||
*/
|
||||
public AttachmentList(final ContentItem item,
|
||||
final List<ItemAttachment<?>> attachments) {
|
||||
this.listId = ACSObject.generateID().longValue();
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
|
||||
this.item = item;
|
||||
|
||||
this.name = item.getDisplayName() + "s_AttachmentList";
|
||||
this.order = 0;
|
||||
|
||||
this.attachments = attachments;
|
||||
|
||||
NgCmsCollection.attachmentLists.put(this.listId, this);
|
||||
}
|
||||
|
||||
public long getListId() {
|
||||
return listId;
|
||||
}
|
||||
|
||||
public void setListId(final long listId) {
|
||||
this.listId = listId;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public ContentItem getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public void setItem(final ContentItem item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public long getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
public void setOrder(final long order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public LocalizedString getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(final LocalizedString title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public LocalizedString getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public List<ItemAttachment<?>> getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
public void setAttachments(final List<ItemAttachment<?>> attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public void addAttachment(final ItemAttachment<?> attachment) {
|
||||
this.attachments.add(attachment);
|
||||
}
|
||||
|
||||
public void removeAttachment(final ItemAttachment<?> attachment) {
|
||||
this.attachments.remove(attachment);
|
||||
}
|
||||
}
|
||||
|
|
@ -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 <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 2/21/18
|
||||
*/
|
||||
public class ContentItem extends CcmObject implements Portable {
|
||||
private String itemUuid;
|
||||
private LocalizedString name;
|
||||
private LocalizedString title;
|
||||
private LocalizedString description;
|
||||
@JsonIdentityReference(alwaysAsId = true)
|
||||
private ContentType contentType;
|
||||
private ContentItemVersion version;
|
||||
private Date launchDate;
|
||||
private String ancestors;
|
||||
@JsonIgnore
|
||||
private List<AttachmentList> attachments;
|
||||
@JsonIdentityReference(alwaysAsId = true)
|
||||
private Lifecycle lifecycle;
|
||||
@JsonIdentityReference(alwaysAsId = true)
|
||||
private Workflow workflow;
|
||||
private Date creationDate;
|
||||
private Date lastModified;
|
||||
private String creationUserName;
|
||||
private String lastModifyingUserName;
|
||||
|
||||
/**
|
||||
* Constructor for the ng-object.
|
||||
*
|
||||
* @param trunkContentItem the trunk object
|
||||
*/
|
||||
public ContentItem(final com.arsdigita.cms.ContentItem trunkContentItem) {
|
||||
super(trunkContentItem);
|
||||
|
||||
this.itemUuid = UUID.randomUUID().toString();
|
||||
|
||||
this.name = new LocalizedString();
|
||||
this.title = new LocalizedString();
|
||||
this.description = new LocalizedString();
|
||||
final Locale locale = trunkContentItem.getLocale().toJavaLocale();
|
||||
name.addValue(locale, trunkContentItem.getDisplayName());
|
||||
title.addValue(locale, trunkContentItem.getName());
|
||||
description.addValue(locale, trunkContentItem.getAdditionalInfo());
|
||||
|
||||
//this.contentType
|
||||
this.version = ContentItemVersionMapper
|
||||
.mapContentItemVersion(trunkContentItem.getVersion());
|
||||
|
||||
this.launchDate = null;
|
||||
this.ancestors = trunkContentItem.getPath();
|
||||
|
||||
this.attachments = new ArrayList<>();
|
||||
//this.lifecycle
|
||||
//this.workflow
|
||||
|
||||
this.creationDate = trunkContentItem.getCreationDate();
|
||||
this.lastModified = trunkContentItem.getLastModifiedDate();
|
||||
this.creationUserName = trunkContentItem.getCreationUser().getName();
|
||||
this.lastModifyingUserName = trunkContentItem.getLastModifiedUser()
|
||||
.getName();
|
||||
|
||||
NgCmsCollection.contentItems.put(this.getObjectId(), this);
|
||||
}
|
||||
|
||||
public String getItemUuid() {
|
||||
return itemUuid;
|
||||
}
|
||||
|
||||
public void setItemUuid(final String itemUuid) {
|
||||
this.itemUuid = itemUuid;
|
||||
}
|
||||
|
||||
public LocalizedString getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(final LocalizedString name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public ContentType getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
public void setContentType(final ContentType contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
public LocalizedString getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(final LocalizedString title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public LocalizedString getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public ContentItemVersion getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(final ContentItemVersion version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Date getLaunchDate() {
|
||||
return launchDate;
|
||||
}
|
||||
|
||||
public void setLaunchDate(final Date launchDate) {
|
||||
this.launchDate = launchDate;
|
||||
}
|
||||
|
||||
public String getAncestors() {
|
||||
return ancestors;
|
||||
}
|
||||
|
||||
public void setAncestors(final String ancestors) {
|
||||
this.ancestors = ancestors;
|
||||
}
|
||||
|
||||
public List<AttachmentList> getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
public void setAttachments(final List<AttachmentList> attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public void addAttachments(final AttachmentList attachmentList) {
|
||||
this.attachments.add(attachmentList);
|
||||
}
|
||||
|
||||
public void removettachments(final AttachmentList attachmentList) {
|
||||
this.attachments.remove(attachmentList);
|
||||
}
|
||||
|
||||
public Lifecycle getLifecycle() {
|
||||
return lifecycle;
|
||||
}
|
||||
|
||||
public void setLifecycle(final Lifecycle lifecycle) {
|
||||
this.lifecycle = lifecycle;
|
||||
}
|
||||
|
||||
public Workflow getWorkflow() {
|
||||
return workflow;
|
||||
}
|
||||
|
||||
public void setWorkflow(final Workflow workflow) {
|
||||
this.workflow = workflow;
|
||||
}
|
||||
|
||||
public Date getCreationDate() {
|
||||
return creationDate;
|
||||
}
|
||||
|
||||
public void setCreationDate(final Date creationDate) {
|
||||
this.creationDate = creationDate;
|
||||
}
|
||||
|
||||
public Date getLastModified() {
|
||||
return lastModified;
|
||||
}
|
||||
|
||||
public void setLastModified(final Date lastModified) {
|
||||
this.lastModified = lastModified;
|
||||
}
|
||||
|
||||
public String getCreationUserName() {
|
||||
return creationUserName;
|
||||
}
|
||||
|
||||
public void setCreationUserName(final String creationUserName) {
|
||||
this.creationUserName = creationUserName;
|
||||
}
|
||||
|
||||
public String getLastModifyingUserName() {
|
||||
return lastModifyingUserName;
|
||||
}
|
||||
|
||||
public void setLastModifyingUserName(final String lastModifyingUserName) {
|
||||
this.lastModifyingUserName = lastModifyingUserName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* 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 <a href="mailto:tosmers@uni-bremen.de>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
|
||||
}
|
||||
|
|
@ -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 <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 2/21/18
|
||||
*/
|
||||
public class ContentSection extends CcmApplication {
|
||||
private String label;
|
||||
@JsonIdentityReference(alwaysAsId = true)
|
||||
private Folder rootDocumentsFolder;
|
||||
@JsonIdentityReference(alwaysAsId = true)
|
||||
private Folder rootAssetsFolder;
|
||||
private String pageResolverClass;
|
||||
private String itemResolverClass;
|
||||
private String templateResolverClass;
|
||||
private String xmlGeneratorClass;
|
||||
@JsonIdentityReference(alwaysAsId = true)
|
||||
private List<Role> roles;
|
||||
private Locale defaultLocale;
|
||||
@JsonIgnore
|
||||
private List<ContentType> contentTypes;
|
||||
@JsonIdentityReference(alwaysAsId = true)
|
||||
private List<LifecycleDefinition> lifecycleDefinitions;
|
||||
@JsonIdentityReference(alwaysAsId = true)
|
||||
private List<Workflow> workflowTemplates;
|
||||
|
||||
public ContentSection(final com.arsdigita.cms.ContentSection
|
||||
trunkContentSection) {
|
||||
super(trunkContentSection);
|
||||
|
||||
this.label = trunkContentSection.getName();
|
||||
|
||||
//this.rootDocumentsFolder
|
||||
//this.rootAssetsFolder
|
||||
|
||||
this.pageResolverClass = trunkContentSection.getPageResolverClassName();
|
||||
this.itemResolverClass = trunkContentSection.getItemResolverClassName();
|
||||
this.templateResolverClass = trunkContentSection
|
||||
.getTemplateResolverClassName();
|
||||
this.xmlGeneratorClass = trunkContentSection.getXMLGeneratorClassName();
|
||||
|
||||
this.roles = new ArrayList<>();
|
||||
|
||||
this.defaultLocale = trunkContentSection
|
||||
.getDefaultLocale().toJavaLocale();
|
||||
|
||||
this.contentTypes = new ArrayList<>();
|
||||
this.lifecycleDefinitions = new ArrayList<>();
|
||||
this.workflowTemplates = new ArrayList<>();
|
||||
|
||||
NgCmsCollection.contentSections.put(this.getObjectId(), this);
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(final String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public Folder getRootDocumentsFolder() {
|
||||
return rootDocumentsFolder;
|
||||
}
|
||||
|
||||
public void setRootDocumentsFolder(final Folder rootDocumentsFolder) {
|
||||
this.rootDocumentsFolder = rootDocumentsFolder;
|
||||
}
|
||||
|
||||
public Folder getRootAssetsFolder() {
|
||||
return rootAssetsFolder;
|
||||
}
|
||||
|
||||
public void setRootAssetsFolder(final Folder rootAssetsFolder) {
|
||||
this.rootAssetsFolder = rootAssetsFolder;
|
||||
}
|
||||
|
||||
public String getPageResolverClass() {
|
||||
return pageResolverClass;
|
||||
}
|
||||
|
||||
public void setPageResolverClass(final String pageResolverClass) {
|
||||
this.pageResolverClass = pageResolverClass;
|
||||
}
|
||||
|
||||
public String getItemResolverClass() {
|
||||
return itemResolverClass;
|
||||
}
|
||||
|
||||
public void setItemResolverClass(final String itemResolverClass) {
|
||||
this.itemResolverClass = itemResolverClass;
|
||||
}
|
||||
|
||||
public String getTemplateResolverClass() {
|
||||
return templateResolverClass;
|
||||
}
|
||||
|
||||
public void setTemplateResolverClass(final String templateResolverClass) {
|
||||
this.templateResolverClass = templateResolverClass;
|
||||
}
|
||||
|
||||
public String getXmlGeneratorClass() {
|
||||
return xmlGeneratorClass;
|
||||
}
|
||||
|
||||
public void setXmlGeneratorClass(final String xmlGeneratorClass) {
|
||||
this.xmlGeneratorClass = xmlGeneratorClass;
|
||||
}
|
||||
|
||||
public List<Role> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(final List<Role> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public void addRole(final Role role) {
|
||||
this.roles.add(role);
|
||||
}
|
||||
|
||||
public void removeRole(final Role role) {
|
||||
this.roles.remove(role);
|
||||
}
|
||||
|
||||
public Locale getDefaultLocale() {
|
||||
return defaultLocale;
|
||||
}
|
||||
|
||||
public void setDefaultLocale(final Locale defaultLocale) {
|
||||
this.defaultLocale = defaultLocale;
|
||||
}
|
||||
|
||||
public List<ContentType> getContentTypes() {
|
||||
return contentTypes;
|
||||
}
|
||||
|
||||
public void setContentTypes(final List<ContentType> contentTypes) {
|
||||
this.contentTypes = contentTypes;
|
||||
}
|
||||
|
||||
public void addContentType(final ContentType contentType) {
|
||||
this.contentTypes.add(contentType);
|
||||
}
|
||||
|
||||
public void removeContentType(final ContentType contentType) {
|
||||
this.contentTypes.remove(contentType);
|
||||
}
|
||||
|
||||
public List<LifecycleDefinition> getLifecycleDefinitions() {
|
||||
return lifecycleDefinitions;
|
||||
}
|
||||
|
||||
public void setLifecycleDefinitions(final List<LifecycleDefinition>
|
||||
lifecycleDefinitions) {
|
||||
this.lifecycleDefinitions = lifecycleDefinitions;
|
||||
}
|
||||
|
||||
public void addLifecycleDefinition(final LifecycleDefinition
|
||||
lifecycleDefinition) {
|
||||
this.lifecycleDefinitions.add(lifecycleDefinition);
|
||||
}
|
||||
|
||||
public void removeLifecycleDefinition(final LifecycleDefinition
|
||||
lifecycleDefinition) {
|
||||
this.lifecycleDefinitions.remove(lifecycleDefinition);
|
||||
}
|
||||
|
||||
public List<Workflow> getWorkflowTemplates() {
|
||||
return workflowTemplates;
|
||||
}
|
||||
|
||||
public void setWorkflowTemplates(final List<Workflow> workflowTemplates) {
|
||||
this.workflowTemplates = workflowTemplates;
|
||||
}
|
||||
|
||||
public void addWorkflowTemplate(final Workflow workflowTemplate) {
|
||||
this.workflowTemplates.add(workflowTemplate);
|
||||
}
|
||||
|
||||
public void removeWorkflowTemplate(final Workflow workflowTemplate) {
|
||||
this.workflowTemplates.remove(workflowTemplate);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
* 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.ContentTypeModeMapper;
|
||||
import com.arsdigita.cms.portation.modules.lifecycle.LifecycleDefinition;
|
||||
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 java.util.Locale;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:tosmers@uni-bremen.de>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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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 <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 3/2/18
|
||||
*/
|
||||
public enum ContentTypeMode {
|
||||
|
||||
DEFAULT,
|
||||
INTERNAL,
|
||||
HIDDEN
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* 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.portation.modules.core.categorization.Category;
|
||||
import com.arsdigita.portation.modules.core.categorization.util.CategoryInformation;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:tosmers@uni-bremen.de>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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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 <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 3/2/18
|
||||
*/
|
||||
public enum FolderType {
|
||||
|
||||
DOCUMENTS_FOLDER, // for ContentItems
|
||||
ASSETS_FOLDER // for Assets
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
* 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.fasterxml.jackson.annotation.JsonIdentityReference;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 2/21/18
|
||||
*/
|
||||
public class ItemAttachment<T extends Asset> 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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 <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 2/21/18
|
||||
*/
|
||||
public class ContentItemVersionMapper {
|
||||
public static ContentItemVersion mapContentItemVersion(final String
|
||||
version) {
|
||||
switch (version) {
|
||||
case "DRAFT":
|
||||
return ContentItemVersion.DRAFT;
|
||||
case "PENDING":
|
||||
return ContentItemVersion.PENDING;
|
||||
case "LIVE":
|
||||
return ContentItemVersion.LIVE;
|
||||
default:
|
||||
return ContentItemVersion.DRAFT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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.ContentTypeMode;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 3/2/18
|
||||
*/
|
||||
public class ContentTypeModeMapper {
|
||||
public static ContentTypeMode mapContentTypeMode(final String mode) {
|
||||
switch (mode) {
|
||||
case "D":
|
||||
return ContentTypeMode.DEFAULT;
|
||||
case "I":
|
||||
return ContentTypeMode.INTERNAL;
|
||||
case "H":
|
||||
return ContentTypeMode.HIDDEN;
|
||||
default:
|
||||
return ContentTypeMode.DEFAULT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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.FolderType;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 3/2/18
|
||||
*/
|
||||
public class FolderTypeMapper {
|
||||
public static FolderType mapFolderType(final String type) {
|
||||
switch (type) {
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
/*
|
||||
* 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.fasterxml.jackson.annotation.JsonIdentityReference;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:tosmers@uni-bremen.de>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<Phase> 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<Phase> getPhases() {
|
||||
return phases;
|
||||
}
|
||||
|
||||
public void setPhases(final List<Phase> phases) {
|
||||
this.phases = phases;
|
||||
}
|
||||
|
||||
public void addPhase(final Phase phase) {
|
||||
this.phases.add(phase);
|
||||
}
|
||||
|
||||
public void removePhase(final Phase phase) {
|
||||
this.phases.remove(phase);
|
||||
}
|
||||
}
|
||||
|
|
@ -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 <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 3/5/18
|
||||
*/
|
||||
public class LifecycleDefinition implements Portable {
|
||||
private long definitionId;
|
||||
private LocalizedString label;
|
||||
private LocalizedString description;
|
||||
private String defaultListener;
|
||||
@JsonIdentityReference(alwaysAsId = true)
|
||||
private List<PhaseDefinition> phaseDefinitions;
|
||||
|
||||
public LifecycleDefinition(final com.arsdigita.cms.lifecycle
|
||||
.LifecycleDefinition trunkLifecycleDefinition) {
|
||||
this.definitionId = trunkLifecycleDefinition.getID().longValue();
|
||||
|
||||
this.label = new LocalizedString();
|
||||
this.description = new LocalizedString();
|
||||
final Locale locale = Locale.getDefault();
|
||||
this.label.addValue(locale, trunkLifecycleDefinition.getLabel());
|
||||
this.description
|
||||
.addValue(locale, trunkLifecycleDefinition.getDescription());
|
||||
|
||||
this.defaultListener = trunkLifecycleDefinition.getDefaultListener();
|
||||
|
||||
this.phaseDefinitions = new ArrayList<>();
|
||||
|
||||
NgCmsCollection.lifecycleDefinitions.put(this.definitionId, this);
|
||||
}
|
||||
|
||||
public long getDefinitionId() {
|
||||
return definitionId;
|
||||
}
|
||||
|
||||
public void setDefinitionId(final long definitionId) {
|
||||
this.definitionId = definitionId;
|
||||
}
|
||||
|
||||
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 getDefaultListener() {
|
||||
return defaultListener;
|
||||
}
|
||||
|
||||
public void setDefaultListener(final String defaultListener) {
|
||||
this.defaultListener = defaultListener;
|
||||
}
|
||||
|
||||
public List<PhaseDefinition> getPhaseDefinitions() {
|
||||
return phaseDefinitions;
|
||||
}
|
||||
|
||||
public void setPhaseDefinitions(final List<PhaseDefinition> phaseDefinitions) {
|
||||
this.phaseDefinitions = phaseDefinitions;
|
||||
}
|
||||
|
||||
public void addPhaseDefinition(final PhaseDefinition phaseDefinition) {
|
||||
this.phaseDefinitions.add(phaseDefinition);
|
||||
}
|
||||
|
||||
public void removePhaseDefinition(final PhaseDefinition phaseDefinition) {
|
||||
this.phaseDefinitions.remove(phaseDefinition);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
/*
|
||||
* 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.fasterxml.jackson.annotation.JsonIdentityReference;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:tosmers@uni-bremen.de>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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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 <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 3/5/18
|
||||
*/
|
||||
public class PhaseDefinition implements Portable {
|
||||
private long definitionId;
|
||||
private LocalizedString label;
|
||||
private LocalizedString description;
|
||||
private long defaultDelay;
|
||||
private long defaultDuration;
|
||||
private String defaultListener;
|
||||
|
||||
public PhaseDefinition(final com.arsdigita.cms.lifecycle.PhaseDefinition
|
||||
trunkPhaseDefinition) {
|
||||
this.definitionId = trunkPhaseDefinition.getID().longValue();
|
||||
|
||||
this.label = new LocalizedString();
|
||||
this.description = new LocalizedString();
|
||||
final Locale locale = Locale.getDefault();
|
||||
this.label.addValue(locale, trunkPhaseDefinition.getLabel());
|
||||
this.description
|
||||
.addValue(locale, trunkPhaseDefinition.getDescription());
|
||||
|
||||
this.defaultDelay = trunkPhaseDefinition.getDefaultDelay().longValue();
|
||||
this.defaultDuration = trunkPhaseDefinition.getDefaultDuration()
|
||||
.longValue();
|
||||
|
||||
this.defaultListener = trunkPhaseDefinition.getDefaultListener();
|
||||
|
||||
NgCmsCollection.phaseDefinitions.put(this.definitionId, this);
|
||||
}
|
||||
|
||||
public long getDefinitionId() {
|
||||
return definitionId;
|
||||
}
|
||||
|
||||
public void setDefinitionId(final long definitionId) {
|
||||
this.definitionId = definitionId;
|
||||
}
|
||||
|
||||
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 long getDefaultDelay() {
|
||||
return defaultDelay;
|
||||
}
|
||||
|
||||
public void setDefaultDelay(final long defaultDelay) {
|
||||
this.defaultDelay = defaultDelay;
|
||||
}
|
||||
|
||||
public long getDefaultDuration() {
|
||||
return defaultDuration;
|
||||
}
|
||||
|
||||
public void setDefaultDuration(final long defaultDuration) {
|
||||
this.defaultDuration = defaultDuration;
|
||||
}
|
||||
|
||||
public String getDefaultListener() {
|
||||
return defaultListener;
|
||||
}
|
||||
|
||||
public void setDefaultListener(final String defaultListener) {
|
||||
this.defaultListener = defaultListener;
|
||||
}
|
||||
}
|
||||
|
|
@ -32,5 +32,5 @@ public abstract class AbstractConverter {
|
|||
* order, so that dependencies can only be set, where the objects have
|
||||
* already been created.
|
||||
*/
|
||||
public abstract void startConversion();
|
||||
public abstract void startConversions();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,5 +40,8 @@ public abstract class AbstractExporter {
|
|||
indentation = ind;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to start all the different marshaller classes.
|
||||
*/
|
||||
public abstract void startMarshaller();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* 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.cmd;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:tosmers@uni-bremen.de>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));
|
||||
}
|
||||
}
|
||||
|
|
@ -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());
|
||||
}
|
||||
}*/
|
||||
|
||||
// ...
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
}*/
|
||||
|
||||
// ...
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Long, Category> categories = new HashMap<>();
|
||||
public static Map<Long, Categorization> categorizations = new HashMap<>();
|
||||
|
||||
public static Map<Long, Permission> permissions = new HashMap<>();
|
||||
|
||||
public static Map<Long, Workflow> workflows = new HashMap<>();
|
||||
public static Map<Long, TaskComment> taskComments = new HashMap<>();
|
||||
public static Map<Long, Task> tasks = new HashMap<>();
|
||||
|
|
@ -66,48 +73,22 @@ public class NgCoreCollection {
|
|||
public static Map<Long, TaskDependency> taskDependencies = new HashMap<>();
|
||||
public static Map<Long, TaskAssignment> taskAssignments = new HashMap<>();
|
||||
|
||||
public static Map<Long, Permission> permissions = new HashMap<>();
|
||||
public static Map<Long, ResourceType> resourceTypes = new HashMap<>();
|
||||
public static Map<Long, Resource> resources = new HashMap<>();
|
||||
public static Map<Long, CcmApplication> ccmApplications = new HashMap<>();
|
||||
|
||||
public static Map<Long, Domain> domains = new HashMap<>();
|
||||
public static Map<Long, DomainOwnership> domainOwnerships = new HashMap<>();
|
||||
|
||||
|
||||
// in case maps need to be sorted for export
|
||||
public static ArrayList<Category> sortedCategories;
|
||||
public static ArrayList<Workflow> sortedWorkflows;
|
||||
public static ArrayList<AssignableTask> sortedAssignableTasks;
|
||||
public static ArrayList<CcmApplication> 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<AssignableTask> 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<Task> dependencies = anUnsorted.getDependsOn();
|
||||
|
||||
for (Task task : dependencies) {
|
||||
AssignableTask assignableTask = (AssignableTask) task;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<com.arsdigita.categorization.Category> 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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<com.arsdigita.london.terms.Domain> 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<com.arsdigita.london.terms.Domain> 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");
|
||||
|
|
@ -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<com.arsdigita.kernel.ResourceType> 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -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<com.arsdigita.kernel.Group> 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<com.arsdigita.kernel.permissions.Permission> 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;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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<com.arsdigita.kernel.Role> 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<com.arsdigita.kernel.User> 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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<Application> 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<CcmApplication> 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -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<com.arsdigita.workflow.simple.UserTask> 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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<com.arsdigita.workflow.simple.TaskComment> 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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<com.arsdigita.workflow.simple.Workflow> 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Categorization>
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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<Category> {
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<DomainOwnership> 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
|
||||
|
||||
|
|
@ -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;
|
||||
|
|
@ -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<Domain> {
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
@ -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<DomainOwnershi
|
|||
public void marshallAll(final Format format,
|
||||
final String pathName,
|
||||
final boolean indentation) {
|
||||
System.out.print("\tExporting domainOwnerships...");
|
||||
ExportLogger.exporting("domain ownerships");
|
||||
prepare(format, pathName, "domainOwnerships", indentation);
|
||||
exportList(new ArrayList<>(NgCoreCollection.domainOwnerships.values()));
|
||||
System.out.print("\tdone.\n");
|
||||
}
|
||||
}
|
||||
|
|
@ -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 <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 3/2/18
|
||||
*/
|
||||
public class CategoryInformation {
|
||||
private String displayName;
|
||||
private String uniqueId;
|
||||
private String name;
|
||||
private LocalizedString title;
|
||||
private LocalizedString description;
|
||||
private boolean enabled;
|
||||
private boolean visible;
|
||||
private boolean abstractCategory;
|
||||
private long categoryOrder;
|
||||
|
||||
public CategoryInformation(final String displayName,
|
||||
final String uniqueId,
|
||||
final String name,
|
||||
final String title,
|
||||
final String description,
|
||||
final boolean enabled,
|
||||
final boolean visible,
|
||||
final boolean abstractCategory,
|
||||
final long categoryOrder) {
|
||||
this.displayName = displayName;
|
||||
|
||||
this.uniqueId = uniqueId;
|
||||
this.name = name;
|
||||
|
||||
this.title = new LocalizedString();
|
||||
this.description = new LocalizedString();
|
||||
Locale locale = Locale.getDefault();
|
||||
this.title.addValue(locale, title);
|
||||
this.description.addValue(locale, description);
|
||||
|
||||
this.enabled = enabled;
|
||||
this.visible = visible;
|
||||
this.abstractCategory = abstractCategory;
|
||||
|
||||
this.categoryOrder = categoryOrder;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public String getUniqueId() {
|
||||
return uniqueId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public LocalizedString getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public LocalizedString getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
return visible;
|
||||
}
|
||||
|
||||
public boolean isAbstractCategory() {
|
||||
return abstractCategory;
|
||||
}
|
||||
|
||||
public long getCategoryOrder() {
|
||||
return categoryOrder;
|
||||
}
|
||||
}
|
||||
|
|
@ -22,6 +22,7 @@ import com.arsdigita.kernel.ACSObject;
|
|||
import com.arsdigita.portation.conversion.NgCoreCollection;
|
||||
import com.arsdigita.portation.modules.core.categorization.Categorization;
|
||||
import com.arsdigita.portation.modules.core.categorization.Category;
|
||||
import com.arsdigita.portation.modules.core.categorization.util.CategoryInformation;
|
||||
import com.arsdigita.portation.modules.core.security.Permission;
|
||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
|
@ -75,11 +76,11 @@ public class CcmObject {
|
|||
}
|
||||
|
||||
// specific constructor for ldn-terms' domain
|
||||
public CcmObject(String domainKey) {
|
||||
public CcmObject(final String displayName) {
|
||||
this.objectId = ACSObject.generateID().longValue();
|
||||
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
this.displayName = domainKey + "_DName";
|
||||
this.displayName = displayName;
|
||||
|
||||
this.permissions = new ArrayList<>();
|
||||
this.categories = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
@ -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<ResourceType> {
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
@ -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<Group> {
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<GroupMembershi
|
|||
public void marshallAll(final Format format,
|
||||
final String pathName,
|
||||
final boolean indentation) {
|
||||
System.out.print("\tExporting group memberships...");
|
||||
ExportLogger.exporting("group memberships");
|
||||
prepare(format, pathName, "groupMemberships", indentation);
|
||||
exportList(new ArrayList<>(NgCoreCollection.groupMemberships.values()));
|
||||
System.out.print("\tdone.\n");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Permission> {
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Role> {
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<RoleMembership>
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<User> {
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
@ -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 <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
|
|
@ -57,9 +58,8 @@ public class CcmApplicationMarshaller extends AbstractMarshaller<CcmApplication>
|
|||
public void marshallAll(final Format format,
|
||||
final String pathName,
|
||||
final boolean indentation) {
|
||||
System.out.print("\tExporting ccmApplications...");
|
||||
ExportLogger.exporting("ccm applications");
|
||||
prepare(format, pathName, "ccmApplications", indentation);
|
||||
exportList(NgCoreCollection.sortedCcmApplications);
|
||||
System.out.print("\tdone.\n");
|
||||
}
|
||||
}
|
||||
|
|
@ -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 AssignableTaskMarshaller extends AbstractMarshaller<AssignableTask>
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<TaskAssignment>
|
|||
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");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<TaskComment> {
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Workflow> {
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
|
||||
* @version created the 7/28/17
|
||||
*/
|
||||
public class NgCoreCollection {
|
||||
public static Map<Long, ResourceType> resourceTypes = new HashMap<>();
|
||||
public static Map<Long, Resource> resources = new HashMap<>();
|
||||
public static Map<Long, CcmApplication> ccmApplications = new HashMap<>();
|
||||
|
||||
public static Map<Long, Domain> domains = new HashMap<>();
|
||||
public static Map<Long, DomainOwnership> domainOwnerships = new HashMap<>();
|
||||
|
||||
|
||||
// if lists need to be sorted in specific way to work with import
|
||||
public static ArrayList<CcmApplication> sortedCcmApplications;
|
||||
|
||||
|
||||
/**
|
||||
* Private constructor to prevent the instantiation of this class.
|
||||
*/
|
||||
private NgCoreCollection() {}
|
||||
}
|
||||
|
|
@ -1,70 +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.modules;
|
||||
|
||||
import com.arsdigita.london.terms.portation.conversion.NgCoreCollection;
|
||||
import com.arsdigita.london.terms.portation.modules.core.categorization.DomainOwnershipMarshaller;
|
||||
import com.arsdigita.london.terms.portation.modules.core.core.ResourceTypeMarshaller;
|
||||
import com.arsdigita.london.terms.portation.modules.core.categorization.DomainMarshaller;
|
||||
import com.arsdigita.london.terms.portation.modules.core.web.CcmApplicationMarshaller;
|
||||
import com.arsdigita.portation.AbstractExporter;
|
||||
import com.arsdigita.portation.Format;
|
||||
import com.arsdigita.portation.modules.CoreExporter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Helper to implement the specifics for the exportation. Makes source code
|
||||
* in the cli-tool shorter and more readable.
|
||||
*
|
||||
* Their exists no direct usage of this class. It is used via reflections in
|
||||
* the ccm-core package to start export of these classes.
|
||||
*
|
||||
* @author <a href="mailto:tosmers@uni-bremen.de>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);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue