Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BO Enterprise XI, Viewer Hyperlink from Infoview error 1

Status
Not open for further replies.

dehinde

MIS
Mar 31, 2006
3
0
0
AT
We are running BOE XI on a WindowsServer 2003 box using IIS 6. The clients are all WinXP.
I have used the Hyperlink (Add place holder) in the "send to email" destination in Infoview successsfully to have an instance of a report mailed to users. We also use SSO. However, after a recent update (latest BOXI and Common XI update)the links no longer work. I have tried everything recommended by BO to no avail. On clicking a link, e.g


the browser returns:

"An error has occurred: An unknown error has occurred."

How can I troubleshoot the problem? Or is there a known solution? I believe the problem is with openDocument.aspx in the scrript directory of Infoview, but I don't know where to start and would be grateful for any assistance
 
Here is the source of original openDocument.aspx. I have had similar problem and noticed that my openDocument.aspx was corrupted. Make a backup cpyu and paste the follwoing code in openDocument.aspx and see if it helps.
------------
<%@ LANGUAGE="JSCRIPT" CODEPAGE=65001 %>
<%
Response.Expires = -1;
Response.ContentType = "text/html";
Response.Charset = "UTF-8";
%>
<!--#include file="tools/utils.aspx" -->
<%
var bFindCharset = true; //false: no guessing is done with charset for the incoming query string, use the one defined by sCharset variable
//true: will try to read an optionnal parameter &charset= to determine charset encoding
var sForceCharset = "UTF-8"; //charset by default, change this to support legacy OpenDocument URLs not url-encoded with UTF-8
//empty string "" would mean to use the default charset on this platform
var sCharset = new String(sForceCharset);
if (bFindCharset) {
var sCharsetTemp = "" + Request.QueryString("charset");
if (sCharsetTemp != "undefined") { //if the param exists it MUST have a valid charset name value, otherwise the behavior is not certain...
sCharset = sCharsetTemp;
}
}

//switch to the corresponding codepage for reading query string parameters
//currently only a limited number of codepage are supported...
if (sCharset.toLowerCase() == "iso-8859-1") Session.CodePage = 1252;
else if (sCharset.toLowerCase() == "shift-jis") Session.CodePage = 932;
else if (sCharset.toLowerCase() == "iso-2022-kr") Session.CodePage = 949;
else if (sCharset.toLowerCase() == "gb2312") Session.CodePage = 936;
else if (sCharset.toLowerCase() == "big5") Session.CodePage = 950;
else Session.CodePage = 65001;

//openDocument.asp
//see spec bluecanal
/////////////////////////////////////////////////////////////////////////////
//Description :
//Properties :
/////////////////////////////////////////////////////////////////////////////

/* Here is the exhaustive list of supported query string parameter as defined in latest spec (CB0)
*
* sRepoType (legacy: RepoType)
* sRepo (specific CB0)
* sPath (specific CB0)
* sDocName (legacy: sDoc)
* sAlternateDocName (secific CB0)
* sType (legacy: sTyp, legacy values: "W"qy, "R"ep, "B"qy)
* sIDType (specific CB0, can be CUID, GUID, RUID, ParentID, InfoObjectID (default))
* iDocID
* sReportName (legacy: sReport ?)
* sPartContext (specific CB0)
* sReportPart (specific CB0)
* sReportMode
* sInstance (specific CB0)
* lsM*, lsR*, lsS* and lsC*
* sRefresh (legacy: Refresh, sForceRefresh)
* NAII
* sOutputFormat
* sViewer
* sWindow
* sMode
* Page (only legacy ?)
* sKind (specific CB1)
* token
* sf
* buttonrefresh
* buttonexport
* buttonprint
*
*/

/*
//From this list we define an array containing all authorized parameters.
//We removed the implicit parameters passed to IV (docname, id, repotype, doctype)
//and the parameter already handled by this page's logic (ls* for prompts and sRefresh)
var stAutorizedParams = new Array(
// "sRepoType", "RepoType",
"sRepo",
"sPath",
// "sDocName", "sDoc",
"sAlternateDocName",
// "sType", "sTyp",
// "sIDType", // now the ID type for crystal is stored inside the id
// "iDocID",
"sReportName", "sReport",
"sPartContext",
"sReportPart",
"sReportMode",
"sInstance",
// "lsM*", "lsR*", "lsS*", "lsC*",
// "sRefresh", "Refresh", "sForceRefresh",
"NAII",
"sOutputFormat",
"sViewer",
"sWindow", // is handled here but passed to viewer anyway (in case of the viewer wants to know it is opened in a window)
"sMode",
// "sEntry", // for future usage
// "sKind",
// "token",
"Page",
"sf",
"buttonrefresh",
"buttonexport",
"buttonprint"
);
*/

var stHandledParams = new Array(
"sRepoType", "RepoType",
"sDocName", "sDoc",
"sType", "sTyp",
"sIDType", // now the ID type for crystal is stored inside the id
"iDocID",
"lsM*", "lsR*", "lsS*", "lsC*",
"sRefresh", "Refresh", "sForceRefresh",
"sEntry", // for future usage
"sKind",
"token"
);

//get the corresponding hashtable for faster lookup (+lowercase keys)
var htHandledParams = new Array(stHandledParams.length);
for (var ii = 0 ; ii < stHandledParams.length ; ii++) {
htHandledParams[stHandledParams[ii].toLowerCase()] = "Y";
}

//get parameters
var sDocName = "" + Request.QueryString("sDoc");
if(sDocName == "undefined" || sDocName == "") sDocName = "" + Request.QueryString("sDocName");
if(sDocName == "undefined" || sDocName == "") sDocName = "untitled";

//special CB0, Crystal uses different ID types. Read this value here
var sIDType = "" + Request.QueryString("sIDType"); if (sIDType == "undefined") sIDType = "";
sIDType = sIDType.toLowerCase();

var sDocID = "" + Request.QueryString("iDocID");
if(sDocID == "undefined" || sDocID == "") sDocID = "0"; //default
var iDocID = 0;
if (sIDType != "cuid"
&& sIDType != "guid"
&& sIDType != "ruid"
&& sIDType != "parentid"
&& strIsNumeric(sDocID)) { //this is not a crystal special ID type, but a normal numeric ID (BO or InfoObjectID)
iDocID = sDocID - 0;
sDocID = "" + iDocID;
}

var sDocType = "" + Request.QueryString("sType");
if(sDocType == "undefined" || sDocType == "") sDocType = "" + Request.QueryString("sTyp");
if(sDocType == "undefined" || sDocType == "") sDocType = "" + Request.QueryString("sDocType");

//check parameter type
if(sDocType == "W") sDocType = "wqy";
else if(sDocType == "R") sDocType = "rep";
else if(sDocType == "B") sDocType = "bqy";

//not used but here for consistancy
var documentDomain = "" + Request.QueryString("sRepo");
if(documentDomain == "undefined" || documentDomain == "") documentDomain = "Document";

var documentRepoType = "" + Request.QueryString("RepoType");
if(documentRepoType == "undefined" || documentRepoType == "") documentRepoType = "" + Request.QueryString("sRepoType");
if(documentRepoType == "undefined" || documentRepoType == "") documentRepoType = "0";

var iDocRepoType = "0";
//not sure if the repo is C,M,I or corporate etc
if(documentRepoType == "Inbox" || documentRepoType == "inbox" || documentRepoType == "I" || documentRepoType == "1")
documentRepoType = "1";
else if(documentRepoType == "personal" || documentRepoType == "Personal" || documentRepoType == "M" || documentRepoType == "2")
documentRepoType = "2";

//we use the sIDType param to know what kind of ID is the resource
//the documentRepoType will depend on that:
//CUID, GUID, RUID or ParentID => documentRepoType = "10"
//others (unspecified or InfoObjectID) => documentRepoType = "0", assimiled to a BOBJ corporate resource
if ( sIDType == "cuid" ||
sIDType == "guid" ||
sIDType == "ruid" ||
sIDType == "parentid") {
documentRepoType = "10"; //special faked repotype for this type of resource
sDocID = sIDType + "," + sDocID; //a composite ID to remind ID type: <sIDType>,<sDocID>. Will be parsed by crystal viewers
}

else documentRepoType = "0";

//other values can go here

//These I am not sure of
//var documentReport = "" + Request.QueryString("Report");
//var documentPage = "" + Request.QueryString("Page");
//var documentHide = "" + Request.QueryString("Hide");

//refresh
var bRefresh = false;
var sRefresh = "" + Request.QueryString("Refresh");
if(sRefresh == "undefined" || sRefresh == "") sRefresh = "" + Request.QueryString("sRefresh");
if(sRefresh == "undefined" || sRefresh == "") sRefresh = "" + Request.QueryString("sForceRefresh");

if(sRefresh != "undefined" || sRefresh != "") bRefresh = (sRefresh == "Y" || sRefresh == "yes")? true : false;

var sDocToken = ""; //null presumably

var sKind = "" + Request.QueryString("sKind");
var token = "" + Request.QueryString("token");

/*
open doc with prompts feature:
- check for lsS or lsM
- we do this here and then encode the URL
- the prompts need to be regathered at the viewer end using the same technique
*/
//===============PROMPT GATHERING=======================//
//var hasNAII = false;
var prompts = "";
var sOtherParams = "";
var e = Request.QueryString.GetEnumerator();
while( e.MoveNext() )
{
var name = "" + e.Current;
var params = Request.QueryString.GetValues(name);
if ((name.indexOf("lsS")==0) || (name.indexOf("lsM")==0) || (name.indexOf("lsC")==0))
{
if (prompts != "") prompts += "&"; //add & for correct url
if (sDocType == "wid")
{ //wid use a ; seperated list
prompts += URLEncodeUTF8(name) + "="; //convert to ; seperated list
for (var i = 0; i < params.length; i++)
{
//Must encode ; character to get the whole QueryString encoded
prompts += (i > 0 ? URLEncodeUTF8(";") : "") + URLEncodeUTF8(params);
}
}
else
{
for (var i = 0; i < params.length; i++)
{
prompts += (i > 0 ? "&" : "") + URLEncodeUTF8(name) + "=" + URLEncodeUTF8(params);
}
}
}
/*
else if (name.indexOf("NAII") > -1)
{
hasNAII = true; //related to prompts only, has no value
}
*/
else if (name.indexOf("lsR")==0) { //added for CB0, range prompt (eg: &lsRCity=[Austin..Chicago])
prompts += (prompts != "" ? "&" : "") + URLEncodeUTF8(name) + "=" + URLEncodeUTF8(""+Request.QueryString(name));
}
else if (typeof(htHandledParams[name.toLowerCase()]) == "undefined") { //don't pass already handled params
sOtherParams += (sOtherParams != "" ? "&" : "") + URLEncodeUTF8(name) + "=" + URLEncodeUTF8(""+Request.QueryString(name));
}
}//eof enumeration

//build the uid in the infoview style:
//uid is under the form <name>,<id>,<repotype>,<doctype>,<SDK token>. Ex : "3Reports_2onlyhavesections,39614,0,rep,"
var sDocUID = sDocName + C_SEP + sDocID + C_SEP + documentRepoType + C_SEP + sDocType + C_SEP + sDocToken + C_SEP + sKind;

//cmdP1 = the docuid
var sRespURL = "documentXML.aspx?token=" + URLEncodeUTF8(token) + "&cmdP1=" + URLEncodeUTF8(sDocUID);

//cmdP2 has the prompts and other parameters
var cmdP2 = prompts /* + (hasNAII ? "&NAII=" : "") */; //URL chunk for prompts and NAII
if (sOtherParams != "" && cmdP2 != "") cmdP2 += "&";
cmdP2 += sOtherParams;

//cmdP2 can be used for the extra parameter values like prompts, report and page
//NB: a new type of URL redirection can now be specified using askPromptView for cmd
if (prompts != "")
{
sRespURL += "&cmd=askPromptView&cmdBlock=all&cmdP2=" + URLEncodeUTF8(cmdP2);
}
else
{
if(bRefresh)
{
sRespURL += "&cmd=askView&cmdBlock=all&cmdP2=" + URLEncodeUTF8((cmdP2 == "" ? "" : (cmdP2 + "&")) + "sRefresh=yes&refresh=Y");
}
else
{
sRespURL += "&cmd=askView&cmdBlock=all&cmdP2=" + URLEncodeUTF8(cmdP2); //need cmdP2 for other parameters
}
}
//saves the real document URL into HTTP session, in case we have to login
Session("extRedirectionURL") = sRespURL;

Session.CodePage = 65001; //re-set the codepage to UTF8 for writing this page result
%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
</HEAD>
<SCRIPT language='javascript1.3'>
function MM_openBrWindow(theURL, winName, features, bUnique) {
var _winName = winName;
if (!bUnique) {
var dtemp = new Date();
_winName = _winName + dtemp.getTime();
}
pop = window.open(theURL, _winName, features);
pop.opener = self;
}

function getQueryParamValue(strQueryString, strParamName) {
var strRet = "";
if("undefined" != typeof(strQueryString) && strQueryString != null) {
var arrQueryParam = strQueryString.split('&');
for (var i=0;i<arrQueryParam.length;i++) {
var strName = arrQueryParam;
var strValue = "";
var iPos = arrQueryParam.indexOf('=');
if (iPos>=0) {
strName = arrQueryParam.substring(0, iPos);
strValue = arrQueryParam.substring(iPos + 1);
}
if (strParamName == strName) {
strRet = strValue;
break;
}
}
}
return strRet;
}

function findParent() {
<%
var sWindow = Request.QueryString("sWindow"); if (sWindow == null) sWindow = "Same";
var bNewWin = false;
if (sWindow != "Same") {
bNewWin = true;
//if sWindow != New then the provided string is the identifier of the new window
}

if (bNewWin) {
%>
MM_openBrWindow('<%=sRespURL %>', '<%=sWindow %>', '', <%=(sWindow == "New" ? "false" : "true") %>); //toolbar=yes,location=yes,status=yes,resizable=yes,width=' + width + ',height=' + height, false);
history.back();
<%
}
else {
%>
/*
var found = false;
var frameToFind = "XML.aspx";
var obj = window;
try {
while (!found && typeof(obj.parent) != "undefined" && obj.parent != obj) { //escape clause please
var loc = "" + obj.parent.document.location;
if (loc.indexOf(frameToFind) < 0) {
obj = obj.parent;
}
else {
found = true;
}
}
}
catch(e) { //cross domain issue ? assume that this URL is like an external one
found = false;
}

//if test needed
if (found) { //open in parent ie documentXML or myInfoviewXML frame level
obj = obj.parent;
if (("" + obj.document.location.href).indexOf("documentXML.aspx") > 0) {
//we are in documentXML frameset, let's stack the current documentXML URL (including possibly new token)
//to allow backward navigation (close) history
//we ask the action header bar the real UID of the (previously) opened doc
if (typeof(obj.parent.push) != "undefined" && typeof(obj.getDocUID) != "undefined") { //the stack should be defined in webiHome.jsp
//calculate the URL, knowing the current docUID, and asking viewer for the last storage token
var curDocUID = obj.getDocUID();
var sURL = "documentXML.aspx?ctxLayout_last=fromSession&cmdBlock=all&cmd=askView&cmdP1=" + URLEncodeUTF8(curDocUID); //here is the real URL to come back to the currently opened document
obj.parent.push(sURL, obj.timeStamp); //push this URL into the stack, and stamp it to help manage browser's back/forward
}
}
if (typeof(obj.asyncOpenDocument) != "undefined") {
var bIE = (document.all ? true : false);
var sViewerURL = obj.frames[1].location.href;
var sViewType = getQueryParamValue(sViewerURL, "ViewType") ;
obj.asyncOpenDocument('<%=sRespURL%>'); //asynchronous launch of URL
if (!bIE || sViewType != "P") { //Don't do back if the document is wid or rep and viewed on PDF on IE
//FR 103137, apparently acroread on IE is already doing this...
history.back();
}
}
else obj.document.location.href = '<%=sRespURL%>';
}
else { //this should handle the external URL case ...
//document.location.href = '<%="/" + Application("wiroot") + "/scripts/login/topStart.html"%>';
document.location.replace('<%="/" + Application("wiroot") + "/scripts/login/topStart.html"%>');
}
*/
var mywin = window;
while (mywin != mywin.parent && mywin.parent && (mywin.name == 'ceframe' || mywin.name == 'documentFrame000hb')) {
mywin = mywin.parent;
}
mywin.document.location.replace("<%=sRespURL%>");
<%
}
%>
}
</SCRIPT>
<BODY onload='findParent();'></BODY>
</HTML>

------------
 
Thank you very much, the code worked..I guess the folks at Business Objects should be informed about the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top