use of com.netsteadfast.greenstep.bsc.vo.StrategyMapItemsVO in project bamboobsc by billchen198318.
the class LoadStrategyMapItemsForRecCommand method fillStrategyMapItems.
private StrategyMapItemsVO fillStrategyMapItems(VisionVO vision, Context context) throws ServiceException, Exception {
StrategyMapItemsVO mapItems = new StrategyMapItemsVO();
int w = 190;
StrategyMapVO map = new StrategyMapVO();
map.setVisId(vision.getVisId());
DefaultResult<StrategyMapVO> smResult = this.strategyMapService.findByUK(map);
if (smResult.getValue() == null) {
this.setMessage(context, smResult.getSystemMessage().getValue());
return mapItems;
}
map = smResult.getValue();
Map<String, Object> params = new HashMap<String, Object>();
params.put("masterOid", map.getOid());
List<BbStrategyMapNodes> nodes = this.strategyMapNodesService.findListByParams(params);
List<BbStrategyMapConns> conns = this.strategyMapConnsService.findListByParams(params);
for (int i = 0; nodes != null && i < nodes.size(); i++) {
BbStrategyMapNodes node = nodes.get(i);
String div = "<div class=\"w\" id=\"" + node.getId() + "\">" + node.getText() + "<div class=\"ep\"></div></div>";
String css = "#" + node.getId() + " { left:" + node.getPositionX() + "px; top:" + node.getPositionY() + "px; width:" + w + "px; }";
mapItems.getDiv().add(div);
mapItems.getCss().add(css);
}
for (int i = 0; conns != null && i < conns.size(); i++) {
BbStrategyMapConns conn = conns.get(i);
mapItems.getCon().add("{ source:\"" + conn.getSourceId() + "\", target:\"" + conn.getTargetId() + "\" }");
}
return mapItems;
}
use of com.netsteadfast.greenstep.bsc.vo.StrategyMapItemsVO in project bamboobsc by billchen198318.
the class LoadStrategyMapItemsForNewCommand method fillStrategyMapItems.
private StrategyMapItemsVO fillStrategyMapItems(VisionVO vision) throws Exception {
StrategyMapItemsVO mapItems = new StrategyMapItemsVO();
int w = 190;
int top = 10;
for (PerspectiveVO perspective : vision.getPerspectives()) {
int left = 10;
for (ObjectiveVO objective : perspective.getObjectives()) {
String idName = objective.getObjId();
/**
* 1em = 16px
*
* <div class="w" id="phone1">PHONE INTERVIEW 1<div class="ep"></div></div>
* #phone1 { left:35em; top:12em; width:7em; }
*
*/
String div = "<div class=\"w\" id=\"" + idName + "\">" + objective.getName() + "<div class=\"ep\"></div></div>";
String css = "#" + idName + " { left:" + left + "px; top:" + top + "px; width:" + w + "px; }";
mapItems.getDiv().add(div);
mapItems.getCss().add(css);
left += (w + 80);
}
top += 120;
}
return mapItems;
}
use of com.netsteadfast.greenstep.bsc.vo.StrategyMapItemsVO in project bamboobsc by billchen198318.
the class IndexAction method loadRecord.
@SuppressWarnings("unchecked")
private void loadRecord() throws ControllerException, ServiceException, Exception {
String visionOid = this.getFields().get("visionOid");
if (super.isNoSelectId(visionOid)) {
return;
}
Context context = new ContextBase();
context.put("visionOid", visionOid);
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("strategyMapItemsForRecChain", context);
this.setPageMessage(resultObj.getMessage());
if (resultObj.getValue() instanceof StrategyMapItemsVO) {
this.divItems = ((StrategyMapItemsVO) resultObj.getValue()).getDiv();
this.cssItems = ((StrategyMapItemsVO) resultObj.getValue()).getCss();
this.conItems = ((StrategyMapItemsVO) resultObj.getValue()).getCon();
}
}
use of com.netsteadfast.greenstep.bsc.vo.StrategyMapItemsVO in project bamboobsc by billchen198318.
the class LoadStrategyMapItemsForNewCommand method execute.
@Override
public boolean execute(Context context) throws Exception {
if (this.getResult(context) == null || !(this.getResult(context) instanceof BscStructTreeObj)) {
return false;
}
BscStructTreeObj treeObj = (BscStructTreeObj) this.getResult(context);
String visionOid = (String) context.get("visionOid");
VisionVO vision = null;
for (VisionVO obj : treeObj.getVisions()) {
if (obj.getOid().equals(visionOid)) {
vision = obj;
}
}
StrategyMapItemsVO mapItems = this.fillStrategyMapItems(vision);
this.setResult(context, mapItems);
return false;
}
use of com.netsteadfast.greenstep.bsc.vo.StrategyMapItemsVO in project bamboobsc by billchen198318.
the class LoadStrategyMapItemsForRecCommand method execute.
@Override
public boolean execute(Context context) throws ServiceException, Exception {
if (this.getResult(context) == null || !(this.getResult(context) instanceof BscStructTreeObj)) {
return false;
}
BscStructTreeObj treeObj = (BscStructTreeObj) this.getResult(context);
String visionOid = (String) context.get("visionOid");
VisionVO vision = null;
for (VisionVO obj : treeObj.getVisions()) {
if (obj.getOid().equals(visionOid)) {
vision = obj;
}
}
StrategyMapItemsVO mapItems = this.fillStrategyMapItems(vision, context);
this.setResult(context, mapItems);
return false;
}
Aggregations