adds the acctual conversion classes
git-svn-id: https://svn.libreccm.org/ccm/trunk@4180 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
aa0a3f8838
commit
c1b248c148
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* 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.conversion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
|
* @version created the 6/27/16
|
||||||
|
*/
|
||||||
|
public class MainConversion {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* 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.conversion;
|
||||||
|
|
||||||
|
import com.arsdigita.portation.modules.core.categorization.Categorization;
|
||||||
|
import com.arsdigita.portation.modules.core.categorization.Category;
|
||||||
|
import com.arsdigita.portation.modules.core.workflow.Task;
|
||||||
|
import com.arsdigita.portation.modules.core.workflow.Workflow;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
|
* @version created the 6/27/16
|
||||||
|
*/
|
||||||
|
public class NgCollection {
|
||||||
|
|
||||||
|
//public static Map<Long, CcmObject> ccmObjects = new HashMap<>();
|
||||||
|
public static Map<Long, Workflow> workflows = new HashMap<>();
|
||||||
|
public static Map<Long, Task> tasks = new HashMap<>();
|
||||||
|
public static Map<Long, Category> categories = new HashMap<>();
|
||||||
|
public static Map<Long, Categorization> categorizations = new HashMap<>();
|
||||||
|
|
||||||
|
private NgCollection() {}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* 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.conversion.core.categorization;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
|
* @version created the 6/29/16
|
||||||
|
*/
|
||||||
|
public class CategorizationConversion {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
/*
|
||||||
|
* 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.conversion.core.categorization;
|
||||||
|
|
||||||
|
import com.arsdigita.portation.conversion.NgCollection;
|
||||||
|
import com.arsdigita.portation.modules.core.categorization.Category;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
|
* @version created the 6/29/16
|
||||||
|
*/
|
||||||
|
public class CategoryConversion {
|
||||||
|
|
||||||
|
public static void convertAll() {
|
||||||
|
// Todo:
|
||||||
|
List<com.arsdigita.categorization.Category> trunkCategories = new ArrayList<>();
|
||||||
|
|
||||||
|
trunkCategories.forEach(Category::new);
|
||||||
|
|
||||||
|
setParentCategory(trunkCategories);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setParentCategory(
|
||||||
|
List<com.arsdigita.categorization.Category> trunkCategories) {
|
||||||
|
Long id, parentId;
|
||||||
|
Category category, parentCategory;
|
||||||
|
|
||||||
|
for (com.arsdigita.categorization.Category
|
||||||
|
trunkCategory : trunkCategories) {
|
||||||
|
id = trunkCategory.getID().longValue();
|
||||||
|
parentId = trunkCategory.getDefaultParentCategory().getID()
|
||||||
|
.longValue();
|
||||||
|
|
||||||
|
category = NgCollection.categories.get(id);
|
||||||
|
parentCategory = NgCollection.categories.get(parentId);
|
||||||
|
|
||||||
|
if (category != null && parentCategory != null) {
|
||||||
|
category.setParentCategory(parentCategory);
|
||||||
|
parentCategory.addSubCategory(category);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
/*
|
||||||
|
* 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.conversion.core.workflow;
|
||||||
|
|
||||||
|
|
||||||
|
import com.arsdigita.portation.conversion.NgCollection;
|
||||||
|
import com.arsdigita.portation.modules.core.workflow.Task;
|
||||||
|
import com.arsdigita.portation.modules.core.workflow.Workflow;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
|
* @version created the 6/29/16
|
||||||
|
*/
|
||||||
|
public class TaskConversion {
|
||||||
|
|
||||||
|
public static void convertAll() {
|
||||||
|
// Todo:
|
||||||
|
List<com.arsdigita.workflow.simple.Task> trunkTask = new ArrayList<>();
|
||||||
|
|
||||||
|
trunkTask.forEach(Task::new);
|
||||||
|
|
||||||
|
setWorkflow(trunkTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setWorkflow(List<com.arsdigita.workflow.simple.Task>
|
||||||
|
trunkTasks) {
|
||||||
|
long id, workflowId;
|
||||||
|
Task task;
|
||||||
|
Workflow workflow;
|
||||||
|
|
||||||
|
for (com.arsdigita.workflow.simple.Task trunkTask : trunkTasks) {
|
||||||
|
id = trunkTask.getID().longValue();
|
||||||
|
workflowId = trunkTask.getWorkflow().getID().longValue();
|
||||||
|
|
||||||
|
task = NgCollection.tasks.get(id);
|
||||||
|
workflow = NgCollection.workflows.get(workflowId);
|
||||||
|
|
||||||
|
if (task != null && workflow != null) {
|
||||||
|
task.setWorkflow(workflow);
|
||||||
|
workflow.addTask(task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
* 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.conversion.core.workflow;
|
||||||
|
|
||||||
|
import com.arsdigita.portation.modules.core.workflow.Workflow;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
|
||||||
|
* @version created the 6/27/16
|
||||||
|
*/
|
||||||
|
public class WorkflowConversion {
|
||||||
|
|
||||||
|
public static void convertAll() {
|
||||||
|
List<com.arsdigita.workflow.simple.Workflow> trunkWorkflows =
|
||||||
|
com.arsdigita.workflow.simple.Workflow.getObjectWorkflows();
|
||||||
|
|
||||||
|
trunkWorkflows.forEach(Workflow::new);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue