Project code management

From Catglobe Wiki
Jump to: navigation, search



Project code management

The project code of projects can be set up to be automatically managed by Catglobe. From version 5.8.1 the logic for how such expressions can be formatted was made more flexible as well as requires the setting up of two different web configuration keys.

To define the format of the project number, use the web config key ValidationExpressionForProjectNumber. To define the default code that will appear upon the creation of a new project, use the web config key DefaultCodeForProjectNumber.

The ValidationExpressionForProjectNumber key could look something like the following:

<add key="ValidationExpressionForProjectNumber" value="[A-Z]{2}(\d{4,5})[a-Z]{3}" />

Let us analyze the value to understand what it means. The value in the above example consists of three parts defining each their part of the project code.

[A-Z]{2} = means that the first two characters in the project code are upper case letters between A and Z.

(\d{4,5}) = means that the second 4 to 5 characters are a unique 4 to 5 digit number. This number will automatically be created by the system starting from "0001", increasing by one each time a new project code is created, until finally ending at "99999".

[a-Z]{3} = means that the last three characters in the project code are either upper or lower case letters between a and Z.

This DefaultCodeForProject key is used to propose a default code to the user when creating a new project. The key code e.g. look something like below.

<add key="DefaultCodeForProjectNumber" value="CC#CCC"/>

The symbol "#" in the key will be replaced by the unique number that should be used for the project code next (i.e. the value of (d\[4,5]). Any other symbols in the string will just be shown as are.

Let us look at an example of how this may work:

Let us assume we have the following three project numbers on database already (where value="[A-Z]{2}(\d{4,5})[a-Z]{3}" ) and where the DefaultCodeForProject is "CC#ccc".

  • VN0001Cat
  • VN0002Qnr
  • VN0003REP

The suggested next available code in the Project resource dialog would be “CC0004ccc”

Then the following project codes would be illegal

  • 120004REP
  • VN0003QNR
  • vn0004QNR
  • VN0004AB1
  • VN0006ÆØÅ

The following codes would be legal

  • DK0004QnR
  • VN0004aBC
  • VN0004abc

When setting project number in the project dialogue it will look like below:

Projectcode581-1

If the default project code key is configured to include the unique number (with ”#” in the value of the key), whenever you create a new project, the system will propose a code for the project. Notice that the system will automatically insert a default value that you can then edit afterwards.

Back to: Project code