Holger Knublauch

Added popup dialog when user clicks on log table

......@@ -378,65 +378,15 @@ app:AutoCompleteCallback
] ;
ui:private "true"^^xsd:boolean ;
ui:prototype
[ rdf:type ui:group ;
ui:child
[ rdf:type ui:TextNode ;
ui:childIndex 0 ;
ui:text """
[
"""^^xsd:string
] ;
ui:child
[ rdf:type ui:forEach ;
ui:child
[ rdf:type ui:TextNode ;
ui:childIndex 0 ;
ui:text """{
\"label\" : \""""^^xsd:string
] ;
ui:child
[ rdf:type ui:TextNode ;
ui:childIndex 1 ;
ui:text [ sp:varName "label"^^xsd:string
]
] ;
ui:child
[ rdf:type ui:TextNode ;
ui:childIndex 2 ;
ui:text """\",
\"resource\" : \""""^^xsd:string
] ;
ui:child
[ rdf:type ui:TextNode ;
ui:childIndex 3 ;
ui:text [ rdf:type ui:encodeNode ;
sp:arg1 [ sp:varName "resource"^^xsd:string
]
]
] ;
ui:child
[ rdf:type ui:TextNode ;
ui:childIndex 4 ;
ui:text """\",
\"value\" : \""""^^xsd:string
] ;
ui:child
[ rdf:type ui:TextNode ;
ui:childIndex 5 ;
ui:text [ sp:varName "label"^^xsd:string
]
] ;
ui:child
[ rdf:type ui:TextNode ;
ui:childIndex 6 ;
ui:text """\"
}"""^^xsd:string
] ;
ui:childIndex 1 ;
ui:resultSet
[ rdf:type swon:RSObjectArray ;
arg:resultSet
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "resource"^^xsd:string
] [ sp:varName "label"^^xsd:string
] [ sp:expression
[ sp:varName "label"^^xsd:string
] ;
sp:varName "value"^^xsd:string
]) ;
sp:where ([ sp:object
[ sp:varName "type"^^xsd:string
......@@ -498,15 +448,6 @@ app:AutoCompleteCallback
[ sp:varName "?3"^^xsd:string
]
])
] ;
ui:separator ","^^xsd:string
] ;
ui:child
[ rdf:type ui:TextNode ;
ui:childIndex 2 ;
ui:text """
]
"""^^xsd:string
]
] .
......@@ -1098,7 +1039,8 @@ app:CustomEditForm
ui:childIndex 0 ;
ui:class
[ rdf:type app:resourceType
]
] ;
ui:matchIds "edit,*"^^xsd:string
] ;
ui:childIndex 1
] ;
......@@ -1464,6 +1406,13 @@ app:DateRangeFacet
]
] .
app:DialogElements
rdf:type ui:NodeClass ;
rdfs:comment "Abstract superclass for dialog-related elements."^^xsd:string ;
rdfs:label "Dialog elements"^^xsd:string ;
rdfs:subClassOf app:Elements ;
ui:abstract "true"^^xsd:boolean .
app:EditForm
rdf:type app:FormClass ;
rdfs:comment "A form that can be used to create a new or edit an existing resource. It has an option to switch to view mode, as well as Save Changes and Cancel buttons."^^xsd:string ;
......@@ -4089,6 +4038,54 @@ app:ResourceSubjectFacet
]
] .
app:ResourceViewDialog
rdf:type ui:NodeClass ;
rdfs:comment "A dialog that shows the default view of a given resource. This needs to be inserted into the document and will remain initially invisible. The JavaScript call appOpenResourceViewDialog() must be called with the provided loadId and the URI of a resource."^^xsd:string ;
rdfs:label "Resource view dialog"^^xsd:string ;
rdfs:subClassOf app:DialogElements ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The ui:loadId of the ui:loadable that will be placed around the dialog."^^xsd:string ;
spl:predicate arg:loadId ;
spl:valueType xsd:string
] ;
ui:prototype
[ rdf:type ui:loadable ;
ui:child
[ rdf:type ui:if ;
ui:child
[ rdf:type html:Div ;
html:id [ rdf:type ui:concat ;
sp:arg1 "div-"^^xsd:string ;
sp:arg2 [ sp:varName "loadId"^^xsd:string
]
] ;
html:title
[ rdf:type ui:label ;
sp:arg1 [ sp:varName "resource"^^xsd:string
]
] ;
ui:child
[ rdf:type ui:resourceView ;
ui:childIndex 0 ;
ui:resource
[ sp:varName "resource"^^xsd:string
]
] ;
ui:childIndex 0
] ;
ui:childIndex 0 ;
ui:condition
[ rdf:type sp:bound ;
sp:arg1 [ sp:varName "resource"^^xsd:string
]
]
] ;
ui:loadId
[ sp:varName "loadId"^^xsd:string
]
] .
app:ResultSetGrid
rdf:type ui:NodeClass ;
rdfs:comment "A tabular component to display the results of an existing SPARQL result set. This does not do lazy loading but constructs a static data table from all entries in the result set. Use this only for small data sets."^^xsd:string ;
......@@ -4288,7 +4285,8 @@ app:SearchForm
ui:childIndex 0 ;
ui:class
[ rdf:type app:resourceType
]
] ;
ui:matchIds "search,*"^^xsd:string
] ;
ui:childIndex 4
] ;
......@@ -6247,6 +6245,7 @@ app:ViewForm
ui:child
[ rdf:type ui:resourceView ;
ui:childIndex 0 ;
ui:matchIds "view,*"^^xsd:string ;
ui:resource
[ sp:varName "resource"^^xsd:string
]
......@@ -7540,6 +7539,11 @@ arg:leftWidth
rdfs:label "left width"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:loadId
rdf:type rdf:Property ;
rdfs:label "load id"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:modeName
rdf:type rdf:Property ;
rdfs:label "mode name"^^xsd:string ;
......
......@@ -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
......