/[cvs]/nfo/php/libs/org.netfrag.glib/Application/ComponentRegistry.php
ViewVC logotype

Annotation of /nfo/php/libs/org.netfrag.glib/Application/ComponentRegistry.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations)
Mon Mar 10 23:25:02 2003 UTC (21 years, 5 months ago) by joko
Branch: MAIN
Changes since 1.2: +5 -5 lines
+ fixed metadata for phpDocumentor

1 joko 1.1 <?php
2     /**
3     * This file contains the Application::ComponentRegistry class.
4     *
5     * @author Andreas Motl <andreas.motl@ilo.de>
6 joko 1.2 * @package org.netfrag.glib
7     * @name Application::ComponentRegistry
8     *
9 joko 1.1 */
10    
11     /**
12 joko 1.3 * $Id: ComponentRegistry.php,v 1.2 2003/03/05 18:54:42 joko Exp $
13 joko 1.2 *
14     * $Log: ComponentRegistry.php,v $
15 joko 1.3 * Revision 1.2 2003/03/05 18:54:42 joko
16     * updated docu - phpDocumentor is very strict about its 'blocks'...
17     *
18 joko 1.2 * Revision 1.1 2003/03/01 15:29:11 joko
19     * + initial commit
20 joko 1.1 *
21     *
22     */
23    
24    
25     /**
26     * This provides an infrastructure for having
27     * components to be registered with.
28     *
29     * These components could be something which make up
30     * parts, areas or pages on a large website (the level above
31     * the widget-layer) or just simple plugins or shared code.
32     * (similar to m$'s dll/com-system, but very lightweight)
33     *
34     * Currently, we are registering "Views" with this thing.
35     * These "Views" should represent the "Views" in the MVC Model.
36     * "Views" are components made up of phpHtmlLib widgets.
37     *
38     * They currently live in the "Page::" namespace, which should be
39     * migrated to the "View::" namespace to actually represent this
40     * stuff conveniently 1:1 in userspace.
41     *
42     * references:
43     * - package=org.netfrag.glib, module=DesignPattern::MVC
44     * - package=lib.admin.frontend, module=TsBackend: $this->_mvc->add_view( ... )
45     *
46     *
47     * @author Andreas Motl <andreas.motl@ilo.de>
48     * @copyright (c) 2003 - All Rights reserved.
49     * @license GNU LGPL (GNU Lesser General Public License)
50     *
51 joko 1.2 * @link http://www.netfrag.org/~joko/
52     * @link http://www.gnu.org/licenses/lgpl.txt
53 joko 1.1 *
54     * @package org.netfrag.glib
55 joko 1.2 * @subpackage Application
56     * @name Application::ComponentRegistry
57 joko 1.1 *
58 joko 1.3 * @todo (o) Be able to *persistently* register new components.
59 joko 1.1 * By now the declaration (read-only) is included on each request.
60     * No caching or similar stuff occours at this level!!!
61     *
62     */
63     class Application_ComponentRegistry {
64    
65     /**
66     * This var holds the locator metadata hash
67     * that is used to feed metadata to a per-query-instance
68     * of a Data::Driver::Proxy object.
69     *
70     */
71     var $_regdb = NULL;
72    
73     var $_registry = NULL;
74     var $_mode = NULL;
75    
76    
77     /**
78     * The constructor may be used to pass in the
79     * complete registry as a payload chunk.
80     *
81     * @param registry
82     */
83     function Application_ComponentRegistry($registry = null, $mode = null) {
84    
85     $this->_registry = &$registry;
86    
87     if ($mode) {
88     $this->set_mode($mode);
89    
90     // autodetect mode
91     } else {
92    
93     if ($registry) {
94     $this->set_mode('REGDB_PAYLOAD');
95     } else {
96     $this->set_mode('REGDB_CONSTANT');
97     }
98    
99     }
100    
101     $this->read_regdb();
102    
103     }
104    
105     function set_mode( $mode ) {
106     $this->_mode = $mode;
107     return $this->_mode;
108     }
109    
110     function get_mode() {
111     return $this->_mode;
112     }
113    
114     function read_regdb() {
115     switch ($this->get_mode()) {
116     case 'REGDB_LOCAL':
117     $this->_regdb = &$this->_registry;
118     break;
119     case 'REGDB_CONSTANT':
120     $this->_regdb = COMPONENT_regdb;
121     break;
122     }
123    
124     }
125    
126     function getComponentByTopic($name) {
127    
128     }
129    
130     function getComponentByPage($name) {
131    
132     }
133    
134    
135     }
136    
137     ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed