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

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

There is a newer version: 4.0.0
Show newest version
/*
 * 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 createSchema(graph) {
	var schema = [];
	schema.push('\n');
	schema.push(' \n');
	var parent = graph.getDefaultParent();
	var childCount = graph.model.getChildCount(parent);

	for (var i=0; i\n');
			
			var columnCount = graph.model.getChildCount(child);

			if (columnCount > 0) {
				for (var j=0; j\n');
					} else {
						schema.push('    \n');
					}
				}
			}
			schema.push('  \n');
		} else {
			schema.push('  \n');
			schema.push('  \n');
		}
	}
	schema.push(' \n');
	
	var enc = new mxCodec(mxUtils.createXmlDocument());
	var node = enc.encode(graph.getModel());
	var model = mxUtils.getXml(node);
	schema.push(' '+model);
	schema.push('\n');
	
	return schema.join('');
}

function createSchemaJson(graph) {
	var root = {};
	root.schema = {};
	root.schema.structures = [];
	var parent = graph.getDefaultParent();
	var childCount = graph.model.getChildCount(parent);

	for (var i=0; i 0) {
				for (var j=0; j




© 2015 - 2025 Weber Informatics LLC | Privacy Policy