Browse Source

Eigenschafften Gruppen, mehrspaltiges Layout #5

makro_datasrc
Daniel Quathamer 2 years ago
parent
commit
67ece9cd3c
  1. 15
      build.xml
  2. 21
      src-modules/module/viz/conf/viz.xml
  3. 2
      src-modules/module/viz/masken/44000_felderinfo.unl
  4. 46
      superx/xml/js/viz/viz_functions.js
  5. 12
      superx/xml/viz_html_chart.xsl

15
build.xml

@ -1,12 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project name="ModuleCreation" default="all" basedir="."> <project name="ModuleCreation" default="help" basedir=".">
<!--Aufruf mit <!--Aufruf mit
ant -DMODULE_PATH=$VIZ_PFAD -DBASE_DIR=. -DWEBAPP=$WEBAPP -DMODULE=viz all
So erzeugen Sie dann ein SuperX-Paket:
ant -DMODULE_PATH=$VIZ_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=viz dist
--> -->
<dirname file="${ant.file}" property="moduleCreateBaseDir" /> <dirname file="${ant.file}" property="moduleCreateBaseDir" />
@ -26,6 +21,14 @@ ant -DMODULE_PATH=$VIZ_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=viz dist
<condition property="isUnix"> <condition property="isUnix">
<os family="unix" /> <os family="unix" />
</condition> </condition>
<target name="help" description="Bedienung">
<echo message="Aufruf: " />
<echo message="ant -DMODULE_PATH=$VIZ_PFAD -DBASE_DIR=. -DWEBAPP=$WEBAPP -DMODULE=viz all" />
<echo message="So erzeugen Sie dann ein SuperX-Paket:" />
<echo message="ant -DMODULE_PATH=$VIZ_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=viz dist" />
</target>
<target name="all" description="Gruppe: Kopiere Modul Sourcen in den WEB-INF-Verzeichnisbaum"> <target name="all" description="Gruppe: Kopiere Modul Sourcen in den WEB-INF-Verzeichnisbaum">
<antcall target="module_copy_source" /> <antcall target="module_copy_source" />
<antcall target="call_module_scripts_create_ant" /> <antcall target="call_module_scripts_create_ant" />

21
src-modules/module/viz/conf/viz.xml

@ -159,7 +159,7 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" />
<columns> <columns>
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/> <column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="caption" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" /> <column name="caption" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" />
<column name="prop_uniquename" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" /> <column name="prop_uniquename" type="VARCHAR" size="255" default="" notnull="" description="Schlüssel" />
<column name="prop_default" type="VARCHAR" size="255" default="" notnull="false" description="Defaultwert" /> <column name="prop_default" type="VARCHAR" size="255" default="" notnull="false" description="Defaultwert" />
<column name="prop_unit" type="VARCHAR" size="255" default="" notnull="false" description="Einheit" /> <column name="prop_unit" type="VARCHAR" size="255" default="" notnull="false" description="Einheit" />
<column name="is_generic" type="SMALLINT" size="255" default="1" notnull="false" description="Generische Eigenschaft" ><comment>1=ja, 0=nein</comment></column> <column name="is_generic" type="SMALLINT" size="255" default="1" notnull="false" description="Generische Eigenschaft" ><comment>1=ja, 0=nein</comment></column>
@ -391,6 +391,7 @@ mode="full">
</filters> </filters>
<field-selection complete="false" /> <field-selection complete="false" />
<customfield name="tid" nullFieldValue="" /> <customfield name="tid" nullFieldValue="" />
<customfield name="property_group_id" visibleSize="10" nullFieldValue="" />
<customfield name="caption" nullFieldValue="" visibleSize="30" /> <customfield name="caption" nullFieldValue="" visibleSize="30" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" /> <customfield name="uniquename" nullFieldValue="" visibleSize="30" />
<customfield type="link" name="Details" path="/superx/edit/viz/viz_property_edit.jsp" linkid="tid"/> <customfield type="link" name="Details" path="/superx/edit/viz/viz_property_edit.jsp" linkid="tid"/>
@ -423,6 +424,24 @@ mode="full">
<customfield name="property_group_id" visibleSize="10" nullFieldValue="" /> <customfield name="property_group_id" visibleSize="10" nullFieldValue="" />
<customfield name="explanation" visibleSize="80" nullFieldValue="" /> <customfield name="explanation" visibleSize="80" nullFieldValue="" />
</form>
<form name="viz_property_group_list"
table="viz_property_group"
path="/edit/viz/viz_property_group_list.jsp"
followUp=""
caption="Diagrammgruppen-Eigenschaften verwalten"
orderBy="name"
gotoHt=""
helpfile=""
maxRows="*"
mode="full">
<description>In diesem Formular können Sie Gruppen von Diagrammeigenschaften verwalten. </description>
<filters>
</filters>
<field-selection complete="false" />
<customfield name="tid" nullFieldValue="" />
<customfield name="caption" nullFieldValue="" visibleSize="30" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" />
</form> </form>
</dbforms> </dbforms>
</module> </module>

2
src-modules/module/viz/masken/44000_felderinfo.unl

@ -3,6 +3,6 @@
44002^Eigenschaften verwalten^100^0^0^150^300^1^char^30^0^18^^^<<SQL>> select '../edit/viz/viz_property_list.jsp' from xdummy;^ 44002^Eigenschaften verwalten^100^0^0^150^300^1^char^30^0^18^^^<<SQL>> select '../edit/viz/viz_property_list.jsp' from xdummy;^
44003^Name^20^0^0^150^150^1^sql^50^0^0^^^^ 44003^Name^20^0^0^150^150^1^sql^50^0^0^^^^
44004^Komponente^1^0^0^150^200^1^integer^200^0^13^<<SQL>> select tid,name from systeminfo order by 2;^ ^^ 44004^Komponente^1^0^0^150^200^1^integer^200^0^13^<<SQL>> select tid,name from systeminfo order by 2;^ ^^
44005^Projekte verwalten^200^0^0^150^300^1^char^30^0^13^^^<<SQL>> select '../edit/qa/qa_project_list.jsp' from xdummy;^ 44005^Eigenschaftsgruppen verwalten^200^0^0^150^300^1^char^30^0^18^^^<<SQL>> select '../edit/viz/viz_property_group_list.jsp' from xdummy;^
44006^Projekt^5^0^0^150^200^1^integer^200^0^13^<<SQL>> select tid,name from qa_project where active=1 /* and systeminfo_id=<<Komponente>> */ order by 2;^^^ 44006^Projekt^5^0^0^150^200^1^integer^200^0^13^<<SQL>> select tid,name from qa_project where active=1 /* and systeminfo_id=<<Komponente>> */ order by 2;^^^
44007^Status Test^200^0^0^150^200^1^integer^200^0^13^<<SQL>> select 1,'nur aktive' from xdummy union select 0,'nur inaktive' from xdummy order by 2;^^ ^ 44007^Status Test^200^0^0^150^200^1^integer^200^0^13^<<SQL>> select 1,'nur aktive' from xdummy union select 0,'nur inaktive' from xdummy order by 2;^^ ^

46
superx/xml/js/viz/viz_functions.js

@ -450,6 +450,9 @@ function renderFormDetails(formDiv,myCommonChartProperties)
while (myForm.firstChild) { while (myForm.firstChild) {
myForm.removeChild(myForm.firstChild); myForm.removeChild(myForm.firstChild);
} }
const columnsDiv = document.createElement("div");
columnsDiv.classList.add("columns");
/* /*
const tabElem = document.createElement("table"); const tabElem = document.createElement("table");
for(var k=0;k < myCommonChartProperties.length;k++) for(var k=0;k < myCommonChartProperties.length;k++)
@ -485,10 +488,45 @@ function renderFormDetails(formDiv,myCommonChartProperties)
tabElem.appendChild( rowElem); tabElem.appendChild( rowElem);
} }
*/ */
for(var k=0;k < myCommonChartProperties.length;k++)
//first Collect all groups:
var commonChartPropertyGroups=[];
var previousGroup="";
for(var k=0;k < myCommonChartProperties.length;k++)
{ {
myForm.appendChild(renderChartPropertyField(myCommonChartProperties[k])); var groupUniquename=myCommonChartProperties[k].groupUniquename;
if(groupUniquename != previousGroup)
{
var newcommonChartPropertyGroup = new commonChartPropertyGroup(myCommonChartProperties[k].groupCaption,groupUniquename);
commonChartPropertyGroups.push(newcommonChartPropertyGroup);
}
previousGroup=groupUniquename;
}
for(var i=0;i < commonChartPropertyGroups.length;i++)
{
const columnDiv = document.createElement("div");
columnDiv.classList.add("column");
columnDiv.classList.add("is-narrow");
const columnDivBox = document.createElement("div");
columnDivBox.classList.add("box");
columnDivBox.style="width: 300px";
const colHeader = document.createTextNode(commonChartPropertyGroups[i].caption);
const colHeaderParagraph = document.createElement("p");
colHeaderParagraph.classList.add("title");
colHeaderParagraph.classList.add("is-6");
colHeaderParagraph.appendChild(colHeader);
columnDivBox.appendChild(colHeaderParagraph);
for(var k=0;k < myCommonChartProperties.length;k++)
{
if(myCommonChartProperties[k].groupUniquename==commonChartPropertyGroups[i].groupUniquename)
columnDivBox.appendChild(renderChartPropertyField(myCommonChartProperties[k]));
}
columnDiv.appendChild(columnDivBox);
columnsDiv.appendChild(columnDiv);
} }
myForm.appendChild(columnsDiv);
} }
function renderChartPropertyField(commonChartProperty) function renderChartPropertyField(commonChartProperty)
@ -521,7 +559,7 @@ function renderChartPropertyField(commonChartProperty)
//Einfaches Texteingabefeld: //Einfaches Texteingabefeld:
const inpElem = document.createElement("input"); const inpElem = document.createElement("input");
inpElem.type="TEXT"; inpElem.type="TEXT";
inpElem.size=15; inpElem.size=5;
inpElem.title=commonChartProperty.explanation; inpElem.title=commonChartProperty.explanation;
inpElem.name=commonChartProperty.name; inpElem.name=commonChartProperty.name;
inpElem.id=commonChartProperty.name; inpElem.id=commonChartProperty.name;
@ -1085,7 +1123,7 @@ function getCommonChartProperty(name)
var propertyValue=""; var propertyValue="";
for (var i=0;i<commonChartProperties.length;i++) for (var i=0;i<commonChartProperties.length;i++)
{ {
if(commonChartProperties[i].name==name) if(commonChartProperties[i].name==name )
{ {
propertyValue=document.forms["chartPropertiesForm"].elements[name].value; propertyValue=document.forms["chartPropertiesForm"].elements[name].value;
if(propertyValue=="" && commonChartProperties[i].defaultValue!="") if(propertyValue=="" && commonChartProperties[i].defaultValue!="")

12
superx/xml/viz_html_chart.xsl

@ -126,7 +126,7 @@ padding-bottom:10px;
//document.body.append(Plot.plot(options)); //document.body.append(Plot.plot(options));
function commonChartProperty(name,caption,isMandatory,inputType,staticValues,defaultValue,explanation,groupUniquename) function commonChartProperty(name,caption,isMandatory,inputType,staticValues,defaultValue,explanation,groupCaption,groupUniquename)
{ {
this.name=name; this.name=name;
this.caption=caption; this.caption=caption;
@ -135,6 +135,7 @@ this.isMandatory=isMandatory;
this.inputType=inputType; this.inputType=inputType;
this.defaultValue=defaultValue; this.defaultValue=defaultValue;
this.explanation=explanation; this.explanation=explanation;
this.groupCaption=groupCaption;
this.groupUniquename=groupUniquename; this.groupUniquename=groupUniquename;
this.getValueResultset = function () { this.getValueResultset = function () {
var valueOptions=[]; var valueOptions=[];
@ -155,6 +156,11 @@ var staticValueArray = staticValues.split(/\|/);
return valueOptions; return valueOptions;
} }
} }
function commonChartPropertyGroup(caption,groupUniquename)
{
this.caption=caption;
this.groupUniquename=groupUniquename;
}
var commonChartProperties=[]; var commonChartProperties=[];
]]></xsl:text> ]]></xsl:text>
@ -179,6 +185,8 @@ var newCommonChartProperty = new commonChartProperty("</xsl:text>
<xsl:text>","</xsl:text> <xsl:text>","</xsl:text>
<xsl:value-of select="@explanation" /> <xsl:value-of select="@explanation" />
<xsl:text>","</xsl:text> <xsl:text>","</xsl:text>
<xsl:value-of select="@group_caption" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@group_uniquename" /> <xsl:value-of select="@group_uniquename" />
<xsl:text>"); <xsl:text>");
commonChartProperties.push(newCommonChartProperty); commonChartProperties.push(newCommonChartProperty);
@ -186,7 +194,7 @@ commonChartProperties.push(newCommonChartProperty);
</xsl:for-each> </xsl:for-each>
<xsl:text> <xsl:text>
var newCommonChartProperty = new commonChartProperty("chartCaption","Titel des Diagramms", false,"TEXT", "","</xsl:text> var newCommonChartProperty = new commonChartProperty("chartCaption","Titel des Diagramms", false,"TEXT", "","</xsl:text>
<xsl:value-of select="/ergebnisse/ergebnis/maskenname" /><xsl:text>","wird unter dem Diagramm angezeigt","TITLE"); <xsl:value-of select="/ergebnisse/ergebnis/maskenname" /><xsl:text>","wird unter dem Diagramm angezeigt","Diagrammkopf","TITLE");
commonChartProperties.push(newCommonChartProperty); commonChartProperties.push(newCommonChartProperty);
</xsl:text> </xsl:text>

Loading…
Cancel
Save