PDA

View Full Version : Layout for Domino developers



galdaka
22 Feb 2007, 8:07 AM
Hi, I trying migrate from 0.40 to 1.0 Alfa (Rev 8), I have this inical problems/notes:

Posible bugs/notes Layout (IE6),

- stuck.gif is present image directory but not use in ext-all.css

- layout regions not save sizes width/height by cookies. Collapse/Expand state OK.

- When you click in stick button (in my case in east region) the collapse button stopped in over state.

- layout-sprite.gif from 0.40 dissapears => Now are collapse.gif, expand.gif, ns-collapse.gif, ns-expand.gif, panel-close.gif

- I use Domino web server. I create a normal borderlayout but when preview in web, window status bar says: "(Quedan 1 elemento) Descargando datos http://0/..." with IE6 in FF OK. I work offline. I donīt understand what is the problem!!!! This borderlayout works fine in Local mode and in FF.


Thanks Jack your job is awesome,

gizzmo
22 Feb 2007, 9:00 AM
I have the same problem with http://0/ with IE6 and domino...
Works fine ni FireFox...

Keep up the good work, Jack

js1234224
22 Feb 2007, 9:05 AM
I too see the http://0.0.0.0 issue (IE7 / Domino - only noticed it as I'm behind an authenticating proxy).

tryanDLS
22 Feb 2007, 9:13 AM
I've see this too - it's not related to domino. It seems to happen in IE6, but not IE7 or FF. The status bar shows downloading items 3, then 2. When it gets to the last item to download it shows '(1 item remaining) downloading data http://0/...' and hangs. It's not consistent, but it happens from the HelloWorld dialog example http://www.yui-ext.com/deploy/ext-1.0-alpha1/examples/dialog/hello.html

js1234224
22 Feb 2007, 9:19 AM
I've see this too - it's not related to domino. It seems to happen in IE6, but not IE7 or FF. The status bar shows downloading items 3, then 2. When it gets to the last item to download it shows '(1 item remaining) downloading data http://0/...' and hangs. It's not consistent, but it happens from the HelloWorld dialog example http://www.yui-ext.com/deploy/ext-1.0-alpha1/examples/dialog/hello.html

I definitely see the problem with IE7 too - I run the Microsoft Fiddler debugging proxy, and see a request to 0.0.0.0 directly after ext-all.js is retrieved.

Here's part of the log:


GET http://www.yui-ext.com/deploy/ext-1.0-alpha1/examples/dialog/hello.html
304 Not Modified

GET http://www.yui-ext.com/deploy/ext-1.0-alpha1/resources/css/ext-all.css
304 Not Modified

GET http://www.yui-ext.com/deploy/ext-1.0-alpha1/resources/css/ytheme-gray.css
304 Not Modified

GET http://www.yui-ext.com/deploy/ext-1.0-alpha1/yui-utilities.js
304 Not Modified

GET http://www.yui-ext.com/deploy/ext-1.0-alpha1/ext-all.js
304 Not Modified

GET http://0.0.0.0/
500 Server Error

GET http://www.yui-ext.com/deploy/ext-1.0-alpha1/ext-bridge-yui.js
304 Not Modified

GET http://www.yui-ext.com/deploy/ext-1.0-alpha1/examples/dialog/hello.js
304 Not Modified

GET http://www.yui-ext.com/deploy/ext-1.0-alpha1/examples/examples.css
304 Not Modified

GET http://www.yui-ext.com/deploy/ext-1.0-alpha1/examples/info-bg.gif
304 Not Modified

galdaka
22 Feb 2007, 10:22 AM
The error is in ext-all.js but that is not advance much. I will continue proving with the following revisions. This it is the first step to migrate my application and I already have problems ;).

If somebody is working with EXT and IDomino I would like interchange ideas. I use DominoXMLDataModel.js to work with grid with incredibly fast results with 50000 documents, I hope that the change to new grid does not suppose much problem with that.

Also work with DominoUIOutLine.js to obtain precious tree Web from a Notes client Outline without work. OutLine works fine with Ext 1.0.

Sorry for my English.

Herm
22 Feb 2007, 1:30 PM
Please post your datamodels js here if you are willing - there are a few Notes/Domino people here and we would love to see.

Jack Ratcliff has done some great work in his Domino Web Tools Project over on OpenNTF.org: http://www.openntf.org/Projects/pmt.nsf/ProjectVersions/C3298DE9BC7E2BA986257288000D5E9D?OpenDocument . He's in release mode :-)

Cheers,
Peter

gizzmo
22 Feb 2007, 2:33 PM
I use Jack Ratcliffs idea how to create an outline. But I rather create a new TreeLoader than creating a completly new tree object. It can be used in the same way as Ext.tree.TreeLoader.


Domino.OutlineTreeLoader = function(config){
this.baseParams = {};
this.requestMethod = 'GET';
Ext.apply(this, config);

this.events = {
'beforeload' : true,
'load' : true,
'loadexception' : true
};
};

Ext.extend(Domino.OutlineTreeLoader, Ext.tree.TreeLoader, {

processResponse : function(response, node, callback){
var xml = response.responseXML;
try {

var arEntries = xml.getElementsByTagName('outlineentry');
var curNode = null;
var arNodes = [];

for (var i=0; i<arEntries.length; i++) {

var entry = arEntries.item(i);

var nodeType = entry.attributes.getNamedItem('type').value;
var nodeTitle = entry.attributes.getNamedItem('title').value;

var tmpHref = entry.attributes.getNamedItem('url');
var nodeHref = (tmpHref) ? tmpHref.value : "";

var tmpIcon = entry.attributes.getNamedItem('icon');
var nodeIcon = (tmpIcon) ? tmpIcon.value : "";

var curPosition = entry.attributes.getNamedItem('position').value;

var expandable = entry.attributes.getNamedItem('expandable');
var isExpandable = (expandable) ? true : false;

var cls;
switch (nodeType) {
// section
case "0" :
cls = (isExpandable) ? "folder" : "file";
break;
// view
case "2" :
cls = "file";
break;
// folder
case "20" :
cls = "folder";
break;
default :
cls = "file";
};

var curNode = new Ext.tree.TreeNode({
text : nodeTitle,
cls : cls,
allowDrag : true,
isTarget : true,
leaf : false,
outlineHref : nodeHref,
outlineType : nodeType,
expandable: isExpandable,
position : curPosition,
icon : nodeIcon
});

arNodes[curPosition] = curNode;

if (curPosition.indexOf('.') > 0) {
var parentPosition = curPosition.substring(0,curPosition.lastIndexOf('.'));
arNodes[parentPosition].appendChild(curNode);
} else {
node.appendChild(curNode);
}
}

if(typeof callback == 'function'){
callback(this, node);
}
}catch(e){
this.handleFailure(response);
}
},

createNode : function(attr) {
alert('This method is deprecated!');
}
});

// Johan

jack.slocum
22 Feb 2007, 4:52 PM
I have proposed fix for the //0 problem. Can one of you Domino guys having the problem replace /'+'/0 (should be easy to search for) with /'+'/: and let me know if it fixes the problem? Thanks.

galdaka
22 Feb 2007, 11:10 PM
Hi jack,

With change works fine (exta-all.js line 18 ):


Ext.EventManager=function(){var _1;var _2;var _3=false;var _4;var _5;var E=YAHOO.util.Event;var D=YAHOO.util.Dom;var _8=function(){if(!_3){_3=true;if(_2){clearInterval(_2);}if(_1){_1.fire();_1.clearListeners();}}};var _9=function(){_1=new Ext.util.Event();if(document.addEventListener){E.on(document,"DOMContentLoaded",_8);}else{if(Ext.isIE){document.write("<s"+"cript id=\"ie-deferred-loader\" defer=\"defer\" src=\"/"+"/\"></s"+"cript>");

You fix in next release or with this change is fixed?

About the other thing??? - layout regions not save sizes width/height by cookies but Collapse/Expand state works fine. ???

DominoOutline.js: I have taken it of dwt - Domino Web tools project. But I have made it independent to have it in js aside. Thanks Jack Ratcliff.


DominoUIOutline = function(config) {
Ext.apply(this,config);
this.init();
};

DominoUIOutline.prototype.init = function() {
YAHOO.util.Connect.asyncRequest('POST', this.outlineUrl + '?ReadEntries', {
success : this.init2.createDelegate(this),
failure : this.init2.createDelegate(this)
}, null);
};

DominoUIOutline.prototype.init2 = function(o) {
var response = o.responseXML;
var arEntries = response.getElementsByTagName('outlineentry');

var Tree = Ext.tree;
var tree = new Tree.TreePanel(this.outlinePanel.getEl(), {
animate : true,
containerScroll : true,
dropConfig : {appendOnly : true},
rootVisible : false
});

var root = new Tree.TreeNode({
text : 'domino-folders',
draggable : false,
id : 'domino-folders'
});
tree.setRootNode(root);
var curNode = null;
var arNodes = [];
for (var i=0; i<arEntries.length; i++) {
var entry = arEntries.item(i);
var dwtType = entry.attributes.getNamedItem('type').value;
var dwtTitle = entry.attributes.getNamedItem('title').value;
var tmpdwtHref = entry.attributes.getNamedItem('url');
var dwtHref = (tmpdwtHref) ? tmpdwtHref.value : "";

var expandable = entry.attributes.getNamedItem('expandable');
var isExpandable = (expandable) ? true : false;

var tmpdwtIcon = entry.attributes.getNamedItem('icon');
var dwtIcon = (tmpdwtIcon) ? tmpdwtIcon.value : "";
var curPosition = entry.attributes.getNamedItem('position').value;

var cls;
switch (dwtType) {
case "0" :
cls = (isExpandable) ? "folder" : "file";
break;
case "2" :
cls = "file";
break;
case "20" :
cls = "folder";
break;
default :
cls = "file";
};

var curNode = new Tree.TreeNode({
text : dwtTitle,
cls : cls,
allowDrag : true,
isTarget : true,
leaf : false,
dwtHref : dwtHref,
dwtType : dwtType,
dwtExpandable: isExpandable,
dwtPosition : curPosition,
icon : dwtIcon
});

curNode.on('click', this.openEntry.createDelegate(this), this, true);

arNodes[curPosition] = curNode;

if (curPosition.indexOf('.') > 0) {
var parentPosition = curPosition.substring(0,curPosition.lastIndexOf('.'));
arNodes[parentPosition].appendChild(curNode);
} else {
root.appendChild(curNode);
}

};


tree.render();
root.expand();
};

DominoUIOutline.prototype.openEntry = function(node, e){
var attributes, dwtType, dwtHref, dwtPosition, entryId, title;
attributes = node.attributes;
dwtHref = attributes.dwtHref;
dwtType = attributes.dwtType;
dwtPosition = attributes.dwtPosition;
entryId = "id-" + dwtPosition;
title = node.text;

//CUSTOM
if (dwtType == "2" || dwtType == "20") {
var viewUrl = (dwtHref.indexOf('?') > 0) ? dwtHref.split('?')[0] : dwtHref.split('!')[0];
var iframe = Ext.DomHelper.append(document.body, {tag: 'iframe', frameBorder: 0, src: viewUrl});
var panel = new Ext.ContentPanel(iframe, {title: title, fitToFrame:true, closable:true});
this.layout.add('center', panel);
} else if (dwtHref != "") {
var viewUrl = (dwtHref.indexOf('?') > 0) ? dwtHref.split('?')[0] : dwtHref.split('!')[0];
var iframe = Ext.DomHelper.append(document.body, {tag: 'iframe', frameBorder: 0, src: viewUrl});
var panel = new Ext.ContentPanel(iframe, {title: title, fitToFrame:true, closable:true});
this.layout.add('center', panel);

}
};

Ext.data.Node.prototype.hasChildNodes = function() {
if (this.attributes.dwtType == "20" || (this.attributes.dwtType == "0" && this.attributes.dwtExpandable == true)) {
return true;
} else {
return false;
}
};

Call:


........
.....
crearOutline : function(){
outline = new DominoUIOutline({
layout : layout,
outlinePanel : layoutWest,
outlineUrl : 'http://dfdsfsd/dsfsdf.nsf/menuIzdo' <= Outline URL
});
},
......

DominoXMLDataModel.js: Is in domino yui project but only works in old version of YUI-EXT. If somebody updates DominoXMLDataModel.js for new grid it would be good ;). Any ideas of how implement this?


Thanks jack.

gizzmo
22 Feb 2007, 11:11 PM
Hi Jack

I tried to replace /'+'/0 with /'+'/ in the EventManager.js file.
Still an error, but now: (Error: 0x57) http:///

changed line 44:

document.write("<s"+'cript id="ie-deferred-loader" defer="defer" src="/'+'/0"></s'+"cript>");

Johan

js1234224
23 Feb 2007, 12:50 AM
I have proposed fix for the //0 problem. Can one of you Domino guys having the problem replace /'+'/0 (should be easy to search for) with /'+'/: and let me know if it fixes the problem? Thanks.

Thanks Jack - that fix works for me. I'm no longer seeing any requests to http://0.0.0.0 in Microsoft Fiddler.

jack.slocum
23 Feb 2007, 3:33 AM
Gizzmo, you are missing the trailing :

gizzmo
23 Feb 2007, 7:37 AM
Hi Jack,

I don't know what I'm doing wrong. In ext-all.js, on row 18 I change to


document.write("<s"+"cript id=\"ie-deferred-loader\" defer=\"defer\" src=\"/"+"/:\"></s"+"cript>");

have also tried this, as galdaka do


document.write("<s"+"cript id=\"ie-deferred-loader\" defer=\"defer\" src=\"/"+"/\"></s"+"cript>");

But maybe it will be corrected in the next revision...

cfulnecky
9 Nov 2007, 7:31 AM
Hi,

I am seeing the following after loading ext-all.js

00:00:02.129 0.016 147 GET 304 application/x-javascript http://ctWeb/ext/ext-all.js?version=5.0.1.111

00:00:02.221 0.000 * GET (Error 0x57) * http://:/

00:00:02.221 0.000 * GET (Error 0x57) * http://:/


I don't notice any ill effects, can it safely be ingnored?

Thanks,
Charles