cancel
Showing results for 
Search instead for 
Did you mean: 

hide/ show content (pages/ivews/tabs) based on time of the day

Former Member
0 Kudos

Hi All

is it possible to hide/ show content (pages/ivews/tabs) on the portal based on time of the day?

what are the various options?

first thing came to my mind was desktop rules. but there are no time specific rules.

any help is appreciated

thanks

Prasad B.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kevin

There is a weblog for hiding the roles for a particular user for a particular duration. Check this out.

Hope this helps.

Regards,

Harini S

Answers (1)

Answers (1)

guru_subramanianb
Active Contributor
0 Kudos

Hi,

Hiding the tabs (pages,iviews) etc can be done in Portal by reading the Portal roles in Webdynpro application.

You have to include the Portalapi.jar file in the lib folder or the classpath of your webdynpro application.

then try the following code. re- enhance it where ever necessary to your logic.

// check whether the user is anonymous

if (user != null) {

//access logon ID by iterating through the IUserAccount array

IUserAccount[] acct = user.getUserAccounts();

if (acct[0] != null) {

strUserid = acct[0].getLogonUid();

wdContext.currentContextElement().setCurrentUser(

new String(strUserid.toUpperCase()));

wdContext.currentContextElement().setCurrentDate(

new Date(System.currentTimeMillis()));

}

} else {

wdContext.currentContextElement().setCurrentUser(

"Anonymous User");

}

} catch (UMException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

//@@end

}

This will give you the current logged in User. Set the time accorndingly for the user then use the WDVisibility to hide the tab for the particular user.

Hope it helps.

Thanks,

Guru