“Energy and persistence conquer all things.”
— Benjamin Franklin
Last time, we were about to throw together a little dashboard of Service Account information when we ran into a little problem with the Content Selector Configuration Editor. Actually, it turned out to be a problem with the snh-form-field tag, but now that we have taken the time to fix that, we should be able to get back to where we were and continue on. So let’s get back into the configurator tool and try one more time to create a new configuration script.
Well, that’s much better! Now we can see all of the fields again in the modal pop-up as well as both of the buttons, so things are back to normal with the newer version. After creating the Requester perspective, we go through the process again to create the Fulfiller perspective.
Now, we could have used slightly different names, such as Owner and Provider, but again, this is just a sample of what could be; your mileage may vary. One thing that we did do on the Fulfiller perspective, though, was to add the itil role so that only actual fulfillers would have access to that portion of the dashboard.
Next, we need to add some states, and for our purpose, the states of Active, Retired, and Pending should suffice.
With that out of the way, now we can start completing the Tables section. Clicking on the Add a new Table button in the Requester tab will bring up the modal Table Selector pop-up.
Once the Table has been added, we can fill in all of the rest of the configuration data.
For the Active state, we will use following fields:
number,type,user_id,owner,owning_group
… and the following filter:
active=true^ownerDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORowning_groupDYNAMICd6435e965f510100a9ad2572f2b47744
For the Retired tab, we will just change the above filter from active=true to active=false. Everything else can remain the same. For accounts in the pending state, there will be no record on the Service Account table just yet, so we can just set the filter to 1=0, which should always find no records. To see the pending accounts, we will need to add another table. We can deal with that later, though, so for now let’s just focus on the Service Account table and then see how it all comes out.
Basically, we go through pretty much the same process for the Fulfiller tab, and once we save all of our input, we end up with the following configuration script.
var ServiceAccountDashboardConfig = Class.create();
ServiceAccountDashboardConfig.prototype = Object.extendsObject(global.ContentSelectorConfig, {
initialize: function() {
},
perspective: [{
name: 'requester',
label: 'Requester',
roles: ''
},{
name: 'fulfiller',
label: 'Fulfiller',
roles: 'itil'
}],
state: [{
name: 'active',
label: 'Active'
},{
name: 'retired',
label: 'Retired'
},{
name: 'pending',
label: 'Pending'
}],
table: {
requester: [{
name: 'x_660634_service_0_service_account',
displayName: 'Service Account',
active: {
filter: 'active=true^ownerDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORowning_groupDYNAMICd6435e965f510100a9ad2572f2b47744',
fields: 'number,type,user_id,owner,owning_group',
svcarray: [],
aggarray: [],
btnarray: [],
refmap: {
sys_user: 'user_profile'
},
actarray: []
},
retired: {
filter: 'active=false^ownerDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORowning_groupDYNAMICd6435e965f510100a9ad2572f2b47744',
fields: 'number,type,user_id,owner,owning_group',
svcarray: [],
aggarray: [],
btnarray: [],
refmap: {
sys_user: 'user_profile'
},
actarray: []
},
pending: {
filter: '1=0',
fields: 'number',
svcarray: [],
aggarray: [],
btnarray: [],
refmap: {},
actarray: []
}
}],
fulfiller: [{
name: 'x_660634_service_0_service_account',
displayName: 'Service Account',
active: {
filter: 'active=true^type.fulfillment_groupDYNAMICd6435e965f510100a9ad2572f2b47744',
fields: 'number,type,user_id,owner,owning_group',
svcarray: [],
aggarray: [],
btnarray: [],
refmap: {
sys_user: 'user_profile'
},
actarray: []
},
retired: {
filter: 'active=false^type.fulfillment_groupDYNAMICd6435e965f510100a9ad2572f2b47744',
fields: 'number,type,user_id,owner,owning_group',
svcarray: [],
aggarray: [],
btnarray: [],
refmap: {
sys_user: 'user_profile'
},
actarray: []
},
pending: {
filter: '1=0',
fields: 'number',
svcarray: [],
aggarray: [],
btnarray: [],
refmap: {},
actarray: []
}
}]
},
type: 'ServiceAccountDashboardConfig'
});
Now all we need to do is to create a Portal Page that will use the configuration script and we can take it out for a spin. That sounds like a good project for our next installment.