cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the mashup dynamically with the help of authenticator?

Highlighted
Newbie

How to change the mashup dynamically with the help of authenticator?

We have a condition that some group name can see one mashup and another group name can see another mashup. How to do it. We have to change the mashup and widgets dynamically on the basis of group name?

Tags (1)
3 REPLIES 3
Highlighted

Re: How to change the mashup dynamically with the help of authenticator?

Hi,

I don't know  if with an Authenticator can be done, but easily you can build a script that sets user Home Mashup depending on the group it belongs to.

Carles.

Highlighted

Re: How to change the mashup dynamically with the help of authenticator?

Hi,

Thanks Carles for the response. Do you have any example for setting it ? If you have then can you please share with me.

Thanks,

Aditya Kumar

Highlighted

Re: How to change the mashup dynamically with the help of authenticator?

Hi Aditya,

Should be something like this ( take it easy, I didn't tested it ):

var searchResult = Resources["SearchFunctions"].SearchPeople({

  maxItems: 1000000 ,

  searchExpression: undefined ,

    modelTags: undefined,

  query: undefined,

  aspects: undefined,

  excludedAspects: undefined,

    maxSearchItems: undefined

});

if (searchResult.rows.length) {

   var peopleNames = searchResult.rows[0].peopleResults;

   var user,userGroups,group,groupHomeMashup;

   for each(peopleRow in peopleNames.rows) {

        user = Users[peopleRow.name];

        userGroups = user.GetGroups();

        for each(groupRow in userGroups.rows) {

            group = Groups[groupRow.name];

            if (group) {

                groupHomeMashup = group.GetHomeMashup();

                if (groupHomeMashup) {

                    user.SetHomeMashup({ name: groupHomeMashup });

                    break;

                }

            }

        }

    }

}

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!