CynicRus
2012-10-28 11:33:47
Hi. 10 days ago I started this work to create a script manager. After working thoroughly on it I'm almost through with the thing. The structures for data storage in xml tree both for the client and server have been designed. A class for working with such structures has been developed as well. It was originally planned to add up to the existing script manager, but after having examined its source code it was decided to start from scratch. At the moment the job is 95 per cent complete. In the framework of the developed class I have worked out several functions for loading and saving the information from the server side as well as loading, updating and synchronizing the client side with the server one. I have also designed a few types of data for working with the given tree structures based on class TCollection. The solution in question is a cross-platform one, it can work in both Windows and Linux. Now for the full completion of the project it's necessary to add a couple of functions and also test it all properly.
Below I attach the examples of the developed formats of the client and server sides with the necessary explanations.
Tags:
<?xml version="1.0" encoding="UTF-8"?> - the obligatory string for the document title validation
Structure:
Tag is used for the package description and has only one attribute — 'name' — which in its turn is the script category name. It owns the tag-file with attributes like:
- 'filename' — the name shown in script manager as 'script name'; also, on the basis of this attribute, url name for script package downloading is formed;
- 'date_modify' stands for the latest script package modification;
- 'author' — just the author of the script;
- 'email' — the author's e-mail;
- 'version' is the script package version on the server.
The tag-file includes the tag description with the value of the script description. Can consist of several strings.
Tag-subfile that has attributes 'filepath' and 'filename' is used in case of multifiles in a package, where 'filepath' stands for the path to extract the files and 'filename' — for the name of the file extracted.
The client side has a server structure, only with some attributes like 'update' and 'installed' added. 'Update' contains the script update availability flag, and 'installed' — the flag showing whether the script package is installed.
The up-to-date code is available on the official repository(tnx Dgby714): https://github.com/SRL/ScriptManager
You are welcome to criticise the code.
Thanks for your attention.
Cheers,
Cynic.
PS: a few screens:
Linux: http://s017.radikal.ru/i402/1210/20/02e6815b74ba.png
Windows:http://s60.radikal.ru/i169/1210/97/5507e6e813c3.jpg
Below I attach the examples of the developed formats of the client and server sides with the necessary explanations.
<?xml version="1.0" encoding="UTF-8"?>
<Document>
<structure name="Agility">
<file filename="another_agility" date_modify="10.11.2012" author="san" email="what@mail.com" version="1.6" >
<description>great script</description>
<subfile filename="112211.png" filepath="C:/"/>
<subfile filename="lalala.simba" filepath="C:/"/>
</file>
</structure>
</Document>
Tags:
<?xml version="1.0" encoding="UTF-8"?> - the obligatory string for the document title validation
Structure:
Tag is used for the package description and has only one attribute — 'name' — which in its turn is the script category name. It owns the tag-file with attributes like:
- 'filename' — the name shown in script manager as 'script name'; also, on the basis of this attribute, url name for script package downloading is formed;
- 'date_modify' stands for the latest script package modification;
- 'author' — just the author of the script;
- 'email' — the author's e-mail;
- 'version' is the script package version on the server.
The tag-file includes the tag description with the value of the script description. Can consist of several strings.
Tag-subfile that has attributes 'filepath' and 'filename' is used in case of multifiles in a package, where 'filepath' stands for the path to extract the files and 'filename' — for the name of the file extracted.
The client side has a server structure, only with some attributes like 'update' and 'installed' added. 'Update' contains the script update availability flag, and 'installed' — the flag showing whether the script package is installed.
The up-to-date code is available on the official repository(tnx Dgby714): https://github.com/SRL/ScriptManager
You are welcome to criticise the code.
Thanks for your attention.
Cheers,
Cynic.
PS: a few screens:
Linux: http://s017.radikal.ru/i402/1210/20/02e6815b74ba.png
Windows:http://s60.radikal.ru/i169/1210/97/5507e6e813c3.jpg