/[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.1 - (hide annotations)
Sat Mar 1 15:29:11 2003 UTC (21 years, 5 months ago) by joko
Branch: MAIN
+ initial commit

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

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