MostGenerator icon indicating copy to clipboard operation
MostGenerator copied to clipboard

connect field types to variables

Open rallek opened this issue 12 years ago • 4 comments

for example the upload field: in upload you have the property "Allowed File Size" It would be great to have this property inside the main tools "Variables"

How can this be done? e.g. "Allowed File Size" must be 0 than you have to create a Container "Variables" in your model with an integer Var type. Beside the Basic Data with the default Value there should be "Further options"

  • entity
  • entity field

The validator will check if the entity field exists and the var type of the entity field is matching the choosen var type in the variables container.

Other fields of upload where this relation can be usefull:

  • Allowed File Extensions
  • Regular Expression
  • Sub Folder Name (with check if it exists and is writable)

This might be also be usefull for other fields with "further options" but mostly for upload

rallek avatar Feb 09 '13 12:02 rallek

Make it more easy and intuitiv: If in a default value is a "myvariable" and myvariable exists as a variable the generator is using the variable.

rallek avatar Nov 01 '13 17:11 rallek

example: in mostapp we do have today e.g.

upload uploadFile {
    documentation "select a file for uploading"
    mandatory true
    allowedFileSize 102400
    allowedExtensions "pdf, zip, doc, docx, xls, xlsx"
}

if a link to a variable is possible it should look like:

upload uploadFile {
    documentation "select a file for uploading"
    mandatory true
    allowedFileSize #myFileSize#
    allowedExtensions "#myExtensions#"
}

and we declare a variable

textVar myExtensions {
        documentation "the file extensions allowed"
        value "pdf, zip, doc, docx, xls, xlsx, gif, jpeg, jpg, png"
    },
vars {
        intVar myFileSize {
        documentation "the maximum file size allowed"
        value "102400"
    }

This are typically work I have to do for my small modueles. This would be a very wellcome feature :-)

rallek avatar Jan 19 '14 11:01 rallek

At the moment this ticket is my biggest whish. One more idea how to do. If I declare one field for an entity there is in MOST on the right the area to adjust the propperties of the field. Allways if the field do offer the possibility to give a default value I propose to have an additional field named defaultVarialble. This have not to be declared in the variable container but will be gernerated as a variable and insted of the default value in the themplates we will have the varibale addressed. That would be great to have :-)

rallek avatar Sep 26 '15 10:09 rallek

if #887 is the way you are willing to implement, #263 can be closed.

rallek avatar Jan 08 '17 19:01 rallek