CARIS HPD : HPD® Server API : Database Setup : Integrator Overrides Reference Methods : CANLOCKREPRESENTATION
 

CANLOCKREPRESENTATION

This function allows an integrator to customize which representations can be locked (and therefore edited) by the HPD Source Editor. This function is called when a feature is being locked on a specific usage or set of usages. See also CANLOCKFEATURE.

The function used by the integrator must have a fast response time, as the user will have to wait for the result to continue the edit task.

Input

Parameter

Type

Description

p_rep_id

INTEGER

The ID of representation being modified

p_usage_id

INTEGER

The ID of the Usage for this representation

Return Value

Type

Description

Boolean

TRUE if Lock allowed

FALSE if Lock request rejected

Example

The following example shows the code for this function and where the integrator would add code to decide if a given object can be locked for modification by the HPD Source Editor.

FUNCTION canlockrepresentation (

   p_rep_id           IN       representation.rep_id%TYPE,

   p_usage_id     IN     USAGE.usage_id%TYPE

) RETURN BOOLEAN IS

-- v_ACRONYM OBJECT_CLASS.ACRONYM%TYPE;

BEGIN

/*

 

   -- Example code 1

   SELECT ACRONYM INTO v_ACRONYM

   FROM REPRESENTATION REP, RWFOBJECT RWF, OBJECT_CLASS OC

   WHERE REP.RWFOBJECT_RWF_ID = RWF.RWF_ID

   AND RWF.OBJECTCLASS_ID = OC.OBJECTCLASS_ID

   AND REP.REP_ID = p_rep_id;

 

   -- Do not allow locking of depares.

   IF v_ACRONYM = 'DEPARE' THEN

      RETURN FALSE;

   END IF;

 

   -- Example code 2

   -- Do not allow spatial editing on usage id 1

   IF p_usage_id = 1 THEN

      RETURN FALSE;

   END IF;

*/

 

   RETURN TRUE;

END canlockrepresentation;