-
Notifications
You must be signed in to change notification settings - Fork 0
Tools_en
These tools will help you to use sofof easier.
To prepare the database manually you have to configure the server and start it then open a session to use it. You have to write that code every time you want to use Sofof in a project. To do all that processes sofof offers the ability to write that configuration in an XML file. You can add users to the server, create a database, configure and start sessions. I will explain that in an XML file that uses all the features.
<sofof
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns='http://sofof.org/xsd'>
<server port="6969" database="sofof-database" ssl="true">
<users>
<user name="Rami" password="password"/>
<user name="user2" password="password"/>
</users>
</server>
<sessions>
<session name="web" url="java:website.org:7647">
<user name="supervisor5" password="*%55554@"/>
</session>
<session name="local" url=”java:localhost:6969”>
<user name="Rami" password="password"/>
</session>
</sessions>
</sofof>The XML file is composed of the root node sofof which have some XML settings that you have to write it. The root node has two children. The server node represents the Server configurations and the sessions node represents the _Session_s configurations. You can load the server configuration using the method configure and load the sessions configuration using the static method configure on the SessionManager and it will load the configured sessions. As you can see in the previous code each session has a name. You can get the configured session using the static method getSession(String name) on the SessionManager after passing the session name you have assigned to it in the XML file. This method will return null when there is no session with the passed name. This example shows how to configure the server and the database:
new Server().configure().startUp();
SessionManager.configure();
Session local = SessionManager.getSession("local");Like the other databases, sofof has a tool that will help you to do some commands on the database. You can start this tool from the console by running the sofof jar file. The result will be like this in the windows cmd:

As you can see from the image you can do the main operations on the database. This is using the commands listed on the console. In addition, you can after using the startServer or startSession by passing their required parameters (write -h after the command name to know it's parameters) execute commands on the session or server objects (depends on which command you choose) using the JavaScript language. When you try to run the command startServer the runner will put the Server object in a variable with the name server and the console will start to receive from you the JavaScript scripts to execute it. The same thing when you try to run the startSession command and this will put the Session object in a variable with the name session. You can use any class from sofof directly because all sofof classes are imported.
You can Look at other useful projects from here: