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

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