PDA

View Full Version : MM XML customization


Teh Tiack Ein
03-19-2008, 05:03 AM
XML code below disable any user to change user password in the MM client.


<Attribute>
DB_PASSWORD
<Visible>false</Visible>
<IncludeInLayoutManager>false</IncludeInLayoutManager>
<Protect>true</Protect>
</Attribute>


If I would like to just disable "medmgr" user to change password but enable other user to change password in the same MM Client, how do you configure this XML file? See example below.

If user = "medmgr" then

<Attribute>
DB_PASSWORD
<Visible>false</Visible>
<IncludeInLayoutManager>false</IncludeInLayoutManager>
<Protect>true</Protect>
</Attribute>

Else
<Attribute>
DB_PASSWORD
<Visible>true</Visible>
<IncludeInLayoutManager>true</IncludeInLayoutManager>
<Protect>false</Protect>
</Attribute>
End If

mgb
03-19-2008, 02:01 PM
No such functionality exists via XML configuration.

alexniccoli
03-20-2008, 04:18 AM
Hi
Maybe you can customize your xml file and adding a java class to your
project in netbeans.

Customize this section:

<Class>
<Name>DBR_ATTRIB_COL</Name>
<AuditTrail>OFF</AuditTrail>
...
<BusinessObjectClass>com.acme.datamgmt.biz.ACMEMMAttribute</BusinessObjectClass>
...
</Class>

ACMEMMAttribute will extends MMAttribute class.
And in isProtected method (wich return a boolean)
you can write some like this:

public boolean isProtected() throws WMException {

if (this.getAttributeName().equals("PASSWORD")) && ((WMClass)(this.getParent()).getClassName()).equals("WM_SU"))
{
if (WMSession.getWMSession().getUserName().equals("medmgr"))
return true
else
return false;

return super.isProtected();
}


Pay attention that this method is called frequently so your check must be fast
and not slow like not inquiry db.In this case no query are performed.

Alessandro Niccoli