Constructor for creating content-dependent applications in the style of Web 2.0

It will be about the recently opened Open Source project SAPID CMF. By itself, the name SAPID may seem vaguely familiar to some. Yes, once upon a time there was such a simple CMS SAPID that allowed to administer inline sites, it required only 1MB of disk space and managed to do without a DBMS. However, few people remember that this system was created to demonstrate the capabilities of the XML Sapiens paradigm. CMS SAPID safely and pompously celebrated its first anniversary, and then, for two years, no significant new releases, sadly, were observed. However, the last year on the SAPID community site from time to time slipped information about work on a new branch of the SAPID CMF project. Voila! Here it is - a branch available for download ( http://sapidcmf.sourceforge.net) and for a “cap” dating ( http://cmfdemo.xmlsapiens.org ).
SAPID CMF is something like a two-in-one set, where SAPID is a content management system with a basic administrative interface and CMF is a constructor for turning this interface into its own customized system.
Any CMS is, on the one hand, an engine for web applications, and on the other, an interface for administering these applications. It would be logical to assume that the applications of the delivery area (those that are available to users of the site) and the applications of the CMS administrative panel operate on the basis of a single engine, obey the same logic, and use the same principle of templates. Thus, a CMS that allows the creation of external web applications should just as easily provide the creation of internal administrative interfaces. The heart of SAPID is the XML Sapiens processor. XML Sapiens- declarative language for describing patterns of data structures, design and functionality. Using the language, you can create components for all three levels (data, design, functionality) and use them repeatedly (reusing), like designer cubes, to get a wide variety of solutions. The XML Sapiens processor compiles these components into a ready-made user interface for the application.
For web applications, unlike desktop programs, there is no predefined set of GTK controls. This is both an advantage and a disadvantage. When creating each new application or group of applications, developers are forced to create a new GTK. In order to make life easier for developers, the GTK of the SAPID CMF administrative panel is made in the manner of Windows. Each of its applications has a workspace, menus, modal windows, message boxes, dialogs, processes. The components available are tree view and list view. Thus, we have a kind of “gentleman's set” for quickly creating administrative panel applications in a single style.


Readiness for development
You will say: “Great! I will add my own applications to the admin panel. In a month, a new release of the framework will appear. I will upgrade and lose all my work. ” In fact, the SAPID CMF is organized in such a way that only the basic components are replaced during the upgrade, and the additional components added by the developer will remain intact. The question arises: “How to modify the basic components and protect the modification code from being overwritten during the upgrade?”. SAPID CMF uses an event model in the style of aspect-oriented programming. The system defines various events. You can add your own various event handlers that modify the environment properly. The modification code will be placed in the plugins folder, which is skipped when updating the framework. In terms of AOP for making modifications to basic components (API libraries, controllers, etc.) you define some aspect of the modification.
$ ModalWindowCustomization = new Aspect ();
We set the listening area for it, say all classes and all methods
$ pc = $ ModalWindowCustomization-> pointcut ("call * :: *");
and assign the modification code
$ pc -> _ event ("ModalWindowSchemasDefined", "customizateModalWindow (\ $ obj);") to a specific event ;
As already mentioned, the overriding goal of SAPID CMF is to ensure efficient reuse of data structure blanks, layout, and functionality when creating web applications. The framework contains the VIEWS root folder. It contains a DEFAULT folder for default admin panel skin themes and a DELIVERY folder for application templates created on the basis of the framework. If you add additional themes, the corresponding folders will appear here. Any of them contains functionality templates (DDC folder), field sets (FIELDSETs folder), content request templates (QCs folder) and design templates (TEMPLATES folder).
Once written, use repeatedly
When you create a web application in a layout sketch of a logical page, dynamic areas are defined. For example, we cut out menu blocks, list blocks, etc. and transfer their design code to the corresponding DDC. DDC, in addition to the design code, also defines the dynamic block logic . Here conditions can be used, data enumerations from the requested CMS applications, inclusion, XML Sapiens expressions, as well as unlimited nesting of these structures. XML is used to describe this logic. XML Sapiens allows you to use the same DDC to form different dynamic blocks. When a DDC is called, parameters that can be considered in a DDC environment can be transmitted.
If a data entry form is assumed in the code of the dynamic block or in the code of the template of the logical page, we turn to QC. QC determines how the data communicated to it will be displayed or requested. Say if we use a call like

If the set of fields of the data request form varies dynamically (depending on the state of the environment), we can use the call to the set of fields. For instance,
This construct will return a set of content request fields corresponding to the admin state in the fieldset1.xml file.
What is the theory in practice?

It is possible to read to this place, you thought: “All these piles look somehow scary. It’s interesting, can at least something really make money on this framework? ” In the distribution package, a ready-made demo site is delivered with the framework. In addition to typical things, the site contains an example of an authorization / registration form using AJAX. The form also includes OpenID authorization. The site provides an example of an ad slot for banners of mixed types (GIF / Flash / DHTML / RichMedia). There is also an example of using IntelliTXT technology. Terms entered into the thesaurus of the system are automatically converted in the texts of the pages of the site into tooltip links (double underlined links). When you hover over the link, a window with a hint pops up. The system keeps statistics of impressions related to window links,
The demo site contains an example of a multi-level gallery with the ability to comment on photos. Voting is acceptable for both photos and comments. An example of a catalog on a site demonstrates the possibilities of grouping products by tags (similar products, tag cloud). In general, there is something to work with and, moreover, there is some basic set of solutions that you can safely use in your projects.