blob: 10e8a1e0d986326d105dc3bbcef5eb60c1b09d85 [file] [log] [blame]
//------------------------------------------------------------------------------
// Copyright (c) 2005, 2006 IBM Corporation 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:
// IBM Corporation - initial implementation
//------------------------------------------------------------------------------
var elementUrls = new Array();
function buildProcessElementBreadCrumb(url, backPath) {
var linksText = "";
var start = 0;
var viewFrame = getViewFrame();
if ( viewFrame != null && viewFrame.getBreadcrumbsHtml ) {
linksText = viewFrame.getBreadcrumbsHtml(url);
if ( linksText != null && linksText != "" ) {
start = 999;
} else {
linksText = viewFrame.getBreadcrumbsHtmlByGuid(par_proc);
start = 1;
}
}
//alert(start);
var paths = par_path.split(",");
if ( start < paths.length ) {
var path = "";
for (var i = 0; i < paths.length; i++) {
var guid = paths[i];
if ( path != "" ) path += ",";
path += guid;
if ( i < start ) continue;
var text = getProcessElementLinkHtmlFromId(guid, path, backPath);
if ( text != "" ) {
if ( linksText != "" ) {
linksText += "&nbsp;>&nbsp";
}
linksText += text;
}
}
}
//linksText += getProcessElementLinkHtmlFromId(paths[paths.length-1], par_path, backPath);
//alert(linksText);
document.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">");
document.write("<tr><td align=\"right\">" + linksText + "</td><tr>");
document.write("</table>");
}
function getProcessElementLinkHtmlFromId(guid, elementPath, backPath) {
var str = "";
var item = elementUrls[guid];
if ( item != null ) {
var text = item[0];
var url = backPath + item[1];
// escape the quotes
url = url.replace(/'/g, "\\'");
url = url.replace(/\"/g, "\\\"");
str = "<a href=\"javascript:location.href=getActivityItemUrl('" + url + "', '" + par_proc + "', '" + elementPath + "', '');\">" + text + "</a>";
}
return str;
}
// dynamically generated element url info from RMC publishing service