Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
titleDashboard
<dashboard oid="72b1f98e-f587-4b9f-b92b-72e251da2345">
    <name>role-dashboard</name>
    <display>
        <label>Role dashboard</label>
    </display>
    <widget>
        <identifier>roles</identifier>
        <display>
            <label>Number of roles</label>
            <color>#00a65a</color>
            <icon>
                <cssClass>fe fe-role_icon</cssClass>
            </icon>
        </display>
        <data>
            <sourceType>objectCollection</sourceType>
            <collection>
                <collectionRef oid="72b1f98e-f587-4b9f-b92b-72e251dbb255" type="ObjectCollectionType"/>
            </collection>
        </data>
        <presentation>
            <dataField>
                <fieldType>value</fieldType>
                <expression>
                    <proportional>
                        <style>value-only</style>
                    </proportional>
                </expression>
            </dataField>
            <dataField>
                <fieldType>unit</fieldType>
                <expression>
                    <value>roles</value>
                </expression>
            </dataField>
            <view>
                <column>
                    <name>nameColumn</name>
                    <path>name</path>
                    <display>
                        <label>Name</label>
                    </display>
                </column>
                <column>
                    <name>members</name>
                    <display>
                        <label>Members</label>
                    </display>
                    <previousColumn>nameColumn</previousColumn>
					<export>
                    	<expression>
                        	<script>
                            	<code>
                                	import com.evolveum.midpoint.prism.query.*
                                	import com.evolveum.midpoint.xml.ns._public.common.common_3.*
                                                                
                                	query = prismContext.queryFor(UserType.class).item(AssignmentHolderType.F_ROLE_MEMBERSHIP_REF).ref(object.getOid()).build();
                                
                                	objects = midpoint.searchObjects(UserType.class, query)
                                	return objects.size();
                          		</code>
                        	</script>
                    	</expression>
					</export>
                </column>
            </view>
        </presentation>
    </widget>
</dashboard>

...