All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ide-entity.js.serializer.js Maven / Gradle / Ivy

/*
 * Copyright (c) 2010-2019 SAP and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   SAP - initial API and implementation
 */
function createModel(graph) {
	var model = [];
	model.push('\n');
	model.push(' \n');
	var parent = graph.getDefaultParent();
	var childCount = graph.model.getChildCount(parent);

	for (var i=0; i\n');
			
			var propertyCount = graph.model.getChildCount(child);
			if (propertyCount > 0) {
				for (var j=0; j\n');
				}
			}
			model.push('  \n');
		} else {
			var relationName = child.name ? child.name : child.source.parent.value.name+'_'+ child.target.parent.value.name;
			model.push('  \n');
			model.push('  \n');
		}
	}
	model.push(' \n');
	
	var enc = new mxCodec(mxUtils.createXmlDocument());
	var node = enc.encode(graph.getModel());
	var mxGraph = mxUtils.getXml(node);
	model.push(' '+mxGraph);
	model.push('\n');
	
	return model.join('');
}

function createModelJson(graph) {
	var root = {};
	root.model = {};
	root.model.entities = [];
	var parent = graph.getDefaultParent();
	var childCount = graph.model.getChildCount(parent);
	var compositions = {};
	
	for (var i=0; i 0) {
				for (var j=0; j




© 2015 - 2025 Weber Informatics LLC | Privacy Policy