%--
Copyright (C) 2004-2009 by Autodesk, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of version 2.1 of the GNU Lesser
General Public License as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--%>
<%@ Page language="c#" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Collections.Specialized" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Web" %>
<%
Response.Charset = "utf-8";
MgLocalizer.SetLocalizedFilesPath(Request.ServerVariables["APPL_PHYSICAL_PATH"] + "..\\localized\\");
GetRequestParameters();
try
{
InitializeWebTier();
MgUserInformation cred = new MgUserInformation(session);
cred.SetClientIp(GetClientIp(Request));
cred.SetClientAgent(GetClientAgent());
//connect to the site and get a feature service and a resource service instances
MgSiteConnection site = new MgSiteConnection();
site.Open(cred);
//Get the MgWebLayout object
MgResourceService resourceSrvc = (MgResourceService)site.CreateService(MgServiceType.ResourceService);
MgResourceIdentifier webLayoutResId = new MgResourceIdentifier(webLayoutId);
MgWebLayout webLayout = new MgWebLayout(resourceSrvc, webLayoutResId);
MgWebTaskPane taskPane = webLayout.GetTaskPane();
String taskPaneUrl = taskPane.GetInitialTaskUrl();
String vpath = GetSurroundVirtualPath(Request);
if (taskPaneUrl == null || taskPaneUrl.Length == 0)
{
taskPaneUrl = "gettingstarted.aspx";
}
String templ = LoadTemplate(Request, "../viewerfiles/taskframe.templ");
String[] vals = {
vpath + "tasklist.aspx",
locale,
taskPaneUrl,
session,
HttpUtility.UrlEncode(webLayoutId),
dwf.ToString(NumberFormatInfo.InvariantInfo),
locale
};
Response.Write(Substitute(templ, vals));
}
catch (MgException exc)
{
OnError(MgLocalizer.GetString("TASKS", locale), exc.GetMessage());
return;
}
catch (Exception ne)
{
OnError(MgLocalizer.GetString("TASKS", locale), ne.Message);
return;
}
%>