Skip to content

Commit

Permalink
#19 MappingContext update, OpenGraph 0.1.3 update
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungpilPark committed Jul 6, 2017
1 parent 0da3887 commit e253057
Show file tree
Hide file tree
Showing 14 changed files with 15,852 additions and 59,041 deletions.

Large diffs are not rendered by default.

27,286 changes: 0 additions & 27,286 deletions uengine-bpmn-modeler/src/webapp/lib/opengraph/OpenGraph-0.1-SNAPSHOT.js

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<div name="mappingContext">
<div style="position: relative; left: 0; width: 700px; height: 400px; background-color: #f6f6f6;overflow:auto;">
<div id="<%=value.mappingTreeLeft.id%>" style="width:200px; height: 400px; float: left; background-color: #f6f6f6;" align="left"><%= fields.mappingTreeLeft.here()%></div>
<%= fields.mappingCanvas.here() %>
<div id="<%=value.mappingTreeRight.id%>" style="width:200px; height: 400px; float: left; background-color: #f6f6f6;" align="left"><%= fields.mappingTreeRight.here()%></div>
</div>
<div name="mappingContext" style="width:1100px;height:100%;position:relative">
<%= fields.mappingCanvas.here() %>
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.uengine.contexts;

import java.io.Serializable;
import java.util.Map;

import org.codehaus.jackson.map.ObjectMapper;
import org.metaworks.annotation.Id;
import org.metaworks.component.Tree;
import org.metaworks.component.TreeNode;
Expand Down Expand Up @@ -37,18 +39,29 @@ public MappingContext(Activity activity, ProcessInstance instance, ParameterCont
MetaworksRemoteService.autowire(rightTree);
MappingCanvas canvas = new MappingCanvas();
canvas.setCanvasId("mappingCanvas");
canvas.setLeftTreeId(leftTree.getId());
canvas.setRightTreeId(rightTree.getId());

//mappingElements 세팅
if(mappingElements != null){
if (mappingElements != null) {
canvas.setMappingElements(mappingElements);
}
try {
leftTree.init();
rightTree.init();
ObjectMapper mapper = new ObjectMapper();
Map leftMap = mapper.convertValue(leftTree, Map.class);
Map rightMap = mapper.convertValue(rightTree, Map.class);
String leftJson = mapper.writeValueAsString(leftMap);
String rightJson = mapper.writeValueAsString(rightMap);

canvas.setLeftTreeJson(leftJson);
canvas.setRightTreeJson(rightJson);
} catch (Exception ex) {
ex.printStackTrace();
}

setMappingCanvas(canvas);

setMappingTreeLeft(leftTree);
setMappingTreeRight(rightTree);
//setMappingTreeLeft(leftTree);
//setMappingTreeRight(rightTree);
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var org_uengine_contexts_MappingTree = function(objectId, className){
debugger;
// default setting
this.objectId = objectId;
this.className = className;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.codehaus.jackson.map.ObjectMapper;
import org.metaworks.Remover;
import org.metaworks.annotation.*;
import org.metaworks.component.Tree;
Expand Down Expand Up @@ -327,8 +328,22 @@ public void drawInit() throws Exception {
mappingContext = new MappingContext();
MappingCanvas canvas = new MappingCanvas();
canvas.setCanvasId("mappingCanvas");
canvas.setLeftTreeId(leftTree.getId());
canvas.setRightTreeId(rightTree.getId());
try {
leftTree.init();
rightTree.init();
ObjectMapper mapper = new ObjectMapper();
Map leftMap = mapper.convertValue(leftTree, Map.class);
Map rightMap = mapper.convertValue(rightTree, Map.class);
String leftJson = mapper.writeValueAsString(leftMap);
String rightJson = mapper.writeValueAsString(rightMap);

canvas.setLeftTreeJson(leftJson);
canvas.setRightTreeJson(rightJson);
} catch (Exception ex) {
ex.printStackTrace();
}
// canvas.setLeftTreeId(leftTree.getId());
// canvas.setRightTreeId(rightTree.getId());
mappingContext.setMappingCanvas(canvas);
}
mappingContext.setMappingTreeLeft(leftTree);
Expand All @@ -346,8 +361,22 @@ public void drawInit() throws Exception {
if( mappingContextOut.getMappingCanvas() == null ){
MappingCanvas canvas = new MappingCanvas();
canvas.setCanvasId("mappingCanvas"+"Out");
canvas.setLeftTreeId(leftTreeOut.getId());
canvas.setRightTreeId(rightTreeOut.getId());
try {
leftTree.init();
rightTree.init();
ObjectMapper mapper = new ObjectMapper();
Map leftMap = mapper.convertValue(leftTree, Map.class);
Map rightMap = mapper.convertValue(rightTree, Map.class);
String leftJson = mapper.writeValueAsString(leftMap);
String rightJson = mapper.writeValueAsString(rightMap);

canvas.setLeftTreeJson(leftJson);
canvas.setRightTreeJson(rightJson);
} catch (Exception ex) {
ex.printStackTrace();
}
// canvas.setLeftTreeId(leftTreeOut.getId());
// canvas.setRightTreeId(rightTreeOut.getId());
mappingContextOut.setMappingCanvas(canvas);
}
mappingContextOut.setMappingTreeLeft(leftTreeOut);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div id="<%=value.canvasId%>" style="width:280px; height: 400px; float: left; line-height: 17px;"></div>
<div id="mapping-<%=objectId%>" style="cursor: default;width: 1100px;overflow: scroll;"></div>
Loading

0 comments on commit e253057

Please sign in to comment.