Skip to content

Commit

Permalink
Merge branch 'development' into merge_match
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanderhaegen Cedrik committed Feb 11, 2015
2 parents dbb7058 + 83f1526 commit cb7ea92
Show file tree
Hide file tree
Showing 23 changed files with 486 additions and 310 deletions.
21 changes: 21 additions & 0 deletions CHANGES.rst
@@ -1,3 +1,24 @@
0.4.1 (??-??-2015)
------------------

- A conceptscheme, concept or collection can now be export to RDF through
skosprovider_rdf_ 0.3.1. These are individuals export endpoints that can
be reached in one of two ways. Either by hitting a url like
http://localhost:6543/conceptschemes/GEOGRAPHY/c/335 with a supported RDF mimetype
(``application/rdf+xml``, ``application/x-turtle``, ``text-turle``). Or by
using an RDF syntax specific suffix (.rdf or .ttl).
- Allow sorting the languages in the admin interface.
- When importing, allow the user to request more information on a concept or
collection, before actually importing it.
- Reorganised and extended the right click menu on the grid in the admin
interface.
- Allow looking up a *skos:match* from within the admin interface.
- Some issues with the length of language ids were solved.
- Fixed some issues when importing a collection instead of a concept.
- Made it easy to add a Google Analytics tracker.
- Updated some dependencies.
- Some code cleanup and reorganisation.

0.4.0 (23-12-2014)
------------------

Expand Down
4 changes: 2 additions & 2 deletions atramhasis/static/admin/bower.json
Expand Up @@ -19,9 +19,9 @@
"dojo": "~1.10.4",
"dojox": "~1.10.4",
"util": "dojo-util#~1.10.4",
"put-selector": "~0.3.5",
"put-selector": "~0.3.6",
"xstyle": "~0.2.1",
"dgrid": "~0.3.15",
"dgrid": "0.3.17",
"dGrowl": "~0.0.0"
}
}
21 changes: 4 additions & 17 deletions atramhasis/static/admin/src/app/App.js
Expand Up @@ -49,19 +49,14 @@ define([

postMixInProperties: function () {
this.inherited(arguments);

console.log('postMixInProperties', arguments);
},

buildRendering: function () {
this.inherited(arguments);

console.log('buildRendering', arguments);
},

postCreate: function () {
this.inherited(arguments);
console.log('postCreate', arguments);
this.thesauri = new ThesaurusCollection();

this.notificationController = new dGrowl({
Expand All @@ -75,7 +70,6 @@ define([

startup: function () {
this.inherited(arguments);
console.log('startup', arguments);
var self = this;

this.externalSchemeService = new ExternalSchemeService({
Expand Down Expand Up @@ -149,8 +143,6 @@ define([
}, "addConceptNode");

on(addConceptButton, "click", function () {

console.log("on addConceptButton " + self.currentScheme);
self._createConcept(conceptForm, conceptDialog, self.currentScheme);
});

Expand Down Expand Up @@ -178,13 +170,12 @@ define([
self._importConcept(conceptForm, conceptDialog, evt.concept.uri, evt.scheme);
}
else {
console.error('No valid URI.');
topic.publish('dGrowl', '', {'title': 'No valid URI', 'sticky': true, 'channel':'error'});
}
});

on(schemeFileteringSelect, "change", function (e) {
if (e) {
console.log("on schemeCombo ", e);
self.currentScheme = e;
filteredGrid.setScheme(e);
addConceptButton.set('disabled', false);
Expand All @@ -207,8 +198,6 @@ define([
else {
var thesaurus = self.thesauri.stores[schemeid];
thesaurus.get(conceptid).then(function (item) {
console.log("create contentpane");
console.log(item);
var concept = new ConceptDetail({
conceptid: item.id,
label: item.label,
Expand Down Expand Up @@ -343,8 +332,7 @@ define([


topic.subscribe("conceptform.submit", function (form) {
console.log("conceptform.submit subscribe");
console.log(form);
console.log("conceptform.submit subscribe ", form);

var broader = array.map(form.broader, function(item){ return {"id": item}; });
var narrower = array.map(form.narrower, function(item){ return {"id": item}; });
Expand All @@ -355,7 +343,7 @@ define([
var superordinates = array.map(form.superordinates, function(item){ return {"id": item}; });

var rowToAdd = {
"id:": form.concept_id,
// "id:": form.concept_id,
"type": form.ctype,
"labels": form.label,
"notes": form.note,
Expand All @@ -372,7 +360,6 @@ define([
filteredGrid.conceptGrid.store.put(rowToAdd, {id: form.concept_id})
.then(
function () {
console.log("row edited");
conceptDialog.hide();
var message = "The " + rowToAdd.type + " has been saved";
topic.publish('dGrowl', message, {'title': "Success", 'sticky': false, 'channel':'info'});
Expand Down Expand Up @@ -433,7 +420,7 @@ define([
conceptDialog.set("title", "Import concept or collection");
conceptDialog.show();
}, function(err){
console.error(err);
topic.publish('dGrowl', "", {'title': err, 'sticky': true, 'channel':'error'});
});
} catch(err) {
topic.publish('dGrowl', "", {'title': err, 'sticky': true, 'channel':'error'});
Expand Down
2 changes: 0 additions & 2 deletions atramhasis/static/admin/src/app/ConceptForm.js
Expand Up @@ -172,7 +172,6 @@ define(
if (this.matchesManager.getMatches()){
formObj.matches = this.matchesManager.getMatches();
}
console.log(formObj);
topic.publish("conceptform.submit", formObj);
}
this.dialog && this.dialog.layout();
Expand All @@ -197,7 +196,6 @@ define(
},

init: function (scheme, concept) {
console.log("init cdialog: " + scheme);
this.reset();
this.scheme = scheme;
var schemebox = dijit.byId("schemebox");
Expand Down
89 changes: 32 additions & 57 deletions atramhasis/static/admin/src/app/FilteredGrid.js
Expand Up @@ -15,10 +15,15 @@ define([
"dijit/Menu",
"dijit/MenuItem",
"dijit/ConfirmDialog",
"dojo/store/Memory", "dojo/store/Cache",
"dojo/store/JsonRest",
"dojo/store/Memory",
"dojo/store/Cache",
"dojo/store/Observable",
"dgrid/OnDemandGrid", "dgrid/Selection", "dgrid/Keyboard", "dgrid/editor"

], function (declare, on, topic, lang, _Widget, _TemplatedMixin, _WidgetsInTemplateMixin, template, ComboBox, TextBox, Button, Menu, MenuItem, ConfirmDialog, Memory, Cache, OnDemandGrid, Selection, Keyboard, editor) {
], function (declare, on, topic, lang, _Widget, _TemplatedMixin, _WidgetsInTemplateMixin, template, ComboBox,
TextBox, Button, Menu, MenuItem, ConfirmDialog, JsonRest, Memory, Cache, Observable,
OnDemandGrid, Selection, Keyboard, editor) {
return declare([_Widget, _TemplatedMixin, _WidgetsInTemplateMixin], {
templateString: template,

Expand All @@ -32,14 +37,6 @@ define([
conceptFilter: {label: "", type: "all"},
isResettingFilters: true,

postMixInProperties: function () {
this.inherited(arguments);
},

buildRendering: function () {
this.inherited(arguments);
},

postCreate: function () {
this.inherited(arguments);

Expand All @@ -54,8 +51,6 @@ define([
startup: function () {
this.inherited(arguments);
var self = this;
console.log("startup grid");

var timeoutId;

this.typeCombo = new ComboBox({
Expand All @@ -73,8 +68,6 @@ define([
intermediateChanges: true
}, "filterNode");

var self = this;

var columns = [
{label: "ID", field: "id"},
{label: "label", field: "label"},
Expand All @@ -89,41 +82,30 @@ define([
selectionMode: "single",
minRowsPerPage: 20,
maxRowsPerPage: 100

}, "gridNode");

on(this.conceptGrid, "dgrid-select", lang.hitch(this, function (evt) {
var row = evt.rows[0];
on(this.conceptGrid, ".dgrid-row:click", lang.hitch(this, function (evt) {
var row = this.conceptGrid.row(evt);
row.scheme = this.conceptScheme;
console.log("row selected: " + row.id);
topic.publish("concept.open", row.id, row.scheme);
}));

this.conceptGrid.on(".dgrid-row:contextmenu", function (evt) {
evt.preventDefault();


var cell = self.conceptGrid.cell(evt);
var gridId = self.conceptGrid.get("id");
var pMenu = self._createGridContextMenu(gridId, cell.element, self, cell.row.data.id, cell.row.data.type, cell.row.data.label);
var args = {target: pMenu.selector};
pMenu._openMyself(args);

}
);

this.conceptGrid.on(".dgrid-row:contextmenu", lang.hitch(this, function (evt) {
evt.preventDefault(); // prevent default browser context menu
var cell = this.conceptGrid.cell(evt);
var gridId = this.conceptGrid.get("id");
var pMenu = this._createGridContextMenu(gridId, cell.element, this, cell.row.data.id, cell.row.data.type, cell.row.data.label);
pMenu._scheduleOpen(this, null, { x: evt.pageX, y: evt.pageY });
}));

on(this.typeCombo, "change", lang.hitch(this, function (evt) {
if (evt != "") {
console.log("on ", evt);
this._setTypeFilter(evt);
}

}));

this.textFilter.watch("value", (lang.hitch(this, function (name, oldValue, newValue) {
if (this.isResettingFilters) return false;
console.log("typing text: " + newValue);
if (timeoutId) {
clearTimeout(timeoutId);
timeoutId = null;
Expand All @@ -136,7 +118,6 @@ define([
},

_resetFilters: function () {
console.log("grid _reset");
this.isResettingFilters = true;
this.typeCombo.reset();
this.textFilter.reset();
Expand All @@ -145,44 +126,36 @@ define([
},

setScheme: function (schemeid) {
console.log("grid setScheme: " + schemeid);
this._resetFilters();
this.conceptScheme = schemeid;
this.conceptStore = Cache(dojo.store.JsonRest({
target: "/conceptschemes/" + schemeid + "/c",
sortParam: "sort"
}), Memory());
this.conceptStore = new Observable( Cache( JsonRest({
'target': "/conceptschemes/" + schemeid + "/c",
'idProperty': 'id',
'sortParam': 'sort',
'accepts': 'application/json'
}), Memory()));
this.conceptGrid.set("store", this.conceptStore, this.conceptFilter);
},

ResetConceptGrid: function () {
this._resetFilters();

this.conceptStore = null;
this.conceptGrid.set("store", this.conceptStore, this.conceptFilter);

},


_setTypeFilter: function (type) {
console.log("setting type filter: " + type);
this.conceptFilter = {label: this.conceptFilter.label, type: type};
this.conceptGrid.set("query", this.conceptFilter);
},

_setTextFilter: function (label) {
console.log("setting label filter: " + label);
this.conceptFilter = {label: label, type: this.conceptFilter.type};
this.conceptGrid.set("query", this.conceptFilter);
},

_createGridContextMenu: function (targetNodeId, selector, widget, conceptId, type, label) {
var pMenu;
var self = this;
pMenu = new Menu({
targetNodeIds: [targetNodeId],
selector: selector
});
var pMenu = new Menu({});

if (type == "concept") {
pMenu.addChild(new MenuItem({
Expand All @@ -207,7 +180,6 @@ define([
topic.publish("concept.addMemberOf", conceptId, label);
}
}));

}

pMenu.addChild(new MenuItem({
Expand All @@ -216,12 +188,14 @@ define([
widget._editConcept(conceptId);
}
}));

pMenu.addChild(new MenuItem({
label: "Delete",
onClick: function () {
widget._deleteConcept(conceptId, type, label);
}
}));

pMenu.addChild(new dijit.MenuSeparator());
pMenu.addChild(new MenuItem({
label: "Add a new Concept or collection",
Expand All @@ -230,22 +204,23 @@ define([
}
}));

return pMenu;
},

pMenu.startup();
return pMenu;
var args = {target: pMenu.selector};
pMenu._openMyself(args);

_addNarrower: function (conceptId, type, label) {
topic.publish("concept.addNarrower", conceptId, type, label);
},

_addMemberOf: function (conceptId, type, label) {
topic.publish("concept.addMemberOf", conceptId, type, label);
},

_editConcept: function (conceptId) {
topic.publish("concept.edit", conceptId);

},

_createNewConcept: function () {

topic.publish("concept.create");
},

Expand Down

0 comments on commit cb7ea92

Please sign in to comment.