]project-open[ : @This Wiki
Portrait

Welcome, Unregistered Visitor

Contact ·  Index · Login · Register
 

Contents

Remote Training
Support
SaaS Service

5 registered users
 in last 24 hours

PL/SQL Constructor

A "constructor" is a PL/SQL routine  to create a new ]po[ object. As a convention, constructor names consist of the object_type, followed by "__new" (double underscore).

­

Constructors construct ]po[ objects starting with the top element of the ]po[ "class" hierarchy, which is acs_object followed by other super-classes. For this reason ]po[ constructors require you to specify all required parameters of all super-classes.


Let's look take a typical example (creating a new project):

 

select im_project__new (
        :object_id,
        :object_type,
        :creation_date,
        :creation_user,
        :creation_ip,
        :context_id,

        :project_name,
        :project_nr,
        :project_path,
        :parent_id,
        :company_id,
        :project_type_id,
        :project_status_id
);

 

The first 6 parameters are the parameters required by the [acs_object__new] constructor and are passed on directly:

  • o­bject_id - NULL:
    The object_id for the new object. This parameter should usually be NULL, indicating that the next object_id should be taken.

  • object_type - 'im_project':
    The object_type for the new object. This should usually be the object type itself.
    The constructors of a sub-type (for example: im_ticket is a sub-class of im_project) will specify the object_type of the sub-type here.

  • creation_date - now():
    The date of creation, for audit purposes.
    In most cases it's save to put the PL/SQL function "now()" here, to use the current time.

  • creation_user - 0:
    The ID of the user creating the object, for audit purposes.
    External applications can use the value "0" to refer to the pre-defined "anonymous user", or use the following SQL to determine the SysAdmin user: "select min(user_id) from users where user_id > 0".

  • creation _id - "0.0.0.0":
    The IP-address of the user creating the object.
    You can use '0.0.0.0' to indicate that there is no valid IP address (for example in case of an external application creating the user).

  • context_id - NULL:
    The ID of a "context" or "container" object, such as a package.
    The object will inherit permissions from the context_id, if it is not NULL.

The following parameters are specific to each object type and cover required database fields. Here are the parameters for creating a new projects:

    ­
  • project_name - "Sample Project":
    A human readable name for the project. The field is unique, within the object's hierarchy level.

  • project_nr - "2009_0001":
    A current number for the project. The default ]po[ number circuit consists of 4 digits for the year, followed by an underscore and 4 digits for the current number of the project within the year.

  • project_path - "2009_0001":
    The path for projec files in the file storage. Restriction: This field should be identical to the project_nr at the moment.

  • parent_id - NULL:
    The ID of the project's super-project. This field allows creating project hierarchies.

  • company_id - company_id:
    Who is the customer of the project (=paying for the project?). You need to specify a valid company.
    For testing or for "internal" projects (i.e. projects without an external customer) you can specify the "internal company" with the ID: "select company_id from im_companies where company_path = 'internal'".

  • project_type_id - 2501:
    A valid ID from the Intranet Project Type category or the "im_project_types" view. The 2501 sample value is a constant and refers to a "Consulting Project".

  • project_status_id - 76:
    A valid ID from the Intranet Project Status category or the "im_project_status" view. The 76 sample value is a constant and refers to the status "Open".

­

­

­

Please take a moment to complete this form to help us improve our service.

Note:
Please only provide feedback in regards to content this page shows. For support inquiries please refer either to the Community Support forum at Sourceforge or check out our 'Professional Support'

Did this page help you to achieve your goal?

 Yes  No  Don't know

Please provide us with comments to improve this page:

How useful is the information?

 1  2  3  4  5
Not
useful
      Extremely
useful
 
  

Explore

Installers
Demo Server
Modules & Functionality
Packages
Business Processes supported
FAQ's

Help

Getting started
User Manuals
Configuration Manuals
Community Support
Professional Support

News

News
Twitter
RSS Community / Sourceforge
Register for Newsletter

Get in touch

Contact
Register



Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0 Generic License - Privacy Policy