Jump to: navigation, search

Stardust/Enhancing and Embedding Stardust/Browser Modeler/Embedding the Browser Modeler

Embedding Concepts

Prerequisites

Embedding the Outline

Managing Views

Define the View Manager via

define([ 'm_htmlViewManager' ], function(m_jsfViewManager) {
	return {
		viewManager: {
			id : "htmlViewManager",
			provider : m_htmlViewManager,
		},
	};
});

The sample implementation of a purely HTML-based view manager for the Reference Implementation is

define([ "m_utils", "m_extensionManager" ], function(m_utils,
		m_extensionManager) {
	return {
		create : function() {
			return new HtmlViewManager();
		}
	};
 
	/**
	 * 
	 */
	function HtmlViewManager() {
		/**
		 * 
		 */
		HtmlViewManager.prototype.toString = function() {
			return "Lightdust.HtmlViewManager";
		};
 
		/**
		 * 
		 */
		HtmlViewManager.prototype.openView = function(viewId, queryString,
				objectId) {
			var extension = m_extensionManager.findExtensions("view", "viewId",
					viewId)[0];
 
			m_utils.debug("Extension: " + extension.viewHtmlUrl + " "
					+ extension.viewJavaScriptUrl);
 
			jQuery("#viewHeader").empty();
			jQuery("#viewHeader").append(extension.viewLabel);
			jQuery("#viewAnchor").attr("src", extension.viewHtmlUrl + "?" + queryString);
		};
	}
});

to inject opened Views in an IFrame, e.g.

<iframe id="viewAnchor" width="1650" height="800">

Reference Implementation

A Reference Implementation for a standalone editor which shows the above concepts can be obtained from the @ project in the Stardust Git. A Utility JAR has to be build with this project and to be injected into your Stardust deployment.