improvements to blank node handling in bulk deletion

This commit is contained in:
brianjlowe 2012-06-08 19:38:04 +00:00
parent cef7b583e2
commit b480cb2eea
78 changed files with 5882 additions and 605 deletions

View file

@ -111,14 +111,6 @@
:configContextFor rdf:type owl:ObjectProperty ;
rdfs:domain :ConfigContext .
:inheritingConfigContextFor rdf:type owl:ObjectProperty ;
rdfs:domain :ConfigContext ;
rdfs:subPropertyOf :configContextFor .
:nonInheritingConfigContextFor rdf:type owl:ObjectProperty ;
rdfs:domain :ConfigContext ;
rdfs:subPropertyOf :configContextFor .
:qualifiedBy rdf:type owl:ObjectProperty ;
rdfs:domain :ConfigContext .
@ -130,6 +122,14 @@
rdfs:domain :ConfigContext ;
rdfs:subPropertyOf :qualifiedBy .
:inheritingConfigurationFor rdf:type owl:ObjectProperty ;
rdfs:domain :ConfigContext ;
rdfs:subPropertyOf :configContextFor .
:nonInheritingConfigurationFor rdf:type owl:ObjectProperty ;
rdfs:domain :ConfigContext ;
rdfs:subPropertyOf :configContextFor .
:hasListView rdf:type owl:ObjectProperty ;
rdfs:range :ListDisplayView ;
rdfs:domain :PropertyDisplayConfig ;
@ -246,15 +246,15 @@
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:defer rdf:type :OfferEditOption ,
owl:NamedIndividual .
owl:NamedIndividual .
:false rdf:type :OfferEditOption ,
owl:NamedIndividual .
:doNotOfferForEdit rdf:type :OfferEditOption ,
owl:NamedIndividual .
:ifStatement rdf:type :OfferEditOption ,
owl:NamedIndividual .
owl:NamedIndividual .
:true rdf:type :OfferEditOption ,
:offerForEdit rdf:type :OfferEditOption ,
owl:NamedIndividual .
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -112,7 +112,10 @@ owl:versionInfo
a owl:DatatypeProperty.
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#queryModel>
a owl:DatatypeProperty.
a owl:DatatypeProperty.
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#htmlValue>
a owl:DatatypeProperty.
######### Object Properties#########
###Basic

View file

@ -786,38 +786,38 @@
</servlet-mapping>
<servlet>
<servlet-name>ObjectPropertyHierarchyListingController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.listing.ObjectPropertyHierarchyListingController</servlet-class>
<servlet-name>ShowObjectPropertyHierarchyController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.freemarker.ShowObjectPropertyHierarchyController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ObjectPropertyHierarchyListingController</servlet-name>
<servlet-name>ShowObjectPropertyHierarchyController</servlet-name>
<url-pattern>/showObjectPropertyHierarchy</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>DataPropertyHierarchyListingController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.listing.DataPropertyHierarchyListingController</servlet-class>
<servlet-name>ShowDataPropertyHierarchyController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.freemarker.ShowDataPropertyHierarchyController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>DataPropertyHierarchyListingController</servlet-name>
<servlet-name>ShowDataPropertyHierarchyController</servlet-name>
<url-pattern>/showDataPropertyHierarchy</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>PropertyWebappsListingController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.listing.PropertyWebappsListingController</servlet-class>
<servlet-name>ListPropertyWebappsController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.freemarker.ListPropertyWebappsController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>PropertyWebappsListingController</servlet-name>
<servlet-name>ListPropertyWebappsController</servlet-name>
<url-pattern>/listPropertyWebapps</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>DatatypePropertiesListingController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.listing.DatatypePropertiesListingController</servlet-class>
<servlet-name>ListDatatypePropertiesController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.freemarker.ListDatatypePropertiesController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>DatatypePropertiesListingController</servlet-name>
<servlet-name>ListDatatypePropertiesController</servlet-name>
<url-pattern>/listDatatypeProperties</url-pattern>
</servlet-mapping>
@ -1300,6 +1300,20 @@
<url-pattern>/admin/getObjectClasses</url-pattern>
</servlet-mapping>
<!-- VIVO OpenSocial Extension by UCSF -->
<servlet>
<servlet-name>GadgetController</servlet-name>
<servlet-class>edu.ucsf.vitro.opensocial.GadgetController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>GadgetController</servlet-name>
<url-pattern>/gadget</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GadgetController</servlet-name>
<url-pattern>/gadget/sandbox</url-pattern>
</servlet-mapping>
<!-- ==================== tag libraries ============================== -->
<jsp-config>
<taglib>

View file

@ -65,6 +65,11 @@ span#expandAll {
float: right;
font-size: 0.85em;
}
span.rangeClass {
color:#064D68;
padding-left:22px;
padding-right:8px;
}
div#expandLink {
margin-top:-10px;
width:100%;

View file

@ -1,3 +1,5 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
.menuFlag {
width:67px;
height:18px;

View file

@ -0,0 +1,26 @@
// Textarea and select clone() bug workaround | Spencer Tipping
// Licensed under the terms of the MIT source code license
// Motivation.
// jQuery's clone() method works in most cases, but it fails to copy the value of textareas and select elements. This patch replaces jQuery's clone() method with a wrapper that fills in the
// values after the fact.
// An interesting error case submitted by Piotr Przybył: If two <select> options had the same value, the clone() method would select the wrong one in the cloned box. The fix, suggested by Piotr
// and implemented here, is to use the selectedIndex property on the <select> box itself rather than relying on jQuery's value-based val().
(function (original) {
jQuery.fn.clone = function () {
var result = original.apply(this, arguments),
my_textareas = this.find('textarea').add(this.filter('textarea')),
result_textareas = result.find('textarea').add(this.filter('textarea')),
my_selects = this.find('select').add(this.filter('select')),
result_selects = result.find('select').add(this.filter('select'));
for (var i = 0, l = my_textareas.length; i < l; ++i) $(result_textareas[i]).val($(my_textareas[i]).val());
for (var i = 0, l = my_selects.length; i < l; ++i) result_selects[i].selectedIndex = my_selects[i].selectedIndex;
return result;
};
}) (jQuery.fn.clone);
// Generated by SDoc

View file

@ -1,18 +1,34 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
var pageManagementUtils = {
dataGetterLabelToURI:null,//initialized by custom data
processDataGetterUtils:processDataGetterUtils,//an external class that should exist before this one
dataGetterMap:null,
// on initial page setup
onLoad:function(){
if (this.disableFormInUnsupportedBrowsers()) {
return;
}
this.mixIn();
this.initDataGetterProcessors(),
this.initObjects();
this.bindEventListeners();
this.initDisplay();
},
initDataGetterProcessors:function() {
//data getter processor map should come in from custom data
//Go through each and initialize with their class
if(pageManagementUtils.processDataGetterUtils != null) {
var dataGetterProcessorMap = pageManagementUtils.dataGetterProcessorMap = pageManagementUtils.processDataGetterUtils.dataGetterProcessorMap;
$.each(dataGetterProcessorMap, function(key, dataGetterProcessorObject) {
//passes class name from data getter label to uri to processor
dataGetterProcessorObject.initProcessor(pageManagementUtils.dataGetterLabelToURI[key]);
})
}
},
disableFormInUnsupportedBrowsers: function() {
var disableWrapper = $('#ie67DisableWrapper');
@ -28,6 +44,7 @@ var pageManagementUtils = {
},
mixIn: function() {
//Data getter process list input should be retrieved from the custom data
// Mix in the custom form utility methods
$.extend(this, vitro.customFormUtils);
// Get the custom form data from the page
@ -35,11 +52,12 @@ var pageManagementUtils = {
},
initObjects:function(){
this.counter = 0;
this.contentTypeSelect = $("#typeSelect");
this.contentTypeSelect = $("select#typeSelect");
//list of options
this.contentTypeSelectOptions = $('select#typeSelect option');
this.classGroupSection = $("section#classGroup");
this.nonClassGroupSection = $("section#nonClassGroup");
this.classGroupSection = $("section#browseClassGroup");
this.sparqlQuerySection = $("section#sparqlQuery");
this.fixedHTMLSection = $("section#fixedHtml");
//From original menu management edit
this.defaultTemplateRadio = $('input.default-template');
this.customTemplateRadio = $('input.custom-template');
@ -48,12 +66,19 @@ var pageManagementUtils = {
// this.changeContentType = $('#changeContentType');
this.selectContentType = $('#selectContentType');
// this.existingContentType = $('#existingContentType');
this.selectClassGroupDropdown = $('#selectClassGroup');
this.classesForClassGroup = $('#classesInSelectedGroup');
this.selectClassGroupDropdown = $('select#selectClassGroup');
this.classesForClassGroup = $('section#classesInSelectedGroup');
this.selectedGroupForPage = $('#selectedContentTypeValue');
this.allClassesSelectedCheckbox = $('#allSelected');
this.displayInternalMessage = $('#internal-class label em');
this.pageContentSubmissionInputs = $("#pageContentSubmissionInputs");
this.headerBar = $("section#headerBar");
this.moreContentButton = $("input#moreContent");
this.isMenuCheckbox = $("input#menuCheckbox");
this.menuSection = $("section#menu");
this.submitButton = $("input#submit");
this.leftSideDiv = $("div#leftSide");
this.rightSideDiv = $("div#rightSide")
},
initDisplay: function(){
//right side components
@ -62,125 +87,120 @@ var pageManagementUtils = {
//Why would you want to hide this? This hides everything
// $("section#pageDetails").hide();
$("section#headerBar").hide();
this.headerBar.hide();
this.classGroupSection.hide();
this.nonClassGroupSection.hide();
$("section#classesInSelectedGroup").addClass('hidden');
$("input#moreContent").hide();
this.sparqlQuerySection.hide();
this.fixedHTMLSection.hide();
this.classesForClassGroup.addClass('hidden');
this.moreContentButton.hide();
//left side components
$("input.default-template").attr('checked',true);
$("input#menuCheckbox").attr('checked',false);
$("section#menu").hide();
this.defaultTemplateRadio.attr('checked',true);
this.isMenuCheckbox.attr('checked',false);
this.menuSection.hide();
},
bindEventListeners:function(){
$("input.default-template").click( function() {
$("section#custom-template").addClass('hidden');
this.defaultTemplateRadio.click( function() {
pageManagementUtils.customTemplate.addClass('hidden');
//Also clear custom template value so as not to submit it
pageManagementUtils.clearInputs(pageManagementUtils.customTemplate);
});
$("input.custom-template").click( function() {
$("section#custom-template").removeClass('hidden');
this.customTemplateRadio.click( function() {
pageManagementUtils.customTemplate.removeClass('hidden');
});
$("input#menuCheckbox").click( function() {
if ( $("section#menu").is(':hidden') ) {
$("section#menu").show();
this.isMenuCheckbox.click( function() {
if ( pageManagementUtils.menuSection.is(':hidden') ) {
pageManagementUtils.menuSection.show();
}
else {
$("section#menu").hide();
pageManagementUtils.menuSection.hide();
}
});
$("input#submit").click( function() {
this.submitButton.click( function() {
$("section#pageDetails").show();
});
//Collapses the current content and creates a new section of content
//Resets the content to be cloned to default settings
$("input#moreContent").click( function() {
this.moreContentButton.click( function() {
var selectedType = pageManagementUtils.contentTypeSelect.val();
var selectedTypeText = $("#typeSelect option:selected").text();
//Not sure why selected group here? This won't always be true for more content
//var selectedGroup = $('select#selectClassGroup').val();
//Aren't these already hidden?
//Hide both sections
$("section#classGroup").hide();
$("section#nonClassGroup").hide();
//Reset class group
pageManagementUtils.resetClassGroupSection();
//Hide all sections
pageManagementUtils.classGroupSection.hide();
pageManagementUtils.fixedHTMLSection.hide();
pageManagementUtils.sparqlQuerySection.hide();
//Reset main content type drop-down
pageManagementUtils.contentTypeSelectOptions.eq(0).attr('selected', 'selected');
$("input#moreContent").hide();
if ( $("div#leftSide").css("height") != undefined ) {
$("div#leftSide").css("height","");
if ( $("div#leftSide").height() < $("div#rightSide").height() ) {
$("div#leftSide").css("height",$("div#rightSide").height() + "px");
pageManagementUtils.moreContentButton.hide();
if ( pageManagementUtils.leftSideDiv.css("height") != undefined ) {
pageManagementUtils.leftSideDiv.css("height","");
if ( pageManagementUtils.leftSideDiv.height() < pageManagementUtils.rightSideDiv.height() ) {
pageManagementUtils.leftSideDiv.css("height",pageManagementUtils.rightSideDiv.height() + "px");
}
}
$("section#headerBar").hide();
$("section#headerBar").text("");
//pageManagementUtils.cloneContentArea(selectedType,selectedGroup);
pageManagementUtils.cloneContentArea(selectedType, selectedTypeText);
pageManagementUtils.contentTypeSelect.focus();
pageManagementUtils.headerBar.hide();
pageManagementUtils.headerBar.text("");
pageManagementUtils.cloneContentArea(selectedType, selectedTypeText);
//Reset class group section AFTER cloning not before
pageManagementUtils.resetClassGroupSection();
//Clear all inputs values
pageManagementUtils.clearSourceTemplateValues();
pageManagementUtils.contentTypeSelect.focus();
});
//replacing with menu management edit version which is extended with some of the logic below
this.selectClassGroupDropdown.change(function() {
pageManagementUtils.chooseClassGroup();
});
/*
$("select#selectClassGroup").change( function() {
if ( $("select#selectClassGroup").val() == "" ) {
$("section#classesInSelectedGroup").addClass('hidden');
$("div#leftSide").css("height","");
$("input#moreContent").hide();
this.contentTypeSelect.change( function() {
_this = pageManagementUtils;
pageManagementUtils.clearSourceTemplateValues();
if ( _this.contentTypeSelect.val() == "browseClassGroup" ) {
pageManagementUtils.classGroupSection.show();
pageManagementUtils.fixedHTMLSection.hide();
pageManagementUtils.sparqlQuerySection.hide();
pageManagementUtils.moreContentButton.hide();
pageManagementUtils.headerBar.text("Browse Class Group - ");
pageManagementUtils.headerBar.show();
}
else {
$("section#classesInSelectedGroup").removeClass('hidden');
$("input#moreContent").show();
if ( $("div#leftSide").height() < $("div#rightSide").height() ) {
$("div#leftSide").css("height",$("div#rightSide").height() + "px");
}
}
});*/
$("select#typeSelect").change( function() {
$('input#variable').val("");
$('textarea#textArea').val("");
if ( $("#typeSelect").val() == "browseClassGroup" ) {
$("section#classGroup").show();
$("section#nonClassGroup").hide();
$("input#moreContent").hide();
$("section#headerBar").text("Browse Class Group - ");
$("section#headerBar").show();
}
if ( $("#typeSelect").val() == "fixedHtml" || $("#typeSelect").val() == "sparqlQuery" ) {
$("section#classGroup").hide();
if ( $("#typeSelect").val() == "fixedHtml" ) {
$('span#taSpan').text("Enter fixed HTML here");
$("section#headerBar").text("Fixed HTML - ");
if ( _this.contentTypeSelect.val() == "fixedHtml" || _this.contentTypeSelect.val() == "sparqlQuery" ) {
pageManagementUtils.classGroupSection.hide();
//if fixed html show that, otherwise show sparq
if ( _this.contentTypeSelect.val() == "fixedHtml" ) {
pageManagementUtils.headerBar.text("Fixed HTML - ");
pageManagementUtils.fixedHTMLSection.show();
pageManagementUtils.sparqlQuerySection.hide();
}
else {
$('span#taSpan').text("Enter SPARQL query here");
$("section#headerBar").text("SPARQL Query Results - ");
pageManagementUtils.headerBar.text("SPARQL Query Results - ");
pageManagementUtils.sparqlQuerySection.show();
pageManagementUtils.fixedHTMLSection.hide();
}
$("section#nonClassGroup").show();
$("section#headerBar").show();
$('select#selectClassGroup option').eq(0).attr('selected', 'selected');
$("section#classesInSelectedGroup").addClass('hidden');
$("input#moreContent").show();
pageManagementUtils.headerBar.show();
//$('select#selectClassGroup option').eq(0).attr('selected', 'selected');
pageManagementUtils.classesForClassGroup.addClass('hidden');
pageManagementUtils.moreContentButton.show();
}
if ( $("#typeSelect").val() == "" ) {
$("section#classGroup").hide();
$("section#nonClassGroup").hide();
$("input#moreContent").hide();
$('select#selectClassGroup option').eq(0).attr('selected', 'selected');
$("section#classesInSelectedGroup").addClass('hidden');
$("section#headerBar").hide();
$("section#headerBar").text("");
if ( _this.contentTypeSelect.val() == "" ) {
pageManagementUtils.classGroupSection.hide();
pageManagementUtils.fixedHTMLSection.hide();
pageManagementUtils.sparqlQuerySection.hide();
pageManagementUtils.moreContentButton.hide();
//$('select#selectClassGroup option').eq(0).attr('selected', 'selected');
pageManagementUtils.classesForClassGroup.addClass('hidden');
pageManagementUtils.headerBar.hide();
pageManagementUtils.headerBar.text("");
}
pageManagementUtils.adjustSaveButtonHeight();
});
@ -194,13 +214,17 @@ var pageManagementUtils = {
});*/
//Submission: validate as well as create appropriate hidden json inputs
$("form").submit(function () {
$("form").submit(function (event) {
var validationError = pageManagementUtils.validateMenuItemForm();
if (validationError == "") {
//Create the appropriate json objects
pageManagementUtils.createPageContentForSubmission();
//return true;
//For testing, not submitting anything
//event.preventDefault();
return true;
} else{
$('#error-alert').removeClass('hidden');
$('#error-alert p').html(validationError);
//TODO: Check why scrolling appears to be a problem
@ -209,69 +233,48 @@ var pageManagementUtils = {
}
});
},
//Clear values in content areas that are cloned to create the page content type specific sections
//i.e. reset sparql query/class group areas
//TODO: Check if reset is more what we need here?
clearSourceTemplateValues:function() {
//inputs, textareas
pageManagementUtils.clearInputs(pageManagementUtils.fixedHTMLSection);
pageManagementUtils.clearInputs(pageManagementUtils.sparqlQuerySection);
pageManagementUtils.clearInputs(pageManagementUtils.classGroupSection);
},
clearInputs:function($el) {
//jquery selector :input selects all input text area select and button elements
$el.find("input").val("");
$el.find("textarea").val("");
//resetting class group section as well so selection is reset if type changes
$el.find("select option:eq(0)").attr("selected", "selected");
},
//Clone content area
cloneContentArea: function(contentType, contentTypeLabel) {
var ctr = pageManagementUtils.counter;
var counter = pageManagementUtils.counter;
var varOrClas;
var varOrClass;
//Clone the object, renaming ids and copying text area values as well
$newContentObj = pageManagementUtils.createCloneObject(contentType, counter);
if ( contentType == "fixedHTML" || contentType == "sparqlQuery" ) {
var taValue = $('textarea#textArea').val();
alert("original text area value is " + taValue);
var $newContentObj = $('section#nonClassGroup').clone();
$newContentObj.addClass("pageContent");
varOrClass = $newContentObj.find('input').val();
$newContentObj.show();
//Save content type
$newContentObj.attr("contentType", contentType);
$newContentObj.attr("id", contentType + counter);
$newContentObj.find('input#variable').attr("id","variable" + counter);
$newContentObj.find('textarea#textArea').attr("id","textArea" + counter);
$newContentObj.find('label#variableLabel').attr("id","variableLabel" + counter);
$newContentObj.find('label#taLabel').attr("id","taLabel" + counter);
//Keep the name of the inputs the same
// $newContentObj.find('input#variable').attr("name","variable" + counter);
// $newContentObj.find('textarea#textArea').attr("name","textArea" + counter);
// There's a jquery bug when cloning textareas: the value doesn't
// get cloned. So
// copy the value "manually."
$newContentObj.find("textarea[name='textArea']").val(taValue);
}
if ( contentType == "sparqlQuery" || contentType == "fixedHtml") {
varOrClass = $newContentObj.find('input[name="saveToVar"]').val();
}
else if ( contentType == "browseClassGroup" ) {
var $newContentObj = $('section#classGroup').clone();
$newContentObj.addClass("pageContent");
$newContentObj.show();
$newContentObj.attr("contentType", contentType);
$newContentObj.attr("id", "classGroup" + counter);
$newContentObj.find('section#selectContentType').attr("id", "selectContentType" + counter);
$newContentObj.find('select#selectClassGroup').val(groupValue);
$newContentObj.find('select#selectClassGroup').attr("id","selectClassGroup" + counter);
$newContentObj.find('select#selectClassGroup' + counter).attr("name","selectClassGroup" + counter);
$newContentObj.find('section#classesInSelectedGroup').attr("id","classesInSelectedGroup" + counter);
$newContentObj.find('section#classesInSelectedGroup' + counter).removeClass('hidden');
$newContentObj.find('p#selectClassesMessage').attr("id","selectClassesMessage" + counter);
// Will need to uncomment this and find a way to apply the css style
// $newContentObj.find('section#internal-class').attr("id","internal-class" +
// counter);
$newContentObj.find("input[name='display-internalClass']").attr("name","display-internalClass" + counter);
$newContentObj.find('ul#selectedClasses').attr("id","selectedClasses" + counter);
$newContentObj.find('ul#selectedClasses' + counter).attr("name","selectedClasses" + counter);
$newContentObj.find('ul#selectedClasses' + counter).children("li").each( function(i,abc) {
var $theCheckbox = $(this).find('input');
$theCheckbox.attr("name", $theCheckbox.attr("name") + counter);
});
varOrClass = $newContentObj.find('select#selectClassGroup' + counter + ' option:selected').text();
$newContentObj.find('section#classesInSelectedGroup' + counter).removeClass('hidden');
varOrClass = $newContentObj.find('select#selectClassGroup' + counter + ' option:selected').text();
}
pageManagementUtils.createClonedContentContainer($newContentObj, counter, contentTypeLabel, varOrClass);
//previously increased by 10, just increasing by 1 here
pageManagementUtils.counter++;
},
createClonedContentContainer:function($newContentObj, counter, contentTypeLabel, varOrClass) {
//Create the container for the new content
$newDivContainer = $("<div></div>", {
id: "divContainer" + counter,
"class": "pageContentContainer",
@ -281,10 +284,20 @@ var pageManagementUtils = {
+ "' class='pageContentWrapper'><input id='remove" + counter
+ "' type='button' class='delete' value='Delete' class='deleteButton' /></div>"
});
var $clickableSpan = $newDivContainer.children('span#clickable' + counter);
//Hide inner div
var $innerDiv = $newDivContainer.children('div#innerContainer' + counter);
$innerDiv.hide();
//Expand/collapse toggle
//Bind event listers for the new content for display/removal etc.
pageManagementUtils.bindClonedContentContainerEvents($newDivContainer, counter);
//Append the new container to the section storing these containers
$newDivContainer.appendTo($('section#contentDivs'));
//place new content object
$newContentObj.prependTo($innerDiv);
},
bindClonedContentContainerEvents:function($newDivContainer, counter) {
var $clickableSpan = $newDivContainer.children('span#clickable' + counter);
var $innerDiv = $newDivContainer.children('div#innerContainer' + counter);
//Expand/collapse toggle
$clickableSpan.click(function() {
if ( $innerDiv.is(':visible') ) {
$innerDiv.slideUp(222);
@ -302,26 +315,20 @@ var pageManagementUtils = {
}
window.setTimeout('pageManagementUtils.adjustSaveButtonHeight()', 223);
});
//remove button
$newRemoveButton = $innerDiv.find('input#remove' + counter);
// this will have to disable submitted fields as well as hide them.
$newRemoveButton.click(function() {
$innerDiv.parent("div").css("display","none");
pageManagementUtils.adjustSaveButtonHeight();
});
$newDivContainer.appendTo($('section#contentDivs'));
$newContentObj.prependTo($innerDiv);
counter = counter + 10;
},
resetClassGroupSection:function() {
$('select#selectClassGroup option').eq(0).attr('selected', 'selected');
$("section#classesInSelectedGroup").addClass('hidden');
},
//finalize later, but basically use same attribute across page content and use attribute instead of id
//Attribute would be what keeps track of content, so contentCounter or something like that
toggleArrow:function() {
//doing this in clear inputs instead which will be triggered
//every time content type is changed AS well as on more content button after
//original content is cloned and stored
//$('select#selectClassGroup option').eq(0).attr('selected', 'selected');
pageManagementUtils.classesForClassGroup.addClass('hidden');
},
//Adjust save button height
adjustSaveButtonHeight:function() {
@ -345,7 +352,6 @@ var pageManagementUtils = {
} else {
//update existing content type with correct class group name and hide class group select again
var _this = pageManagementUtils;
// pageManagementUtils.hideClassGroups();
pageManagementUtils.selectedGroupForPage.html(results.classGroupName);
@ -372,14 +378,14 @@ var pageManagementUtils = {
//From NEW code
if (pageManagementUtils.selectClassGroupDropdown.val() == "" ) {
$("section#classesInSelectedGroup").addClass('hidden');
pageManagementUtils.classesForClassGroup.addClass('hidden');
$("div#leftSide").css("height","");
$("input#moreContent").hide();
pageManagementUtils.moreContentButton.hide();
}
else {
$("section#classesInSelectedGroup").removeClass('hidden');
$("input#moreContent").show();
pageManagementUtils.classesForClassGroup.removeClass('hidden');
pageManagementUtils.moreContentButton.show();
if ( $("div#leftSide").height() < $("div#rightSide").height() ) {
$("div#leftSide").css("height",$("div#rightSide").height() + "px");
}
@ -390,39 +396,24 @@ var pageManagementUtils = {
});
},
/*
showClassGroups: function() { //User has clicked change content type
//Show the section with the class group dropdown
this.selectContentType.removeClass("hidden");
//Hide the "change content type" section which shows the selected class group
this.existingContentType.addClass("hidden");
//Hide the checkboxes for classes within the class group
this.classesForClassGroup.addClass("hidden");
},
hideClassGroups: function() { //User has selected class group/content type, page should show classes for class group and 'existing' type with change link
//Hide the class group dropdown
this.selectContentType.addClass("hidden");
//Show the "change content type" section which shows the selected class group
this.existingContentType.removeClass("hidden");
//Show the classes in the class group
this.classesForClassGroup.removeClass("hidden");
},*/
toggleClassSelection: function() {
// Check/unckeck all classes for selection
$('input:checkbox[name=allSelected]').click(function(){
if ( this.checked ) {
// if checked, select all the checkboxes
$('input:checkbox[name=classInClassGroup]').attr('checked','checked');
// if checked, select all the checkboxes for this particular section
$(this).closest("ul").find('input:checkbox[name=classInClassGroup]').attr('checked','checked');
//$('input:checkbox[name=classInClassGroup]').attr('checked','checked');
} else {
// if not checked, deselect all the checkboxes
$('input:checkbox[name=classInClassGroup]').removeAttr('checked');
$(this).closest("ul").find('input:checkbox[name=classInClassGroup]').removeAttr('checked');
// $('input:checkbox[name=classInClassGroup]').removeAttr('checked');
}
});
$('input:checkbox[name=classInClassGroup]').click(function(){
$('input:checkbox[name=allSelected]').removeAttr('checked');
$(this).closest(ul).find('input:checkbox[name=allSelected]').removeAttr('checked');
});
}, //This is SPECIFIC to VIVO so should be moved there
updateInternalClassMessage:function(classGroupName) { //User has changed content type
@ -482,29 +473,63 @@ var pageManagementUtils = {
//Create a new hidden input with a specific name and assign value per page content
pageManagementUtils.createPageContentInputForSubmission(jsonObjectString);
});
//in this case it's a sparql data getter, but what about the others
/*
var len = pageContentSections.length;
var i;
for(i = 0; i < len; i++) {
var pageContentSection = $(pageContentSections[i]);
var pageContentSectionId = pageContentSection.attr("id");
var jsonObject = pageManagementUtils.processPageContentSection(pageContentSection);
var jsonObjectString = JSON.stringify(jsonObject);
//Create a new hidden input with a specific name and assign value per page content
pageManagementUtils.createPageContentInputForSubmission(jsonObjectString);
}*/
},
createPageContentInputForSubmission: function(inputValue) {
$("<input type='hidden' name='pageContentUnit' value='" + inputValue + "'>").appendTo(pageManagementUtils.pageContentSubmissionInputs);
},
//returns a json object with the data getter information required
processPageContentSection:function(pageContentSection) {
var variableValue = pageContentSection.find("input[name='variable']").val();
var queryValue = pageContentSection.find("textarea[name='textArea']").val();
var returnObject = {saveToVar:variableValue, query:queryValue, dataGetterClass:pageManagementUtils.dataGetterLabelToURI["sparqlDataGetter"], queryModel:"vitro:contextDisplayModel"};
return returnObject;
//This processing should be specific to the type and so that content type's specific processor will
//return the json object required
if(pageManagementUtils.processDataGetterUtils != null) {
var dataGetterType = pageManagementUtils.processDataGetterUtils.selectDataGetterType(pageContentSection);
if(pageManagementUtils.dataGetterProcessorMap != null) {
var dataGetterProcessor = pageManagementUtils.dataGetterProcessorMap[dataGetterType];
//the content type specific processor will create the json object to be returned
var jsonObject = dataGetterProcessor.processPageContentSection(pageContentSection);
return jsonObject;
} else {
//ERROR handling
alert("An error has occurred and the map of processors for this content is missing. Please contact the administrator");
return null;
}
}
alert("An error has occurred and the code for processing this content is missing a component. Please contact the administrator.");
//Error handling here
return null;
},
//clones and returns cloned object for content type
createCloneObject:function(contentType, counter) {
var originalObjectPath = 'section#' + contentType;
var $newContentObj = $(originalObjectPath).clone();
$newContentObj.addClass("pageContent");
//Save content type
$newContentObj.attr("contentType", contentType);
//Set id for object
$newContentObj.attr("id", contentType + counter);
$newContentObj.show();
pageManagementUtils.renameIdsInClone($newContentObj, counter);
// pageManagementUtils.cloneTextAreaValues(originalObjectPath, $newContentObj);
return $newContentObj;
},
//This is specifically for cloning text area values
//May not need this if implementing the jquery fix
///would need a similar function for select as well
cloneTextAreaValues:function(originalAncestorPath, $newAncestorObject) {
$(originalAncestorPath + " textarea").each(function(index, el) {
var originalTextAreaValue = $(this).val();
var originalTextAreaName = $(this).attr("name");
$newAncestorObject.find("textarea[name='" + originalTextAreaName + "']").val(originalTextAreaValue);
});
},
//given an object and a counter, rename all the ids
renameIdsInClone:function($newContentObj, counter) {
$newContentObj.find("[id]").each(function(index, el) {
var originalId = $(this).attr("id");
var newId = originalId + counter;
$(this).attr("id", newId);
});
}
};

View file

@ -0,0 +1,21 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
//Process sparql data getter and provide a json object with the necessary information
//Depending on what is included here, a different type of data getter might be used
var processClassGroupDataGetterContent = {
dataGetterClass:null,
//can use this if expect to initialize from elsewhere
initProcessor:function(dataGetterClassInput) {
this.dataGetterClass = dataGetterClassInput;
},
//Do we need a separate content type for each of the others?
processPageContentSection:function(pageContentSection) {
//Will look at classes etc.
var classGroup = pageContentSection.find("select[name='selectClassGroup']").val();
//query model should also be an input, ensure class group URI is saved as URI and not string
var returnObject = {classGroup:classGroup, dataGetterClass:this.dataGetterClass};
return returnObject;
}
}

View file

@ -0,0 +1,29 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
//This class is responsible for the product-specific form processing/content selection that might be possible
//Overrides the usual behavior of selecting the specific JavaScript class needed to convert the form inputs
//into a JSON object for submission based on the page content type
//This will need to be overridden or extended, what have you.. in VIVO
var processDataGetterUtils = {
dataGetterProcessorMap:{"browseClassGroup": processClassGroupDataGetterContent,
"sparqlQuery": processSparqlDataGetterContent,
"fixedHtml":processFixedHTMLDataGetterContent,
"individualsForClasses":processIndividualsForClassesDataGetterContent},
selectDataGetterType:function(pageContentSection) {
var contentType = pageContentSection.attr("contentType");
//The form can provide "browse class group" as content type but need to check
//whether this is in fact individuals for classes instead
if(contentType == "browseClassGroup") {
//Is ALL NOT selected and there are other classes, pick one
//this SHOULD be an array
var allClassesSelected = pageContentSection.find("input[name='allSelected']:checked");
//If all NOT selected then need to pick a different content type
if(allClassesSelected.length == 0) {
contentType = "individualsForClasses";
}
}
return contentType;
}
};

View file

@ -0,0 +1,20 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
//Process sparql data getter and provide a json object with the necessary information
var processFixedHTMLDataGetterContent = {
dataGetterClass:null,
//can use this if expect to initialize from elsewhere
initProcessor:function(dataGetterClass) {
this.dataGetterClass =dataGetterClass;
},
//requires variable and text area
processPageContentSection:function(pageContentSection) {
var saveToVarValue = pageContentSection.find("input[name='saveToVar']").val();
var htmlValue = pageContentSection.find("textarea[name='htmlValue']").val();
//query model should also be an input
var returnObject = {saveToVar:saveToVarValue, htmlValue:htmlValue, dataGetterClass:this.dataGetterClass};
return returnObject;
}
}

View file

@ -0,0 +1,24 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
var processIndividualsForClassesDataGetterContent = {
dataGetterClass:null,
//can use this if expect to initialize from elsewhere
initProcessor:function(dataGetterClassInput) {
this.dataGetterClass = dataGetterClassInput;
},
//Do we need a separate content type for each of the others?
processPageContentSection:function(pageContentSection) {
//Will look at classes etc.
var classGroup = pageContentSection.find("select[name='selectClassGroup']").val();
//query model should also be an input
//Get classes selected
var classesSelected = [];
pageContentSection.find("input[name='classInClassGroup']:checked").each(function(){
//Need to make sure that the class is also saved as a URI
classesSelected.push($(this).val());
});
var returnObject = {classGroup:classGroup, classesSelectedInClassGroup:classesSelected, dataGetterClass:this.dataGetterClass};
return returnObject;
}
}

View file

@ -0,0 +1,23 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
//Process sparql data getter and provide a json object with the necessary information
var processSparqlDataGetterContent = {
dataGetterClass:null,
//can use this if expect to initialize from elsewhere
initProcessor:function(dataGetterClass) {
this.dataGetterClass =dataGetterClass;
},
processPageContentSection:function(pageContentSection) {
var variableValue = pageContentSection.find("input[name='saveToVar']").val();
var queryValue = pageContentSection.find("textarea[name='query']").val();
var queryModel = pageContentSection.find("input[name='queryModel']").val();
//query model should also be an input
//set query model to query model here - vitro:contentDisplayModel
var returnObject = {saveToVar:variableValue, query:queryValue, dataGetterClass:this.dataGetterClass, queryModel:queryModel};
return returnObject;
}
};

View file

@ -0,0 +1,449 @@
/*
Profiles Shindig Helper functions for gadget-to-container commands
*/
// dummy function so google analytics does not break for institutions who do not use it
_gaq = {};
_gaq.push = function(data) { //
};
// pubsub
gadgets.pubsubrouter.init(function(id) {
return my.gadgets[shindig.container.gadgetService.getGadgetIdFromModuleId(id)].url;
}, {
onSubscribe: function(sender, channel) {
setTimeout("my.onSubscribe('" + sender + "', '" + channel + "')", 3000);
// return true to reject the request.
return false;
},
onUnsubscribe: function(sender, channel) {
//alert(sender + " unsubscribes from channel '" + channel + "'");
// return true to reject the request.
return false;
},
onPublish: function(sender, channel, message) {
// return true to reject the request.
// track with google analytics
if (sender != '..' ) {
var moduleId = shindig.container.gadgetService.getGadgetIdFromModuleId(sender);
}
if (channel == 'VISIBLE') {
var statusId = document.getElementById(sender + '_status');
if (statusId) {
// only act on these in HOME view since they are only meant to be seen when viewer=owner
if (my.gadgets[moduleId].view != 'home') {
return true;
}
if (message == 'Y') {
statusId.style.color = 'GREEN';
statusId.innerHTML = 'This section is VISIBLE';
if (my.gadgets[moduleId].visible_scope == 'U') {
statusId.innerHTML += ' to UCSF';
}
else {
statusId.innerHTML += ' to the public';
}
}
else {
statusId.style.color = '#CC0000';
statusId.innerHTML = 'This section is HIDDEN';
if (my.gadgets[moduleId].visible_scope == 'U') {
statusId.innerHTML += ' from UCSF';
}
else {
statusId.innerHTML += ' from the public';
}
}
}
}
else if (channel == 'added' && my.gadgets[moduleId].view == 'home') {
if (message == 'Y') {
_gaq.push(['_trackEvent', my.gadgets[moduleId].name, 'SHOW', 'profile_edit_view']);
osapi.activities.create(
{ 'userId': gadgets.util.getUrlParameters()['Person'],
'appId': my.gadgets[moduleId].appId,
'activity': {'postedTime': new Date().getTime(), 'title': 'added a gadget', 'body': 'added the ' + my.gadgets[moduleId].name + ' gadget to their profile' }
}).execute(function(response){});
}
else {
_gaq.push(['_trackEvent', my.gadgets[moduleId].name, 'HIDE', 'profile_edit_view']);
}
}
else if (channel == 'status') {
// message should be of the form 'COLOR:Message Content'
var statusId = document.getElementById(sender + '_status');
if (statusId) {
var messageSplit = message.split(':');
if (messageSplit.length == 2) {
statusId.style.color = messageSplit[0];
statusId.innerHTML = messageSplit[1];
}
else {
statusId.innerHTML = message;
}
}
}
else if (channel == 'analytics') {
// publish to google analytics
// message should be JSON encoding object with required action and optional label and value
// as documented here: http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html
// note that event category will be set to the gadget name automatically by this code
// Note: message will be already converted to an object
if (message.hasOwnProperty('value')) {
_gaq.push(['_trackEvent', my.gadgets[moduleId].name, message.action, message.label, message.value]);
}
else if (message.hasOwnProperty('label')) {
_gaq.push(['_trackEvent', my.gadgets[moduleId].name, message.action, message.label]);
}
else {
_gaq.push(['_trackEvent', my.gadgets[moduleId].name, message.action]);
}
}
else if (channel == 'profile') {
_gaq.push(['_trackEvent', my.gadgets[moduleId].name, 'go_to_profile', message]);
document.location.href = '/' + location.pathname.split('/')[1] + '/display/n' + message;
}
else if (channel == 'JSONPersonIds' || channel == 'JSONPubMedIds') {
// do nothing, no need to alert
}
else {
alert(sender + " publishes '" + message + "' to channel '" + channel + "'");
}
return false;
}
});
// helper functions
my.findGadgetsAttachingTo = function(chromeId) {
var retval = [];
for (var i = 0; i < my.gadgets.length; i++) {
if (my.gadgets[i].chrome_id == chromeId) {
retval[retval.length] = my.gadgets[i];
}
}
return retval;
};
my.removeGadgets = function(gadgetsToRemove) {
for (var i = 0; i < gadgetsToRemove.length; i++) {
for (var j = 0; j < my.gadgets.length; j++) {
if (gadgetsToRemove[i].url == my.gadgets[j].url) {
my.gadgets.splice(j, 1);
break;
}
}
}
};
my.onSubscribe = function(sender, channel) {
// lookup pubsub data based on channel and if a match is found, publish the data to that channel after a delay
if (my.pubsubData[channel]) {
gadgets.pubsubrouter.publish(channel, my.pubsubData[channel]);
}
else {
alert(sender + " subscribes to channel '" + channel + "'");
}
//PageMethods.onSubscribe(sender, channel, my.pubsubHint, my.CallSuccess, my.CallFailed);
};
my.removeParameterFromURL = function(url, parameter) {
var urlparts= url.split('?'); // prefer to use l.search if you have a location/link object
if (urlparts.length>=2) {
var prefix= encodeURIComponent(parameter)+'=';
var pars= urlparts[1].split(/[&;]/g);
for (var i= pars.length; i-->0;) //reverse iteration as may be destructive
if (pars[i].lastIndexOf(prefix, 0)!==-1) //idiom for string.startsWith
pars.splice(i, 1);
url= urlparts[0]+'?'+pars.join('&');
}
return url;
};
// publish the people
my.CallSuccess = function(result) {
gadgets.pubsubrouter.publish('person', result);
};
// alert message on some failure
my.CallFailed = function(error) {
alert(error.get_message());
};
my.requestGadgetMetaData = function(view, opt_callback) {
var request = {
context: {
country: "default",
language: "default",
view: view,
ignoreCache : my.noCache,
container: "default"
},
gadgets: []
};
for (var moduleId = 0; moduleId < my.gadgets.length; moduleId++) {
// only add those with matching views
if (my.gadgets[moduleId].view == view) {
request.gadgets[request.gadgets.length] = {'url': my.gadgets[moduleId].url, 'moduleId': moduleId};
}
}
var makeRequestParams = {
"CONTENT_TYPE" : "JSON",
"METHOD" : "POST",
"POST_DATA" : gadgets.json.stringify(request)};
gadgets.io.makeNonProxiedRequest(my.openSocialURL + "/gadgets/metadata",
function(data) {
data = data.data;
if (opt_callback) {
opt_callback(data);
}
},
makeRequestParams,
"application/javascript"
);
};
my.renderableGadgets = [];
my.generateGadgets = function(metadata) {
// put them in moduleId order
for (var i = 0; i < metadata.gadgets.length; i++) {
var moduleId = metadata.gadgets[i].moduleId;
// Notes by Eric. Not sure if I should have to calculate this myself, but I will.
var height = metadata.gadgets[i].height;
var width = metadata.gadgets[i].width;
var viewPrefs = metadata.gadgets[i].views[my.gadgets[moduleId].view];
if (viewPrefs) {
height = viewPrefs.preferredHeight || height;
width = viewPrefs.preferredWidth || width;
}
my.renderableGadgets[moduleId] = shindig.container.createGadget({'specUrl': metadata.gadgets[i].url, 'secureToken': my.gadgets[moduleId].secureToken,
'title': metadata.gadgets[i].title, 'userPrefs': metadata.gadgets[i].userPrefs,
'height': height, 'width': width, 'debug': my.debug});
// set the metadata for easy access
my.renderableGadgets[moduleId].setMetadata(metadata.gadgets[i]);
}
// this will be called multiple times, only render when all gadgets have been processed
var ready = my.renderableGadgets.length == my.gadgets.length;
for (var i = 0; ready && i < my.renderableGadgets.length; i++) {
if (!my.renderableGadgets[i]) {
ready = false;
}
}
if (ready) {
shindig.container.addGadgets(my.renderableGadgets );
shindig.container.renderGadgets();
}
};
my.init = function() {
// overwrite this RPC function. Do it at this level so that rpc.f (this.f) is accessible for getting module ID
// gadgets.rpc.register('requestNavigateTo', doProfilesNavigation);
shindig.container.gadgetClass = ProfilesGadget;
shindig.container.layoutManager = new ProfilesLayoutManager();
shindig.container.setNoCache(my.noCache);
shindig.container.gadgetService = new ProfilesGadgetService();
// since we render multiple views, we need to do somethign fancy by swapping out this value in getIframeUrl
shindig.container.setView('REPLACE_THIS_VIEW');
// do multiple times as needed if we have multiple views
// find out what views are being used and call requestGadgetMetaData for each one
var views = {};
for (var moduleId = 0; moduleId < my.gadgets.length; moduleId++) {
var view = my.gadgets[moduleId].view;
if (!views[view]) {
views[view] = view;
my.requestGadgetMetaData(view, my.generateGadgets);
}
}
};
// ProfilesGadgetService
ProfilesGadgetService = function() {
shindig.IfrGadgetService.call(this);
};
ProfilesGadgetService.inherits(shindig.IfrGadgetService);
ProfilesGadgetService.prototype.requestNavigateTo = function(view, opt_params) {
var urlTemplate = gadgets.config.get('views')[view].urlTemplate;
var url = urlTemplate || 'OpenSocial.aspx?';
url += window.location.search.substring(1);
// remove appId if present
url = my.removeParameterFromURL(url, 'appId');
// Add appId if the URL Template begins with the word 'gadget'
if (urlTemplate.toLowerCase().indexOf('gadget') == 0) {
var moduleId = shindig.container.gadgetService.getGadgetIdFromModuleId(this.f);
var appId = my.gadgets[moduleId].appId;
url += (url.indexOf('?') != url.length - 1 ? '&' : '') + 'appId=' + appId;
}
if (opt_params) {
var paramStr = gadgets.json.stringify(opt_params);
if (paramStr.length > 0) {
url += (url.indexOf('?') != url.length - 1 ? '&' : '') + 'appParams=' + encodeURIComponent(paramStr);
}
}
if (url && document.location.href.indexOf(url) == -1) {
document.location.href = url;
}
};
// ProfilesGadget
ProfilesGadget = function(opt_params) {
shindig.Gadget.call(this, opt_params);
this.debug = my.debug;
this.serverBase_ = my.openSocialURL + "/gadgets/";
var gadget = this;
var subClass = shindig.IfrGadget;
this.metadata = {};
for (var name in subClass) if (subClass.hasOwnProperty(name)) {
if (name == 'getIframeUrl') {
// we need to keep this old one
gadget['originalGetIframeUrl'] = subClass[name];
}
else if (name != 'finishRender') {
gadget[name] = subClass[name];
}
}
};
ProfilesGadget.inherits(shindig.BaseIfrGadget);
ProfilesGadget.prototype.setMetadata = function(metadata) {
this.metadata = metadata;
};
ProfilesGadget.prototype.hasFeature = function(feature) {
for (var i = 0; i < this.metadata.features.length; i++) {
if (this.metadata.features[i] == feature) {
return true;
}
}
return false;
};
ProfilesGadget.prototype.getAdditionalParams = function() {
var params = '';
for (var key in my.gadgets[this.id].additionalParams) {
params += '&' + key + '=' + my.gadgets[this.id].additionalParams[key];
}
return params;
};
ProfilesGadget.prototype.finishRender = function(chrome) {
window.frames[this.getIframeId()].location = this.getIframeUrl();
if (my.gadgets[this.id].start_closed) {
this.handleToggle();
}
else if (chrome) {
// set the gadget box width, and remember that we always render as open
chrome.style.width = (my.gadgets[this.id].open_width || 600) + 'px';
}
};
ProfilesGadget.prototype.getIframeUrl = function() {
var url = this.originalGetIframeUrl();
return url.replace('REPLACE_THIS_VIEW', my.gadgets[this.id].view);
};
ProfilesGadget.prototype.handleToggle = function() {
var gadgetIframe = document.getElementById(this.getIframeId());
if (gadgetIframe) {
var gadgetContent = gadgetIframe.parentNode;
var gadgetImg = document.getElementById('gadgets-gadget-title-image-' + this.id);
if (gadgetContent.style.display) {
//OPEN
gadgetContent.parentNode.style.width = (my.gadgets[this.id].open_width || 600) + 'px';
gadgetContent.style.display = '';
gadgetImg.src = '/' + location.pathname.split('/')[1] + '/themes/opensocial/images/openSocial/icon_squareDownArrow.gif';
// refresh if certain features require so
//if (this.hasFeature('dynamic-height')) {
if (my.gadgets[this.id].chrome_id == 'gadgets-search') {
this.refresh();
document.getElementById(this.getIframeId()).contentWindow.location.reload(true);
}
if (my.gadgets[this.id].view == 'home') {
// record in google analytics
_gaq.push(['_trackEvent', my.gadgets[this.id].name, 'OPEN_IN_EDIT', 'profile_edit_view']);
}
else {
osapi.activities.create(
{ 'userId': gadgets.util.getUrlParameters()['Person'],
'appId': my.gadgets[this.id].appId,
'activity': {'postedTime': new Date().getTime(), 'title': 'gadget viewed', 'body': my.gadgets[this.id].name + ' gadget was viewed' }
}).execute(function(response){});
// record in google analytics
_gaq.push(['_trackEvent', my.gadgets[this.id].name, 'OPEN']);
}
}
else {
//CLOSE
gadgetContent.parentNode.style.width = (my.gadgets[this.id].closed_width || 600) + 'px';
gadgetContent.style.display = 'none';
gadgetImg.src = '/' + location.pathname.split('/')[1] + '/themes/opensocial/images/openSocial/icon_squareArrow.gif';
if (my.gadgets[this.id].view == 'home') {
// record in google analytics
_gaq.push(['_trackEvent', my.gadgets[this.id].name, 'CLOSE_IN_EDIT', 'profile_edit_view']);
}
else {
// record in google analytics
_gaq.push(['_trackEvent', my.gadgets[this.id].name, 'CLOSE']);
}
}
}
};
ProfilesGadget.prototype.getTitleBarContent = function(continuation) {
if (my.gadgets[this.id].view == 'canvas') {
document.getElementById("gadgets-title").innerHTML = (this.title ? this.title : 'Gadget');
continuation('<span class="gadgets-gadget-canvas-title"></span>');
}
else {
continuation(
'<div id="' + this.cssClassTitleBar + '-' + this.id +
'" class="' + this.cssClassTitleBar + '"><span class="' +
this.cssClassTitleButtonBar + '">' +
'<a href="#" onclick="shindig.container.getGadget(' + this.id +
').handleToggle();return false;" class="' + this.cssClassTitleButton +
'"><img id="gadgets-gadget-title-image-' + this.id + '" src="/' + location.pathname.split('/')[1] + '/themes/opensocial/images/openSocial/icon_squareDownArrow.gif"/></a></span> <span id="' +
this.getIframeId() + '_title" class="' + this.cssClassTitle + '">' +
'<a href="#" onclick="shindig.container.getGadget(' + this.id + ').handleToggle();return false;">' +
(this.title ? this.title : 'Gadget') + '</a>' + '</span><span id="' +
this.getIframeId() + '_status" class="gadgets-gadget-status"></span></div>');
}
};
// ProfilesLayoutManager. Creates a FloatLeftLayoutManager for every chromeId in our gadgets
ProfilesLayoutManager = function() {
shindig.LayoutManager.call(this);
// find out what chromeId's are being used, create a FloatLeftLayoutManager for each
this.layoutManagers = {};
for (var moduleId = 0; moduleId < my.gadgets.length; moduleId++) {
var chromeId = my.gadgets[moduleId].chrome_id;
if (!this.layoutManagers[chromeId]) {
this.layoutManagers[chromeId] = new shindig.FloatLeftLayoutManager(chromeId);
}
}
};
ProfilesLayoutManager.inherits(shindig.LayoutManager);
ProfilesLayoutManager.prototype.getGadgetChrome = function(gadget) {
return this.layoutManagers[my.gadgets[gadget.id].chrome_id].getGadgetChrome(gadget);
};

View file

@ -32,6 +32,7 @@
this.form = $('form#classHierarchyForm');
this.select = $('select#displayOption');
this.addClass = $('input#addClass');
this.addGroup = $('input#addGroup');
},
bindEventListeners: function() {
@ -49,6 +50,10 @@
classHierarchyUtils.form.attr("action", "vclass_retry");
classHierarchyUtils.form.submit();
});
this.addGroup.click(function() {
classHierarchyUtils.form.attr("action", "editForm?controller=Classgroup");
classHierarchyUtils.form.submit();
});
},
buildClassHierarchyHtml: function() {
@ -96,6 +101,7 @@
getTheChildren: function(node) {
var childDetails = "";
var subclassString = " ";
var ctr = 0
$.each(node.children, function() {
if ( ctr == 0 ) {
@ -105,12 +111,18 @@
else {
childDetails += "<tr><td></td>" ;
}
if ( this.children.length == 1 ) {
subclassString += "<span style='font-size:0.8em'> (1 subclass)</span>";
}
else if ( this.children.length > 1 ) {
subclassString += "<span style='font-size:0.8em'> (" + this.children.length + " subclasses)</span>";
}
childDetails += "<td class='subclassCell'><span class='subclassExpandPlus' id='subclassExpand"
+ classHierarchyUtils.expandCounter + "'>&nbsp;</span>"
+ this.name + "</td></tr><tr><td></td><td><table id='subclassTable"
+ this.name + subclassString + "</td></tr><tr><td></td><td><table id='subclassTable"
+ classHierarchyUtils.expandCounter + "' class='subclassTable'>";
subclassString = " ";
classHierarchyUtils.clickableSpans.push('subclassExpand' + classHierarchyUtils.expandCounter);
classHierarchyUtils.expandCounter += 1;
@ -141,13 +153,13 @@
$clickableHeader.click(function() {
if ( $clickableHeader.attr('view') == "less" ) {
$clickableHeader.addClass("headerSpanMinus");
$('table#classHierarchy' + ctr).find('span').addClass("subclassExpandMinus");
$('table#classHierarchy' + ctr).find('span.subclassExpandPlus').addClass("subclassExpandMinus");
$('table#classHierarchy' + ctr).find('table.subclassTable').show();
$clickableHeader.attr('view', 'more' );
}
else {
$clickableHeader.removeClass("headerSpanMinus");
$('table#classHierarchy' + ctr).find('span').removeClass("subclassExpandMinus");
$('table#classHierarchy' + ctr).find('span.subclassExpandPlus').removeClass("subclassExpandMinus");
$('table#classHierarchy' + ctr).find('table.subclassTable').hide();
$clickableHeader.attr('view', 'less' );
}
@ -180,14 +192,14 @@
if ( classHierarchyUtils.expandAll.text() == "expand all" ) {
classHierarchyUtils.expandAll.text("collapse all");
$('span.headerSpanPlus').addClass("headerSpanMinus");
$('table.classHierarchy').find('span').addClass("subclassExpandMinus");
$('table.classHierarchy').find('span.subclassExpandPlus').addClass("subclassExpandMinus");
$('table.classHierarchy').find('table.subclassTable').show();
$('section#container').find('span.headerSpanPlus').attr('view','more');
}
else {
classHierarchyUtils.expandAll.text("expand all");
$('span.headerSpanPlus').removeClass("headerSpanMinus");
$('table.classHierarchy').find('span').removeClass("subclassExpandMinus");
$('table.classHierarchy').find('span.subclassExpandPlus').removeClass("subclassExpandMinus");
$('table.classHierarchy').find('table.subclassTable').hide();
$('section#container').find('span.headerSpanPlus').attr('view','less');
}

View file

@ -0,0 +1,293 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
var objectPropHierarchyUtils = {
onLoad: function(urlBase,displayOption,type) {
this.imagePath = urlBase + "/images/";
this.propType = type;
this.initObjects();
this.expandAll.hide();
this.checkJsonTree();
if ( noProps ) {
this.buildNoPropsHtml();
}
else if ( displayOption == "all" ) {
this.buildAllPropsHtml();
}
else {
this.buildPropertyHierarchyHtml();
this.wireExpandLink();
}
if ( displayOption == "hierarchy" ) {
this.expandAll.show();
}
this.bindEventListeners();
},
initObjects: function() {
this.expandAll = $('span#expandAll').find('a');
this.classCounter = 1;
this.expandCounter = 1;
this.classHtml = "";
this.clickableSpans = [] ;
this.form = $('form#classHierarchyForm');
this.select = $('select#displayOption');
this.addProperty = $('input#addProperty');
noProps = new Boolean;
},
bindEventListeners: function() {
if ( this.propType == "object" ) {
this.select.change(function() {
if ( objectPropHierarchyUtils.select.val() == "all") {
objectPropHierarchyUtils.form.attr("action", "listPropertyWebapps");
}
else {
objectPropHierarchyUtils.form.attr("action", "showObjectPropertyHierarchy");
}
objectPropHierarchyUtils.form.submit();
});
this.addProperty.click(function() {
objectPropHierarchyUtils.form.attr("action", "editForm?controller=Property");
objectPropHierarchyUtils.form.submit();
});
}
else {
this.select.change(function() {
if ( objectPropHierarchyUtils.select.val() == "all") {
objectPropHierarchyUtils.form.attr("action", "listDatatypeProperties");
}
else {
objectPropHierarchyUtils.form.attr("action", "showDataPropertyHierarchy");
}
objectPropHierarchyUtils.form.submit();
});
this.addProperty.click(function() {
objectPropHierarchyUtils.form.attr("action", "editForm?controller=Dataprop");
objectPropHierarchyUtils.form.submit();
});
}
},
checkJsonTree: function() {
if ( json.length == 1 ) {
$.each(json, function() {
// check to see whether we have a 'no properties' message or an actual json tree
if ( this.name.indexOf("properties") != -1 && this.data == undefined ) {
noProps = true;
}
else {
noProps = false;
}
});
}
else {
noProps = false;
}
},
buildPropertyHierarchyHtml: function() {
$.each(json, function() {
$newClassSection = jQuery("<section></section>", {
id: "classContainer" + objectPropHierarchyUtils.classCounter
});
var descendants = "";
var headerSpan = "";
if ( this.children.length ) {
descendants = objectPropHierarchyUtils.getTheChildren(this);
headerSpan = "<span class='headerSpanPlus' id='headerSpan" + objectPropHierarchyUtils.classCounter
+ "' view='less'>&nbsp;</span>";
}
objectPropHierarchyUtils.classHtml += "<div>" + this.name + headerSpan + "</div>" + "<table class='classHierarchy' id='classHierarchy"
+ objectPropHierarchyUtils.classCounter + "'>" ;
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>Local Name:</td><td>"
+ (this.data.internalName.length > 0 ? this.data.internalName : "none" ) + "</td></tr>";
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>Group:</td><td>"
+ (this.data.group.length > 0 ? this.data.group : "unspecified" ) + "</td></tr>";
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>Domain Class:</td><td>"
+ (this.data.domainVClass.length > 0 ? this.data.domainVClass : "none" ) + " ";
objectPropHierarchyUtils.classHtml += "<span class='rangeClass'>Range Class:</span>"
+ (this.data.rangeVClass.length > 0 ? this.data.rangeVClass : "none" ) + "</td></tr>";
objectPropHierarchyUtils.classHtml += descendants;
objectPropHierarchyUtils.classHtml += "</table>";
// alert(objectPropHierarchyUtils.classHtml);
$newClassSection.html(objectPropHierarchyUtils.classHtml);
$newClassSection.appendTo($('section#container'));
objectPropHierarchyUtils.makeHeaderSpansClickable(objectPropHierarchyUtils.classCounter);
objectPropHierarchyUtils.makeSubpropertySpansClickable();
objectPropHierarchyUtils.clickableSpans = [] ;
objectPropHierarchyUtils.classHtml = "";
objectPropHierarchyUtils.classCounter += 1;
});
},
getTheChildren: function(node) {
var childDetails = "";
var subclassString = " ";
var ctr = 0
$.each(node.children, function() {
if ( ctr == 0 ) {
childDetails += "<tr><td class='classDetail'>Subproperties:</td>";
ctr = ctr + 1;
}
else {
childDetails += "<tr><td></td>" ;
}
if ( this.children.length == 1 ) {
subclassString += "<span style='font-size:0.8em'> (1 subclass)</span>";
}
else if ( this.children.length > 1 ) {
subclassString += "<span style='font-size:0.8em'> (" + this.children.length + " subclasses)</span>";
}
childDetails += "<td class='subclassCell' colspan='2'><span class='subclassExpandPlus' id='subclassExpand"
+ objectPropHierarchyUtils.expandCounter + "'>&nbsp;</span>"
+ this.name + subclassString + "</td></tr><tr><td></td><td colspan='2'><table id='subclassTable"
+ objectPropHierarchyUtils.expandCounter + "' class='subclassTable'>";
subclassString = " ";
objectPropHierarchyUtils.clickableSpans.push('subclassExpand' + objectPropHierarchyUtils.expandCounter);
objectPropHierarchyUtils.expandCounter += 1;
childDetails += "<tr><td class='classDetail'>Local Name:</td><td>"
+ (this.data.internalName.length > 0 ? this.data.internalName : "none" ) + "</td></tr>";
childDetails += "<tr><td class='classDetail'>Group:</td><td>"
+ (this.data.group.length > 0 ? this.data.group : "unspecified" ) + "</td></tr>";
childDetails += "<tr><td class='classDetail'>Domain Class:</td><td>"
+ (this.data.domainVClass.length > 0 ? this.data.domainVClass : "none" ) + " ";
childDetails += "<span class='rangeClass'>Range Class:</span>"
+ (this.data.rangeVClass.length > 0 ? this.data.rangeVClass : "none" ) + "</td></tr>";
if ( this.children ) {
var grandChildren = objectPropHierarchyUtils.getTheChildren(this);
childDetails += grandChildren;
}
});
childDetails += "</table></td></tr>";
return childDetails;
},
makeHeaderSpansClickable: function(ctr) {
var $clickableHeader = $('section#classContainer' + ctr).find('span.headerSpanPlus');
$clickableHeader.click(function() {
if ( $clickableHeader.attr('view') == "less" ) {
$clickableHeader.addClass("headerSpanMinus");
$('table#classHierarchy' + ctr).find('span.subclassExpandPlus').addClass("subclassExpandMinus");
$('table#classHierarchy' + ctr).find('table.subclassTable').show();
$clickableHeader.attr('view', 'more' );
}
else {
$clickableHeader.removeClass("headerSpanMinus");
$('table#classHierarchy' + ctr).find('span.subclassExpandPlus').removeClass("subclassExpandMinus");
$('table#classHierarchy' + ctr).find('table.subclassTable').hide();
$clickableHeader.attr('view', 'less' );
}
});
},// $('myOjbect').css('background-image', 'url(' + imageUrl + ')');
makeSubpropertySpansClickable: function() {
$.each(objectPropHierarchyUtils.clickableSpans, function() {
var currentSpan = this;
var $clickableSpan = $('section#container').find('span#' + currentSpan);
var $subclassTable = $('section#container').find('table#subclassTable' + currentSpan.replace("subclassExpand",""));
$clickableSpan.click(function() {
if ( $subclassTable.is(':visible') ) {
$subclassTable.hide();
$subclassTable.find('table.subclassTable').hide();
$subclassTable.find('span').removeClass("subclassExpandMinus");
$clickableSpan.removeClass("subclassExpandMinus");
}
else {
$subclassTable.show();
$clickableSpan.addClass("subclassExpandMinus");
}
});
});
},
wireExpandLink: function() {
this.expandAll.click(function() {
if ( objectPropHierarchyUtils.expandAll.text() == "expand all" ) {
objectPropHierarchyUtils.expandAll.text("collapse all");
$('span.headerSpanPlus').addClass("headerSpanMinus");
$('table.classHierarchy').find('span.subclassExpandPlus').addClass("subclassExpandMinus");
$('table.classHierarchy').find('table.subclassTable').show();
$('section#container').find('span.headerSpanPlus').attr('view','more');
}
else {
objectPropHierarchyUtils.expandAll.text("expand all");
$('span.headerSpanPlus').removeClass("headerSpanMinus");
$('table.classHierarchy').find('span.subclassExpandPlus').removeClass("subclassExpandMinus");
$('table.classHierarchy').find('table.subclassTable').hide();
$('section#container').find('span.headerSpanPlus').attr('view','less');
}
});
},
buildAllPropsHtml: function() {
$.each(json, function() {
$newClassSection = jQuery("<section></section>", {
id: "classContainer" + objectPropHierarchyUtils.classCounter
});
objectPropHierarchyUtils.classHtml += "<div>" + this.name + "</div>" + "<table class='classHierarchy' id='classHierarchy"
+ objectPropHierarchyUtils.classCounter + "'>" ;
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>Local Name:</td><td>"
+ (this.data.internalName.length > 0 ? this.data.internalName : "none" ) + "</td></tr>";
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>Group:</td><td>"
+ (this.data.group.length > 0 ? this.data.group : "unspecified" ) + "</td></tr>";
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>Domain Class:</td><td>"
+ (this.data.domainVClass.length > 0 ? this.data.domainVClass : "none" ) + " ";
objectPropHierarchyUtils.classHtml += "<span class='rangeClass'>Range Class:</span>"
+ (this.data.rangeVClass.length > 0 ? this.data.rangeVClass : "none" ) + "</td></tr>";
objectPropHierarchyUtils.classHtml += "</table>";
$newClassSection.html(objectPropHierarchyUtils.classHtml);
$newClassSection.appendTo($('section#container'));
objectPropHierarchyUtils.classHtml = "";
objectPropHierarchyUtils.classCounter += 1;
});
},
buildNoPropsHtml: function() {
$.each(json, function() {
$newClassSection = jQuery("<section></section>", {
id: "classContainer" + objectPropHierarchyUtils.classCounter
});
objectPropHierarchyUtils.classHtml = "<h4>" + this.name + "</h4>";
$newClassSection.html(objectPropHierarchyUtils.classHtml);
$newClassSection.appendTo($('section#container'));
objectPropHierarchyUtils.classHtml = "";
});
}
}

View file

@ -1,16 +1,16 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%-- colspan set to 4 in DatapropRetryController.java --%>
<tr class="editformcell">
<td valign="top" colspan="1">
<b>Public Name</b><br/><i>as will display on public pages</i><br/>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%-- colspan set to 4 in DatapropRetryController.java --%>
<tr class="editformcell">
<td valign="top" colspan="1">
<b>Public Name</b><br/><i>as will display on public pages</i><br/>
<input name="PublicName" value="<form:value name="PublicName"/>"/>
<c:set var="PublicNameError"><form:error name="PublicName"/></c:set>
<c:if test="${!empty PublicNameError}">
<span class="notice"><c:out value="${PublicNameError}"/></span>
</c:if>
</c:if>
</td>
<td valign="top" colspan="1">
<b>Property Group</b><br/>
@ -27,10 +27,10 @@
<b>Update Level</b><br /><i>(specify least restrictive level allowed)</i><br />
<select name="ProhibitedFromUpdateBelowRoleLevelUsingRoleUri"><form:option name="ProhibitedFromUpdateBelowRoleLevelUsingRoleUri"/></select>
</td>
</tr>
</tr>
<tr class="editformcell">
<!-- c:set var="existingLocalName" value="<form:value name='LocalName'/>"/ -->
<td valign="top" colspan="2">
<!-- c:set var="existingLocalName" value="<form:value name='LocalName'/>"/ -->
<td valign="top" colspan="2">
<b>Ontology</b><br/>
<c:choose>
<c:when test="${_action eq 'update'}">
@ -45,42 +45,42 @@
<form:option name="Namespace"/>
</select>
</c:otherwise>
</c:choose>
</td>
<td valign="top" colspan="2">
</c:choose>
</td>
<td valign="top" colspan="2">
<b>Local Name*</b>
<c:choose>
<c:when test="${_action eq 'update'}">
<br/><i>Change only via the "change URI" button on the previous screen</i><br/>
<br/><i>Change only via the "change URI" button on the previous screen</i><br/>
<input name="LocalName" value="<form:value name="LocalName"/>" disabled="disabled"/>
</c:when>
<c:otherwise>
<i>(must be a valid XML name)<br/>startLowercaseAndUseCamelStyle</i><br/>
<input name="LocalName" value="<form:value name="LocalName"/>"/>
</c:otherwise>
</c:choose>
</c:choose>
<c:set var="LocalNameError"><form:error name="LocalName"/></c:set>
<c:if test="${!empty LocalNameError}">
<span class="notice"><c:out value="${LocalNameError}"/></span>
</c:if>
</c:if>
</td>
</tr>
<tr class="editformcell">
<td valign="top" colspan="2">
<b>Domain Class</b><br/>
<select name="DomainClassURI">
<form:option name="DomainClassURI"/>
</select>
</td>
</tr>
<tr class="editformcell">
<td valign="top" colspan="2">
<b>Range Datatype</b><br/>
<select name="RangeDatatypeURI">
<form:option name="RangeDatatypeURI"/>
</select>
</tr>
<tr class="editformcell">
<td valign="top" colspan="2">
<b>Domain Class</b><br/>
<select name="DomainClassURI">
<form:option name="DomainClassURI"/>
</select>
</td>
</tr>
<tr class="editformcell">
<td valign="top" colspan="2">
<b>Range Datatype</b><br/>
<select name="RangeDatatypeURI">
<form:option name="RangeDatatypeURI"/>
</select>
</td>
<td valign="bottom" colspan="2">
<c:set var="functionalLabel" value="<b>Functional property</b> <i>(has at most one value for each individual)</i>" />
@ -92,7 +92,7 @@
<input name="Functional" type="checkbox" value="TRUE"/>${functionalLabel}
</c:otherwise>
</c:choose>
</td>
</td>
</tr>
<tr class="editformcell">
@ -104,17 +104,17 @@
<span class="notice"><c:out value="${ExampleError}"/></span>
</c:if>
</td>
</tr>
<tr class="editformcell">
<td valign="top" colspan="4">
<b>Description</b> for ontology editors<br/>
</tr>
<tr class="editformcell">
<td valign="top" colspan="4">
<b>Description</b> for ontology editors<br/>
<textarea name="Description"><form:value name="Description"/></textarea>
<c:set var="DescriptionError"><form:error name="Description"/></c:set>
<c:if test="${!empty DescriptionError}">
<span class="notice"><c:out value="${DescriptionError}"/></span>
</c:if>
</td>
</c:if>
</td>
</tr>
<tr class="editformcell">
@ -126,24 +126,24 @@
<span class="notice"><c:out value="${PublicDescriptionError}"/></span>
</c:if>
</td>
</tr>
<tr class="editformcell">
<td valign="top" colspan="1">
<b>Display Tier</b><br/>
</tr>
<tr class="editformcell">
<td valign="top" colspan="1">
<b>Display Tier</b><br/>
<input name="DisplayTier" value="<form:value name="DisplayTier"/>"/>
<c:set var="DisplayTierError"><form:error name="DisplayTier"/></c:set>
<c:if test="${!empty DisplayTierError}">
<span class="notice"><c:out value="${DisplayTierError}"/></span>
</c:if>
</td>
<td valign="top" colspan="1">
<b>Display Limit</b><br/>
</c:if>
</td>
<td valign="top" colspan="1">
<b>Data Entry Limit</b><br/>
<input name="DisplayLimit" value="<form:value name="DisplayLimit"/>"/>
<c:set var="DisplayLimitError"><form:error name="DisplayLimit"/></c:set>
<c:if test="${!empty DisplayLimitError}">
<span class="notice"><c:out value="${DisplayLimitError}"/></span>
</c:if>
</c:if>
</td>
<td valign="top" colspan="1">
<em>Optional: <b>custom entry form</b></em><br />
@ -155,4 +155,4 @@
</td>
</td>
</tr>

View file

@ -0,0 +1,15 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--Save to variable indicated in generator -->
<#assign htmlExists = false/>
<#if variableName?has_content>
<#assign htmlExists = true />
</#if>
<#if htmlExists>
${.globals[variableName]}
<#else>
No HTML specified.
</#if>

View file

@ -6,6 +6,7 @@
<#assign subjectUri = individual.controlPanelUrl()?split("=") >
<#list propertyGroups.all as group>
<#assign groupName = group.getName(nameForOtherGroup)>
<#assign verbose = (verbosePropertySwitch.currentValue)!false>
<section class="property-group" role="region">
<nav class="scroll-up" role="navigation">
@ -29,13 +30,13 @@
<#-- Property display name -->
<#if property.localName == "authorInAuthorship" >
<h3 id="${property.localName}">${property.name} <@p.addLink property editable /> <@p.verboseDisplay property />
<a id="managePropLink" href="${urls.base}/managePublications?subjectUri=${subjectUri[1]!}" title="manage publications" <#if verbosePropertySwitch.currentValue>style="padding-top:10px"</#if> >
<a id="managePropLink" href="${urls.base}/managePublications?subjectUri=${subjectUri[1]!}" title="manage publications" <#if verbose>style="padding-top:10px"</#if> >
manage publications
</a>
</h3>
<#elseif property.localName == "hasResearcherRole">
<h3 id="${property.localName}">${property.name} <@p.addLink property editable /> <@p.verboseDisplay property />
<a id="managePropLink" href="${urls.base}/manageGrants?subjectUri=${subjectUri[1]!}" title="manage grants & projects" <#if verbosePropertySwitch.currentValue>style="padding-top:10px"</#if> >
<a id="managePropLink" href="${urls.base}/manageGrants?subjectUri=${subjectUri[1]!}" title="manage grants & projects" <#if verbose>style="padding-top:10px"</#if> >
manage grants & projects
</a>
</h3>

View file

@ -48,6 +48,30 @@
</#list>
</ul>
<#-- VIVO OpenSocial Extension by UCSF -->
<#if openSocial??>
<#if openSocial.visible>
<script type="text/javascript" language="javascript">
// find the 'Search' gadget(s).
var searchGadgets = my.findGadgetsAttachingTo("gadgets-search");
var keyword = '${querytext}';
// add params to these gadgets
if (keyword) {
for (var i = 0; i < searchGadgets.length; i++) {
var searchGadget = searchGadgets[i];
searchGadget.additionalParams = searchGadget.additionalParams || {};
searchGadget.additionalParams["keyword"] = keyword;
}
}
else { // remove these gadgets
my.removeGadgets(searchGadgets);
}
</script>
<div id="gadgets-search" class="gadgets-gadget-parent"></div>
</#if>
</#if>
<#-- Paging controls -->
<#if (pagingLinks?size > 0)>
<div class="searchpages">

View file

@ -16,6 +16,9 @@
<option value="group" <#if displayOption == "group">selected</#if> >Classes by Class Group</option>
</select>
<input id="addClass" value="Add New Class" class="form-button" type="submit" />
<#if displayOption == "group">
<input type="submit" id="addGroup" class="form-button" value="Add New Group"/>
</#if>
</form>

View file

@ -0,0 +1,49 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--
Used to display both the object and data property hierarchies, though there are
separate controllers for those. Also used to display lists of "all" object and
data properties, though there are separate controllers for those, too.
-->
<section role="region">
<h2>${pageTitle!}</h2>
<#if !displayOption?has_content>
<#assign displayOption = "hierarchy">
</#if>
<form name="classHierarchyForm" id="classHierarchyForm" action="show<#if propertyType == "object">Object<#else>Data</#if>PropertyHierarchy" method="post" role="classHierarchy">
<label id="displayOptionLabel" class="inline">Display Options</label>
<select id="displayOption" name="displayOption">
<option value="hierarchy" <#if displayOption == "asserted">selected</#if> >Property Hierarchy</option>
<option value="all" <#if displayOption == "all">selected</#if> >All Properties</option>
</select>
<input type="submit" class="form-button" id="addProperty" value="Add new <#if propertyType == "object">object<#else>data</#if> property"/>
</form>
<div id="expandLink"><span id="expandAll" ><a href="#" title="expand all">expand all</a></span></div>
<section id="container">
</section>
</section>
<script language="javascript" type="text/javascript" >
var json = [${jsonTree!}];
</script>
<script language="javascript" type="text/javascript" >
$(document).ready(function() {
objectPropHierarchyUtils.onLoad("${urls.base!}","${displayOption!}","${propertyType}");
});
</script>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/classHierarchy.css" />')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/siteAdmin/objectPropertyHierarchyUtils.js"></script>')}

View file

@ -0,0 +1,66 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--Browse Class Groups Section-->
<#-----------Variable assignment-------------->
<#--Requires Menu action be defined in parent template-->
<#assign classGroup = pageData.classGroup />
<#assign classGroups = pageData.classGroups />
<#assign isClassGroupPage = false/>
<#assign includeAllClasses = false/>
<#-- some additional processing here which shows or hides the class group selection and classes based on initial action-->
<#assign existingClassGroupStyle = " " />
<#assign selectClassGroupStyle = 'class="hidden"' />
<#-- Reveal the class group and hide the class selects if adding a new menu item or editing an existing menu item with an empty class group (no classes)-->
<#-- Menu action needs to be sent from main template-->
<#if menuAction == "Add" || !classGroup?has_content>
<#assign existingClassGroupStyle = 'class="hidden"' />
<#assign selectClassGroupStyle = " " />
</#if>
<#--HTML Portion-->
<section id="browseClassGroup" style="background-color:#f9f9f9;padding-left:6px;padding-top:2px;border-width:1px;border-style:solid;border-color:#ccc;">
<section id="selectContentType" name="selectContentType" ${selectClassGroupStyle} role="region">
<label for="selectClassGroup">Class Group<span class="requiredHint"> *</span></label>
<select name="selectClassGroup" id="selectClassGroup" role="combobox">
<option value="-1" role="option">Select one</option>
<#list classGroups as aClassGroup>
<option value="${aClassGroup.URI}" <#if aClassGroup.URI = associatedPageURI>selected</#if> role="option">${aClassGroup.publicName}</option>
</#list>
</select>
</section>
<section id="classesInSelectedGroup" name="classesInSelectedGroup" ${existingClassGroupStyle}>
<#-- Select classes in a class group -->
<p id="selectClassesMessage" name="selectClassesMessage">Select content to display<span class="requiredHint"> *</span></p>
<#include "pageManagement--classIntersections.ftl">
<ul id="selectedClasses" name="selectedClasses" role="menu">
<#--Adding a default class for "ALL" in case all classes selected-->
<li class="ui-state-default" role="menuitem">
<input type="checkbox" name="allSelected" id="allSelected" value="all" <#if !isIndividualsForClassesPage?has_content>checked</#if> />
<label class="inline" for="All"> All</label>
</li>
<#list classGroup as classInClassGroup>
<li class="ui-state-default" role="menuitem">
<input type="checkbox" id="classInClassGroup" name="classInClassGroup" value="${classInClassGroup.URI}"
<#if includeAllClasses = true>checked</#if>
<#if isIndividualsForClassesPage?has_content>
<#list includeClasses as includeClass>
<#if includeClass = classInClassGroup.URI>
checked
</#if>
</#list>
</#if> />
<label class="inline" for="${classInClassGroup.name}"> ${classInClassGroup.name}</label>
<span class="ui-icon-sortable"></span>
</li>
</#list>
</ul>
</section>
</section>
<#--Include JavaScript specific to the types of data getters related to this content-->
<#include "pageManagement--browseClassGroupsScripts.ftl">

View file

@ -0,0 +1,4 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Scripts for class group browsing -->
${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processClassGroupDataGetterContent.js"></script>')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processIndividualsForClassesDataGetterContent.js"></script>')}

View file

@ -0,0 +1,5 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--These are the different content templates that will be cloned and used within page management-->
<#include "pageManagement--browseClassGroups.ftl">
<#include "pageManagement--sparqlQuery.ftl">
<#include "pageManagement--fixedHtml.ftl">

View file

@ -0,0 +1,16 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--Sets up script for custom form data. Including here instead of as separate javascript
file to ensure this script is always loaded first. Can also make sure placed first in
scripts list.-->
<script type="text/javascript">
var customFormData = {
dataGetterLabelToURI:{
//maps labels to URIs
"browseClassGroup": "java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.ClassGroupPageData",
"individualsForClasses": "java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.IndividualsForClassesDataGetter",
"sparqlQuery":"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter",
"fixedHtml":"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.FixedHTMLDataGetter"
}
};
</script>

View file

@ -0,0 +1,10 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--This contains the template for the fixed HTML content type that is to be cloned and used in page management-->
<section id="fixedHtml" style="background-color:#f9f9f9;padding-left:6px;padding-top:2px;border-width:1px;border-style:solid;border-color:#ccc;">
<label id="fixedHTMLVariableLabel" for="fixedHTMLVariable">Variable Name<span class="requiredHint"> *</span></label>
<input type="text" name="saveToVar" size="20" value="" id="fixedHTMLSaveToVar" role="input" />
<label id="fixedHTMLValueLabel" for="fixedHTMLValue">Enter fixed HTML here<span id="fixedHTMLValueSpan"></span><span class="requiredHint"> *</span></label>
<textarea id="fixedHTMLValue" name="htmlValue" cols="70" rows="15" style="margin-bottom:7px"></textarea>
</section>
${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processFixedHTMLDataGetterContent.js"></script>')}

View file

@ -0,0 +1,11 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--This contains the template for the Sparql Query content type that is to be cloned and used in page management-->
<section id="sparqlQuery" style="background-color:#f9f9f9;padding-left:6px;padding-top:2px;border-width:1px;border-style:solid;border-color:#ccc;">
<label id="variableLabel" for="variable">Variable Name<span class="requiredHint"> *</span></label>
<input type="text" name="saveToVar" size="20" value="" id="saveToVar" role="input" />
<label id="queryModelLabel" for="queryModel">Query Model</label>
<input type="text" name="queryModel" size="20" value="" id="queryModel" role="input" />
<label id="queryLabel" for="queryLabel"><span id="querySpan">Enter SPARQL query here</span><span class="requiredHint"> *</span></label>
<textarea id="query" name="query" cols="70" rows="15" style="margin-bottom:7px"></textarea>
</section>
${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processSparqlDataGetterContent.js"></script>')}

View file

@ -1,27 +1,16 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--Set up variables-->
<#--------Set up variables-------->
<#assign pageData = editConfiguration.pageData />
<#assign menuAction = pageData.menuAction />
<#assign classGroup = pageData.classGroup />
<#assign classGroups = pageData.classGroups />
<#assign pageName = "" />
<#assign selectedTemplateType = "default" />
<#assign prettyUrl = ""/>
<#assign associatedPage = ""/>
<#assign associatedPageURI = ""/>
<#assign menuItem = ""/>
<#assign isClassGroupPage = false/>
<#assign includeAllClasses = false/>
<#-- some additional processing here which shows or hides the class group selection and classes based on initial action-->
<#assign existingClassGroupStyle = " " />
<#assign selectClassGroupStyle = 'class="hidden"' />
<#-- Reveal the class group and hide the class selects if adding a new menu item or editing an existing menu item with an empty class group (no classes)-->
<#if menuAction == "Add" || !classGroup?has_content>
<#assign existingClassGroupStyle = 'class="hidden"' />
<#assign selectClassGroupStyle = " " />
</#if>
<#------------HTML Portion------------->
<section id="error-alert" role="alert" class="hidden">
<img src="${urls.images}/iconAlert.png" width="24" height="24" alert="Error alert icon" />
<p></p>
@ -35,6 +24,7 @@
<input type="hidden" id="editKey" name="editKey" value="${editKey}" />
<input type="hidden" id="menuItem" name="menuItem" value="${menuItem}"/>
<h2>Add Page</h2>
<!--Drop down for the types of content possible-->
<section id="floatRight" style="margin-top:0px;float:right;background-color:#fff;width:580px;margin-right:-4px">
<div id="rightSide">
<section id="addPageOne" role="region">
@ -51,60 +41,14 @@
<section id="headerBar" style="background-color:#f5f5f5;border-color:#ccc;border-width:1px;border-style:solid;border-bottom-width:0px;padding-left:6px">
</section>
<section id="classGroup" style="background-color:#f9f9f9;padding-left:6px;padding-top:2px;border-width:1px;border-style:solid;border-color:#ccc;">
<section id="selectContentType" name="selectContentType" ${selectClassGroupStyle} role="region">
<label for="selectClassGroup">Class Group<span class="requiredHint"> *</span></label>
<select name="selectClassGroup" id="selectClassGroup" role="combobox">
<option value="-1" role="option">Select one</option>
<#list classGroups as aClassGroup>
<option value="${aClassGroup.URI}" <#if aClassGroup.URI = associatedPageURI>selected</#if> role="option">${aClassGroup.publicName}</option>
</#list>
</select>
</section>
<section id="classesInSelectedGroup" name="classesInSelectedGroup" ${existingClassGroupStyle}>
<#-- Select classes in a class group -->
<p id="selectClassesMessage" name="selectClassesMessage">Select content to display<span class="requiredHint"> *</span></p>
<#include "pageManagement--classIntersections.ftl">
<ul id="selectedClasses" name="selectedClasses" role="menu">
<#--Adding a default class for "ALL" in case all classes selected-->
<li class="ui-state-default" role="menuitem">
<input type="checkbox" name="allSelected" id="allSelected" value="all" <#if !isIndividualsForClassesPage?has_content>checked</#if> />
<label class="inline" for="All"> All</label>
</li>
<#list classGroup as classInClassGroup>
<li class="ui-state-default" role="menuitem">
<input type="checkbox" id="classInClassGroup" name="classInClassGroup" value="${classInClassGroup.URI}"
<#if includeAllClasses = true>checked</#if>
<#if isIndividualsForClassesPage?has_content>
<#list includeClasses as includeClass>
<#if includeClass = classInClassGroup.URI>
checked
</#if>
</#list>
</#if> />
<label class="inline" for="${classInClassGroup.name}"> ${classInClassGroup.name}</label>
<#-- PLACEHOLDER - not yet implemented) -->
<span class="ui-icon-sortable"></span> <#--sortable icon for dragging and dropping menu items-->
</li>
</#list>
</ul>
</section>
</section>
<section id="nonClassGroup" style="background-color:#f9f9f9;padding-left:6px;padding-top:2px;border-width:1px;border-style:solid;border-color:#ccc;">
<label id="variableLabel" for="variable">Variable Name<span class="requiredHint"> *</span></label>
<input type="text" name="variable" size="20" value="" id="variable" role="input" />
<label id="taLabel" for="selectClassGroup"><span id="taSpan"></span><span class="requiredHint"> *</span></label>
<textarea id="textArea" name="textArea" cols="70" rows="15" style="margin-bottom:7px"></textarea>
</section>
<#--This include file contains links to the templates that will be cloned and used for the different content types-->
<!--This content will be copied/shown for these particular content types, so any fields for n3 editing need to be included
here that correspond to a specific content type. These are related to specific "data getters" on the server side. -->
<#include "pageManagement--contentTemplates.ftl">
<input type="button" id="moreContent" name="moreContent" value="Add More Content" class="delete" style="margin-top:8px" />
</div>
</section>
<!--Information for page or menu item level-->
<div id="leftSide">
<section id="addPageOne" role="region" style="background-color:#fff;">
<label for="page-name">Title<span class="requiredHint"> *</span></label>
@ -137,35 +81,30 @@
<br />
<p class="requiredHint">* required fields</p>
</section>
<!--Hidden input with JSON objects added will be included here-->
<!--Hidden input with JSON objects added will be included here. This is the field with the page content information
mirroring what is required by the Data getter server side objects. -->
<div id="pageContentSubmissionInputs" style="display:none"></div>
</form>
</section>
<!-
<!--Hardcoding for now but should be retrieved from generator-->
<script type="text/javascript">
var customFormData = {
dataGetterLabelToURI:{
//maps labels to URIs
"browseClassGroup": "java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.ClassGroupPageData",
"sparqlDataGetter":"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter"
},
dataGetterMap:{"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.ClassGroupPageData": "Class Group Page",
"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.BrowseDataGetter": "Browse Page",
"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.IndividualsForClassesDataGetter": "Class Group Page - Selected Classes",
"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter": "Sparql Query Results" }
};
</script>
<!--Hardcoding for now but should be retrieved from generator: Custom data-->
<#include "pageManagement--customDataScript.ftl">
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/menupage/menuManagement.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/menupage/pageManagement.css" />')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script>')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/jquery.fix.clone.js"></script>')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/json2.js"></script>')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/customFormUtils.js"></script>')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/browserUtils.js"></script>')}
<#--Process Data Getter Utils will refer to the various content type specific javascript files that should
already have been added within the template section for each content type-->
${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processDataGetterUtils.js"></script>')}
<#--Page management is used on page load and utilizes processDataGetterUtils as well as the custom data from the custom data script-->
${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/pageManagementUtils.js"></script>')}

View file

@ -34,9 +34,9 @@
</#if>
</#macro>
<#macro dataPropertyList property editable>
<#macro dataPropertyList property editable template=property.template>
<#list property.statements as statement>
<@propertyListItem property statement editable >${statement.value}</@propertyListItem>
<@propertyListItem property statement editable ><#include "${template}"></@propertyListItem>
</#list>
</#macro>