updates for page management and updates for licenses

This commit is contained in:
hjkhjk54 2012-06-05 21:34:06 +00:00
parent f8137db5c8
commit 57ffa0096f
8 changed files with 26 additions and 16 deletions

View file

@ -38,6 +38,7 @@ webapp/web/js/tiny_mce/**/*
webapp/web/js/jquery.js webapp/web/js/jquery.js
webapp/web/js/jquery-ui/* webapp/web/js/jquery-ui/*
webapp/web/js/jquery_plugins/* webapp/web/js/jquery_plugins/*
webapp/web/js/jquery.fix.clone.js
# See /doc/3rd-party-licenses.txt for LICENSE file # See /doc/3rd-party-licenses.txt for LICENSE file
webapp/web/dojo.js webapp/web/dojo.js
@ -174,6 +175,9 @@ webapp/src/edu/cornell/mannlib/vitro/webapp/web/antisamy-vitro-1.4.4.xml
# A kluge class derived from JarJar code. See /doc/3rd-party-licenses.txt for LICENSE file # A kluge class derived from JarJar code. See /doc/3rd-party-licenses.txt for LICENSE file
utilities/buildutils/src/com/tonicsystems/jarjar/KlugedDepFind.java utilities/buildutils/src/com/tonicsystems/jarjar/KlugedDepFind.java
#Public Domain
webapp/web/js/json2.js
# Part of the OpenSocial integration - What license should apply here? # Part of the OpenSocial integration - What license should apply here?
webapp/src/edu/ucsf/vitro/opensocial/GadgetController.java webapp/src/edu/ucsf/vitro/opensocial/GadgetController.java
webapp/src/edu/ucsf/vitro/opensocial/GadgetSpec.java webapp/src/edu/ucsf/vitro/opensocial/GadgetSpec.java

View file

@ -151,11 +151,13 @@ public class ManagePagePreprocessor extends
JSONArray values = jsonObject.getJSONArray(literalLabel); JSONArray values = jsonObject.getJSONArray(literalLabel);
literalValues = (List<String>) JSONSerializer.toJava(values); literalValues = (List<String>) JSONSerializer.toJava(values);
} }
String[] literalValuesSubmission = new String[literalValues.size()];
literalValuesSubmission = literalValues.toArray(literalValuesSubmission);
//This adds literal, connecting the field with //This adds literal, connecting the field with
submission.addLiteralToForm(editConfiguration, submission.addLiteralToForm(editConfiguration,
editConfiguration.getField(submissionLiteralName), editConfiguration.getField(submissionLiteralName),
submissionLiteralName, submissionLiteralName,
(String[])literalValues.toArray()); literalValuesSubmission);
} }
for(String uriLabel:uriLabels) { for(String uriLabel:uriLabels) {

View file

@ -20,9 +20,9 @@ import net.sf.json.JSONSerializer;
//Returns the appropriate n3 for selection of classes from within class group //Returns the appropriate n3 for selection of classes from within class group
public class ProcessIndividualsForClassesDataGetterN3 extends ProcessClassGroupDataGetterN3 { public class ProcessIndividualsForClassesDataGetterN3 extends ProcessClassGroupDataGetterN3 {
private static String classType = "java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.IndividualsForClassesDataGetter"; private static String classType = "java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.IndividualsForClassesDataGetter";
private JSONObject values = null; protected JSONObject values = null;
int classCount = 0; int classCount = 0;
private static String individualClassVarNameBase = "classesSelectedInClassGroup"; protected static String individualClassVarNameBase = "classesSelectedInClassGroup";
public ProcessIndividualsForClassesDataGetterN3(JSONObject jsonObject){ public ProcessIndividualsForClassesDataGetterN3(JSONObject jsonObject){
this.values = jsonObject; this.values = jsonObject;
if(values != null && values.containsKey(individualClassVarNameBase)) { if(values != null && values.containsKey(individualClassVarNameBase)) {
@ -43,15 +43,8 @@ public class ProcessIndividualsForClassesDataGetterN3 extends ProcessClassGroup
} }
/*
@Override
public String getN3ForTypePartial(int counter) {
String dataGetterVar = getDataGetterVar(counter);
String n3 = dataGetterVar + " a <" + getClassType() + ">";
return n3;
}*/
private List<String> addIndividualClassesN3(int counter) { protected List<String> addIndividualClassesN3(int counter) {
List<String> classN3 = new ArrayList<String>(); List<String> classN3 = new ArrayList<String>();
if(classCount > 0) { if(classCount > 0) {
classN3.add(generateIndividualClassN3(counter)); classN3.add(generateIndividualClassN3(counter));
@ -59,7 +52,7 @@ public class ProcessIndividualsForClassesDataGetterN3 extends ProcessClassGroup
return classN3; return classN3;
} }
private String generateIndividualClassN3(int counter) { protected String generateIndividualClassN3(int counter) {
String dataGetterVar = getDataGetterVar(counter); String dataGetterVar = getDataGetterVar(counter);
String n3 = dataGetterVar + " <" + DisplayVocabulary.GETINDIVIDUALS_FOR_CLASS + "> "; String n3 = dataGetterVar + " <" + DisplayVocabulary.GETINDIVIDUALS_FOR_CLASS + "> ";
//Consider a multi-valued field - in this case single field with multiple values //Consider a multi-valued field - in this case single field with multiple values

View file

@ -47,6 +47,7 @@ public class IndividualsForClassesDataGetter extends DataGetterBase implements D
String dataGetterURI; String dataGetterURI;
String classGroupURI; String classGroupURI;
Map<String, Object> classIntersectionsMap; Map<String, Object> classIntersectionsMap;
private final static String defaultTemplate = "page-classgroup.ftl";
/** /**
* Constructor with display model and data getter URI that will be called by reflection. * Constructor with display model and data getter URI that will be called by reflection.
@ -132,6 +133,8 @@ public class IndividualsForClassesDataGetter extends DataGetterBase implements D
data.put("dataServiceUrlIndividualsByVClass", this.getDataServiceUrl()); data.put("dataServiceUrlIndividualsByVClass", this.getDataServiceUrl());
//this is the class group associated with the data getter utilized for display on menu editing, not the custom one created //this is the class group associated with the data getter utilized for display on menu editing, not the custom one created
data.put("classGroupUri",this.classGroupURI); data.put("classGroupUri",this.classGroupURI);
//default template, overridden at page level if specified in display model
data.put("bodyTemplate", defaultTemplate);
} catch(Exception ex) { } catch(Exception ex) {
log.error("An error occurred retrieving Vclass Intersection individuals", ex); log.error("An error occurred retrieving Vclass Intersection individuals", ex);
} }

View file

@ -40,6 +40,8 @@ public class SparqlQueryDataGetter extends DataGetterBase implements DataGetter{
final static Log log = LogFactory.getLog(SparqlQueryDataGetter.class); final static Log log = LogFactory.getLog(SparqlQueryDataGetter.class);
//default template
private final static String defaultTemplate = "menupage--defaultSparql.ftl";
/** /**
* Constructor with display model and data getter URI that will be called by reflection. * Constructor with display model and data getter URI that will be called by reflection.
@ -135,6 +137,8 @@ public class SparqlQueryDataGetter extends DataGetterBase implements DataGetter{
//put results in page data, what key to use for results? //put results in page data, what key to use for results?
Map<String, Object> rmap = new HashMap<String,Object>(); Map<String, Object> rmap = new HashMap<String,Object>();
rmap.put(this.saveToVar, results); rmap.put(this.saveToVar, results);
//This will be overridden at page level in display model if template specified there
rmap.put("bodyTemplate", defaultTemplate);
return rmap; return rmap;
} }

View file

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

View file

@ -1,3 +1,5 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
var processIndividualsForClassesDataGetterContent = { var processIndividualsForClassesDataGetterContent = {
dataGetterClass:null, dataGetterClass:null,
//can use this if expect to initialize from elsewhere //can use this if expect to initialize from elsewhere

View file

@ -7,7 +7,7 @@
<#assign htmlExists = true /> <#assign htmlExists = true />
</#if> </#if>
<#if htmlExists> <#if htmlExists>
${variableName} ${.globals[variableName]}
<#else> <#else>
No HTML specified. No HTML specified.
</#if> </#if>