/editing/cf2/prerspective.html is a URL matched in the 
src/editing/cf2/sitemap.xmap. It uses transformers/perspective.xsl for its 
rendering.
     
 <map:match pattern="perspective.html">
        <map:generate src="sitemap.xmap"/>
        <map:transform src="transformers/perspective.xsl">
        </map:transform>
        <map:serialize type="html"/>
      </map:match>

You can see which standard URL is used for the perspective in xpath 
/perspective/@frameUrl in file 
src/workbench/standard-configuration/perspectives/<perspective-name>/component.xml

Jasha



-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Reinier van den Born
Sent: Wed 29-10-2008 13:06
To: Hippo CMS development public mailinglist
Subject: Re: [HippoCMS-dev] Xinha questions
 
Hoi Jasha,

The file is in a slightly different location for me 
(/explorer/resources/html/perspective.html) but anyway...

I created a folder "explorer" in my extensions and gave it the following 
override.xmap:
   <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";>

     <map:pipelines>
       <map:pipeline type="noncaching">

         <map:match pattern="resources/html/perspective.html">
           <map:read src="perspective.html"/> <!-- don't need the directory 
structure -->
         </map:match>

         <map:match pattern="**">
           <map:mount uri-prefix="" src="site://explorer/sitemap.xmap"/>
         </map:match>

       </map:pipeline>
     </map:pipelines>

   </map:sitemap>

Then I copied the original perspective.html to 
extensions/explorer/perspective.html and modified _editor_url and the 
script element that loads htmlarea right below it. Look like this:

   <script type="text/javascript">
           _editor_url = "/extensions/cforms/resources/xinha/";
           _editor_lang = "en";
         </script>
   <script type="text/javascript" 
src="/extensions/cforms/resources/xinha/htmlarea.js">&nbsp;</script>

When I browse to 
http://localhost:50000/explorer/resources/html/perspective.html I actually get 
to see my version, so 
that works.

However when I reload the editor and look at the source HTML of the frame it 
doesn't show the change. _editor_url and 
src for loading htmlarea.js are the same as before.

Also plugins are simply loaded from the original location.

So I started scanning the project and found 4 sitemaps where a perspective.html 
is generated using a 
transformers/perspective.xsl.
One location is site/editing/cf2, maybe that is the one you meant? 
Unfortunately there is no XSL at location.

There are two locations (site/slide and site/slide/explorer) where the sitemap 
may actually produce a perspective.html.
Lo and behold the script elements that I want to change are present in the 
transformer/perspective.xsl files there.
But the location of these files makes little sense to me: slide?

All this raises the question: Is there a solution other than overriding half of 
the editor?
If no, I might as well make my local copy and get rid of a whole lot of 
complications.

Btw, I wouldn't mind a solution where the editor is updated to the latest 
Xinha. Haven't tried this, but is sports a 
method to load a plugin from another, specific location.
Which may very well solve the problem that I started with :-)


Reinier



Jasha Joachimsthal wrote:
> Hi Reinier,
> 
> is overriding /explorer/cf2/perspective.html an option? This page contains 
> the scripts used in the editing perspective, including:
> </script>
>         <script type="text/javascript">
>           _editor_url = "/cforms/resources/xinha/";
>           _editor_lang = "en";
>         </script>
> 
> Jasha
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] on behalf of Reinier van den Born
> Sent: Tue 28-10-2008 17:23
> To: Hippo CMS development public mailinglist
> Subject: Re: [HippoCMS-dev] Xinha questions
>  
> Hi Jeroen,
> 
> Like I mentioned before overriding doesn't work.
> Problem is that the site/sitemap contains an explicit pipeline for 
> cform/resources/** before it starts looking voor 
> overrides. The override pipeline is the last one in the sitemap, which maybe 
> isn't the best place?
> 
> Xinha versions. I asked about that before and didn't get an answer.
> Probably because I tend to ask to many Qs in one mail :-)
> 
> Anyway, for now, I took the latest and greatest, stable Xinha version (0.95)
> and copied it into the editor tree. No other modifications.
> Seems to work fine... no Xinha/HTMLArea object naming problems in sight.
> 
> Are there any other, specific problems you expect (and that I should check)
> or, since the basics work, do you think I am OK?
> 
> 
> Reinier

> 
> 
> 
> Jeroen Reijn wrote:
>> Hi Reinier,
>>
>> http://wiki.hippo.nl/display/CMS/Overriding+core+CMS+code should be the 
>> way to go in this case. But you are probably trying to use the Xinha 
>> trunk. Beware that the current Xinha trunk/release has refactored it's 
>> core and the current JavaScript API( which is used inside the CMS) 
>> probably won't work anymore if you change it to Xinha trunk. The current 
>> Xinha is now located in called XinhaCore.js or something similar and the 
>> HTMLArea object, which previously existed, does not exist anymore in the 
>> new Xinha code and is replaced with the Xinha object.
>>
>>>>>> Hi,
>>>>>>
>>>>>> I have a couple of questions about Xinha:
>>>>>>
>>>>>> Q1:
>>>>>> I would like to add some plugins to Xinha that don't come standard 
>>>>>> with the Hippo editor (eg. definition lists).
>>>>>> And fiddle with/replace some that are standard (because they don't 
>>>>>> place themselves correctly on the toolbar).
>>>>>>
>>>>>> I was hoping to be able to add the plugins somewhere down my 
>>>>>> extensions folder and tell Xinha to look there, but haven't found a 
>>>>>> way to do this.
>>>>>> Any suggestions?
>> Sure you can create your own Xinha plugins. I've done it in multiple 
>> occasions.
>>
>> Try adding this function to your extended htmlarea.js (which is 
>> referenced in the <lib> tag in your BE templates.
>>
>> HTMLArea.loadExternalPlugin = function(pluginPath, pluginName, callback) {
>>   // Might already be loaded
>>   if(eval('typeof ' + pluginName) != 'undefined')
>>   {
>>     if(callback)
>>     {
>>       callback(pluginName);
>>     }
>>     return true;
>>   }
>>
>>   var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g,
>>           function (str, l1, l2, l3) {
>>             return l1 + "-" + l2.toLowerCase() + l3;
>>           }).toLowerCase() + ".js";
>>   var plugin_file = pluginPath + "/" + pluginName + "/" + plugin;
>>
>>   if(callback)
>>   {
>>     HTMLArea._loadback(plugin_file, function() { callback(pluginName); });
>>   }
>>   else
>>   {
>>     document.write("<script type='text/javascript' src='" + plugin_file 
>> + "'></script>");
>>   }
>>   return false;
>> };
>>
>> Now you should be able to say something like (where Expander is the name 
>> of your plugin):
>>
>> HTMLArea.loadExternalPlugin("/extensions/xinha/plugins", "Expander");
>>
>>
>>>>>> Q2.
>>>>>> Looking through the Xinha docs I don't see any reference to the 
>>>>>> type of HTML it generates:
>>>>>> XHTML, HTML 4.01, or some older version.
>>>>>> It looks like it is XHTML. If so, is there a way to tell it to 
>>>>>> generate HTML 4.01?
>> Xinha itself creates some HTML, which is not always very well formatted. 
>> Therefor we have use the HTMLCleaner. In the new version of the CMS, you 
>> can choose between XHTML strict and transitional. It will allways 
>> generate valid XHTML if you use the HTMLCleaner.
>>
>>>>>> Q3.
>>>>>> I noticed some keyboard shortcuts are defined for Xinha (<ctrl-1> 
>>>>>> for H1, etc).
>>>>>> They have apparently nothing to do with the plugin that allows 
>>>>>> changes like that from the toolbar.
>>>>>> So is there a way to disable these boys?
>>>>>> (I don't want to allow content editor anything but entering plain 
>>>>>> text, lists, emphasis etc.)
>> Yes, you should be able to create your own Xinha plugin for this. You 
>> can then catch the key events.
>>
>>>>>> Any help is greatly appreciated.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Reinier van den Born
>>>>>>
>>>>>> -- 
>>>>>>
>>>>>> Reinier van den Born
>>>>>>
>>>>>> HintTech B.V.
>>>>>> Rotterdamseweg 183c, 2629 HD Delft
>>>>>> T: +31(0)15 268 2573
>>>>>> F: +31(0)15 268 2567
>>>>>> M: +31(0)6 494 171 36
>>>>>> -- 
>>>>>> HintTech levert specialisten op het gebied van softwareontwikkeling 
>>>>>> (.NET en Java), projectmanagement, informatiebeveiliging en 
>>>>>> business consulting.
>>>>>> KvK Den Haag nr. 27242282 | BTW nr. NL8062.16.396.B01
>>>>>> ********************************************
>>>>>> Hippocms-dev: Hippo CMS development public mailinglist
>>>>>>
>>>>>> Searchable archives can be found at:
>>>>>> MarkMail: http://hippocms-dev.markmail.org
>>>>>> Nabble: http://www.nabble.com/Hippo-CMS-f26633.html
>>>>>>
>>>>>>
>>>>> ********************************************
>>>>> Hippocms-dev: Hippo CMS development public mailinglist
>>>>>
>>>>> Searchable archives can be found at:
>>>>> MarkMail: http://hippocms-dev.markmail.org
>>>>> Nabble: http://www.nabble.com/Hippo-CMS-f26633.html
>>>>>
>>>>>
>>> ********************************************
>>> Hippocms-dev: Hippo CMS development public mailinglist
>>>
>>> Searchable archives can be found at:
>>> MarkMail: http://hippocms-dev.markmail.org
>>> Nabble: http://www.nabble.com/Hippo-CMS-f26633.html
>>>
>> ********************************************
>> Hippocms-dev: Hippo CMS development public mailinglist
>>
>> Searchable archives can be found at:
>> MarkMail: http://hippocms-dev.markmail.org
>> Nabble: http://www.nabble.com/Hippo-CMS-f26633.html
>>
> 
> 
> ------------------------------------------------------------------------
> 
> ********************************************
> Hippocms-dev: Hippo CMS development public mailinglist
> 
> Searchable archives can be found at:
> MarkMail: http://hippocms-dev.markmail.org
> Nabble: http://www.nabble.com/Hippo-CMS-f26633.html
> 

-- 

Reinier van den Born

HintTech B.V.
Rotterdamseweg 183c, 2629 HD Delft
T: +31(0)15 268 2573
F: +31(0)15 268 2567
M: +31(0)6 494 171 36
--
HintTech levert specialisten op het gebied van softwareontwikkeling (.NET en 
Java),
projectmanagement, informatiebeveiliging en business consulting.
KvK Den Haag nr. 27242282 | BTW nr. NL8062.16.396.B01

<<winmail.dat>>

********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html

Reply via email to