Maarch Framework 2.1/Technical Handbook/Configuration

De Maarch // Wiki.

Aller à : Navigation, rechercher

We use XML files to configure MAARCH and its environment. The advantage of a XML configuration is its contextual aptitude, which is difficult to represent in a property file. Indeed in the shape of pairs name/value, the contextual concept is generally badly represented by keys having the shape of way (my.path.towards.my.property). This approach is very useful and this system allows an easy configuration of MAARCH. To use MAARCH properly, some tables must also contains minimal information.


Sommaire

config.xml file

File structure :

<?xml version="1.0" encoding="iso-8859-1"?>
<ROOT>
	<CONFIG>
		<databaseserver>localhost</databaseserver>
		<databasename>maarch</databasename>
		<databaseuser>root</databaseuser>
		<databasepassword></databasepassword>
		<nblinetoshow>10</nblinetoshow>
		<limitcharsearch>2</limitcharsearch>
		<lang>en</lang>
		<adminmail>dev@maarch.org</adminmail>
		<adminname>maarch</adminname>
		<enabledadvsearch>true</enabledadvsearch>
		<enabledquicksearch>true</enabledquicksearch>
		<enabledindexfile>true</enabledindexfile>
		<enabledvideo>true</enabledvideo>
		<enableddir>true</enableddir>
		<shortcut>true</shortcut>
		<xmlpath>xml</xmlpath>
		<debug>true</debug>
		<applicationname>Maarch</applicationname>
		<css>css/new.css</css>
		<vbtemp>c:\tmp\</vbtemp>
	</CONFIG>
       <TABLENAME>
	<arboxes>ARBOXES</arboxes>
		<arcontainers>ARCONTAINERS</arcontainers>
	<authors>AUTHORS</authors>
	<baskets>BASKETS</baskets>
		<docservers>DOCSERVERS</docservers>
	<doctypes>DOCTYPES</doctypes>
		<extdocserver>EXT_DOCSERVER</extdocserver>
		<fulltext>FULLTEXT</fulltext>
		<groupbaskets>GROUPBASKET</groupbaskets>
		<groupsecurity>GROUPSECURITY</groupsecurity>
	<history>HISTORY</history>
		<resgroups>RESGROUPS</resgroups>
		<resgroupcontent>RESGROUP_CONTENT</resgroupcontent>
		<security>SECURITY</security>
		<usergroups>USERGROUPS</usergroups>
		<usergroupcontent>USERGROUP_CONTENT</usergroupcontent>
		<users>USERS</users>
	</TABLENAME>
	<RESOURCES>
			<tablename>res_x</tablename>
			<comment>Office documents</comment>
	</RESOURCES>
	<RESOURCES>
		<tablename>res_video</tablename>
 	<comment>Sample forms</comment>
	</RESOURCES>
      <RESOURCES>
		<tablename>res_a</tablename>
		<comment>Test table</comment>
      </RESOURCES>
	<COLUMNSRESULTS>
		<name>Champs custom texte 1</name>
		<tablename>CUSTOM_T1</tablename>
	</COLUMNSRESULTS>
	<COLUMNSDETAILS>
		<name>Champs custom texte 1</name>
		<tablename>CUSTOM_T1</tablename>
	</COLUMNSDETAILS>
	<COLUMNSDETAILS>
		<name>Champs custom texte 2</name>
		<tablename>CUSTOM_T2</tablename>
	</COLUMNSDETAILS>
	<WORKBATCH>
		<size>100</size>
	</WORKBATCH> 
       <HISTORY>
		<usersdel>true</usersdel>
		<usersban>true</usersban>
		<usersadd>true</usersadd>
		<usersup>true</usersup>
		<usersval>true</usersval>
		<doctypesdel>true</doctypesdel>
		<doctypesadd>true</doctypesadd>
		<doctypesup>true</doctypesup>
		<doctypesval>true</doctypesval>
		<doctypesprop>true</doctypesprop>
		<resadd>true</resadd>
		<resup>true</resup>
		<usergroupsdel>true</usergroupsdel>
		<usergroupsban>true</usergroupsban>
		<usergroupsadd>true</usergroupsadd>
		<usergroupsup>true</usergroupsup>
		<usergroupsval>true</usergroupsval>
	</HISTORY>
</ROOT>


Description :

This file contains on one hand the configuration of the Web servers and databases of MAARCH : address, name, language, password...The various access levels to the interface MAARCH are minimal starting from this file. The tag <CONFIG> contains the configuration of the server:

  • databaseserver : Address of the database server
  • databasename : Name of the database
  • databaseuser : Name of user on the database
  • databasepassword : User password of the database
  • nblinetoshow : Number of lines to post in the lists
  • limitcharsearch : Minimal number of characters for search
  • lang : Language of the application
  • adminmail : mail of the administrator
  • adminname : name and first name of the administrator
  • enabledadvsearch : Allow or not the advanced search
  • enabledquicksearch : Allow or not the quicksearch option
  • enabledindexfile : Allow or not files indexation
  • enabledvideo : Allow or not the Post indexing option
  • enableddir : Allow or not the browse by folder option
  • xmlpath : path to the xml files
  • debug : Active or not the debug mode
  • applicationname : name of the application
  • css : Path of the folder of CSS files

The <TABLENAME> tag contains the name of the tables (except the resources tables).

The <RESOURCES> tag contains one resources table :

  • tablename : name of the table in your database
  • comment : description of this table (showed in the file indexation & advanced search forms)

The <COLUMNSRESULTS> tag contains the list of the columns custom to be posted in the list of the documents after a search with name (made out to post) and tablename (name of the field) in parameters.

The <COLUMNSDETAILS> tag contains the list of the columns custom to be posted in the detailed card of the documents after a research with name (made out to post) and tablename (name of the field) in parameters.

The <WORKBATCH> tag contains the size of a workbatch (used in the Post indexing option).

The <HISTORY> tag contains the event you want to trace in Maarch. True means you trace the event, and false you don’t trace it. By default, Maarch traces all the events. You can access to the history through the Administration menu, when you have the rights.

Here are the events you can trace in Maarch :

  • usersdel : User deletion
  • usersban : User suspension
  • usersadd : User add
  • usersup : User modifications
  • usersval : User validation
  • doctypesdel : Document type deletion
  • doctypesadd : Document type add
  • doctypesup : Document type modification
  • doctypesprop : Document type proposition
  • resadd : Document add
  • resup : Document modification (through post indexing)
  • usergroupsdel : Users group deletion
  • usergroupsban : Users group suspension
  • usergroupsadd : Users group add
  • usergroupsup : Users group modification
  • usergroupsval : Users group validation


dir.xml file

File structure :

<?xml version="1.0" encoding="iso-8859-1"?>
<ROOT>
      <DocumentType>
           <ID>AR</ID>
           <NAME>Activity Report</NAME>
           <FORMAT>
                <NAME>GIF</NAME>
           </FORMAT>
           <FORMAT>
                <NAME>XLS</NAME>
           </FORMAT>
           <FORMAT>
                <NAME>JPG</NAME>
           </FORMAT>
     </DocumentType>
</ROOT>

Description : This file is used for the configuration of the browse by folder functionality. It has to be generated by batch every evening thanks to the file dir_generate_xml.php.

The <DocumentType> tag contains the data linked to a document type :

  • ID : Document type identifier
  • NAME : Document Type label
  • Different <FORMAT> tag : the files format indexed in the database corresponding to this document type.


extensions.xml

File structure :

<?xml version="1.0" encoding="iso-8859-1"?>

<ROOT>
	<FORMAT>
			<name>PDF</name>
			<mime>application/pdf</mime>
	</FORMAT>
</ROOT>


Description : This file contains all the extensions which are authorized in Maarch. The <FORMAT> tag contains the name and MIME type of each format.

Tables configuration

Maarch application needs some information to function properly. You need to enter some data in specific tables before using Maarch . The Database.sql file contains this minimal data.

Users Table To log in the application, you need at least one user, and preferably an administrator. By default, there is a demo user who has the administrator rights. We advise you to make your own admin user and to erase the demo user for security matters. The proper SQL syntax and values are : INSERT INTO `users` VALUES ('user login name', md5(password), 'First Name', 'Last Name', 'Phone Number', 'mail', 'department', , , );

Usergroups Table Each user belongs to at least one user groups. So you need to create at least one user group. If you want your user to be administrator, make this group an administrator group. The proper SQL syntax and values are : INSERT INTO `usergroups` VALUES ('User name', 'Group name ', 'Primary : Y or N', 'user role');

Usergroup_content Table You need to relate your user to your new group. This is done in this table. You can specify the role of the user in this group. Each user must have a primary group. The proper SQL syntax and values are : INSERT INTO `usergroup_content` VALUES ('Group name', 'Group description ', 'Y or N', 'Y');

Security Table This is here that you attribute rights on the resources tables for each group. The proper SQL syntax and values are : INSERT INTO `security` VALUES ('Group name', 'Table name ', 'where clause(without the word where', 'insert rights : Y or N', 'update rights : Y or N');

DocServers Table To archive your documents you need to specify at least one repertory, the document server (DocServer). By default, the docservers table contains one entry. You need to change the PATH_TEMPLATE field, the new value must me your path (UNC compliance) to your docserver in your own server. If you use windows, an UNC name must be like : \\ServerName\SharedName\Path\FileName

Here is an example of the minimal information needed in the DOCSERVERS table : INSERT INTO docservers (DOCSERVER_ID ,PATH_TEMPLATE, CREATION_DATE) VALUES ('mydocserver','\\myserver\mydocserverpath\', now())

DocTypes Table When you index a new document in MAARCH, you need to specify its type. So you need to have already entered some document types in the DocTypes table before indexing documents. By default, this table contains 10 generic documents types, but it will certainly not be adapted to your needs, so don’t hesitate to add more. Here is an example of the minimal information needed in the DOCTYPES table : INSERT INTO doctypes (RES_TABLE, TYPE_ID, DESCRIPTION ) VALUES ('Resources table','Type Id', 'Type description');

Language