creapage.net

HOWTO - Sashipa development

 ImageField: How to display images.

You wish to store images and to display them in your Sashipa application.

The development of this feature is still in process. Storage in BLOB column of the database is not available yet. Nevertheless, a Sashipa software can display image files, and store URIs in the database (in a text format).

Storage of URIs that reference files

In the database, a text column will be used. Probably a varchar of 255 characters.

Information can be given in the environment part of the Sashipa source file. The URI format can be specified, and eventually a default size for image fields that will work on the column. An example:

  <schemaColumn name='tblTest_UriImage1' type='text' notNull='no' maxCharacters='255'>
    ... physicalName ...
    ... singularName ...
    <guiConfigSchemaColumn>
      <imageFieldConfig w='100' h='100' />
    </guiConfigSchemaColumn>
    <valueFormatRef valueFormat='predefinedFormat_textUri' />
  </schemaColumn>

Now the schemaColumn is ready to be used in the GUI:

  <cardForm db='dbTest'>
    ...
    <fieldContainer>
      ...
      <imageField>
        <schemaColumnRef schemaColumn='tblTest_UriImage1' />
      </imageField>
      ...
    </fieldContainer>
  </cardForm>

Because the size of the field is not specified here, the field will take the one of the element imageFieldConfig. Or as a last resort, the element defaultParameterSet will provide a value.

Remarks:

© Copyright 2005 Sashipa-Melba Team. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License as much as this note clearly appears.