Académique Documents
Professionnel Documents
Culture Documents
using
using
using
using
using
using
using
using
System.ComponentModel;
System.Data;
System.Drawing;
System.Web;
System.Web.SessionState;
System.Web.UI;
System.Web.UI.WebControls;
System.Web.UI.HtmlControls;
namespace WmsIDM
{
/// <summary>
/// Summary description for DocView.
/// </summary>
public class DocView : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
try
{
// Parse Query string get the values
string libraryName = Request.QueryString["Library"];
int idmDocId = Convert.ToInt32(Request.QueryString["DocId"]);
short pageNum = Convert.ToInt16(Request.QueryString["Page"]);
if (pageNum <= 0) pageNum = 1;
string qryStr = Request.QueryString.ToString();
string
string
string
string
if (idmDocProperties != null)
{
idmDocFormat = idmDocProperties["F_DOCFORMAT"].Value.ToString() ;
idmDocLocation = idmDocProperties["F_DOCLOCATION"].Value.ToString();
}
}
catch(Exception propertyException)
{
string errMsg = propertyException.Message;
}
string fnWebNavigateVer = "FNWEBNAVIGATE=1.0" + '\u000A';
string applicationURL = "APPLICATIONURL=" + idmWebServiceURL + "/" + '\u000A';
string navigatorURL = "NAVIGATORURL=" + idmWebServiceURL + "/DocView.aspx" +
'\u000A';
string propertiesURL = "PROPERTIESURL=" + idmWebServiceURL +
"/AnnotationContent.aspx" + '\u000A';
string securityURL = "SECURITYURL=" + idmWebServiceURL + "/AnnoSecInfo.aspx" +
'\u000A';
libraryName = "LIBRARYNAME=" + libraryName + '\u000A';
string systemType = "SYSTEMTYPE=1" + '\u000A';
string docIdStr = "DOCUMENTID=" + idmDocId.ToString() + '\u000A';
string pageStr = "STARTPAGE=" + pageNum.ToString() + '\u000A';
string pageCountStr = "PAGECOUNT=" + pageCount.ToString() + '\u000A';
string docCanAnnotate = "false";
string logonIdStr = "LOGONID=" + logonId + '\u000A';
if (idmDocument.GetState(IDMObjects.idmDocState.idmDocCanAnnotate)) docCanAnnotate =
"true";
docCanAnnotate = "DOCSTATECANANNOTATE=" + docCanAnnotate + '\u000A';
// Get the Content URL. Not Sure of what to set????????????????????????
string contentQueryStr = "LogonId=" + logonId + "&DocId=" + idmDocId.ToString() +
"&Page=" + pageNum.ToString();
string contentURL = "CONTENTURL=" + idmWebServiceURL + "/DocContent.dll" + '\u000A';
Response.Expires = -1;
Response.ContentType = "application/x-FileNETNavigate";
Response.AppendHeader("Content-disposition", "filename=" + "DocView.fni" + ";");
Response.Write(fnWebNavigateVer);
Response.Write(applicationURL);
Response.Write(navigatorURL);
Response.Write(contentURL);
Response.Write(propertiesURL);
Response.Write(securityURL);
Response.Write(libraryName);
Response.Write(systemType);
Response.Write(docIdStr);
Response.Write(pageStr);
Response.Write(pageCountStr);
Response.Write(docCanAnnotate);
Response.Write(logonIdStr);
Response.Write(aspSessionId);
Response.Write(sessionCookie);
if (idmDocument !=
null)System.Runtime.InteropServices.Marshal.ReleaseComObject(idmDocument);
if (idmDoc != null)System.Runtime.InteropServices.Marshal.ReleaseComObject(idmDoc);
if (idmLibrary !=
null)System.Runtime.InteropServices.Marshal.ReleaseComObject(idmLibrary);
}
catch(Exception exception)
{
string errMsg = exception.Message;
Response.AddHeader("cache-control", "no-cache");
Response.AddHeader("Pragma", "no-cache");
Response.Status = "200 OK";
Response.ContentType = "text/HTML";
Response.Write(errMsg);
Response.End();
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}