Skip to content

Commit

Permalink
exposed universe for editing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Brumsted committed Nov 11, 2016
1 parent 76609a7 commit 897a770
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,8 @@ public int editVar(String baseHandle, String version, String var, String field,
validFields.put("catStat", new String[] {"5","/var[@name='"+var+"']/catgry["+index+"]/catStat["+index2+"]/@access","Value Statistic Access"});
validFields.put("notes", new String[] {"1","/var[@name='"+var+"']/notes["+index+"]","Notes"});
validFields.put("notesAccs", new String[] {"5","/var[@name='"+var+"']/notes["+index+"]/@access","Note Access"});

validFields.put("qstn", new String[] {"1","/var[@name='"+var+"']/qstn","Question Text"});
validFields.put("universe", new String[] {"1","/var[@name='"+var+"']/universe", "Universe"});

//TODO: I think the ip param is irrevelant at this point, but was in the old eapi
if(!ip.equals("")) logger.debug("Edit request to var from " + ip);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ private Map<String,String[]> getVarFields(String var, String index, String index
validFields.put("notes", new String[] {"1","/codeBook/var[@name='"+var+"']/notes["+index+"]","Notes","0"});
validFields.put("notesAccs", new String[] {"5","/codeBook/var/notes["+index+"]/@access","Note Access", "1"});
validFields.put("qstn", new String[] {"1","/codeBook/var/qstn","Question Text","0"});
validFields.put("universe", new String[] {"1","/codeBook/var/universe", "Universe","0"});

return validFields;
}

Expand Down
12 changes: 12 additions & 0 deletions Source/src/main/webapp/xsl/variable.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@
</xsl:for-each>
</xsl:for-each>
</xsl:if>
<!-- Universe here -->
<xsl:if test="codeBook/var/universe != ''">
<p>
<span class="staticHeader">Universe </span>
</p>
<div class="value2">
<span itemprop="description">
<xsl:copy-of select="codeBook/var/universe/node()" />
</span>
</div>
</xsl:if>

<xsl:if test="count(codeBook/groups/group) gt 0">
<p>
<span class="staticHeader">Groups</span>
Expand Down
19 changes: 19 additions & 0 deletions Source/src/main/webapp/xslEdit/variableEdit.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,25 @@
</xsl:for-each>
</xsl:for-each>
</xsl:if>
<p class="lb2">
<span class="staticHeader">Universe</span>
<a title="Edit field" class="editIcon2">
<xsl:choose>
<xsl:when test="/codeBook/var/universe != ''">
<xsl:attribute name="href"><xsl:value-of select="$varname" />/edit?f=universe</xsl:attribute>
<i class="fa fa-pencil"></i>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href"><xsl:value-of select="$varname" />/edit?f=universe&amp;a=true</xsl:attribute>
<i class="fa fa-plus"></i>
</xsl:otherwise>
</xsl:choose>
</a>
<xsl:copy-of select="cdr:schemaDoc('universe')" />
</p>
<div class="value2">
<xsl:copy-of select="/codeBook/var/universe/node()" />
</div>
<xsl:if test="count(/codeBook/groups/group) gt 0">
<p>
<span class="staticHeader">Groups</span>
Expand Down

0 comments on commit 897a770

Please sign in to comment.