exist-db / exide Goto Github PK
View Code? Open in Web Editor NEWA web-based XQuery IDE for eXist-db
License: GNU General Public License v3.0
A web-based XQuery IDE for eXist-db
License: GNU General Public License v3.0
eXide often shows "Logged in as null' (e.g. when exist-db has been restarted when the editor is open).
Hi Wolfgang,
Thanks a lot for this very useful lib.
normalizePath method is creating some problem when retrieving relative modules. This patch should solve it (it least it does it for me !)
Cheers,
Christophe
/**
* Normalize a collection path. Remove xmldb: part, resolve ..
*/
normalizePath : function (path) {
if (!path)
return path;
path = path.replace(/^xmldb:exist:\/\//, "");
var newComponents = [],
components = path.split("/"),
length = components.length;
for (var i = 0 ; i < length; i++) {
if (components[i] == ".." ) {
//i--;
newComponents.pop();
} else {
newComponents.push(components[i]);
}
}
return newComponents.join('/');
//return newComponents.reverse().join("/");
},
In view.xql:
Change
declare option exist:serialize "method=html5 media-type=text/html enforce-xhtml=yes";
to
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:method "html5";
declare option output:media-type "text/html";
This still leave the case where local variables are defined with the following form uncovered, though:
let $iAmMatching := true(),
$butNotMe := false()
fix (xQuery-helper.js):
Constr.prototype.$localVars = function (prefix, wordrange, complete) {
var variables =[];
var stopRegex = /declare function|};/;
//var varRegex = /let \$[\w\:]+|for \$[\w\:]+|\$[\w\:]+\)/;
//var getVarRegex = /\$[\w\:]+/;
var varRegex = /let \$[\w\-_\:]+|for \$[\w\-_\:]+|\$[\w\-_\:]+\)/;
var getVarRegex = /\$[\w\-_\:]+/;
var nameRegex = new RegExp("^\\" + prefix);
var session = this.editor.getSession();
var row = wordrange.start.row;
while (row > -1) {
var line = session.getDisplayLine(row);
var m;
if (m = line.match(varRegex)) {
$.log("Var: %s", m[0]);
var name = m[0].match(getVarRegex);
if (name[0].match(nameRegex)) {
variables.push({
name: name[0],
type: "variable"
});
}
}
if (line.match(stopRegex)) {
$.log("Stop: %s", line);
return variables;
}
row--;
}
return variables;
}
The results pane is placed at bottom im my case. It has been narrowed to a small stripe of just a few pixels height.
It is not possible to change the size any more by dragging the resize bar. Effectively the results pane keeps being hidden und unusable.
Hi !
I love eXide, but was a bit annoyed by the jumpy behavior of the outline panel (removes every function on every code validation). It can get quite slow when dealing with bulky modules and a lot of imports.
This makes it much smoother. It just fades in and out ouline functions when needed. For this, it relies on the excellent d3.js lib (yes, that is one more dependency ...).
the bulk of the change is as below, the rest available here https://github.com/e-smile/eXide/commit/4bf135c22e9e869789d1e825040013e38219f8f0 (only changed files included) :
$outlineUpdate: function (doc) {
if (this.currentDoc != doc)
return;
eXide.app.resize();
var outline = d3.select("#outline"),
sel = outline.selectAll("li")
.data(doc.functions, function(d) {
return d.name
});
function stringCompare(a, b) {
a = a.toLowerCase();
b = b.toLowerCase();
return a > b ? 1 : a == b ? 0 : -1;
}
var li = sel.enter()
.append("li")
.attr("class", function(d) {
return d.type == eXide.edit.Document.TYPE_FUNCTION
? "ace_support.ace_function"
: "ace_variable"
})
.append("a")
.style("opacity",0)
.attr("title", function(d) {
if(d.signature) {return d.signature}
return null
})
.attr("href", function(d) {
return "#" + (d.source ? d.source : "")
})
.attr("class",function(d) {
var cl = d.type == eXide.edit.Document.TYPE_FUNCTION
? "t.function" : "t_variable"
return cl + " " + (d.visibility === "private" ? "private" : "public" )
})
.text(function(d) {return d.name})
.on("click", function(d) {
var path = this.hash.substring(1);
if(d.row) {
eXide.app.locate("function", path == '' ? null: path, parseInt(d.row));
} else if(d.type == eXide.edit.Document.TYPE_FUNCTION) {
eXide.app.locate("function", path == '' ? null: path, d.name);
} else {
eXide.app.locate("variable", path == '' ? null: path,d.name);
}
})
.transition()
.duration(800)
.style("opacity",1)
sel.sort(function (a, b) { return a == null || b == null ? -1 : stringCompare(a.name, b.name); });
sel.exit()
.transition()
.duration(400)
.style("opacity",0)
.remove()
Sorry for this messy push, but I am struggling trying to have a git working directory in eXist and the git tree repository outside. Not quite working.
Cheers,
C.
I am currently trying to get indexing working. I entered the following code snippet from http://exist-db.org/exist/apps/doc/indexing.xml into eXide
<collection xmlns="http://exist-db.org/collection-config/1.0">
<index xmlns:atom="http://www.w3.org/2005/Atom">
<fulltext default="none" attributes="no">
<create qname="atom:title"/>
</fulltext>
<range>
<create qname="atom:id" type="xs:string"/>
</range>
</index>
</collection>
Now, eXide marks type="xs:string"
as an error with the error message "The value 'xs:string' of attribute 'type' on element 'create' is not valid with respect to its type, 'QName'."
So, either the example from the eXist documentation is wrong or this error message is misleading...
eXide Version: 2.0.1
Browser FF 27.0.1
edited file type was templated html
Dropdown allows to switch between XML output and 'direct output'. Once i clicked the checkbox (after having used the 'run' button) and changed its value it became grayed out and is not changeable any more. Even reloading did not help.
When a java-function throws a XPathException, it is not visible in the UI;
only the log file might give a hint.....
With shared-resources-0.3.9, it s no longer possible to select and copy the XML Output of a query in eXide. Even copying the whole page does not include the XML Output. With shared-resources-0.3.8, copying works fine. Unfortunately, eXide 2.0.6 requires shared-resources-0.3.9.
eXist-version: 2.1
Mac OS X 10.9.1
Tested in browsers: Chrome 31.0.1650.63, Firefox 26.0, Safari 7.0.1.
I add the ticket here, because it appears only to affect eXide.
If I have both:
declare function a( $something as xs:string )
declare function a( )
Then both variations of a appear in the outline view, but clicking on the second one will always bring you to the first - it appears to only be matching by function name and not the arguments as well.
I use eXist-db 2.0 (installed from eXist-db-setup-2.0-rev18252.jar) on Windows XP, with Chrome version 27.0.1453.116.
Steps to reproduce:
If pressing at the end of a single line comment, a colon is inserted on the next line even though the comment has been closed.
This works well when manual starting the comment and pressing return, but not when placing the caret at the end of the comment
To Reproduce:
Type a line, press c, then press return to start a new line of xquery.
Navigate > go to Definition and outline were not working with the distribution I am using.
A few patches here https://github.com/krikrou/eXide/tree/patches.
(or, better: christophe-g@9019864#L2L352)
Sorry, cloned your repository locally and pushed it back to gitHub, thinking that I could also pass pull request this way, but does not seem to work...
Cheers,
C.
Hi,
I would love to have the possibility to split the main editor panel into more (e.g to compare codes between modules, ...)
Is there any chance to see this in the future ?
Cheers and thanks
C.
I create documents using an '@' sign. Example ([email protected]). I encode my request to this url using foo%40bar.com. Everything works well until I open the document from the collection browser. The document, the '%' sign is re-encoded instead of being decoded and I get a new file called foo%2540bar.com.xml in exide. The open command from exide works as expected however.
The java admin client and the exide open command correctly display the url as [email protected];
When running "New XQuery" eXide creates almost empty page , with a character '1' to avoid syntax-validation errors; I think this should change since it looks not so nice too.
The initial state of a new document is dirty and always prompts to save, even when the I have not entered any information. I think the dirty state should only be set if the user has modified the new 'template'.
Hi,
I have some data in an eXist database where the default namespace is set on a wrapper element (fragment), then set to empty on a child element (div).
Using a db connection in oxygen, the behaviour is as expected, so I'm happy that the data is held correctly in the database.
However, when using exist the empty default namespace declaration (xmlns="") is not displayed:
Thanks!
Tom
continually revising - outputting - revising becomes clumsy when one has to hit the minute arrow every time to close to output window in order to view the code properly, so a keyboard shortcut would come in handy here
When syncing an application (xml, xhtml) to the file system, a number of items get lost:
The 1st one is probably related with an issue where XML comments generated in an query are not visible.
Was curious to see why sometimes the "*" is cleared on the editor tab after a save, and sometime not.
It was due to the fact that String.match (called in eXide.js/locate) returns an array and not a string (and hence some doc having an array doc.name)
we should have (notice the [0])
name: path.match(/[^\/]+$/)[0],
instead of
name: path.match(/[^\/]+$/),
in the locate method below.
locate: function(type, path, symbol) {
if (path == null) {
editor.exec("locate", type, symbol);
} else {
$.log("Locating %s in document %s", symbol, path);
var doc = editor.getDocument(path);
if (doc == null) {
var resource = {
name: path.match(/[^\/]+$/)[0],
path: path
};
eXide.app.$doOpenDocument(resource, function(doc) {
if (doc) {
editor.exec("locate", type, symbol);
}
});
} else {
editor.switchTo(doc);
editor.exec("locate", type, symbol);
}
}
},
Hi,
According to the documentation, setting configuration/restrictions/@guest to "no" should prevent public access. Tests on two instances of eXide version 2.0.1 and 2.0.2 on top of existdb 2.1-rev18721 does not seem to handle properly the configuration.xml file.
Do I need something other to make this security feature on?
Regards,
Thanks a lot for this wonderful tool !
Guillaume
Quick question : is there a particular reason for disabling emmet
in the editor ? are there some potential conflicts with the snippet feature ?
If you uncomment the emmet section in editor.js (line 317-321) it is possible to run emmet style for css document (e.g. 'p10' + [tab]
-> padding:10px;
).
Would be nice to have this behavior in xml or html file as well (but could not find how to enable it yet...):
div>li.id$*5 + [tab]
->
<div>
<li class="id1"></li>
<li class="id2"></li>
<li class="id3"></li>
<li class="id4"></li>
<li class="id5"></li>
</div>
Cheers,
C.
When no result was found, the old result values are not reset.
Line 58 of modules/deployment.xql is constantly piping logging information into the console, e.g.:
(Line: 58 /db/apps/eXide/modules/deployment.xql) /db/apps/
Please consider removing this logging info, or if it's meant to be useful to users, please add more descriptive information to the log entry.
Files with extension .xqm extensions are filtered, and do not show up in the open dialog.
When creating a new project from templates, do not copy the .svn directories from the templates dir into the db.
When trying to remove an event listener from the editor, an error is thrown because there is no such method. Please add it for consistency.
When on the bottom line, the error popup often gets in the way of completing the last line. There usually is an error on the last line, when typing in an unfinished document.
If one downloads an app and unzips it, one has a copy of the installation. That's fine, but if one wishes to make modifications and rebuild it, the expath-pkg.xml.tmpl is missing. Could this file be generated as well when downloading?
Find/replace seems essential to any IDE. Please add it.
When using the search with the bottom search bar, the search is always one character behind in what it searches for. So when I type "exis" it will search for "exi", but when I then hit backspace and have "exi" in my search bar, it will search for "exis". This can be quite confusing.
This can be fixed easily by changing line 17 in src/find.js from
$this.input.keydown(function (ev) {
to
$this.input.keyup(function (ev) {
I check this in Firefox 18 and Chrome 24.
When an app is created from template, the collection.xconf should be:
<collection xmlns="http://exist-db.org/collection-config/1.0">
<index xmlns:xs="http://www.w3.org/2001/XMLSchema">
<fulltext default="none" attributes="false"/>
</index>
<triggers>
<trigger class="org.exist.extensions.exquery.restxq.impl.RestXqTrigger"/>
</triggers>
</collection>
Instead of:
<collection xmlns="http://exist-db.org/collection-config/1.0">
<index xmlns:xs="http://www.w3.org/2001/XMLSchema">
<fulltext default="none" attributes="false"/>
</index>
</collection>
When a file is opened using ?open=/db/file AND the previous state of eXide is restored AND the file was already open in that state, the tab containing the file is not necessarily selected. This looks like an issue, however minor.
How come do I have to re-authenticate whenever I refresh the page? Isn't my username saved server-side in the HTTP session?
Buildfile: /Users/jens/Downloads/eXide-develop/build.xml
check-rhino-available:
get-rhino:
[echo] Downloading rhino...
[get] Getting: https://raw.github.com/jrburke/r.js/master/lib/rhino/js.jar
[get] To: /Users/jens/Downloads/eXide-develop/tools/js.jar
[get] https://raw.github.com/jrburke/r.js/master/lib/rhino/js.jar permanently moved to https://raw.githubusercontent.com/jrburke/r.js/master/lib/rhino/js.jar
[get] Getting: http://requirejs.org/docs/release/2.1.4/r.js
[get] To: /Users/jens/Downloads/eXide-develop/tools/r.js
xqlint:
[echo] Optimizing xqlint ...
[copy] Copying 1 file to /Users/jens/Downloads/eXide-develop/support/xqlint
[copy] Copying 1 file to /Users/jens/Downloads/eXide-develop/support/xqlint
[java] js: Couldn't read source file "./support/xqlint/r.js: ./support/xqlint/r.js (No such file or directory)".
BUILD FAILED
/Users/jens/Downloads/eXide-develop/build.xml:109: Java returned: 4
It would be nice if eXide could generate for xquery schrips/modules xqdoc compatible documentation (skeleton) based on the function signature.
This will encourage writing documentation, and saves lots of typing :-)
(:in eXist Admin Client - eXist 2.0 rev 18252:)
let $xml :=
<r>
processing-instruction name2 { "string2" },
processing-instruction name3 {}
}</r>
return $xml
(:return as follows-----------
<r>
</r>
:)
(:in eXide:)
let $xml :=
<r>
processing-instruction name2 { "string2" },
processing-instruction name3 {}
}</r>
return $xml
(:return as follows-----------
<r>
</r>
:)
see at eXist-db/exist#227
Table does not resize!
There are several problems with xqlint when building eXide.
First, the file r.js is not found, as the path should be ${tools}.
Secondly, when r.js is found, the lib directory is not created.
Hi,
I propose to consider an additional empty path to be redirected to the main index.html page into templates/existdb/controller.xql
May do the next line do the trick :
if ($exist:path = ("/","")) then
in replacement of first test that is:
if ($exist:path eq "/") then
This would help a little bit more useability and confidentiality.
Guillaume
Due to changes in Safari 7 (the default browser in Mavericks), there is an offset between the 'actual' editing location and the displayed cursor.
This makes editing not so friendly.
The issue has been identified and fixed in a newer release of ace; the change looks obvious, we could consider a local edit too....
https://groups.google.com/forum/#!topic/ace-discuss/4Et-lLtjOlQ
ajaxorg/ace#1534
When switching between tabs, check if the currently open document has changed on the server.
On my dev-machine
[eXist Version : 2.1]
[eXist Build : 20131214]
ctrl-c / ctrl-v doesn't work in exide.
(my source is one month old, bug maybe fixed already.)
I use eXist-db 2.0 (installed from eXist-db-setup-2.0-rev18252.jar) on Windows XP, with Chrome version 27.0.1453.116.
Steps to reproduce:
If the user enters wrong credentials there should be a more visible error message (user logged in as null is often overseen and not understandable for everyone)
Setting the user with xmldb:login interferes with other applications running in the same browser, because the user/password settings in the session are applied to all XQueries.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.