1. Classes

    Artikel: AN0001603Aktualisiert: 24.09.2018
    Die vorgegebene Sprachenversion vom Artikeltext wird angezeigt, weil es kein Text von der ausgewählten Sprache und Version gibt.

    Classes are used for storing data. Data in classes can be stored, modified and displayed by means of web pages, scripts, web services or directly on database level.

    You can create unlimited number of classes according to your requirements. By assigning a role to a class you can display various classes with various access types (e.g. read, insert, delete) to various groups of users.

    Columns of various data types (text, integer, user) can be created in classes. Particular classes can be referred each to another by means of column Value from a referenced class.

    Data display

    Class data can displayed in three ways:

    • List of records - records are displayed in form of a table
    • Detailed list of records - detailed information about more records are displayed
    • Record detail - detailed form with one record is displayed. User can create and change records in this mode.

    Display Detailed list of records is suitable for displaying records overview, e.g. view of changes in log from some date or for comparison of values between more records.

    Short description

    Each record contains a short description that represents the record. This description is used in references to the record, e.g. when displaying reference from another class, when selecting values from another class in combobox in the record detail etc. Content of the short description can be defined by means of property Description format.

    Instructions, how to create this Description format, can be found on page Description format.

    If there is no Description format defined in the class, short description cannot be created and the referenced record is represented by FullId (class_id_-record_id):

    <120-22>

    Templates

    If there are templates enabled in the class users can save settings of a certain record for a future use into a template. When creating a new record data are filled in according to this template which increases user productivity when working with the system. Each user can see own templates and so called global templates. Template can be marked as global by IT owner of the model.

    Class hierarchy

    You can define complete objects in classes by means of columns. However, if you have objects that share same properties, because they are of the same nature, you can use inheritance.

    Example can be objects car, bus, plane, that have similar properties max. speed, max. mileage, max. number of passengers, because all of them are means of transport. So you can create one class (means of transport) and other classes car, bus, plane can inherit from this class its properties.

    By using inheritance you get several benefits:

    • Adding one column into a parent class will show itself in all child classes
    • You can display list of parent objects (e.g. means of transport) at the same time. One click will lead you to the detail of corresponding means of tansport (differnt for car and different for plane)
    • If you want to refer to means of transport in a class, then you can create one reference column to one class (means of transport). Othewise you would have to create n reference columns - reference to a car, bus, plane.

    Inheritance settings:

    1. Display parent class detail
    2. In the context menu click on Class hierarchy
    3. Choose a new child class in the page
    4. Click on button Add reference to a child class

    There are child classes and parent class displayed in the tab Basic properties in the class detail.

    Option Abstract class says, that such a class cannot contain records. It always needs to have a child class (that is not abstract one), into which records can be inserted. In the above mentioned example class means of transport can be marked as abstract one. Object means of transport does not exist on its own. Only car, plane etc. are real objects.

    Option Display the last child defines, wheather when displaying detail of the given parent class user will be routed to the detail o the last child class. If you display list of records of the class means of transport in our example, then after clicking on ID of the record detail of the class car, plane etc. will be displayed with child class specific columns. When this option is not check off, detail of the class means of transport is displayed (without child class specific columns).

    Class inheritance scheme

    There is Class inheritance scheme in the model context menu. After clicking a graphical class inheritance overview is displayed. Classes, that are not involved in inheritance, are displayed in the bottom part of the list.

    The scheme displays class relations of parent - child type.

    Multiple columns

    Multiple columns represent an alternative to inheritance. image the class Means of transport, where you define by means of a single column Type, which type of means of transport is on which class record. There can be type car, plane, bike... You can use same columns for each type, however with different meaning. E.g. there is one column used for max. speed for a car, but for max. mileage for a plane. At the same time you can let display only some columns for various types.

    Multiple columns cannot be used if the class has a parent or child classes.

    There is following process for creating multiple columns:

    1. Set option Multiple column in the class where you want to use multiple columns
    2. Select column, that will define "Type"
    3. Save the column
    4. Display class detail
    5. In the toolbar click on button Multiple columns
    6. In the displayed page select columns that you want to use for multiple columns
    7. In the second part of the page select step by step all the types and set up display and and names of the requested columns

    Role list

    User access to class data is managed by means of roles. Roles with enabled operations (read, change, delete...) are assigned to classes. Users, that have given role can then perform given operations in the class.

    Roles can be assigned in three ways:

    • assigning role and operation - user with the given role can then perform the given operation with all the records
    • assigning role, operation and org. structure - user with the given role can then perform the given operation with records complying with the org. structure definition
    • taking over access rights from a referenced class/records

    Set up of org. structure

    • Org. structure - select required organization structure
    • Level of access - defines, if the access rights shall be restricted only to records belonging directly to the user org. unit (My org. unit) or set up of organization structure hierarchy shall be taken into account (Also via subordinates) and user will be granted access rights to records belonging to him/her org. unit and subordinate organization units.

    Taking over  access rights from referenced class

    In order to take over access rights from a referenced column, you will select a column referring to another class and type of operation, for which the access rights should be taken over.

    User then needs to have access rights to referenced records. In this way you can "inherit" access rights between classes. Access rights take-over can be utilized when access right should be controlled by access rights to referenced records - e.g. user gets access rights for campaign related to customer to which he has access right or getss access right to see an order to vendor if he has access right to the given vendor.

    In order user can see the class in menu he has to have access right to read the data in the class.

    Custom operation code

    When defining access rights in the class custom operation code can be used. This is suitable when you want to assign certain access rights to the class but you want to identifythe access rights by means of scripts (OG.ClassDef.HaveUserRightByOperationCode)  and apply them as you need. Therefore, you do not need to use operation Read, Insert, Update..., which would grant to the user operation that you do not want to grant.

    Audit a archiving

    Each recordin the class has 9 audit items. There are three groups for record creation, change and deletion. Audit information about the change concerns the last change only. Each group contains information about who, when and from which source performed creation/change/deletion.

    Values are displayed in the record detail in section Audit information. This section cannot be removed from the page. It is packed in the default state in order not to take up room in the screen. It gets unpacked by clicking on its name.

    In order to display the values it is necessary to explicitly switch on the archiving.

    After switching on option Enable data archiving all the changes in the class will be written into a new database table. In this way you get exact record of all the changes in the class. There is icon  for archiving available on pages with list of records and record detail. When you click on it list of all changes or changes of a single record will be displayed.

    When archiving is switched on, it is necessary to monitor space available on the disk, where the database is located, because sometimes this archive can grow fast.

    Data deletion

    ObjectGears system supports three types of deleting class data:

    • Disable record deletion - record stored in the class cannot be deleted
    • Physically delete records - record removed from the database
    • Logically delete records - deleted record is marked (properties Deleted and Deleter) and is considered as deleted

    It is possible to switch between these modes according to actual needs. This means that you can have records deletion disabled in the class, but sometimes it is necessary to switch for a moment to the physical deletion, remove the record from the datbase and then disable records deletion again.

    Logically deleted records are not displayed in the default view, however, when option Enable display of deleted record in the list is checked off, option for displaying also deleted records is available in page with the list of records. These records are displayed in grey and italics in order they differ from active records.

    If the class is enabled for another model, then change of deletion type is not allowed in the class due to possible data integrity violation that could affect other models.

    Sorting and paging

    Sorting has to be usually introduced for classes with more records. You can sort according up to 3 columns in ascending or descending way. After displaying the records you can sort according to whatever column just by clicking on the heading of the given column in the list of records. Sorting have to be explicitly enabled by option Enable sorting.

    Paging can be set by each user individually under option Display records.

     Filtering

    It is necessary to look up data accroding to various columns in larger classes. This why a class can have activated a Quick filter, where you can select columns that shall be displayed in the page with list of records and enable entering a value for filtering.

    Mass changes

    The function of mass changes is useful, when you need to change values in one or more columns at the same time and set one new value in them. You have to only filter these records and click mon the button for mass change. Then you set the ew value in the requested column and save. If you want to delete values in some column, then you check off the check box at the corresponding column.

    This function can be potentially dangerous, because the user can by mistake change large amount of records. This is why this function has to be enabled first in the class and then a role assigned with operation a role Mass data change. After that user with the given role will have available button for mass change in the page with list of records.

    At the same time rules for record display are not applied at a mass change. User then can see all the columns, including those that are normally hidden. User can also have editing access to column that normally cannot be edited. Therefore assign this function only to well informed users.

    Mass deletion

    In some cases it is useful to use mass record deletion. It is not necessary to delete one record after another but records can be just filtered in the class and all of them deleted on one click.

    This function can be potentially dangerous, because the user can by mistake delete large amount of records. This is why this function has to be enabled first in the class and then a role assigned with operation a role Mass data deletion. After that user with the given role will have available button for mass deletion in the page with list of records.

    Notifications

    When notifications are set users receive a message informing about a change in the class. In the set up select, when a notification shall be sent, to which distribution list (list of receivers) and particular notification that shall be sent out.

    Notification is sent out every time, when respective operation "When to send" occurs. Sending cannot be conditioned to certain situations only. In this case you can use sending notification in the class rules.

    Pictures

    Each class can have a big and small picture. Small picture of the class is displayed in menu and in the list of class in the administration. Pictures can be used also in schemes where small or big pitcure is used based on scheme settings.

    RSS

    Class records can be published by means of RSS. First enable RSS and enter number of records that you want to return in RSS. There are only active records returned in RSS and they are sorted by Id in a descending way (the newest records are on top, then there are the older ones).

    The content can be defined by two ways for the heading and description that however cannot be combined. You can select one column for heading or description or you enter a format for calculation of heading and description.

    Example of heading:

    {{Column.created}} - {{Column.name}}

    Other settings

    When checking off option Enable access via web services you will enable users or applications to work with class data by means of remote calls of web services. In order that the call is successful user/application needs also a role assigned. E.g. in order to read the data from a class, there has to be role for the read operation in the class.

    Option Enable navigation in the form enables to display a navigation control in the record detail for switching between records. The user can easily switch between records without having to return to the list of records. When the function After finishing the operation stay at the same page is activated at the same time, the records can be effectively updated and the user can switch to the following or previous record immediatelly.

    Column updating

    There are several rules applied to updating class record (creation or change) depending on the source of update:

    • Update in a form (DataDetail.aspx) - it is possible to update only columns with checked property Enable editing by record creation or Enable editing by record change.
    • Update via web service - it is possible to update only columns with checked property Aktualizace přes webovou službu - je možné aktualizovat pouze sloupce s nastavenou vlastností Enable editing by record creation or Enable editing by record change. Values provided for other columns are ignored without any warning.
    • Update by means of script (script in a rule, workflow etc.) - all the columns (except for system ones) can be updated without any restriction.
    • System columns CANNOT BE UPDATED by user. They are updated by the system itself and values provided in the DataRow object are ignored.

    After update in a form or via web service, rule or script can be executed. This rule or script can update any column without changed any columns (except for a system one) without any restriction.

    Form or web service call are considered as an input that has to be checked in terms of data integrity and therefore these restrictions are in place. Scripts are considered as a secure part of the system and this is why the restrictions do not apply to them.

    Initializing a new record

    Before a new record is displayed in the detail form, several steps are performed. You can use particular steps to initialize record with required values:

    1. default values in column

    2. template - if the template is used, then it is applied

    3. sequence - if some column has sequences enbled, then a new value is created

    4. executio of rules for setting up value and script

    5. initialization via URL (see below)

    This initialization does not take place if the page DataDetail.aspx is in mass update mode.

    Initialization via URL

    Function Initialization via přes URL enables to set one column of type Reference to another class to one value. Add variables Fi1c and Fi1v to url. The first variable is column ID and secind one ID of the referred record.

    .../DataDetail.aspx?Id=100-0&Fi1c=303&Fi1v=10

     

     

×