cancel
Showing results for 
Search instead for 
Did you mean: 

Session persistence?

Former Member
0 Kudos

Hi Guruu2019s

We are currently working on a project where several Webdynpro applications have been developed.

All of the applications are related, and are implemented in the portal as iViews, on different pages.

All of the iViews has functions regarding a User.

Now we want to be able to u201Ctransferu201D the selected user from one iView to another.

That is: When a user has already been selected in one iView, and the customer needs to use the next iView, he would like to avoid searching for the same user, and instead the application should be loaded with the user used in the other iView.

This is the way the Teamviewer works, and it does it by creating a cookie in which the CKEY object is stored. But in Webdynpro we canu2019t use JavaScript, and therefore we canu2019t create a cookie. We could use persistence (eg. Rfc to r3 or to j2ee db) but I think that it would be overkill.

Is there away to create this u2013 u201Csemi persistenceu201D - functionality? We have been looking at creating a portal service which could then use a session cookie to store the information in, but we really canu2019t figure out how to make the service run in the portal, or how to consume it from the WebDynpro applications.

So please, if anyone has some experience, or some advice, help is very appreciated!

Best regards,

Ronni

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Yes, if all iviews are not on same page portal eventing will not work.

You can use maintained customized information for user in Identity Management of portal. Refer to this link:

http://help.sap.com/saphelp_nw04s/helpdata/en/44/0316d50bbe025ce10000000a1553f7/frameset.htm

Regards,

Apurva

Former Member
0 Kudos

Hi Again Apurva!

First of all thank you for helping!

I am not sure that i get the idea of creating a custom attribute to the userID

Then i need to store the selected user, under a UME property of the customer using the application right?

I was looking for a "session" solution, that is a functionality more like the old OADP where a cookie was set

with the CKEY, or a Session been that would only last the time of the user session.

Does anyone know if it is possible to create a portal service, and then use it from inside webdynpro

and how is such a service created?

Best regards,

Ronni Hostrup

Former Member
0 Kudos

Does anyone know if it is possible to create an Portalservice using NWDI, and then consume it in Webdynpro?. and is there a tutorial explaining how to create the Service.

This way it should be possible to have an session cookie to store the selcted userID

so that when another iView is chosen, the last used userID is automatically read out from that cookie.

best regards,

Ronni

Former Member
0 Kudos

Still no one that has any ideas on how to solve this?

Does anyone know if the applicaiton integrator can be used "two ways" - ie. you write a value to it, from inside of webdynpro?

All help is apreciated,

Best regards,

Ronni

former_member182374
Active Contributor
0 Kudos

Hi Ronni,

You can use the IUserMaint object for custom attributes.

Something like:

String userName = "omric";
 
IUserFactory userFactory = UMFactory.getUserFactory();
 
String uniqueID;
 
try {
  IUser iuser = userFactory.getUserByLogonID(userName);
  uniqueID = iuser.getUniqueID();
  
  IUserMaint iusermaint = userFactory.getMutableUser(uniqueID);

  String x = "parameterValue";
  iusermaint.setAttribute("namespace","propertyName",new String[] {x});
  iusermaint.save();
  iusermaint.commit ();

 } catch (Exception e) {
  wdComponentAPI.getMessageManager().reportWarning("Exception --> " + e.getMessage());
}

the setAttribute is saving the value in the DB so it's persistence between iviews...

Not the best solution but does the job

Regards,

Omri

Former Member
0 Kudos

Hi Omri!

Thanks for your answer - it is a solution that can be used - It may not be a pretty solution, keeping temp data on the userprofile, but i can be used, so thank you

Does anyone now if it is possible to create your own java service and use this from inside of Webdynpro??

Best regards,

Ronni

Former Member
0 Kudos

Hi All!

I Found the solution!

it is possible to create your own portalservice, and that service can then do the desired functionality.

eg. create session cookie to store the values in.

So basically all the old "homemade" portal services can be used inside webdynpro

To all who have helped, thanks alot!

Best regards,

Ronni

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can use Portal Eventing or Portal Navigation concept. Refer to the link below:

http://help.sap.com/saphelp_nw04/helpdata/en/d8/6ee03fc2269615e10000000a155106/frameset.htm

To u201Ctransferu201D the selected user from one iView to another, event can be raised by one iview and other iviews can subscribe this event.

Regards,

Apurva

Former Member
0 Kudos

Hi Apurva,

I cant use Portal eventing, because it only works within a page in the portal, not between iViews that are not on the same page i am afraid.

I have lets say 3 iViews on 3 difrent pages, on 3 difrent worksets,

so the user has to press another link in the portal menu (second level) to navigate from one Webdynpro App to another.

So that wont work i am afraid

Thanks anyway for your input.

Best regards,

Ronni