Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Generic Template

Some times it is useful to provide non manufacturer specific templates files which can be served by Noojee Provision. The filesserver-vm directory is reservered for this purposes. All files in this directory are preprocessed as Velocity Macros and can be processed without be associated with a particular handset or manufactorer.

The following keys are injected into the Velocity context:

  • System
  • Directory
  • Handsets

Key: System

The System key provides access ot the set of system variables stored in tblSystem.

The System key is used as follows:

#set( $systemValue = $System.getProperty("somekeyname") )

You can also test if a property exists.

#if( $System.existsProperty("keyname") )
do something
#end

Key: Directory

The Directory key provides a list of the entries in the white pages.

#foreach ($item in $Directory)
        <item>
            <ln>#if( $item.getLastName() )$item.getLastName()#end</ln>
            <fn>#if( $item.getFirstName() )$item.getFirstName()#end</fn>
            <ct>#if( $item.getContact() )$item.getContact()#end</ct>
            <sd></sd>
            <rt>2</rt>
            <dc/>
            <ad>0</ad>
            <ar>0</ar>
            <bw>1</bw>
            <bb>0</bb>
        </item>
#end

The Directory key has the following methods:

String getFirstName()

String getLastName()

String getContact()

String getCompany()

String getLandLine()

String getMobile()

String getFax()

String getEmail()

String getTitle()

boolean isExternal()

Key: Handsets

The Handsets key exposes a list of all handsets keyed by their extension no.

You can obtain the details of any handset via the following:

#set($Handset = $Handsets.get("500"))

Where 500 is the handset extension no.

Once you have the $Handset it then exposes the following methods:

String getAccountPassword()

String getAccountPIN()

String getAllow()

String getAttachVoiceMailSoundFile()

String getCallGroup()

String getContext()

String getDeleteVoiceMail()

String getDeny()

String getDisAllow()

String getDTMFMode()

String getExtension()

String getEmail()

String getHideFromDirectory()

String getIPAddress()

String getMacAddress()

String getMailbox()

String getMailboxPIN()

Manufacturer getManufacturer()

int getModel()

String getPassword()

String getPermit()

String getPickupGroup()

int getSipID()

String getUserName()

String getVoiceMailNotification()

String getVoicemailContext()

boolean isBulkProvisionMode()

 boolean isExisting()

void setSipID(int sipID)

String toString()

Key: Params

The Params key allows you to access any request parameters passed on the URL.

$Params returns a Hashtable of key/value pairs.

To access a specific parameter:

e.g.

http://njprovions:8080:/test.xml?extension=200
Extension:$Params.get("extension")

Wil output

Extension: 200
  • No labels