Heads up! These docs are for Portofino 3, which is a legacy product. Check out Portofino 4!
Copyright 2008-2012 ManyDesigns srl. All rights reserved.

Purpose

If classes are like database tables, attributes are like table columns. Attributes come in different types (integers, text, dates, etc) to capture the variety of information you may want to capture in your application.

Common fields

In the Basic information group:
  • Class: the class the attribute belongs to.
  • Name: the name of the physical column used to represent this class in the database.
  • Pretty name: the name used to present the attribute in the user interface.
  • Required: whether the attribute is mandatory. If checked, no empty/null values are allowed, and a NOT NULL constraint is applied to the column.
  • Immutable: if checked, users will be able to set the value of the attribute during object creation but will not be able to modify it with an update operation.
In the Display group:
  • In name: if checked, the attribute becomes part of the name of the class' objects. The name is used for titles and hyperlinks.
  • In summary: if checked, the attribute is displayed as a column in all tabular views, e.g., in search pages and relationship panels.
  • In details: if checked, the attribute is displayed in all single-object views and forms: the create, read, and update pages.
Notice that an attribute that has all in namein summary and in details flags unchecked is effectively invisible. It is present as a column in the database but has no presentation in the user interface. This may be useful for some
calculated attributes and constraints.
 
In the Position and grouping group:
  • Order: the relative order of the attribute. Attributes with a lower value are displayed first. This field can be left blank. The attributes with a blank order value are displayed after all the other attributes.
  • Group name: for attribute grouping.
In the Help information group:
  • Description: an optional description that is displayed next to the attribute in create and update forms.

Common relationships

In the first (only) group:

  • Visible by user groups

Attribute types

Blob

Blob attributes allow upload and download of documents, images or other large binary files. For more details, see the chapter BLOBs.

Fields in the Blob-specific information group:

  • Max dimension: the maximum allowed size in KBytes.
  • Inline: if checked, the server instructs the client to open the attachment inside the browser's window. If unchecked, the browser is instructed to save the attachment to the local disk. The actual behavior may vary depending on the browser's type and configuration. As a rule of thumb, check this flag if the attachments are small or are frequently updated.
  • Preview: if checked, a small preview image is displayed. If unchecked, the attachment's title is displayed. Check this flag if the attachments are images or documents (text, pdf).
  • Width: the width of the preview image in pixels.
  • Height: the height of the preview image in pixels.

Boolean

Boolean attributes can hold the logical values TRUE and FALSE. For portability reasons, booleans are stored in the database as integer numbers with TRUE = 1 and FALSE = 0.

Date

These attributes represent year-month-day dates. Hours, minutes and seconds are not included.

Decimal

Decimal attributes represent decimal numbers.

Fields in the Decimal-specific information group:

  • precision: precision is the number of digits in a number..
  • scale: scale is the number of digits to the right of the decimal point in a number.
  • format: string pattern to format decimal numbers (see Java DecimalFormat)

Integer

Attribute type for 32-bit signed integer numbers.

Relationship

A relationship attribute effectively represents a foreign-key column, in relational terms. This provides a direct implementation for many-to-one and one-to-one relationships, and an indirect implementation for many-to-many relationships. See chapter Relationhips for more information.

Fields in the Relationship-specific information group:

  • Opposite end class: the class referenced by this foreign key.
  • Opposite end name: the label used for this relationship when seen from the opposite end class.
  • Opposite end order: the relative order of this relationship when seen from the opposite end class.
  • Context: if checked, this relationship makes a context. A context is a navigation path that links objects through relationships (e.g. USA>California>Sacramento trough the relationships "State of" and "Capital of"). Context allows easier search of objects through cascading selections.
  • One to one: if checked, the relationship is one-to-one. This is implemented through a UNIQUE constraint in the database. If unchecked, the relationship is many-to-one.
  • Auto connect to user: if checked, during the creation of objects the value of the attribute is set automatically to the id of the user performing the creation. If you set this flag, the opposite end class must be User.

Text

Attributes for strings or text up to 4000 characters.

Fields in the Text-specific information group:

  • Length: maximum length, also used as the VARCHAR's length in the database.
  • Multiline: if checked, the user interface will present the attribute as a multiline text area; otherwise, as a single line input box.

Workflow

Fields in the Workflow-specific information group:

  • Initial state: the initial state of the workflow. When creating the workflow attribute, leave this field empty. Then, after you have defined the states, come back to the workflow attribute and edit it to set the initial state you want. There can be only one workflow attribute per class. For more information, see the chapter on Workflows.

Required attributes

A required attribute is an attribute for which a value must be provided. You specify whether you want an attribute to be required with the "required" flag when you create the attribute. But you can also edit the attribute and change the flag any time you like to enable or disable this constraint.

A common problem for new users of Portofino is to encounter this error message:

Cannot make attribute 'xyz' required because the table contains {n} null elements.

This happens in two situations:

  • During the creation of a new attribute, when the class already has some objects. When you add a new attribute to an existing objects, it receives a default value of 'null', which is incompatible the 'required' constraint. To solve the problem, first create the new attribute as not required; then go downstairs and edit the existing objects to provide a valid non-null value; finally go back upstairs and edit the attribute to make it required.
  • When changing an attribute from not required to required, if the class already has some objects containing null values. To solve the problem, go downstairs and fix the null values by providing a valid value; then go back upstairs and try again to make the attribute required.

Another thing you must remember is to make sure that all attributes marked as 'required' are also marked as 'in details'. This way Portofino will be able to include the attribute in the creation form and prompt for its value.