Desktop view cookie not updated with currently selected omnis ID

There is currently an issue with the desktop view login cookie not being updated when a record is selected in omnis. This makes all the iparts that can point to the currently selected ID, unusable in the desktop. I know dev are working on this, but could a possible workaround in the meantime lie in updating the following:-

In the post here: http://www.imiscommunity.com/navigation_designer_site_designer_usage, in the last point (5) it explains how to get an IQA query's results to populate the omnis customer portfolio, using the "select" (key_contact) link. Could the customquery.aspx page be modified to update the login cookie at the point the specific record is selected?

CustomQuery.txt file attached (needs to be changed to .aspx)

 

AttachmentSize
CustomQuery_15.1.txt753 bytes

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I'm not sure what you mean

I'm not sure what you mean by the "login cookie" -- do you mean the cookie that indicates who the currently logged in user is, or the "currently selected contact ID" cookie? I'm not 100% sure that solution will work (I think part of the problem is that desktop launches browsers a couple of different ways, and may not pass cookies around correctly).

Eric Means
System Architect, ASI

Login cookie - clarification

Eric, I was assuming there was one cookie that stored both the currently logged in ID and the currently selected ID. The cookie that I meant was the one that the current iparts look at - for example, the IQA iPart allows you to base the results of an IQA query on either the currently logged in ID or the currently selected ID - I assumed these were both held in the same cookie in the web view.

So, taking the thinking over into the desktop view - I know that the framework in the desktop is the same as the web view (login, navigation etc...). When you login to the desktop view, there is a cookie that the currently logged in ID is written to, and the currently selected ID defaults to the ID of the person currently logged in. If you create an IQA iPart in the desktop currently, and you link the results to the currently selected ID, it will always pick up the currently logged in ID. So, I assume that the cookie that the iPart looks at is there, but the currently selected omnis ID is not written to the cookie when the selection is made in omnis.

My idea for a workaround involved not making the selcetion in omnis, but rather in a .net page. Specifically, the Customquery page that we created to show IQA queries. The selection is made on this page (by hitting the "select" link in the query) - the results are then carried through to omnis and the results then show in the customer portfolio.

So, in theory, because you are making the selection in a .net page (and not actually in omnis), it should be possible to easily write the selected ID to the cookie, before the omnis customer portfolio loads.

I haven't seen the code for

I haven't seen the code for the IQA iPart, but if it's using the standard methods, you should be able to set the needed cookie using the code below. The "userID" variable needs to contain the iMIS ID for the person you are selecting. You will probably need to modify the CustomQuery page to raise an event rather than directly sending the user to the special URL; you'd need to handle that event, run the code below, and then do a Response.Redirect to the special URL.

CDataAccess da = new CDataAccess(ConfigurationManager.ConnectionStrings["DataSource.iMIS.Connection"].ConnectionString);
da.OpenConnection();

Asi.Bae.Business.Customer.User user = new Asi.Bae.Business.Customer.User(userID, da);

Secure sc = new Secure();

// Set Up Cookies for user
Response.Cookies["UserID"].Value = sc.Encrypt(user.Id);
Response.Cookies["FirstName"].Value = user.FirstName;
Response.Cookies["LastName"].Value = user.LastName;
Response.Cookies["FullName"].Value = user.FullName;
Response.Cookies["Company_ID"].Value = user.CompanyId;
Response.Cookies["Email"].Value = user.Email;
Response.Cookies["Organization"].Value = user.Company;
Response.Cookies["SecurityGroup"].Value = user.SecurityGroup.Equals(string.Empty) ? sc.Encrypt("None") : sc.Encrypt(user.SecurityGroup);

// If selecting themselves then they are no longer "impersonating"
if (Asi.ContentManagerNet.SessionState.User.ContactId == user.Id)
{
 Session["Impersonating"] = null;
 Session["ContactKey"] = null;
}
else
{
 Asi.Business.Contact.Individual individual = Asi.Business.Contact.IndividualController.Individual(user.Id, StatefulBusinessContainer);
 CurrentContext.SubjectUniformKey = ((individual)).ContactKey;           
 Session["Impersonating"] = true;
 Session["ContactKey"] = CurrentContext.SubjectUniformKey;
}

Eric Means
System Architect, ASI

CDataAccess question

what system imports are used for that ?  I thought it was just "ASI.Bae  "

I am using the same code i.e:

CDataAccess da = new CDataAccess(ConfigurationManager.ConnectionStrings["DataSource.iMIS.Connection"].ConnectionString);
da.OpenConnection();

but I get "Type CDataAccess is Not Defined" error.  (??)

thanks.

 

CDataAccess

Just reference the CDataAccess.dll file. That class is not in a namespace.