Hi,
yes adding a new view is not too hard.
You are right on the view appUrl and classname. A bit of help is turning
on the debugger:
http://wiki.hippo.nl/display/CMS/How+to+configure+the+perspective+debugging+framework
The three things you need to do are:
- Configure a new view (xml and javascript)
- Implement the pipeline to handle that view
- Add the correct listener functions (javascript)
These functions are called upon a change in for instance another view
an update of the view will happen when a folder is opened in for
instance the tree, by adding the function
MyView.Method(openfolder); to your view (if located in the documents
perspective).
I hope this helps.
Regards,
Jeroen Reijn
[EMAIL PROTECTED] wrote:
Hi all,
I'm currently trying to add a new box in the document explorer perspective
(like the details view or the references view, etc...).
I found a "views.js" that's seems used by the components. I guess that I
must add a new function (and its methods) to use my new box.
Is there an easier way to do that ? Someone has already do that ? :)
Thank you for your incoming advices :)
ex:
component.xml :
<view
id="references"
label="References"
className="ReferencesView" ==> function defined
in views.js
appUrl="/explorer/references" ==> cocoon call ?
(sitemap.xmap)
bootParam="/content/"
style="referencesview"/>
views.js :
function ReferencesView() {
if ( Cfx.Class.IsDefined(ReferencesView) == false ) {
Cfx.Class.New( ReferencesView, View );
if( Cfx.Class.IsInitializing( ReferencesView, View )) {
ReferencesView.Method(showreferences);
ReferencesView.Method(showfiledetails);
ReferencesView.Method(do_showfiledetails);
ReferencesView.Method(openfolder);
ReferencesView.Method(do_openfolder);
ReferencesView.Method(load);
ReferencesView.Method(deleteResource);
ReferencesView.Method(moveDocument);
return;
}
}
this.InitInstance();
return this;
function load(str){
if (this.log.debugging()) {
this.log.debug("load: " + str + " into view: " + this.ele.id);
}
try{
this.ele.innerHTML = str;
var cont = this.context.get("pcontainer");
}
catch(error) {
this.log.error(error);
}
}
function showfiledetails(params)
{
this.log.debug("$$$$$$$$ showfiledetails!");
this.resourceID = params;
this.callWithDelay('do_showfiledetails()',this.shortDelay,0);
}
function do_showfiledetails() {
this.log.debug("$$$$$$$$ do_showfiledetails!");
this.refresh();
}
function openfolder() {
var localparams = [{key:'url',val:"/no/resource/selected"}];
this.resourceID = localparams;
this.callWithDelay('do_openfolder()',this.longDelay,0);
}
function do_openfolder() {
this.refresh();
}
function showreferences(params) {
this.log.debug("$$$$$$$$ showreferences!");
this.refresh();
}
function deleteResource(params) {
if (params[0].val) {
var localparams = [{key:'url',val:"/no/resource/selected"}];
this.saveRPC(localparams);
}
}
function moveDocument(params) {
if (params[0].val) {
var localparams = [{key:'url',val:"/no/resource/selected"}];
this.saveRPC(localparams);
}
}
}
_______________
JC Duchaussee
WCMTech
PI 716
--------------------------
______________________________________________________________________________________________
Smals sluit elke aansprakelijkheid uit in verband met de juistheid, de
volledigheid of het tijdig toekomen van de informatie in deze e-mail. Aan
deze e-mail kunnen geen rechten worden ontleend en deze e-mail houdt in
geen geval een erkenning van welkdanige aansprakelijkheid in.
Dit bericht is alleen bestemd voor de geadresseerde. Indien dit bericht
niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden
en het bericht te vernietigen.
Smals décline toute responsabilité quant à l'exactitude, à l'exhaustivité
et au délai de transmission des informations contenues dans cet e-mail.
Aucun droit ne peut être revendiqué sur cet e-mail et cet e-mail
n'implique en aucun cas une reconnaissance de responsabilité, quelle
qu'elle soit.
Ce message s'adresse uniquement au destinataire. Si ce message ne vous est
pas destiné, nous vous prions de nous le signaler immédiatement et de
détruire le message.
********************************************
Hippocms-dev: Hippo CMS development public mailinglist
--
Met vriendelijke groet,
Kind regards,
Jeroen Reijn
Hippo
Oosteinde 11
1017WT Amsterdam
The Netherlands
Tel +31 (0)20 5224466
********************************************
Hippocms-dev: Hippo CMS development public mailinglist