Valuations

Last updated: oct.13, 2016 - 14:26:32

Overview

Now that you know handling templates (if not, refer to this section), and applications (if not, refer to this section), it's finally time to valuate properties for your application.

You can valuate properties at three levels :

  • Platform Level (optional)
  • Module level : the default level considered by Hesperides
  • Instance level (optional)

Inheritance

  • properties at platform level can be inherited at module and instance level
  • properties at module level can be overload at instance level

Entry points

You will see in the table the several entry points to access to each level for both mode (tree and block) :

Operation Tree mode Block mode
Platform level
Module level
Instance level

Platform level

If you want to apply the same values for several module properties, you can add some platform properties (you will also see "global properties").

This level is not mandatory, however it's very convenient not to duplicate data.

Add global properties

Mode Steps
Tree mode
  1. Fill in name (1) and value (2) for your global property :
  2. Press enter
  3. You can add one or several properties
  4. Click on "SAVE THE GLOBAL PROPERTIES", a modal appears :

    Respect the described rule for comment

    For example "add global property for my demo"

Block mode
  1. Fill in name (1) and value (2) for your global property :
  2. Press enter
  3. You can add one or several properties
  4. Click on "SAVE THE GLOBAL PROPERTIES", a modal appears :

    Respect the described rule for comment

    For example "add global property for my demo"

Delete global properties

Mode Steps
Tree mode
  1. Click on the trash icon :
  2. You can delete one or several properties
  3. Click on "SAVE THE GLOBAL PROPERTIES", a modal appears :

    Respect the described rule for comment

    For example "delete global property for my demo"

Block mode
  1. Click on the trash icon :
  2. You can delete one or several properties
  3. Click on "SAVE THE GLOBAL PROPERTIES", a modal appears :

    Respect the described rule for comment

    For example "delete global property for my demo"

Module level

Here we are ! let's fulfill those properties !

Simple properties

If you click on your module "module-test" when you edit your platform, you can valuate properties for your environment :

  • * This icon describe a required property
  • 🔒 This icon describe a password property
  • 🌍 This icon describe a property valued by global property
  • 🛡️ This icon describe a property that have default value
  • (.*) This icon describe a pattern property
  • ✔ This icon describe a property that has a default value equal to its overloaded value
  • ✅ This icon describe a property that has an overloaded value equal to its global property value

Iterable properties

You can edit iterable property in addition to simple property (click on link "Iterable properties" to display it) :

  1. Add as many shoes as you want
  2. Delete the shoe
  3. fulfill brand name and bar code

Generation !

If you generate file or preview instance, you will finally obtain this file :

<html>
    <body>
        <ul>
            <li>brand_1 has bar code : 9999999 </li>
            <li>brand_2 has bar code : 8888888 </li>
        </ul>
    </body>
</html>
    

Use global properties

If you created some global properties, you can use it at module or instance level.

  • If you declared in your template something like new_global_property={{new_global_property}} and if you added a global property as in Add global properties section, you will see this when you edit the module properties :
  • If you added a global property as in Add global properties section, but without declaring it in your template, you can still use it at module level :

Handle with annotations

In annotation section you learned how to add annotations in your template. It's time to see how Hesperides handles it when you edit your module properties :

Annotation Display
required_key={{value1|@required}} If you do not fulfill the value, you won't be able to save your properties
key_with_comment={{value2 |@comment "some comment to explain the key"}}

It's also possible to add comments with the short syntax

key_with_comment={{value2|some comment to explain the key}}
You can see the comment on placeholder if property is empty, or in tooltip when you hover the value input
key_with_default_value={{ value3 |@default "false" }} You can see the default vaule on placeholder if property is empty, or in tooltip when you hover the value input
key_password={{value4|@password}} If you are a non-authorized user and if you display a production platform, you will only see stars
key_with_pattern={{value5|@pattern "[a-z]*"}} If you do not fulfill a value that consider the pattern, you won't be able to save your properties. You can see the pattern on placeholder if property is empty, or in tooltip when you hover the value input

Upgrade module version

When you're changing a module's version, it is possible to copy over its properties to the new version. You just have to check "Copy valuated properties" switch button.



If you forgot to check this option, don't panic, your values are not lost. You just have to revert back to the previous version - e.g. from 2 to 1 - without checking the "Copy valuated properties" switch button. You can now perform the version upgrade operation again with the option checked.

Hespérides can revert back a deployed module valuations up to 2 versions in the past.

Instance level

Define instance property

If you have a property at module level, but you want to specify different values according to instance, you can again use mustache.

First, you have to set your property value at module level like this :

Take care of your property name

If you set the value of your module property with a key already use at platform level, Hesperides will not specify it at instance level !

Preview files

At instance level, you are able to merge templates with valuations and display a preview of it. All you have to do is to hover the name of the instance you want to preview and click on "eye" icon :

Tree mode
Block mode

Whether tree or block mode, you access to the above modal :

  1. Click on file title to open its content
  2. Visualize the generated path of your file
  3. Visualize the generated content of your file
  4. Download the generated file
  5. Download a zip containing every generated files

Local Changes

Local changes can be seens has a way to locally save your work. It allows you to pause and resume later on your work, but also act as a failover system in case of a failure in the saving process(a local save is automatically done before each save). Allowing you to recover your changes without loosing anything.

Limitations

At the time being the local change system only works for simple properties, iterables properties aren't supporter yet, but rest assured their time will come as well.

Save your local changes

To get started with local change let's assuming you are editing a module

Type in or out any changes you want and then press LOCAL button to save locally

When local changes are saved, you can see a message saying that local change has been detected, and you can see them by following the orange color code.

Delete your local changes

We will continue with the previous states of Saving part. The requirement is to have local changes, otherwise the cleaning button won't appear. So let's get to business, the first things to know is that, right now, when cleaning up local changes, it clean all your local changes, you cannot specify which one you want to delete or keep. It should be available in the next release.

Hit the LOCAL button associated with the trash icon to get started

A confirmation pops in for you to confirm that you really want to delete all your local changes. Obviously, if you had done changes in another module, it won't delete it.

Time To Live

Your local changes has different way of being deleted, pay attention to understand how it work :

  • Removing manually your local changes as explained in the previous part
  • While saving for real your local changes will be automatically removed if the save process ends as expected
  • A Time To Live parameter allows Hesperides to control how long your local changes will be kept

To explain a bit more about the TTL system, it works with the platform version_id. Each time a user perform a modification against a platform it increase its version_id. A default TTL of 50 is applied, meaning that when your change will have a difference bigger than 50 they will be automatically removed. The next release will introduce message warning to remind you that your local changes are close to their expiration time

Predefined properties

Hesperides handles contextual variables that can be used directly in your templates or valuations

How to

  • You can get information about application and platform thanks to :
    {{hesperides.application.name}}
    {{hesperides.application.version}}
    {{hesperides.platform.name}}
  • You can get information about module and the path thanks to :
    {{hesperides.module.name}}
    {{hesperides.module.version}}
    {{hesperides.module.path}}
    {{hesperides.module.path.0}}
    {{hesperides.module.path.1}}
    etc ...
  • You can get information about instance thanks to :
    {{hesperides.instance.name}}

Common functions

At three levels, you can do some things to make nice your navigation

Sort

Playing with this switch, you can sort ascending or descending property names :

Filter

  • Playing with thoses inputs (not availables for instance level), you can filter property name or property value or both at same time :
  • Playing with those switches (not availables for platform level), you can display only empty properties or deleted properties :

Clean

Clicking on the button, you can clean the properties that have been deleted previously (see deleted properties section) :

Deleted values

When you delete a property from a template, it's not deleted in platform. That's why you are able to display deleted properties (see model/valuation).