mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-14 03:07:57 +01:00
Added importer freemind
This commit is contained in:
parent
2225a3c640
commit
673af4e922
@ -69,96 +69,104 @@ export default class Freemap {
|
|||||||
freemap.setVesion(version);
|
freemap.setVesion(version);
|
||||||
|
|
||||||
const mainTopicElement = rootElem.firstElementChild;
|
const mainTopicElement = rootElem.firstElementChild;
|
||||||
const mainTopic: Node = this.domToNode(mainTopicElement) as Node;
|
const mainTopic: Node = new Node().loadFromElement(mainTopicElement);
|
||||||
freemap.setNode(mainTopic);
|
freemap.setNode(mainTopic);
|
||||||
|
|
||||||
// Add all the topics nodes...
|
|
||||||
const childNodes = Array.from(mainTopicElement.childNodes);
|
const childNodes = Array.from(mainTopicElement.childNodes);
|
||||||
const topicsNodes = childNodes
|
const childsNodes = childNodes
|
||||||
.filter(
|
.filter(
|
||||||
(child: ChildNode) => child.nodeType === 1 && (child as Element).tagName === 'node',
|
(child: ChildNode) => child.nodeType === 1 && (child as Element).tagName === 'node',
|
||||||
)
|
)
|
||||||
.map((c) => c as Element);
|
.map((c) => c as Element);
|
||||||
|
|
||||||
topicsNodes.forEach((child) => {
|
childsNodes.forEach((child: Element) => {
|
||||||
const childNode = this.domToNode(child);
|
const node = this.domToNode(child);
|
||||||
mainTopic.setArrowlinkOrCloudOrEdge(childNode);
|
mainTopic.setArrowlinkOrCloudOrEdge(node);
|
||||||
});
|
});
|
||||||
|
|
||||||
return freemap;
|
return freemap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private domToNode(nodeElem: Element): Choise {
|
private filterNodes(child: ChildNode): Element {
|
||||||
if (nodeElem.tagName === 'node') {
|
let element: Element;
|
||||||
const node: Node = new Node().loadFromElement(nodeElem);
|
if (child.nodeType === 1) {
|
||||||
|
if (
|
||||||
if (nodeElem.childNodes.length > 0) {
|
(child as Element).tagName === 'node'
|
||||||
const childElement = Array.from(nodeElem.childNodes)
|
|| (child as Element).tagName === 'richcontent'
|
||||||
.filter(
|
|| (child as Element).tagName === 'font'
|
||||||
(child: ChildNode) => child.nodeType === 1 && (child as Element).tagName === 'node',
|
|| (child as Element).tagName === 'edge'
|
||||||
)
|
|| (child as Element).tagName === 'arrowlink'
|
||||||
.map((c) => c as Element);
|
|| (child as Element).tagName === 'clud'
|
||||||
|
|| (child as Element).tagName === 'icon'
|
||||||
childElement.forEach((child) => {
|
) element = child as Element;
|
||||||
const childNode = new Node().loadFromElement(child);
|
|
||||||
node.setArrowlinkOrCloudOrEdge(childNode);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return node;
|
return element;
|
||||||
|
}
|
||||||
|
|
||||||
|
private domToNode(nodeElem: Element): Choise {
|
||||||
|
let node: Choise;
|
||||||
|
|
||||||
|
if (nodeElem.tagName === 'node') {
|
||||||
|
node = new Node().loadFromElement(nodeElem);
|
||||||
|
|
||||||
|
if (nodeElem.childNodes.length > 0) {
|
||||||
|
const childNodes = Array.from(nodeElem.childNodes);
|
||||||
|
const childsNodes = childNodes
|
||||||
|
.filter((child: ChildNode) => this.filterNodes(child))
|
||||||
|
.map((c) => c as Element);
|
||||||
|
|
||||||
|
childsNodes.forEach((child) => {
|
||||||
|
const childNode = this.domToNode(child);
|
||||||
|
if (node instanceof Node) node.setArrowlinkOrCloudOrEdge(childNode);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeElem.tagName === 'font') {
|
if (nodeElem.tagName === 'font') {
|
||||||
const font: Font = new Font();
|
node = new Font();
|
||||||
if (nodeElem.getAttribute('NAME')) font.setName(nodeElem.getAttribute('NAME'));
|
if (nodeElem.getAttribute('NAME')) node.setName(nodeElem.getAttribute('NAME'));
|
||||||
if (nodeElem.getAttribute('BOLD')) font.setBold(nodeElem.getAttribute('BOLD'));
|
if (nodeElem.getAttribute('BOLD')) node.setBold(nodeElem.getAttribute('BOLD'));
|
||||||
if (nodeElem.getAttribute('ITALIC')) font.setItalic(nodeElem.getAttribute('ITALIC'));
|
if (nodeElem.getAttribute('ITALIC')) node.setItalic(nodeElem.getAttribute('ITALIC'));
|
||||||
if (nodeElem.getAttribute('SIZE')) font.setSize(nodeElem.getAttribute('SIZE'));
|
if (nodeElem.getAttribute('SIZE')) node.setSize(nodeElem.getAttribute('SIZE'));
|
||||||
|
|
||||||
return font;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeElem.tagName === 'edge') {
|
if (nodeElem.tagName === 'edge') {
|
||||||
const edge = new Edge();
|
node = new Edge();
|
||||||
if (nodeElem.getAttribute('COLOR')) edge.setColor(nodeElem.getAttribute('COLOR'));
|
if (nodeElem.getAttribute('COLOR')) node.setColor(nodeElem.getAttribute('COLOR'));
|
||||||
if (nodeElem.getAttribute('STYLE')) edge.setStyle(nodeElem.getAttribute('STYLE'));
|
if (nodeElem.getAttribute('STYLE')) node.setStyle(nodeElem.getAttribute('STYLE'));
|
||||||
if (nodeElem.getAttribute('WIDTH')) edge.setWidth(nodeElem.getAttribute('WIDTH'));
|
if (nodeElem.getAttribute('WIDTH')) node.setWidth(nodeElem.getAttribute('WIDTH'));
|
||||||
|
|
||||||
return edge;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeElem.tagName === 'arrowlink') {
|
if (nodeElem.tagName === 'arrowlink') {
|
||||||
const arrowlink = new Arrowlink();
|
node = new Arrowlink();
|
||||||
if (nodeElem.getAttribute('COLOR')) arrowlink.setColor(nodeElem.getAttribute('COLOR'));
|
if (nodeElem.getAttribute('COLOR')) node.setColor(nodeElem.getAttribute('COLOR'));
|
||||||
if (nodeElem.getAttribute('DESTINATION')) arrowlink.setDestination(nodeElem.getAttribute('DESTINATION'));
|
if (nodeElem.getAttribute('DESTINATION')) node.setDestination(nodeElem.getAttribute('DESTINATION'));
|
||||||
if (nodeElem.getAttribute('ENDARROW')) arrowlink.setEndarrow(nodeElem.getAttribute('ENDARROW'));
|
if (nodeElem.getAttribute('ENDARROW')) node.setEndarrow(nodeElem.getAttribute('ENDARROW'));
|
||||||
if (nodeElem.getAttribute('ENDINCLINATION')) arrowlink.setEndinclination(nodeElem.getAttribute('ENDINCLINATION'));
|
if (nodeElem.getAttribute('ENDINCLINATION')) node.setEndinclination(nodeElem.getAttribute('ENDINCLINATION'));
|
||||||
if (nodeElem.getAttribute('ID')) arrowlink.setId(nodeElem.getAttribute('ID'));
|
if (nodeElem.getAttribute('ID')) node.setId(nodeElem.getAttribute('ID'));
|
||||||
if (nodeElem.getAttribute('STARTARROW')) arrowlink.setStartarrow(nodeElem.getAttribute('STARTARROW'));
|
if (nodeElem.getAttribute('STARTARROW')) node.setStartarrow(nodeElem.getAttribute('STARTARROW'));
|
||||||
if (nodeElem.getAttribute('STARTINCLINATION')) arrowlink.setStartinclination(nodeElem.getAttribute('STARTINCLINATION'));
|
if (nodeElem.getAttribute('STARTINCLINATION')) node.setStartinclination(nodeElem.getAttribute('STARTINCLINATION'));
|
||||||
|
|
||||||
return arrowlink;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeElem.tagName === 'cloud') {
|
if (nodeElem.tagName === 'cloud') {
|
||||||
const cloud = new Cloud();
|
node = new Cloud();
|
||||||
if (nodeElem.getAttribute('COLOR')) cloud.setColor(nodeElem.getAttribute('COLOR'));
|
if (nodeElem.getAttribute('COLOR')) node.setColor(nodeElem.getAttribute('COLOR'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeElem.tagName === 'icon') {
|
if (nodeElem.tagName === 'icon') {
|
||||||
const icon = new Icon();
|
node = new Icon();
|
||||||
if (nodeElem.getAttribute('BUILTIN')) icon.setBuiltin(nodeElem.getAttribute('BUILTIN'));
|
if (nodeElem.getAttribute('BUILTIN')) node.setBuiltin(nodeElem.getAttribute('BUILTIN'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeElem.tagName === 'richcontent') {
|
if (nodeElem.tagName === 'richcontent') {
|
||||||
const richcontent = new Richcontent();
|
node = new Richcontent();
|
||||||
|
|
||||||
if (nodeElem.getAttribute('TYPE')) richcontent.setType(nodeElem.getAttribute('TYPE'));
|
if (nodeElem.getAttribute('TYPE')) node.setType(nodeElem.getAttribute('TYPE'));
|
||||||
if (nodeElem.lastElementChild) richcontent.setHtml(String(nodeElem.lastElementChild));
|
if (nodeElem.lastElementChild) node.setHtml(String(nodeElem.getElementsByTagName('html')[0].outerHTML.trim()));
|
||||||
}
|
}
|
||||||
|
|
||||||
const nodeDefault = new Node();
|
return node;
|
||||||
return nodeDefault;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private nodeToXml(childNode: Choise, parentNode: HTMLElement, document: Document): HTMLElement {
|
private nodeToXml(childNode: Choise, parentNode: HTMLElement, document: Document): HTMLElement {
|
||||||
|
@ -27,8 +27,6 @@ export default class FreemindImporter extends Importer {
|
|||||||
|
|
||||||
private relationship: Array<RelationshipModel>;
|
private relationship: Array<RelationshipModel>;
|
||||||
|
|
||||||
private currentId: number;
|
|
||||||
|
|
||||||
constructor(map: FreemindMap) {
|
constructor(map: FreemindMap) {
|
||||||
super();
|
super();
|
||||||
this.freemindMap = map;
|
this.freemindMap = map;
|
||||||
@ -38,6 +36,7 @@ export default class FreemindImporter extends Importer {
|
|||||||
this.mindmap = new Mindmap(nameMap);
|
this.mindmap = new Mindmap(nameMap);
|
||||||
this.nodesmap = new Map<string, NodeModel>();
|
this.nodesmap = new Map<string, NodeModel>();
|
||||||
this.relationship = new Array<RelationshipModel>();
|
this.relationship = new Array<RelationshipModel>();
|
||||||
|
let wiseTopicId = 0;
|
||||||
|
|
||||||
const version: string = this.freemindMap.getVersion();
|
const version: string = this.freemindMap.getVersion();
|
||||||
|
|
||||||
@ -52,20 +51,21 @@ export default class FreemindImporter extends Importer {
|
|||||||
|
|
||||||
const freeNode: FreemindNode = this.freemindMap.getNode();
|
const freeNode: FreemindNode = this.freemindMap.getNode();
|
||||||
this.mindmap.setVersion(FreemindConstant.CODE_VERSION);
|
this.mindmap.setVersion(FreemindConstant.CODE_VERSION);
|
||||||
const wiseTopic = this.mindmap.createNode('CentralTopic', 0);
|
|
||||||
wiseTopic.setId(this.currentId++);
|
wiseTopicId++;
|
||||||
|
const wiseTopic = this.mindmap.createNode('CentralTopic');
|
||||||
wiseTopic.setPosition(0, 0);
|
wiseTopic.setPosition(0, 0);
|
||||||
|
wiseTopic.setId(wiseTopicId);
|
||||||
|
|
||||||
this.convertNodeProperties(freeNode, wiseTopic);
|
this.convertNodeProperties(freeNode, wiseTopic, true);
|
||||||
|
|
||||||
wiseTopic.setShapeType(TopicShape.ROUNDED_RECT);
|
|
||||||
|
|
||||||
this.nodesmap.set(freeNode.getId(), wiseTopic);
|
this.nodesmap.set(freeNode.getId(), wiseTopic);
|
||||||
|
|
||||||
this.convertChildNodes(freeNode, wiseTopic, this.mindmap, 1);
|
this.convertChildNodes(freeNode, wiseTopic, this.mindmap, 1, wiseTopicId);
|
||||||
this.addRelationship(this.mindmap);
|
this.addRelationship(this.mindmap);
|
||||||
|
|
||||||
this.mindmap.setDescription(description);
|
this.mindmap.setDescription(description);
|
||||||
|
this.mindmap.addBranch(wiseTopic);
|
||||||
|
|
||||||
return Promise.resolve(this.mindmap);
|
return Promise.resolve(this.mindmap);
|
||||||
}
|
}
|
||||||
@ -126,21 +126,21 @@ export default class FreemindImporter extends Importer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private convertNodeProperties(freeNode: FreemindNode, wiseTopic: NodeModel): void {
|
private convertNodeProperties(freeNode: FreemindNode, wiseTopic: NodeModel, centralTopic: boolean): void {
|
||||||
const text: string = freeNode.getText();
|
const text: string = freeNode.getText();
|
||||||
wiseTopic.setText(text);
|
if (text) wiseTopic.setText(text);
|
||||||
|
|
||||||
const bgColor: string = freeNode.getBackgorundColor();
|
const bgColor: string = freeNode.getBackgorundColor();
|
||||||
wiseTopic.setBackgroundColor(bgColor);
|
if (bgColor) wiseTopic.setBackgroundColor(bgColor);
|
||||||
|
|
||||||
|
if (centralTopic === false) {
|
||||||
const shape = this.getShapeFromFreeNode(freeNode);
|
const shape = this.getShapeFromFreeNode(freeNode);
|
||||||
wiseTopic.setShapeType(shape);
|
if (shape && shape !== 'fork') wiseTopic.setShapeType(shape);
|
||||||
|
}
|
||||||
|
|
||||||
// Check for style...
|
// Check for style...
|
||||||
const fontStyle = this.generateFontStyle(freeNode, null);
|
const fontStyle = this.generateFontStyle(freeNode, null);
|
||||||
if (fontStyle) {
|
if (fontStyle && fontStyle !== ';;;;') wiseTopic.setFontStyle(fontStyle);
|
||||||
wiseTopic.setFontStyle(fontStyle);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Is there any link...
|
// Is there any link...
|
||||||
const url: string = freeNode.getLink();
|
const url: string = freeNode.getLink();
|
||||||
@ -150,10 +150,10 @@ export default class FreemindImporter extends Importer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const folded = Boolean(freeNode.getFolded());
|
const folded = Boolean(freeNode.getFolded());
|
||||||
wiseTopic.setChildrenShrunken(folded);
|
if (folded) wiseTopic.setChildrenShrunken(folded);
|
||||||
}
|
}
|
||||||
|
|
||||||
private convertChildNodes(freeParent: FreemindNode, wiseParent: NodeModel, mindmap: Mindmap, depth: number): void {
|
private convertChildNodes(freeParent: FreemindNode, wiseParent: NodeModel, mindmap: Mindmap, depth: number, nodeId: number): void {
|
||||||
const freeChilden = freeParent.getArrowlinkOrCloudOrEdge();
|
const freeChilden = freeParent.getArrowlinkOrCloudOrEdge();
|
||||||
let currentWiseTopic: NodeModel = wiseParent;
|
let currentWiseTopic: NodeModel = wiseParent;
|
||||||
let order = 0;
|
let order = 0;
|
||||||
@ -162,15 +162,15 @@ export default class FreemindImporter extends Importer {
|
|||||||
|
|
||||||
freeChilden.forEach((child) => {
|
freeChilden.forEach((child) => {
|
||||||
if (child instanceof FreemindNode) {
|
if (child instanceof FreemindNode) {
|
||||||
const freeChild: FreemindNode = child as FreemindNode;
|
const wiseId = parseInt(child.getId().split('_')[1], 10);
|
||||||
const wiseChild = mindmap.createNode('MainTopic', this.currentId++);
|
const wiseChild = mindmap.createNode('MainTopic', wiseId);
|
||||||
|
|
||||||
this.nodesmap.set(freeChild.getId(), wiseChild);
|
this.nodesmap.set(child.getId(), wiseChild);
|
||||||
|
|
||||||
let norder: number;
|
let norder: number;
|
||||||
if (depth !== 1) {
|
if (depth !== 1) {
|
||||||
norder = order++;
|
norder = order++;
|
||||||
} else if (freeChild.getPosition() && freeChild.getPosition() === FreemindConstant.POSITION_LEFT) {
|
} else if (child.getPosition() && child.getPosition() === FreemindConstant.POSITION_LEFT) {
|
||||||
norder = firstLevelLeftOrder;
|
norder = firstLevelLeftOrder;
|
||||||
firstLevelLeftOrder += 2;
|
firstLevelLeftOrder += 2;
|
||||||
} else {
|
} else {
|
||||||
@ -181,14 +181,16 @@ export default class FreemindImporter extends Importer {
|
|||||||
wiseChild.setOrder(norder);
|
wiseChild.setOrder(norder);
|
||||||
|
|
||||||
// Convert node position...
|
// Convert node position...
|
||||||
const childrenCountSameSide = this.getChildrenCountSameSide(freeChilden, freeChild);
|
const childrenCountSameSide = this.getChildrenCountSameSide(freeChilden, child);
|
||||||
const position: {x: number, y: number} = this.convertPosition(wiseParent, freeChild, depth, norder, childrenCountSameSide);
|
const position: {x: number, y: number} = this.convertPosition(wiseParent, child, depth, norder, childrenCountSameSide);
|
||||||
wiseChild.setPosition(position.x, position.y);
|
wiseChild.setPosition(position.x, position.y);
|
||||||
|
|
||||||
// Convert the rest of the node properties...
|
// Convert the rest of the node properties...
|
||||||
this.convertNodeProperties(freeChild, wiseChild);
|
this.convertNodeProperties(child, wiseChild, false);
|
||||||
|
|
||||||
this.convertChildNodes(freeChild, wiseChild, mindmap, depth + 1);
|
if (child.getArrowlinkOrCloudOrEdge().length > 0) {
|
||||||
|
this.convertChildNodes(child, wiseChild, mindmap, depth++, nodeId);
|
||||||
|
}
|
||||||
|
|
||||||
if (wiseChild !== wiseParent) {
|
if (wiseChild !== wiseParent) {
|
||||||
wiseParent.append(wiseChild);
|
wiseParent.append(wiseChild);
|
||||||
@ -233,18 +235,12 @@ export default class FreemindImporter extends Importer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (child instanceof FreemindRichcontent) {
|
if (child instanceof FreemindRichcontent) {
|
||||||
const content: FreemindRichcontent = child as FreemindRichcontent;
|
const type = child.getType();
|
||||||
const type: string = content.getType();
|
if (type === 'NOTE') {
|
||||||
|
// Formating text
|
||||||
if (type === FreemindConstant.NODE_TYPE) {
|
const text = this.html2Text(child.getHtml());
|
||||||
const text = this.html2text(content);
|
const noteModel: NoteModel = new NoteModel({ text: text || FreemindConstant.EMPTY_NOTE });
|
||||||
currentWiseTopic.setText(text);
|
currentWiseTopic.addFeature(noteModel);
|
||||||
} else {
|
|
||||||
let text = this.html2text(content);
|
|
||||||
const mindmapNote: NoteModel = new NoteModel({ text: '' });
|
|
||||||
text = text || FreemindConstant.EMPTY_NOTE;
|
|
||||||
mindmapNote.setText(text);
|
|
||||||
currentWiseTopic.addFeature(mindmapNote);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,9 +289,7 @@ export default class FreemindImporter extends Importer {
|
|||||||
|
|
||||||
freeChilden.forEach((child) => {
|
freeChilden.forEach((child) => {
|
||||||
if (child instanceof FreemindNode) {
|
if (child instanceof FreemindNode) {
|
||||||
const node: FreemindNode = child as FreemindNode;
|
let side = child.getPosition();
|
||||||
|
|
||||||
let side = node.getPosition();
|
|
||||||
if (!side) {
|
if (!side) {
|
||||||
side = FreemindConstant.POSITION_RIGHT;
|
side = FreemindConstant.POSITION_RIGHT;
|
||||||
}
|
}
|
||||||
@ -315,8 +309,6 @@ export default class FreemindImporter extends Importer {
|
|||||||
result = TopicShape.ROUNDED_RECT;
|
result = TopicShape.ROUNDED_RECT;
|
||||||
} else if (node.getBackgorundColor()) {
|
} else if (node.getBackgorundColor()) {
|
||||||
result = TopicShape.RECTANGLE;
|
result = TopicShape.RECTANGLE;
|
||||||
} else {
|
|
||||||
result = TopicShape.LINE;
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -395,12 +387,9 @@ export default class FreemindImporter extends Importer {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private html2text(content: FreemindRichcontent): string {
|
private html2Text(content: string): string {
|
||||||
const parser = new DOMParser();
|
const contentConvert = content.replace(/(<([^>]+)>)/gi, '');
|
||||||
const doc = parser.parseFromString(content.getHtml(), 'text/html');
|
contentConvert.replace('\t', '');
|
||||||
doc.querySelector('br').append('\\n');
|
return contentConvert.trim();
|
||||||
doc.querySelector('p').append('\\n');
|
|
||||||
doc.querySelector('div').append('\\n');
|
|
||||||
return doc.textContent.replace('\\\\n', '\\n').trim();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<map name="complex" version="tango"><topic central="true" text="PPM Plan" id="1" bgColor="#32e36a"><topic position="241,250" order="10" text="Business Development " id="4" fontStyle=";;;bold;;"/><topic position="226,-100" order="2" text="Backlog Management" shape="line" id="18" fontStyle=";;;bold;;"><link url="https://docs.google.com/a/freeform.ca/drawings/d/1mrtkVAN3_XefJJCgfxw4Va6xk9TVDBKXDt_uzyIF4Us/edit" urlType="url"/></topic><topic position="-193,50" order="5" text="Freeform IT" id="10" fontStyle=";;;bold;;"/><topic position="-271,-50" order="3" text="Client Project Management" id="204" fontStyle=";;;bold;;"/><topic position="-183,-150" order="7" text="Governance & Executive" id="206" fontStyle=";;;bold;;"/><topic position="124,-200" order="8" text="Finance" id="5" fontStyle=";;;bold;;"/><topic position="176,-150" order="6" text="Administration" id="3" fontStyle=";;;bold;;"/><topic position="222,100" order="4" text="Human Resources" id="154" fontStyle=";;;bold;;"><note><![CDATA[HR Vision: Freeform Solutions is successful at its mission, sustainable as an organization AND is a great place to work.
|
<map name="complex" version="tango"><topic central="true" text="PPM Plan" id="1" bgColor="#32e36a"><topic position="241,250" order="10" text="Business Development " id="4" fontStyle=";;;bold;;"/><topic position="226,-100" order="2" text="Backlog Management" shape="line" id="18" fontStyle=";;;bold;;"><link url="https://docs.google.com/a/freeform.ca/drawings/d/1mrtkVAN3_XefJJCgfxw4Va6xk9TVDBKXDt_uzyIF4Us/edit" urlType="url"/></topic><topic position="-193,50" order="5" text="Freeform IT" id="10" fontStyle=";;;bold;;"/><topic position="-271,-50" order="3" text="Client Project Management" id="204" fontStyle=";;;bold;;"/><topic position="-183,-150" order="7" text="Governance & Executive" id="206" fontStyle=";;;bold;;"/><topic position="124,-200" order="8" text="Finance" id="5" fontStyle=";;;bold;;"/><topic position="176,-150" order="6" text="Administration" id="3" fontStyle=";;;bold;;"/><topic position="222,100" order="4" text="Human Resources" id="154" fontStyle=";;;bold;;"><note><![CDATA[HR Vision: Freeform Solutions is successful at its mission, sustainable as an organization AND is a great place to work.
|
||||||
HR Mission: To provide a positive HR service experience for applicants and employees, and collaborate with departments to recruit, develop, support, and retain diverse and talented employees who are the key to Freeform’s reputation and success.]]></note></topic><topic position="-202,150" order="9" text="Freeform Hosting" id="16" fontStyle=";;;bold;;"/><topic position="197,50" order="0" text="Community Outreach" id="247" fontStyle=";;;bold;;"/><topic position="124,300" order="12" text="R&D" id="261" fontStyle=";;;bold;;"><topic position="230,289" order="0" text="Goals" id="263"/><topic position="239,313" order="1" text="Formulize" id="264"/></topic><topic position="-158,0" order="1" text="Probono" id="268"><topic position="-273,1" order="0" id="269"/></topic></topic><topic position="1558,-249" text="Strategy 2: Talent Development" id="31"><note><![CDATA[Strategy #2: Support the talent development of our employees through professional development and learning and through improved performance management.]]></note><topic position="1817,-260" order="0" text="Strategic Priority 2a: Personal Plans" id="113"><note><![CDATA[Each employee will have a personal Professional Development Plan. ]]></note></topic><topic position="1869,-236" order="1" text="Strategic Priority 2b: External learning matches organ. goals" id="114"><note><![CDATA[Each department of Freeform will identify areas that need development to meet overall FS goals. Eg. Project Manager may identify needed improvement in a development tool. Or... Bus. Dev. may identify a new need in NFP that FS could fill within mandate, if training were provided. Professional Dev. priority will be given to proposals for development with clear ROIs.]]></note></topic><topic position="1831,-212" order="2" text="Strategic Priority 2c: Learning Environment" id="116"><note><![CDATA[Learning and innovation are an essential part of providing the best solutions to NFPs. Cost effective internal learning and time to explore innovation will be encouraged, provided they conform with organization goal and clear ROI is demonstrated.]]></note></topic><topic position="1766,-188" order="3" text="So That..." id="112"><icon id="object_rainbow"/><note><![CDATA[(So that... our employees have improved skills and knowledge, So that... they are highly competent and can work well in agile teams and feel fulfilled and self actualized... So that we can so the best work possible, for the least cost, in the shortest time for other NFPs, So that... NFPs can help those who need it.)]]></note></topic></topic><topic position="1952,168" text="Strategy 4: Inclusive, Positive Environment" id="105"><note><![CDATA[Strategy #4: Foster a diverse, inclusive community with a positive work environment.]]></note><topic position="2229,142" order="0" text="Strategic Priority 4a:Feedback" id="119"><note><![CDATA[Conduct regular organizational feedback assessments and collaborate to improve the work climate]]></note></topic><topic position="2246,166" order="1" text="Strategic Priority 4b: Anti Harassment" id="120"><note><![CDATA[Educate employees on the prevention of harassment and discrimination and productive ways to resolve conflict]]></note></topic><topic position="2228,190" order="2" text="Strategic Priority 4c: Diversity" id="121"><note><![CDATA[Insure we promote our commitment to diversity and non-discrimination through our actions and in our outreach and employee recruitment efforts]]></note></topic><topic position="2178,214" order="3" id="253"/><topic position="2191,238" order="4" text="So That..." id="118"><icon id="object_rainbow"/><note><![CDATA[(So that... we can reflect the diverse populations we serve AND ensure everyone feels safe, respected and included, So that... we better serve our diverse client organizations AND we are a great place to work )]]></note></topic></topic><topic position="1326,-642" text="Strategy 1: Recruit & Retain" id="29"><note><![CDATA[Recruit and retain top talent commensurate with identified organizational capacity requirements ]]></note><topic position="1444,-781" order="0" text="So that..." id="28"><note><![CDATA[(So that... we find and keep good people, So that... they are highly competent and can work well in agile teams... So that we can so the best work possible, for the least cost, in the shortest time for other NFPs, So that... NFPs can help those who need it.)]]></note></topic><topic position="1539,-742" order="1" text="Strategic Priority 1a: Recruitment" id="37"><note><![CDATA[1. Identify and use proactive and effective recruitment strategies, ]]></note><topic position="1573,-752" order="0" text="Modify App Form" shrink="true" id="238"><note><![CDATA[Recently, I saw a few job posts sent through different community
|
HR Mission: To provide a positive HR service experience for applicants and employees, and collaborate with departments to recruit, develop, support, and retain diverse and talented employees who are the key to Freeform’s reputation and success.]]></note></topic><topic position="-202,150" order="9" text="Freeform Hosting" id="16" fontStyle=";;;bold;;"/><topic position="197,50" order="0" text="Community Outreach" id="247" fontStyle=";;;bold;;"/><topic position="124,300" order="12" text="R&D" id="261" fontStyle=";;;bold;;"><topic position="230,289" order="0" text="Goals" id="263"/><topic position="239,313" order="1" text="Formulize" id="264"/></topic><topic position="-158,0" order="1" text="Probono" id="268"><topic position="-273,1" order="0" id="269"/></topic></topic><topic position="1558,-249" text="Strategy 2: Talent Development" id="31"><note><![CDATA[Strategy #2: Support the talent development of our employees through professional development and learning and through improved performance management.]]></note><topic position="1817,-260" order="0" text="Strategic Priority 2a: Personal Plans" id="113"><note><![CDATA[Each employee will have a personal Professional Development Plan. ]]></note></topic><topic position="1869,-236" order="1" text="Strategic Priority 2b: External learning matches organ. goals" id="114"><note><![CDATA[Each department of Freeform will identify areas that need development to meet overall FS goals. Eg. Project Manager may identify needed improvement in a development tool. Or... Bus. Dev. may identify a new need in NFP that FS could fill within mandate, if training were provided. Professional Dev. priority will be given to proposals for development with clear ROIs.]]></note></topic><topic position="1831,-212" order="2" text="Strategic Priority 2c: Learning Environment" id="116"><note><![CDATA[Learning and innovation are an essential part of providing the best solutions to NFPs. Cost effective internal learning and time to explore innovation will be encouraged, provided they conform with organization goal and clear ROI is demonstrated.]]></note></topic><topic position="1766,-188" order="3" text="So That..." id="112"><icon id="object_rainbow"/><note><![CDATA[(So that... our employees have improved skills and knowledge, So that... they are highly competent and can work well in agile teams and feel fulfilled and self actualized... So that we can so the best work possible, for the least cost, in the shortest time for other NFPs, So that... NFPs can help those who need it.)]]></note></topic></topic><topic position="1952,168" text="Strategy 4: Inclusive, Positive Environment" id="105"><note><![CDATA[Strategy #4: Foster a diverse, inclusive community with a positive work environment.]]></note><topic position="2229,142" order="0" text="Strategic Priority 4a:Feedback" id="119"><note><![CDATA[Conduct regular organizational feedback assessments and collaborate to improve the work climate]]></note></topic><topic position="2246,166" order="1" text="Strategic Priority 4b: Anti Harassment" id="120"><note><![CDATA[Educate employees on the prevention of harassment and discrimination and productive ways to resolve conflict]]></note></topic><topic position="2228,190" order="2" text="Strategic Priority 4c: Diversity" id="121"><note><![CDATA[Insure we promote our commitment to diversity and non-discrimination through our actions and in our outreach and employee recruitment efforts]]></note></topic><topic position="2178,214" order="3" id="253"/><topic position="2191,238" order="4" text="So That..." id="118"><icon id="object_rainbow"/><note><![CDATA[(So that... we can reflect the diverse populations we serve AND ensure everyone feels safe, respected and included, So that... we better serve our diverse client organizations AND we are a great place to work )]]></note></topic></topic><topic position="1326,-642" text="Strategy 1: Recruit & Retain" id="29"><note><![CDATA[Recruit and retain top talent commensurate with identified organizational capacity requirements ]]></note><topic position="1444,-781" order="0" text="So that..." id="28"><note><![CDATA[(So that... we find and keep good people, So that... they are highly competent and can work well in agile teams... So that we can so the best work possible, for the least cost, in the shortest time for other NFPs, So that... NFPs can help those who need it.)]]></note></topic><topic position="1539,-742" order="1" text="Strategic Priority 1a: Recruitment" id="37"><note><![CDATA[1. Identify and use proactive and effective recruitment strategies, ]]></note><topic position="1573,-752" order="0" text="Modify App Form" id="238"><note><![CDATA[Recently, I saw a few job posts sent through different community
|
||||||
groups and they seem to be taking our idea of screening candidates
|
groups and they seem to be taking our idea of screening candidates
|
||||||
to a next level. Not only they ask candidates to provide resume and
|
to a next level. Not only they ask candidates to provide resume and
|
||||||
cover letter + some project related information but also request
|
cover letter + some project related information but also request
|
||||||
@ -23,7 +23,7 @@ brought recently for "permissions to ask your references about you"
|
|||||||
in the online form so that we don't have to follow up with this
|
in the online form so that we don't have to follow up with this
|
||||||
later.
|
later.
|
||||||
|
|
||||||
Attached below a sample of such screening questions]]></note></topic><topic position="1614,-728" order="1" text="Strategy integrated with hiring plan" id="299"><note><![CDATA[Hiring plan should be comprehensive... not Agile or Iterative, in the sense that staff capacity and skill needs should be met within at least a six month plan. If three Drupal developers are needed, the hiring should be done concurrently to minimize HR costs and time.]]></note></topic></topic><topic position="1477,-700" order="2" text="Strategic Priority 1b: Hiring" id="39"><note><![CDATA[2. Continue to practice our unique Freeform hiring process that balances fit with the Freeform culture and best talent ]]></note></topic><topic position="1487,-647" order="3" text="Strategic Priority 1c: Onboarding" id="41"><note><![CDATA[ ]]></note><topic position="1592,-674" order="0" text="3 Month Onboarding Process" shape="elipse" id="275" bgColor="#adddf0"/><topic position="1570,-650" order="1" text="Tools & Guidelines" id="277"/><topic position="1552,-626" order="2" text="Mentoring" id="276"/></topic><topic position="1484,-569" order="4" text="Strategic Priority 1d: Incentives" id="43"><note><![CDATA[5. Explore incentives - monetary, benefits, fulfilment - needed to encourage top talent to work for and remain working for an NFP]]></note><topic position="1544,-596" order="0" text="Raises" id="274"/><topic position="1548,-572" order="1" text="Benefits" shape="elipse" id="270" bgColor="#adddf0"/><topic position="1577,-548" order="2" text="Rewards Message" id="45"><note><![CDATA[Create a total rewards message to encourage prospective and current employees to understand the full value of working for Freeform]]></note></topic></topic><topic position="1487,-518" order="5" text="Strategic Priority 1e: Offboarding" shrink="true" id="123"><note><![CDATA[Assess and address reasons why talented people leave Freeform]]></note></topic></topic><topic position="726,413" text="Business Development Plan" shape="rounded rectagle" id="156" fontStyle=";;#0d0826;;;" bgColor="#32e36a"><topic position="894,401" order="0" text="Goals" id="164"><topic position="975,422" order="0" text="Increase new clients" id="168"><topic position="1138,409" order="0" text="Academic Research" id="171"/><topic position="1118,433" order="1" id="177"/></topic><topic position="978,488" order="1" text="Support New Products" id="172"><topic position="1125,463" order="0" text="Formulize" id="179"/><topic position="1125,487" order="1" id="180"/><topic position="1125,511" order="2" id="181"/></topic><topic position="966,539" order="2" text="Support CiviCRM" id="255"/><topic position="976,602" order="3" text="Identify Opportunites" id="182"><topic position="1121,565" order="0" id="183"/><topic position="1121,589" order="1" id="184"/><topic position="1121,613" order="2" id="185"/><topic position="1121,637" order="3" id="186"/></topic></topic></topic><topic position="-621,395" text="Hosting NG Plan" shape="rounded rectagle" id="162" fontStyle=";;#0d0826;;;" bgColor="#32e36a"/><topic position="-613,99" text="Freeform IT Plan" shape="rounded rectagle" id="163" bgColor="#52e380"><topic position="-753,68" order="0" text="Fragile" id="17" fontStyle=";;;bold;;"/><topic position="-749,92" order="1" text="Tools" id="259"/><topic position="-760,116" order="2" id="260"/></topic><topic position="-548,-87" text="Project Teams" shape="rounded rectagle" shrink="true" id="9" bgColor="#52e380"><topic position="-668,-142" order="0" text="Projects 1-3" id="13"/><topic position="-668,-118" order="1" text="Projects 4-6" id="14"/><topic position="-672,-94" order="2" text="Projects 7 & 8" id="15"/><topic position="-696,-70" order="3" text="General Work" id="12"/><topic position="-686,-46" order="4" text="Learning Needs Plan" id="11"/></topic><topic position="-532,-250" text="Restructure" shape="rounded rectagle" shrink="true" id="33" bgColor="#52e380"><topic position="-685,-282" order="0" text="Client Centric Process" id="216"/><topic position="-692,-258" order="1" text="Freeform Project Process" id="217"/><topic position="-693,-234" order="2" text="Supportive Systems Plan" id="218"/></topic><topic position="-427,-329" text="Board and C Planning" shape="rounded rectagle" shrink="true" id="208" bgColor="#52e380"><topic position="-614,-384" order="0" text="Mission Statements" id="23"><note><![CDATA[In the absence of one clearly defined mission statement, we have reviewed various expressed mission statement as following
|
Attached below a sample of such screening questions]]></note></topic><topic position="1614,-728" order="1" text="Strategy integrated with hiring plan" id="299"><note><![CDATA[Hiring plan should be comprehensive... not Agile or Iterative, in the sense that staff capacity and skill needs should be met within at least a six month plan. If three Drupal developers are needed, the hiring should be done concurrently to minimize HR costs and time.]]></note></topic></topic><topic position="1477,-700" order="2" text="Strategic Priority 1b: Hiring" id="39"><note><![CDATA[2. Continue to practice our unique Freeform hiring process that balances fit with the Freeform culture and best talent ]]></note></topic><topic position="1487,-647" order="3" text="Strategic Priority 1c: Onboarding" id="41"><note><![CDATA[ ]]></note><topic position="1592,-674" order="0" text="3 Month Onboarding Process" shape="elipse" id="275" bgColor="#adddf0"/><topic position="1570,-650" order="1" text="Tools & Guidelines" id="277"/><topic position="1552,-626" order="2" text="Mentoring" id="276"/></topic><topic position="1484,-569" order="4" text="Strategic Priority 1d: Incentives" id="43"><note><![CDATA[5. Explore incentives - monetary, benefits, fulfilment - needed to encourage top talent to work for and remain working for an NFP]]></note><topic position="1544,-596" order="0" text="Raises" id="274"/><topic position="1548,-572" order="1" text="Benefits" shape="elipse" id="270" bgColor="#adddf0"/><topic position="1577,-548" order="2" text="Rewards Message" id="45"><note><![CDATA[Create a total rewards message to encourage prospective and current employees to understand the full value of working for Freeform]]></note></topic></topic><topic position="1487,-518" order="5" text="Strategic Priority 1e: Offboarding" id="123"><note><![CDATA[Assess and address reasons why talented people leave Freeform]]></note></topic></topic><topic position="726,413" text="Business Development Plan" shape="rounded rectagle" id="156" fontStyle=";;#0d0826;;;" bgColor="#32e36a"><topic position="894,401" order="0" text="Goals" id="164"><topic position="975,422" order="0" text="Increase new clients" id="168"><topic position="1138,409" order="0" text="Academic Research" id="171"/><topic position="1118,433" order="1" id="177"/></topic><topic position="978,488" order="1" text="Support New Products" id="172"><topic position="1125,463" order="0" text="Formulize" id="179"/><topic position="1125,487" order="1" id="180"/><topic position="1125,511" order="2" id="181"/></topic><topic position="966,539" order="2" text="Support CiviCRM" id="255"/><topic position="976,602" order="3" text="Identify Opportunites" id="182"><topic position="1121,565" order="0" id="183"/><topic position="1121,589" order="1" id="184"/><topic position="1121,613" order="2" id="185"/><topic position="1121,637" order="3" id="186"/></topic></topic></topic><topic position="-621,395" text="Hosting NG Plan" shape="rounded rectagle" id="162" fontStyle=";;#0d0826;;;" bgColor="#32e36a"/><topic position="-613,99" text="Freeform IT Plan" shape="rounded rectagle" id="163" bgColor="#52e380"><topic position="-753,68" order="0" text="Fragile" id="17" fontStyle=";;;bold;;"/><topic position="-749,92" order="1" text="Tools" id="259"/><topic position="-760,116" order="2" id="260"/></topic><topic position="-548,-87" text="Project Teams" shape="rounded rectagle" shrink="true" id="9" bgColor="#52e380"><topic position="-668,-142" order="0" text="Projects 1-3" id="13"/><topic position="-668,-118" order="1" text="Projects 4-6" id="14"/><topic position="-672,-94" order="2" text="Projects 7 & 8" id="15"/><topic position="-696,-70" order="3" text="General Work" id="12"/><topic position="-686,-46" order="4" text="Learning Needs Plan" id="11"/></topic><topic position="-532,-250" text="Restructure" shape="rounded rectagle" shrink="true" id="33" bgColor="#52e380"><topic position="-685,-282" order="0" text="Client Centric Process" id="216"/><topic position="-692,-258" order="1" text="Freeform Project Process" id="217"/><topic position="-693,-234" order="2" text="Supportive Systems Plan" id="218"/></topic><topic position="-427,-329" text="Board and C Planning" shape="rounded rectagle" shrink="true" id="208" bgColor="#52e380"><topic position="-614,-384" order="0" text="Mission Statements" id="23"><note><![CDATA[In the absence of one clearly defined mission statement, we have reviewed various expressed mission statement as following
|
||||||
|
|
||||||
Objects of Incorporation in Letters Patent
|
Objects of Incorporation in Letters Patent
|
||||||
The objects of the Corporation are:To provide solutions that facilitate the effective use of information technology in not-for-profit, non-governmental, and charitable organizations throughout Canada, to support and improve their mission delivery.
|
The objects of the Corporation are:To provide solutions that facilitate the effective use of information technology in not-for-profit, non-governmental, and charitable organizations throughout Canada, to support and improve their mission delivery.
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
/* eslint-disable import/prefer-default-export */
|
/* eslint-disable import/prefer-default-export */
|
||||||
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { expect } from '@jest/globals';
|
import { expect } from '@jest/globals';
|
||||||
|
import { diff } from 'jest-diff';
|
||||||
import Importer from '../../../src/components/import/Importer';
|
import Importer from '../../../src/components/import/Importer';
|
||||||
import XMLSerializerFactory from '../../../src/components/persistence/XMLSerializerFactory';
|
import XMLSerializerFactory from '../../../src/components/persistence/XMLSerializerFactory';
|
||||||
import { parseXMLFile } from '../export/Helper';
|
import { parseXMLFile } from '../export/Helper';
|
||||||
@ -11,11 +13,14 @@ export const exporterAssert = async (testName: string, importer: Importer) => {
|
|||||||
|
|
||||||
// Load mindmap DOM..
|
// Load mindmap DOM..
|
||||||
const mindmapPath = path.resolve(__dirname, `./expected/${testName}.wxml`);
|
const mindmapPath = path.resolve(__dirname, `./expected/${testName}.wxml`);
|
||||||
const mindmapMapDocument = parseXMLFile(mindmapPath, 'text/xml');
|
const mindmapDocument = parseXMLFile(mindmapPath, 'text/xml');
|
||||||
|
const serializer = XMLSerializerFactory.createInstanceFromDocument(mindmapDocument);
|
||||||
// Convert to mindmap...
|
const mindmapExpect = serializer.loadFromDom(mindmapDocument, testName);
|
||||||
const serializer = XMLSerializerFactory.createInstanceFromDocument(mindmapMapDocument);
|
|
||||||
const mindmapExpect = serializer.loadFromDom(mindmapMapDocument, testName);
|
|
||||||
|
|
||||||
|
// Compare with expected...
|
||||||
|
if (actualMindmap !== mindmapExpect) {
|
||||||
|
const diffResult = diff(actualMindmap, mindmapExpect);
|
||||||
|
console.log(diffResult);
|
||||||
expect(actualMindmap).toEqual(mindmapExpect);
|
expect(actualMindmap).toEqual(mindmapExpect);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user