Hello
(I already sent the following question to worksite devnet support, I'm also posting here in case someone already had a similar issue).
I have a problem that seems related to the WebRole object in worksite web 8.0.
Here is the detail of what I’m trying to achieve.
I have some specific aspx pages, deployed in the worksite web 8.0. The purpose of these pages is to generate a document and insert it into a specific folder picked by the user through one of the pages.
Initially, these pages are called from within the worksite web, more specifically from a Connector (a Connector in a workspace).
So when these pages are displayed, the worksite web SessionContext object is properly initialized, and everything goes fine from here.
My requirements is that this connector must be available for the users directly in Filesite.
So what I did is basically:
- Build an ICommand that display a web page that contains the appropriate connectors. The page is displayed in outlook directly.
- Since the trusted login is authorized in this environment, I can get the connector displayed properly for any workspace.
Then, when running the pages from Outlook/Filesite, I realized that the SessionContext object was not properly initialized (SessionContext.Current.Session was null for example).
So, in the first page called from the connector, I added the following code to initialize the SessionContext object:
if (SessionContext.Current.Session == null)
{
IntPtr UToken;
UToken = ((HttpWorkerRequest)((IServiceProvider)Context).GetService(typeof(HttpWorkerRequest))).GetUserToken();
SessionContext.Current.ServerName = "SRVFILESITE";
SessionContext.Current.Login(UToken, false);
}
It solved my authentication problem, but from here I get an exception on the following code :
DoRefile refDoc = new DoRefile();
bool reussi = refDoc.DoRefileDocument(oIManFolder,oIManDocument);
oIManDocument.Update();
oIManFolder.Update();
oIManFolder and oIManDocument are instanciated properly. The exception I get is :
at iManage.WorkSite.IManDatabase.GetUser(String userName)
at iManage.WorkSite.Web.SessionContext.RefreshWebRole()
at iManage.WorkSite.Web.Profiling.DocumentEditProfile..ctor(Boolean allowReadOnly)
at iManage.WorkSite.Web.UI.DoRefile.DoRefileDocument(IManFolder parentFolder, IManDocument childDoc)
at ASP.merge_aspx.__Render__control1(HtmlTextWriter __output, Control parameterContainer)
in C:\Program Files\Interwoven\WorkSite\Web\LPAdeveloppements\fusion\merge.aspx:line 171:
[NRTUser ][GetUser ]"UserName" is null
The exception precisely occurs on the line oIManFolder.Update();
I tried to call :
SessionContext.Current.Refresh() and SessionContext.RefreshWebRole()
But it didn’t help.
I guess there must be something wrong or missing in my way of initializing the SessionContext object. But I cannot find any documentation about the worksite web API (is there one ?) and I cannot solve my problem.
Can you please have a look at the above code and let me know what’s is wrong or missing ? Or if you can determine what is the cause of this Exception and let me know how to fix it, it would be really great.
Many thanks in advance.