Class Editor
With this editor you can create your own data models for your app backend.
The navigation bar on the left will show you your classes as well as the readonly classes contained in other modules. You can expand classes from other modules by clicking on the arrow next to the modules name. An example of those classes is e.g. the user class, which is contained in the basic module which every app has included automatically. The user represents a single app user.
New Class
Create a new class, name it and create its attributes. Nothing more easy than that. You can also alter the security configuration. ApiOmat automatically saves the changes.
Inheritance
You can also specify from which other class (either one of your own or one of a module) your class should inherit. Your class will then get all attributes the parent has.
In addition to the attributes, the security settings (required roles, allowed roles, restrict resource access - see security paragraph below), isGlobal and isTransient get inherited as well.
Transient
You can set a class as transient, which will prevent storing data for it in database. This is only needed when creating Native Modules.
Global
You can set a class as global, which means that the data of this class will be stored in a global, app-independent, but system-dependent, database. Note that you should use this feature carefully, unless your data will be visible to all apps that use your module.
Attributes
In the attributes panel below the inheritance settings you can finally add the attributes of the class. For each attribute, you can click on the checkbox to set the attribute as a collection (only possible for some types), select the type of the attribute and give it a name. Hit RETURN or loose the focus on that row and the attribute gets saved.
Hint for power users: You can TAB through the fields and control the whole attribute adding process via keyboard!
Security
Security settings set up the necessary role of users for accessing objects of the class.
We have three roles in ApiOmat:
-
Guest, which means client accessing ApiOmat without a username/password but with the api key.
-
Users, which are the representation of User instances; they have a username/password per definition.
-
Owners, which is a specialization of users; if an object was created by a user, he is the owner of that object. For instance, if a user created a new tweet, he is the owner of that tweet. All other users in the app are users, but not owners of it.
For all methods manipulating an object (create, read, update, or delete) you can specify the role which is necessary to execute the method. By default, all methods can only be accessed by the owner. If you select Guest as the necessary access role, all users and the owner have access, too. Also, if you select User as the role, the owner will have access.
For further information on this topic, see Data access security.
Main Menu
Using the ribbons within the main menu, you can add more classes or, if you use a higher plan than Basic, you can copy data from the other systems (live / staging / test).
-
New Class - will open the new class dialog one more time to let you create a new class
-
Copy models from … – copies all modules, data models and Server Code v.1 from the selected system to the current one. Data is not copied.