A document has been updated:
http://cocoon.zones.apache.org/daisy/documentation/1351.html
Document ID: 1351
Branch: main
Language: default
Name: Migration guide (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 4/13/07 7:48:20 PM
Updated by: Grzegorz Kossakowski
A new version has been created, state: publish
Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name: (unchanged)
Size: 11331 bytes (previous version: 7599 bytes)
Content diff:
(86 equal lines skipped)
<xsl:param name="forms-resources"/>
</pre>
+++ <h2>Javascript adjustments (for widgets authors)</h2>
+++
+++ <p>If you happened to write custom widget you probably will need to adjust
your
+++ code, also. Unfortunately, this step can be more troublesome than others
and can
+++ demand from you better understanding of the changes that has been
incorporated
+++ into Forms code during refactoring process. Here, the most important issues
will
+++ be highlighted taking as example migration of MultiValueEditor from Cocoon's
+++ distribution.<br/>
+++ Here is the diff:</p>
+++
+++ <pre>Index:
src/main/resources/org/apache/cocoon/forms/resources/js/MultiValueEditor.js
+++ ===================================================================
+++ ---
src/main/resources/org/apache/cocoon/forms/resources/js/MultiValueEditor.js
(wersja 517778)
+++ +++
src/main/resources/org/apache/cocoon/forms/resources/js/MultiValueEditor.js
(wersja 517779)
+++ @@ -39,9 +39,9 @@
+++
+++ cformsIdPrefix: "id-prefix-not-set",
+++
+++ - resourcesUri: cocoon.resourcesUri, // to make this available to
the template
+++ + formsResourcesUri: cocoon.formsResourcesUri, // to make this
available to the template
+++
+++ - templatePath: cocoon.resourcesUri +
"/forms/js/templates/MultiValueEditor.html",
+++ + templatePath: cocoon.formsResourcesUri +
"/js/templates/MultiValueEditor.html",
+++
+++ fillInTemplate: function(args, frag) {
+++ cocoon.forms.MultiValueEditor.superclass.fillInTemplate(this,
args, frag);
+++
+++ Index:
src/main/resources/org/apache/cocoon/forms/resources/js/templates/MultiValueEditor.html
+++ ===================================================================
+++ ---
src/main/resources/org/apache/cocoon/forms/resources/js/templates/MultiValueEditor.html
(wersja 517778)
+++ +++
src/main/resources/org/apache/cocoon/forms/resources/js/templates/MultiValueEditor.html
(wersja 517779)
+++ @@ -9,11 +9,11 @@
+++ </select>
+++ </td>
+++ <td width="20px">
+++ - <input dojoAttachPoint="deleteButton" type="image"
src="${this.resourcesUri}/forms/img/delete.gif"/>
+++ + <input dojoAttachPoint="deleteButton" type="image"
src="${this.formsResourcesUri}/img/delete.gif"/>
+++ <br/>
+++ - <input dojoAttachPoint="moveUpButton" type="image"
src="${this.resourcesUri}/forms/img/move_up.gif"/>
+++ + <input dojoAttachPoint="moveUpButton" type="image"
src="${this.formsResourcesUri}/img/move_up.gif"/>
+++ <br/>
+++ - <input dojoAttachPoint="moveDownButton" type="image"
src="${this.resourcesUri}/forms/img/move_down.gif"/>
+++ + <input dojoAttachPoint="moveDownButton" type="image"
src="${this.formsResourcesUri}/img/move_down.gif"/>
+++ <br/>
+++ </td>
+++ </tr>
+++ </pre>
+++
+++ <p>As you can see, there is no <tt>cocoon.resourcesUri</tt> property
anymore. If
+++ you put your own widget in Forms' resource tree, simply replace
+++ <tt>cocoon.resourcesUri</tt> with <tt>cocoon.formsResourcesUri</tt>.
Otherwise,
+++ introduce your own property and set it's value to
+++ <tt>"servlet:/resource/external/yourwidget/"</tt> or similar.<br/>
+++ If you use Forms URI, don't forget to remove redundant <tt>"/forms"</tt>
prefix
+++ (see example above).</p>
+++
+++ <p class="note">It has been removed because there is no universal
+++ <tt>_cocoon/**</tt> matcher loading resources for all blocks (including
Forms);
+++ now every block is responsible on its own for loading its resources. Even
more,
+++ there is no universal pattern for resources URLs because blocks can be
mounted
+++ at different locations. You may think that situation is worse than it used
to be
+++ but it's not the case. If you think that I suggest to learn more about
servlet
+++ service framework.</p>
+++
+++ <p>If you have additional questions don't hesitate to ask for a help on
user's
+++ mailing list.</p>
+++
<h2>Sitemap adjustments</h2>
<p>Obviously, you have to adjust your sitemap too to pass new
parameters:</p>
(79 equal lines skipped)