gran.app.adapter.kernel.udf
Class BaseUDFAdapter

java.lang.Object
  |
  +--gran.app.adapter.kernel.udf.BaseUDFAdapter
All Implemented Interfaces:
Adapter, KernelAdapter, UDFAdapter

public class BaseUDFAdapter
extends java.lang.Object
implements UDFAdapter

User Defined Field (UDF) bean implementation

Version:
$Revision: 1.1.2.22 $
Author:
$Author: maximkr $

Constructor Summary
BaseUDFAdapter()
           
 
Method Summary
 void addUDFImpl(java.lang.String sourceid, java.lang.String caption, java.lang.String order, java.lang.String def, java.lang.String ul, java.lang.String required, java.lang.String type, java.lang.String visible, java.lang.String mail)
          create new UDF
 void addULImpl(java.lang.String udfid, java.lang.String val)
          Add value to list
 void deleteUDFsImpl(java.lang.String[] udfids)
          Delete UDF
 void deleteULsImpl(java.lang.String[] udfids)
          Delete one or more udflist item
 java.lang.String getDescription()
          Get description of adapter as plain text
 java.lang.String getUDFSourceImpl(java.lang.String id, int mode, java.lang.String result)
          select udfsource_id for task, workflow or user.
 java.util.HashMap getUDFValuesImpl(java.lang.String id, int mode, java.util.HashMap result)
          get hash of values of udf properties
 boolean init()
          Initialize adapter.
 java.util.Collection listUDFImpl(java.lang.String idUDF, int modeUDF, java.util.Collection result)
          List all UDF for specified idUDF mode = 0 - id is sourceid mode = 1 - id is taskid, list all for this taskid and it's parents mode = 2 - id is userid, list all for this userid and it's managers mode =3 - id is taskid, list all for this taskid and it's parents.
 java.util.Collection listUDFValuesImpl(java.lang.String idVal, int modeVal, java.util.Collection udfList, java.util.Collection result)
          List collection of UDF values
 void setUDFValueImpl(java.lang.String udfid, java.lang.String sourceid, java.lang.String value, java.lang.Integer udftype)
          set value for selected udf and source.
 void updateUDFImpl(java.lang.String id, java.lang.String caption, java.lang.String order, java.lang.String def, java.lang.String required, java.lang.String visible, java.lang.String mail)
          Update UDF description
 void updateULImpl(java.lang.String id, java.lang.String value)
          Update UDF list value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseUDFAdapter

public BaseUDFAdapter()
Method Detail

init

public boolean init()
Description copied from interface: Adapter
Initialize adapter. TrackStudio calls this method during startup.

Specified by:
init in interface Adapter
Returns:
true when adapter initialized, false otherwise.

getDescription

public java.lang.String getDescription()
Description copied from interface: Adapter
Get description of adapter as plain text

Specified by:
getDescription in interface Adapter

getUDFSourceImpl

public java.lang.String getUDFSourceImpl(java.lang.String id,
                                         int mode,
                                         java.lang.String result)
                                  throws gran.exception.GranException
Description copied from interface: UDFAdapter
select udfsource_id for task, workflow or user. If udfsource not exists - create it.

Specified by:
getUDFSourceImpl in interface UDFAdapter
Parameters:
id - id of task or user
mode -
  • 1,3 - get udfsource for task
  • 2,4 - get udfsource for user
  • 5,6 - get udfsource for workflow
gran.exception.GranException

addUDFImpl

public void addUDFImpl(java.lang.String sourceid,
                       java.lang.String caption,
                       java.lang.String order,
                       java.lang.String def,
                       java.lang.String ul,
                       java.lang.String required,
                       java.lang.String type,
                       java.lang.String visible,
                       java.lang.String mail)
                throws gran.exception.GranException
Description copied from interface: UDFAdapter
create new UDF

Specified by:
addUDFImpl in interface UDFAdapter
Parameters:
sourceid - -udfsource_id
caption - - name
order - - order.
def - -default value
ul - - id of list of available values
required - - required or not
type - - value type
visible - - visible or not
mail - - include field in email notification
Throws:
gran.exception.GranException

deleteUDFsImpl

public void deleteUDFsImpl(java.lang.String[] udfids)
                    throws gran.exception.GranException
Description copied from interface: UDFAdapter
Delete UDF

Specified by:
deleteUDFsImpl in interface UDFAdapter
gran.exception.GranException

setUDFValueImpl

public void setUDFValueImpl(java.lang.String udfid,
                            java.lang.String sourceid,
                            java.lang.String value,
                            java.lang.Integer udftype)
                     throws gran.exception.GranException
Description copied from interface: UDFAdapter
set value for selected udf and source. Value will be converted from string to required type

Specified by:
setUDFValueImpl in interface UDFAdapter
Parameters:
udfid - - UDF identifier
sourceid - - UDFSource identifier
value - - value
udftype - - type of UDF value
Throws:
gran.exception.GranException

listUDFImpl

public java.util.Collection listUDFImpl(java.lang.String idUDF,
                                        int modeUDF,
                                        java.util.Collection result)
                                 throws gran.exception.GranException
Description copied from interface: UDFAdapter
List all UDF for specified idUDF

Specified by:
listUDFImpl in interface UDFAdapter
gran.exception.GranException

listUDFValuesImpl

public java.util.Collection listUDFValuesImpl(java.lang.String idVal,
                                              int modeVal,
                                              java.util.Collection udfList,
                                              java.util.Collection result)
                                       throws gran.exception.GranException
Description copied from interface: UDFAdapter
List collection of UDF values

Specified by:
listUDFValuesImpl in interface UDFAdapter
gran.exception.GranException

getUDFValuesImpl

public java.util.HashMap getUDFValuesImpl(java.lang.String id,
                                          int mode,
                                          java.util.HashMap result)
                                   throws gran.exception.GranException
get hash of values of udf properties

Specified by:
getUDFValuesImpl in interface UDFAdapter
gran.exception.GranException

updateUDFImpl

public void updateUDFImpl(java.lang.String id,
                          java.lang.String caption,
                          java.lang.String order,
                          java.lang.String def,
                          java.lang.String required,
                          java.lang.String visible,
                          java.lang.String mail)
                   throws gran.exception.GranException
Description copied from interface: UDFAdapter
Update UDF description

Specified by:
updateUDFImpl in interface UDFAdapter
gran.exception.GranException

updateULImpl

public void updateULImpl(java.lang.String id,
                         java.lang.String value)
                  throws gran.exception.GranException
Description copied from interface: UDFAdapter
Update UDF list value

Specified by:
updateULImpl in interface UDFAdapter
gran.exception.GranException

deleteULsImpl

public void deleteULsImpl(java.lang.String[] udfids)
                   throws gran.exception.GranException
Description copied from interface: UDFAdapter
Delete one or more udflist item

Specified by:
deleteULsImpl in interface UDFAdapter
gran.exception.GranException

addULImpl

public void addULImpl(java.lang.String udfid,
                      java.lang.String val)
               throws gran.exception.GranException
Description copied from interface: UDFAdapter
Add value to list

Specified by:
addULImpl in interface UDFAdapter
Parameters:
udfid - - identifier of list UDF
val - - added value
Throws:
gran.exception.GranException


Copyright © 2002-2003 TrackStudio, Ltd. All Rights Reserved.