Maarch Framework 3/Developer handbook/Apps

De Maarch Wiki.

Aller à : Navigation, rechercher
Warning.gif Cette section du wiki est en cours de restructuration et de rédaction. Nous nous excusons pour la gêne occasionnée.
This section of the wiki is under heavy restructuring and writing. We're sorry for the inconvenience.

Sommaire

Summary

Overview of the Apps classes

The graphical part of the application is handled by the apps directory and especially the apps classes.

Featured managed by the apps :

  • Administration interfaces
  • Managements of graphics
  • Management of the displayed lists

Core Structure

 /apps
   /apps_name (ex: maarch_sample)
     /admin
       /action
       /architecture
       /groups
       /history
       /maarch_config_tool
       /status
       /users
     /class
       class_admin.php
       class_admin_actions.php
       class_admin_status.php
       class_business_app_tools.php
       class_graphics.php
       class_list_show.php
       class_types.php
       class_usergroup_content.php
       class_usergroups.php
       class_users.php
     /css
       styles.css
       styles_ie.css
       styles.ie7.css
     /img
     /js
     /lang
       en.php
       fr.php
       ...
     /sql
       /data
         core.mysql.sql
         core.postgresql.sql
       /structure
         core.mysql.sql
         core.postgresql.sql
     /tmp
     /tools
     /xml
       config.xml
       menu.xml
       services.xml
     admin.php
     change_pass.php
     index.php
     log.php
     login.php
     logout.php
     maarch_credits.php
     no_right.php
     reopen.php
     verif_pass.php
     welcome.php

The admin directory contains all the files for the application administration. The subdirectory described here are the minimal administration. The business application can have more administration subdirectories.

The css directory contains the main css files of the application and the img directory all the images and icons of the application. All css and image files specific to modules are stored in the modules directories.

The js directory contains all the javascript files of the application.

The lang directory contains the language files of the application.

The tmp directory is the temporary directory of the application by default.

The tools directory contains the external librairies and applications used in Maarch applications.

The php files described here are the minimal structure for the application.

Settings

config.xml

apps/apps_name/xml/config.xml

<?xml version="1.0" encoding="utf-8"?>
<ROOT>
   <CONFIG>
      <businessappname>maarch_sample</businessappname> <!-- Name of the application : must be the name of the directory apps/app_name -->
      <businessapppath>C:\xampp\htdocs\maarch_v3\apps\maarch_sample\</businessapppath> <!-- Path to the application directory, must end with / or \ depending of your OS -->
      <businessappurl>http://127.0.0.1/maarch_v3/apps/maarch_sample/</businessappurl> <!-- URL to  Maarch application -->
      <databaseserver>127.0.0.1</databaseserver> <!-- Name or IP address of the Maarch database -->
      <databaseserverport>3306</databaseserverport> <!-- Maarch database port number -->
      <databasetype>MYSQL</databasetype> <!-- Maarch database type : MYSQL, POSTGRESQL, ... -->
      <databasename>maarch_v3</databasename> <!-- Maarch database name -->
      <databaseuser>root</databaseuser> <!-- Maarch database user -->
      <databasepassword></databasepassword> <!-- Maarch database password -->
      <databasesearchlimit>500</databasesearchlimit> <!-- Maarch database search limit -->
      <nblinetoshow>10</nblinetoshow> <!-- Maximum number of item displayed in lists -->
      <limitcharsearch>2</limitcharsearch> <!-- Minimal number of characters in search -->
      <lang>fr</lang>  <!-- Application language -->
      <adminmail>dev@maarch.org</adminmail> <!-- Maarch admin email -->
      <adminname>maarch</adminname> <!-- Maarch admin name -->
      <debug>false</debug> <!-- Mode debug : true or false -->
      <applicationname>Maarch</applicationname> <!-- Application name, displayed in the top of the browser window -->
      <css>http://127.0.0.1/maarch_v3/apps/maarch_sample/css/styles.css</css> <!-- Maarch main css file -->
      <css_ie>http://127.0.0.1/maarch_v3/apps/maarch_sample/css/style_ie.css</css_ie> <!-- Maarch main css for internet explorer -->
      <css_ie7>http://127.0.0.1/maarch_v3/apps/maarch_sample/css/style_ie7.css</css_ie7> <!-- Maarch main css for internet explorer 7 -->
      <img>img</img> <!-- Path to the directory containing application images and icons -->
      <defaultPage>welcome</defaultPage> <!-- Application welcome page  -->
      <tmppath>C:\xampp\htdocs\maarch_v3\apps\maarch_sample\tmp\</tmppath> <!-- Application temporary directory  -->
      <CookieTime>60</CookieTime><!-- Time of the application cookie in minutes --> 
  </CONFIG>
  <TABLENAME>	<!-- Application specific tables -->					  
	<doctypes_first_level>doctypes_first_level</doctypes_first_level>
	<doctypes_second_level>doctypes_second_level</doctypes_second_level>
  </TABLENAME>
  <WORKBATCH>							
	<size>100</size>
  </WORKBATCH>
  <COLLECTION> <!-- Description of maarch collections -->
	<id>coll_1</id> <!-- Collection identifier -->
	<label>_DOCUMENTS</label> <!-- Collection label : defined in the language files -->
	<table>res_x</table> <!-- Resource table of the collection -->
	<view>res_view</view> <!-- View of the collection -->
	<index_file>index.xml</index_file> <!-- Xml file containing all the indexes specific to the collection -->
	<script_add>index_documents.php</script_add> <!-- Script to add new resources to the collection -->
	<script_search>search_with_folder.php</script_search>  <!-- Script used to search through to the collection -->
	<script_search_result>list_results_documents.php</script_search_result>  <!-- Script display to search results -->
	<script_details>details_documents.php</script_details>  <!-- Details page of the collection -->
	<extensions> <!-- Tables to extend the resource table of the collection -->
	  <table></table>
	</extensions>
	<path_to_lucene_index>C:\Maarch\indexes\coll_1\</path_to_lucene_index>  <!-- Path to the Lucene indexes (used in full-text search) -->
   </COLLECTION>
   <COLLECTION>
	<id>coll_2</id>
	<label>_INVOICES</label>
	<table>res_invoices</table>
	<view>res_view_invoices</view>
	<index_file>index2.xml</index_file>
	<script_add>index_invoices.php</script_add>
	<script_search>search_without_folder.php</script_search>
	<script_search_result>list_results_invoices.php</script_search_result>
	<script_details>details_invoices.php</script_details>
	<extensions>
	  <table></table>
	</extensions>
	<path_to_lucene_index>C:\Maarch\indexes\coll_2\</path_to_lucene_index>
   </COLLECTION>
   <HISTORY> <!-- What will be traced in the application -->
	<usersdel>true</usersdel> <!-- Deleting a user-->				
	<usersban>true</usersban>  <!-- Suspending a user-->	 				
	<usersadd>true</usersadd>  <!-- Adding a new user-->					
	<usersup>true</usersup>	  <!-- Modifying a user-->					
	<usersval>true</usersval> <!-- Validating a user-->				
	<doctypesdel>true</doctypesdel>	 <!-- Delete a document type -->		
	<doctypesadd>true</doctypesadd>	<!--Add a new document type -->			
	<doctypesup>true</doctypesup>	<!-- Modifying a document type -->			
	<doctypesval>true</doctypesval>	 <!-- Validating a document type -->			
	<doctypesprop>true</doctypesprop> <!-- Deprecated -->		
	<usergroupsdel>true</usergroupsdel> <!-- Deleting a user group -->			
	<usergroupsban>true</usergroupsban> <!-- Suspending a user group -->			
	<usergroupsadd>true</usergroupsadd> <!-- Adding a new user group -->
	<usergroupsup>true</usergroupsup> <!-- Modifying a user group -->			
	<usergroupsval>true</usergroupsval> <!-- Validating a user group -->	
	<structuredel>true</structuredel>  <!-- Deleting a structure -->		
	<structureadd>true</structureadd> <!-- Adding a new structure -->			
	<structureup>true</structureup>	<!-- Modifying a structure -->
	<subfolderdel>true</subfolderdel> <!-- Deleting a subfolder -->			
	<subfolderadd>true</subfolderadd> <!-- Adding a new subfolder -->					
	<subfolderup>true</subfolderup>	 <!-- Modifying  a subfolder -->		
	<contractdel>true</contractdel>	 <!-- Deprecated -->	
	<contractadd>true</contractadd>	 <!-- Deprecated -->			
	<contractup>true</contractup>  <!-- Deprecated -->
	<diplomadel>true</diplomadel>	  <!-- Deprecated -->		
	<diplomaadd>true</diplomaadd>	 <!-- Deprecated -->			
	<diplomaup>true</diplomaup>	 <!-- Deprecated -->		
  </HISTORY>
  <KEYWORDS> <!-- Key words used in Maarch Log -->
	<id>ADD</id>
	<label>_ADDITION</label>
  </KEYWORDS>
  <KEYWORDS>
	<id>UP</id>
	<label>_MODIFICATION</label>
  </KEYWORDS>
  <KEYWORDS>
	<id>DEL</id>
	<label>_DELETION</label>
  </KEYWORDS>
  <KEYWORDS>
	<id>BAN</id>
	<label>_SUSPENSION</label>
  </KEYWORDS>
  <KEYWORDS>
	<id>VAL</id>
	<label>_VALIDATION</label>
  </KEYWORDS>
  <KEYWORDS>
	<id>LOGIN</id>
	<label>_LOGIN</label>
  </KEYWORDS>
  <KEYWORDS>
	<id>LOGOUT</id>
	<label>_LOGOUT</label>
  </KEYWORDS>
  <MODULES> <!-- Module loaded in the application -->
   	<moduleid>indexing_searching</moduleid>
	<comment>_INDEXING_SEARCHING</comment>
  </MODULES>
  <MODULES>
  	<moduleid>folder</moduleid>
	<comment>_FOLDERS</comment>
  </MODULES>
  <MODULES>
   	<moduleid>physical_archive</moduleid>
	<comment>_PHYSICAL_ARCHIVE</comment>
  </MODULES>
  <MODULES>
   	<moduleid>workflow</moduleid>
	<comment>_WORKFLOW</comment>
  </MODULES>
  <MODULES>
   	<moduleid>notes</moduleid>
	<comment>_NOTES</comment>
  </MODULES>
  <MODULES>
   	<moduleid>basket</moduleid>
	<comment>_BASKETS</comment>
  </MODULES>
  <MODULES>
   	<moduleid>postindexing</moduleid>
	<comment>_POSTINDEXING</comment>
  </MODULES>
  <MODULES>
   	<moduleid>autofoldering</moduleid>
	<comment>_AUTOFOLDERING</comment>
  </MODULES>
  <MODULES>
   	<moduleid>stats</moduleid>
	<comment>_STATS</comment>
  </MODULES>
</ROOT>

The <COLLECTION> tag contains all information on a ressource collection. The framework is multi-collection. You can define one or more collections in the config.xml file.

The <HISTORY> tag contains the list of all actions that can be saved in the application history. To disabled this, just set the action tag to false.

The <MODULES> tags indicated which module is loaded in the application.

menu.xml

apps/apps_name/xml/menu.xml

<?xml version="1.0" encoding="utf-8"?>
<ROOT>
  <MENU> <!-- Menu item -->
     <id>admin</id> <!-- Identifier of the menu item -->
     <libconst>_ADMIN</libconst> <!-- Text displayed in the menu -->
     <url>index.php?page=admin</url>  <!-- URL of the  menu item -->
     <style>admin</style> <!-- CSS style (identifier or class) of the menu item, defined in the apps/apps_name/css/styles.css file -->
  </MENU>
</ROOT>

services.xml

apps/apps_name/xml/services.xml

<?xml version="1.0" encoding="utf-8"?>
<root>
<SERVICE> 
   <id>admin</id> <!-- if servicetype = menu, this id must be equal to the id of the menu item -->
   <name>_ADMIN</name>
   <comment>_ADMIN</comment>
   <servicetype>menu</servicetype>
   <system_service>false</system_service>
   <enabled>true</enabled>
 </SERVICE>
<SERVICE>
   <id>admin_users</id>
   <name>_ADMIN_USERS</name>
   <comment>_ADMIN_USERS_DESC</comment>
   <servicepage>index.php?page=users&amp;admin=users</servicepage>
   <servicetype>admin</servicetype>
   <system_service>false</system_service>
   <style>admin_users</style>
   <enabled>true</enabled>
   <WHEREAMIUSED>
     <page>admin.php</page>
     <nature>listelement</nature>
   </WHEREAMIUSED>
 </SERVICE>
 <SERVICE>
   <id>admin_groups</id>
   <name>_ADMIN_GROUPS</name>
   <comment>_ADMIN_GROUPS_DESC</comment>
   <servicepage>index.php?page=groups&amp;admin=groups</servicepage>
   <servicetype>admin</servicetype>
   <system_service>false</system_service>
   <style>admin_groups</style>
   <enabled>true</enabled>
   <WHEREAMIUSED>
     <page>admin.php</page>
     <nature>listelement</nature>
   </WHEREAMIUSED>
 </SERVICE>
 <SERVICE>
   <id>admin_architecture</id>
   <name>_ADMIN_ARCHITECTURE</name>
   <comment>_ADMIN_ARCHITECTURE_DESC</comment>
   <servicepage>index.php?page=admin_archi&amp;admin=architecture</servicepage>
   <servicetype>admin</servicetype>
   <system_service>false</system_service>
   <style>admin_architecture</style>
   <enabled>true</enabled>
   <WHEREAMIUSED>
     <page>admin.php</page>
     <nature>listelement</nature>
   </WHEREAMIUSED>
 </SERVICE>
 <SERVICE>
   <id>view_history</id>
   <name>_VIEW_HISTORY</name>
   <comment>_VIEW_HISTORY_DESC</comment>
   <servicepage>index.php?page=history&amp;admin=history</servicepage>
   <servicetype>admin</servicetype>
   <system_service>false</system_service>
   <style>view_history</style>
   <enabled>true</enabled>
   <WHEREAMIUSED>
     <page>admin.php</page>
     <nature>listelement</nature>
   </WHEREAMIUSED>
 </SERVICE>
 <SERVICE>
   <id>xml_param_services</id>
   <name>_XML_PARAM_SERVICE</name>
   <comment>_XML_PARAM_SERVICE_DESC</comment>
   <servicepage>index.php?page=xml_param_services&amp;admin=maarch_config_tool</servicepage>
   <servicetype>admin</servicetype>
   <system_service>false</system_service>
   <style>xml_param_services</style>
   <enabled>true</enabled>
   <WHEREAMIUSED>
     <page>admin.php</page>
     <nature>listelement</nature>
   </WHEREAMIUSED>
 </SERVICE>
 <SERVICE>
   <id>admin_status</id>
   <name>_ADMIN_STATUS</name>
   <comment>_ADMIN_STATUS_DESC</comment>
   <servicepage>index.php?page=status&amp;admin=status</servicepage>
   <servicetype>admin</servicetype>
   <style>admin_status</style>
   <system_service>false</system_service>
   <enabled>true</enabled>
   <WHEREAMIUSED>
     <page>admin/admin.php</page>
     <nature>listelement</nature>
   </WHEREAMIUSED>
 </SERVICE>
  <SERVICE>
   <id>admin_actions</id>
   <name>_ADMIN_ACTIONS</name>
   <comment>_ADMIN_ACTIONS_DESC</comment>
   <servicepage>index.php?page=action&amp;admin=action</servicepage>
   <servicetype>admin</servicetype>
   <style>admin_actions</style>
   <system_service>false</system_service>
   <enabled>true</enabled>
   <WHEREAMIUSED>
     <page>admin.php</page>
     <nature>listelement</nature>
   </WHEREAMIUSED>
 </SERVICE>
</root>
Language