Bug 432 - [Chameleon - Core] widgets found in chameleon instead of user-defined directories
: [Chameleon - Core] widgets found in chameleon instead of user-defined directo...
Status: CLOSED FIXED
: Chameleon
Core
: 1.99
: PC Windows XP
: P2 normal
: 1.99 beta 3
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2004-06-02 11:22 by
Modified: 2004-10-27 17:34 (History)


Attachments
modified_hawaii4.zip-modified template and application (4.06 KB, application/octet-stream)
2004-07-14 12:08, Normand Savard
Details
modified_widget.zip-HelpWidget modified (3.26 KB, application/octet-stream)
2004-07-14 12:09, Normand Savard
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-06-02 11:22:25
When executing a Chameleon application, it is possible to include additional
directories that can be searched for widget definitions.  The intention is to
allow client or application-specific widgets to be deployed that are not part of
the main Chameleon distribution.

If the same widget resides in both Chameleon and in the application-defined
directory, Chameleon currently will find its own widget first and never use the
application-specific one.

In practice this situation shouldn't come up, but theoretically it is possible
that a client application could redefine the behaviour of a widget in this way
(for instance, provide a modified query widget that formats output differently).
 so this should be changed.
------- Comment #1 From 2004-06-02 11:23:30 -------
fixed in cvs
------- Comment #2 From 2004-06-24 14:57:23 -------
should this bug be verified under beta 2, and second what is the best way to
verify this issue.
------- Comment #3 From 2004-07-05 13:13:43 -------
I made a simple test with "sample_enhanced.phtml" application.  I moved the
"ProjectionSelector" widget directory under "sample/htdocs" directory.  The
widget definition was not found.   Paul, could you provide us with documentation
on how it is supposed to work?  
------- Comment #4 From 2004-07-07 11:40:24 -------
In order to make an application use widgets from an application specific
location, you need to register the location with the chameleon framework.  The
method of doing this is to pass an array of directories to be searched to the
CWCExecute function.  In the samples, you would change this line:

$oApp->CWCExecute();

to

$oApp->CWCExecute( "/ms4w/apps/chameleon/samples/htdocs" );

and you would move the ProjectionSelector directory from the
chameleon/htdocs/widgets directory to the chameleon/samples/htdocs directory.

But the real issue resolved by this bug was that if the same widget existed in
both chameleon and the applications' widget path, the one from chameleon would
be used instead of the application one.  So to test this correctly, you should
make a COPY of the ProjectionSelector (or some other widget) and modify in some
way that you can then tell which widget is being used.
------- Comment #5 From 2004-07-14 12:08:09 -------
Created an attachment (id=42) [details]
modified_hawaii4.zip-modified template and application
------- Comment #6 From 2004-07-14 12:09:18 -------
Created an attachment (id=43) [details]
modified_widget.zip-HelpWidget modified
------- Comment #7 From 2004-07-14 12:17:26 -------
Two copies of the same widgets in different locations generates a PHP error.

Test settings used with hawai demo found on xcalibur (see comment #4):

1.  Create a widgets directory under "/path/to/hawaii_chameleon/htdocs".
2.  Copy the "HelpWidget" directory under this new widget directory.
3.  Modified the "HelpWidget.widget.php" file (e.g.:  I modified an output line
like this:
     'echo "<dl><dt class=\"WidgetSectionHeading\">DescriptionNorm:</dt>\n";'.
4.  Modified the "index.phtml" file to specify the new widgets directory.
5.  Load the application.
6.  PHP error (see below).

I attached required files.

Fedora Core 2
Mozilla 1.6
Chameleon 20040709



-------------
PHP error:

[14-Jul-2004 12:02:41] PHP Fatal error:  Cannot redeclare class uimanager in
/home/nsavard/proj/chameleon_beta/htdocs/UIManager.php on line 41
 
------- Comment #8 From 2004-07-22 15:26:37 -------
Changed target to 1.99 Beta 3.
------- Comment #9 From 2004-10-07 14:36:51 -------
tested in the following way:

1. copy sample_ogc.html to sample_customwidget.html

2. copy sample_ogc.phtml to sample_customwidget.phtml

3. edit sample_customwidget.phtml:
* change $szTemplate to sample_customwidget.html
* change $oApp->CWCExecute() to $oApp->CWCExecute( array( $gszAppPath."/widgets"
) );

4. create directory chameleon/samples/htdocs/widgets

5. copy chameleon/htdocs/widgets/MapTitle to chameleon/samples/htdocs/widgets

6. Edit chameleon/samples/htdocs/widgets/MapTitle/MapTitle.widget.php:
* change line 87 to read $szMapTitle = "My TITLE";

7. open app at http://localhost/chameleon/samples/sample_customwidget.phtml.

You will get an error saying that MapTitle cannot open Widget.php ... you can
ignore this

The Title at the top of the page will be My TITLE instead of the name from the
map file.

Confirm:

Remove chameleon/samples/htdocs/widgets and reload, should get DEMO.

------- Comment #10 From 2004-10-25 15:00:59 -------
verified on windows ie. 6, using pauls steps in last comment
------- Comment #11 From 2004-10-27 17:34:16 -------
Verified on Fedora Core 2.