Holger Knublauch

Added popup dialog when user clicks on log table

This diff is collapsed. Click to expand it.
......@@ -35,6 +35,7 @@ body {
.appLabeledObjectsTabularLabel {
width: 160px;
min-width: 160px;
}
.appLabeledObjectsTable {
......@@ -46,6 +47,7 @@ body {
.appLabeledObjectsIconsTD {
width: 16px;
min-width: 16px;
vertical-align: top;
padding-top: 4px;
}
......
......@@ -157,8 +157,9 @@ function appInsertLoadingIndicator(e) {
* syntax, e.g. '<http://example.org/MyClass>' or '"2011-11-11"^^xsd:date'.
* @param id the id of the loadable
* @param args a JavaScript object with additional parameters
* @param callback an optional callback that is called after loading
*/
function appLoad(id, args) {
function appLoad(id, args, callback) {
var e = $('#' + id);
var base = e.attr('uistate');
if(!base) {
......@@ -179,6 +180,9 @@ function appLoad(id, args) {
// TODO: Error handling may not work yet
e.load(uispinServlet, url, function() {
appLoadPostProcessAll(e);
if(callback) {
callback.call();
}
});
}
......@@ -266,17 +270,6 @@ function appLoadSearchResultsGrid(formId, targetId, onSelect) {
}
function appResizeGrid(pane, $Pane, paneState) {
/*
if(grid = $('.ui-jqgrid')) { //}-btable:visible')) {
grid.each(function(index) {
var gridId = $(this).attr('id');
$('#' + gridId).setGridWidth(paneState.innerWidth - 2);
});
}*/
}
/**
* Loads a given ui:loadable with a given variable pre-bound to
* a given URI resource.
......@@ -320,6 +313,33 @@ function appNavigateToInTab(resourceURI, queryGraphURI) {
/**
* Loads and then opens a dialog that was inserted into the current
* document using app:ResourceViewDialog.
* @param loadId the id of the loadable (same as arg:loadId of the app:ResourceViewDialog)
* @param resourceURI the URI of the resource to display
* @param width (optional) the width in pixels
* @param height (optional) the height in pixels
*/
function appOpenResourceViewDialog(loadId, resourceURI, width, height) {
appLoad(loadId, { resource: '<' + resourceURI + '>' }, function() {
var div = $('#div-' + loadId);
var title = div.attr('title');
var options = {
modal: true,
title: title
};
if(width) {
options.width = width;
}
if(width) {
options.height = height;
}
div.dialog(options);
});
}
/**
* Walks up the parents of a 'link' element with a given id until it
* finds a form. Then it replaces that form with a new form displaying
* a given resource.
......@@ -338,6 +358,18 @@ function appReloadForm(resourceURI, queryGraphURI, linkElementId) {
}
function appResizeGrid(pane, $Pane, paneState) {
// TODO: not working well
/*
if(grid = $('.ui-jqgrid')) { //}-btable:visible')) {
grid.each(function(index) {
var gridId = $(this).attr('id');
$('#' + gridId).setGridWidth(paneState.innerWidth - 2);
});
}*/
}
/**
* Selects a given node in a given tree.
* Will expand if necessary, using a server-side shortest path algorithm.
......
......@@ -48,7 +48,8 @@ log:LogEvent
app:keyProperties (<http://purl.org/dc/terms/created> rdf:type log:initiatedBy log:onBehalfOf log:outcome rdfs:comment) ;
ui:instanceView
[ rdf:type log:LogEventFormBody ;
arg:resource spin:_this
arg:resource spin:_this ;
ui:id "search"^^xsd:string
] ;
ui:view [ rdf:type log:LogBrowser
] .
......@@ -226,7 +227,8 @@ log:ReportDownloadEvent
ui:childIndex 1
] ;
ui:childIndex 1
]
] ;
ui:id "search"^^xsd:string
] .
log:ReportEvent
......@@ -243,7 +245,8 @@ log:ReportEvent
arg:label "Report type"^^xsd:string ;
arg:predicate log:reportType ;
ui:childIndex 1
]
] ;
ui:id "search"^^xsd:string
] .
log:ReportUploadEvent
......@@ -273,7 +276,8 @@ log:ReportUploadEvent
ui:childIndex 1
] ;
ui:childIndex 1
]
] ;
ui:id "search"^^xsd:string
] .
log:TableBrowser
......@@ -342,6 +346,7 @@ log:TableBrowser
[ rdf:type app:SearchForm ;
arg:formId "searchForm"^^xsd:string ;
arg:noBorder "true"^^xsd:boolean ;
arg:onSelect "appOpenResourceViewDialog('viewDialog', resource, 500, 400)"^^xsd:string ;
arg:queryGraph
[ sp:varName "queryGraph"^^xsd:string
] ;
......@@ -395,6 +400,18 @@ log:TableBrowser
});"""^^xsd:string
] ;
ui:childIndex 2
] ;
ui:child
[ rdf:type ui:setContext ;
ui:child
[ rdf:type app:ResourceViewDialog ;
arg:loadId "viewDialog"^^xsd:string ;
ui:childIndex 0
] ;
ui:childIndex 3 ;
ui:queryGraph
[ sp:varName "queryGraph"^^xsd:string
]
]
] .
......
......@@ -22,7 +22,8 @@ report:AbstractDR
app:keyProperties (<http://purl.org/dc/terms/created> <http://purl.org/dc/terms/date> rdf:type <http://rdfs.org/sioc/ns#id>) ;
ui:instanceView
[ rdf:type report:DRFormBody ;
arg:resource spin:_this
arg:resource spin:_this ;
ui:id "search"^^xsd:string
] .
report:DDR
......@@ -40,7 +41,8 @@ report:DDR
arg:label "Well bore id"^^xsd:string ;
arg:predicate report:wellBoreId ;
ui:childIndex 1
]
] ;
ui:id "search"^^xsd:string
] .
report:DPR
......@@ -52,7 +54,8 @@ report:DPR
[ rdf:type report:DRFormBody ;
arg:resource spin:_this ;
ui:childIndex 0
]
] ;
ui:id "search"^^xsd:string
] .
report:DRFormBody
......