You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(146) |
Jun
(188) |
Jul
(11) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: <sv...@de...> - 2005-06-20 23:02:46
|
Author: pcamacho
Date: 2005-06-20 19:02:46 -0400 (Mon, 20 Jun 2005)
New Revision: 1371
Modified:
humano2/trunk/web/builder/site/formmanagement.aspx.cs
Log:
FIX: the delete function for a form was not working.
Modified: humano2/trunk/web/builder/site/formmanagement.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/formmanagement.aspx.cs 2005-06-20 22:5=
7:27 UTC (rev 1370)
+++ humano2/trunk/web/builder/site/formmanagement.aspx.cs 2005-06-20 23:0=
2:46 UTC (rev 1371)
@@ -43,27 +43,7 @@
private string receivedColumnsStr; =20
private string receivedType;
=20
- /*
- string ClassName =3D "";
- string strAttrLeft =3D "";
- string strAttrRigth =3D "";
- string formName =3D "";
- string formAttrib =3D "";
- string formType =3D "";
- =09
- int first =3D 0;
- int classId =3D 0;
- int formId =3D 0;
- int action =3D 0;
-
- bool newForm =3D true;
- =09
- private const int CNS_NOTHING =3D 0;
- private const int CNS_CREATE =3D 1;
- private const int CNS_UPDATE =3D 2;
- private const int CNS_DELETE =3D 3;
- =09
- */
+ =20
private void Page_Load(object sender, System.EventArgs e)
{
classId =3D Convert.ToInt32(Request["classId"]);
@@ -77,7 +57,7 @@
=20
if (delete =3D=3D "true")
{
- deleteForm();
+ deleteForm(formId);
return;
}
=20
@@ -87,41 +67,6 @@
return;
} =20
=20
- =20
- =20
- /*
- SessionManager.Current.setNewLastAccess();
- //getRequestParam();
- if (classId > 0 && action !=3D CNS_DELETE)
- {
- //buildListAttrib(classId);
- ClassName =3D getClassName(classId);
- }
-
- switch(action)
- {
- case CNS_NOTHING:
- break;
- case CNS_CREATE:
- createDbForm();
- action =3D CNS_UPDATE;
- buildListAttribFromForm(classId,formId);
- break;
- case CNS_UPDATE:
- if(formAttrib !=3D null)
- {
- createDbForm();
- }
- buildListAttribFromForm(classId,formId);
- break;
- case CNS_DELETE:
- deleteDbForm(formId);
- clearFormsElement();
- break;
- default:
- break;
- }
- */
}
=20
override protected string createXml()
@@ -230,8 +175,6 @@
return dt;
}
=20
-
-
private string getFormName(int formId)
{
Logger.Log("<<getFormName>>",LogLevel.Trace);
@@ -247,17 +190,15 @@
{
name =3D ""; =20
}
- =20
return name;
}
=20
- private void deleteForm()
+ private void deleteForm(int formId)
{
- =20
+ userCred.CoreAdapter.DeleteInstance(formId,userCred);
+ sendMessageToUser(UserMessage.DELETEFORMOK); =20
}
=20
- =20
- =20
private DataTable createFormTable()
{
if(receivedFormName =3D=3D "")
|
|
From: <sv...@de...> - 2005-06-20 22:57:25
|
Author: pcamacho
Date: 2005-06-20 18:57:27 -0400 (Mon, 20 Jun 2005)
New Revision: 1370
Modified:
humano2/trunk/web/builder/site/js/form.js
humano2/trunk/web/builder/site/xsl/createform.xsl
humano2/trunk/web/builder/site/xsl/createreport.xsl
humano2/trunk/web/builder/site/xsl/createview.xsl
Log:
FIX: bug #213.
Modified: humano2/trunk/web/builder/site/js/form.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/form.js 2005-06-20 22:48:44 UTC (re=
v 1369)
+++ humano2/trunk/web/builder/site/js/form.js 2005-06-20 22:57:27 UTC (re=
v 1370)
@@ -21,7 +21,7 @@
=20
//Methods
this.UpdateSubmitAll =3D FormUpdateSubmitAll;
- this.DeleteReport =3D FormDeleteReport;
+ this.Delete =3D FormDelete;
}
=20
function FormUpdateSubmitAll()
@@ -105,7 +105,7 @@
} =20
=20
var sendType =3D document.getElementById("formType").value;
- alert("sendType:" + sendType);
+ //alert("sendType:" + sendType);
if (this.type =3D=3D 'FORM')
{
divSubmitAll.innerHTML +=3D=20
@@ -116,17 +116,20 @@
return true;
}
=20
-function FormDeleteReport()
+function FormDelete()
{
var msg =3D "Are you sure you want to delete the ";
switch(this.type)
{
case 'VIEW': =20
msg +=3D "view";
+ break;
case 'REPORT':
msg +=3D "report"; =20
+ break;
case 'FORM':
- name =3D "form";
+ msg +=3D "form";
+ break;
}
msg +=3D"?";
=20
@@ -138,10 +141,13 @@
{
case 'VIEW': =20
name =3D "viewId";
+ break;
case 'REPORT':
name =3D "reportId"; =20
+ break;
case 'FORM':
name =3D "formId";
+ break;
}
var divSubmitAll =3D GetNodeByTagNameAndAttName("div","SubmitAll=
")[0];
//alert(divSubmitAll);
Modified: humano2/trunk/web/builder/site/xsl/createform.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createform.xsl 2005-06-20 22:48:44=
UTC (rev 1369)
+++ humano2/trunk/web/builder/site/xsl/createform.xsl 2005-06-20 22:57:27=
UTC (rev 1370)
@@ -185,7 +185,7 @@
showButtons: false
}
var rightColumn =3D new SortedGr=
aphicalList(rightColumnParams); =20
- alert("rightColumn:" + rightColu=
mn); =20
+ //alert("rightColumn:" + rightCo=
lumn); =20
=20
</script>
</td>
@@ -262,7 +262,7 @@
<xsl:if test=3D"/for=
m/formDatas/displayDeleteButton=3D'true'" >
<input type=3D"s=
ubmit" value=3D"Delete">
<xsl:attribu=
te name=3D"onclick">
- Form.Del=
eteReport();
+ Form.Del=
ete();
</xsl:attrib=
ute>
</input>
</xsl:if>
@@ -296,7 +296,7 @@
divSubmitAll: document.getElementByI=
d('SubmitAll')
}
var Form =3D new Form(<xsl:value-of sele=
ct=3D"/form/formDatas/classId" />,"FORM", infosToSubmit);
- alert("Form: " + Form);
+ //alert("Form: " + Form);
</xsl:if>
</script>
</form>
Property changes on: humano2/trunk/web/builder/site/xsl/createform.xsl
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: humano2/trunk/web/builder/site/xsl/createreport.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-20 22:48:=
44 UTC (rev 1369)
+++ humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-20 22:57:=
27 UTC (rev 1370)
@@ -523,7 +523,7 @@
<xsl:if test=3D"=
/report/reportDatas/displayDeleteButton=3D'true'" >
<input type=3D=
"submit" value=3D"Delete">
<xsl:att=
ribute name=3D"onclick">
- Form=
.DeleteReport();
+ Form=
.Delete();
</xsl:at=
tribute>
</input>
</xsl:if>
Modified: humano2/trunk/web/builder/site/xsl/createview.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-20 22:48:44=
UTC (rev 1369)
+++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-20 22:57:27=
UTC (rev 1370)
@@ -420,7 +420,7 @@
<xsl:if test=
=3D"/view/viewDatas/displayDeleteButton=3D'true'" >
<input t=
ype=3D"submit" value=3D"Delete">
<xsl=
:attribute name=3D"onclick">
- =
Form.DeleteView();
+ =
Form.Delete();
</xs=
l:attribute>
</input>
</xsl:if>
|
|
From: <sv...@de...> - 2005-06-20 22:48:42
|
Author: pcamacho Date: 2005-06-20 18:48:44 -0400 (Mon, 20 Jun 2005) New Revision: 1369 Added: humano2/trunk/web/builder/site/xsl/createform.xsl Modified: humano2/trunk/web/builder/site/formmanagement.aspx humano2/trunk/web/builder/site/formmanagement.aspx.cs humano2/trunk/web/builder/site/js/createinterfacetools.js humano2/trunk/web/builder/site/js/form.js humano2/trunk/web/builder/site/viewmain.aspx.cs humano2/trunk/web/builder/site/xsl/createview.xsl humano2/trunk/web/builder/site/xsl/functionindex.xsl Log: CHANGE: the interface for creation of form is under xsl and not pure asp = code. Modified: humano2/trunk/web/builder/site/formmanagement.aspx =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/formmanagement.aspx 2005-06-20 17:27:1= 3 UTC (rev 1368) +++ humano2/trunk/web/builder/site/formmanagement.aspx 2005-06-20 22:48:4= 4 UTC (rev 1369) @@ -1,187 +1,4 @@ <%@ Page language=3D"c#" Codebehind=3D"formmanagement.aspx.cs" AutoEvent= Wireup=3D"false" Inherits=3D"Builder.site.formmanagement" ResponseEncodin= g=3D"iso-8859-1" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://w= ww.w3.org/TR/html4/loose.dtd"> <!-- $Id$ --> -<html> - <head> - <title>Form Management</title> - <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3D= iso-8859-1"> - <script src=3D"js/functions.js"></script> - <script src=3D"js/grafcomponents/misc.js"></script> - <script src=3D"js/grafcomponents/test.js"></script> - <script src=3D"js/grafcomponents/sortedlist.js"></script> - <script src=3D"js/grafcomponents/sortedgraphicallist.js"></scrip= t> - <!-- Load this script before the next one --> - <script src=3D"js/form.js"></script> - <script src=3D"js/fn_formsmng.js"></script> - <link href=3D"css/createinterface.css" rel=3D"stylesheet" type=3D= "text/css"> - </head> - <body> - <form name=3D"formulario" action=3D"#" method=3D"post"> - <input type=3D"hidden" name=3D"first" id=3D"first" value=3D"= <% html_getFirst(); %>">=20 - <input type=3D"hidden" name=3D"opaction" id=3D"opaction" val= ue=3D"<% html_getAction(); %>"> - <input type=3D"hidden" name=3D"formid" id=3D"formid" value=3D= "<% html_getFormId(); %>"> - <table class=3D"conttablecenter2"> - <!-- ******************** Header ***********************= **** --> - <tr> - <td> - <table class=3D"smallgraytextnolink"> - <tr> - <td align=3D"right"> - Form Name: - </td> - <td align=3D"left"> - <input id=3D"formName" type=3D"text"= name=3D"formName" value=3D"<% html_getFormName(); %>"> - </td> - </tr> - <tr> - <td align=3D"right"> - Class: - </td> - <td align=3D"left"> - <input id=3D"ClassName" type=3D"text= " name=3D"ClassName" value=3D"<% html_getClassName(); %>"> - <input id=3D"btnGetClass" onclick=3D= "mostrar();" type=3D"button" value=3D">>" name=3D"btnGetClass"> - <input type=3D"hidden" name=3D"Class= Id" id=3D"ClassId" value=3D"<% html_getClassId(); %>"> - <input type=3D"hidden" name=3D"LstAt= trib" id=3D"LstAttrib"> - </td> - </tr> - </table> - </td> - </tr> - =20 - <tr> - <td align=3D"left"> - <iframe id=3D"FrameTempLoad" style=3D"visibility= :hidden;height:0;" name=3D"FrameTempLoad"> - </iframe> - </td> - </tr> - =20 - <!-- ************************** END Header ************= ****** --> - <tr> - <td colspan=3D"2"> - <table width=3D"100%" border=3D"0" cellSpacing=3D= "0" cellPadding=3D"0"> - <tr> - <td width=3D"100%" colspan=3D"2" class=3D= "separatorLine"> - </td> - </tr> - <tr> - <td class=3D"lev1head" valign=3D"top"><f= ont size=3D"2">Items for Form</font></td> - </tr> - </table> - </td> - </tr> - <!-- *************************** Columns ************= ****** --> - <tr> - <td> - <table> - <tr> - <td>Available Columns</td> - <td></td> - <td>Your Columns</td> - <td></td> - <td></td> - <td>Type</td> - </tr> - <tr> - <td rowspan=3D"4"> - <div id=3D"ColumnsToShowLeft" ondblclick= =3D"leftColumn.Move(leftColumn.GetSelectedIndex(),rightColumn,false);" ><= /div> - </td> - <td rowspan=3D"4"> - <input onclick=3D"leftColumn.Move(leftCo= lumn.GetSelectedIndex(),rightColumn,false);" type=3D"button" value=3D"Add= "> - <br> - <input onclick=3D"rightColumn.Move(right= Column.GetSelectedIndex(),leftColumn,true);" type=3D"button" value=3D"Rem= ove"> - </td> - <td rowspan=3D"4"> - <div id=3D"ColumnsToShowRight" ondblclic= k=3D"rightColumn.Move(rightColumn.GetSelectedIndex(),leftColumn,true);"><= /div> - </td> - <td rowspan=3D"4"> - <a onclick=3D"rightColumn.Top(rightColum= n.GetSelectedIndex())" href=3D"#"> - <img src=3D"img/upuparrow.gif"> - </a> - <br> - <a onclick=3D"rightColumn.Up(rightColumn= .GetSelectedIndex())" href=3D"#"> - <img src=3D"img/uparrow.gif"> - </a> - <br> - <a onclick=3D"rightColumn.Down(rightColu= mn.GetSelectedIndex())" href=3D"#"> - <img src=3D"img/downarrow.gif"> - </a> - <br> - <a onclick=3D"rightColumn.Bottom(rightCo= lumn.GetSelectedIndex())" href=3D"#"> - <img src=3D"img/downdownarrow.gif"> - </a> - </td> - <td rowspan=3D"4"> - <input onclick=3D"leftColumn.SetToDefaul= t();rightColumn.SetToDefault();" type=3D"button" value=3D"SetToDefault"> - <br> - <!-- Do not forget to enable all item of= the left list --> - <input type=3D"button" value=3D"RemoveAl= l" onclick=3D"leftColumn.EnableAll();rightColumn.RemoveAll();"> - </td> - <td> - <select size=3D"1" id=3D"formType" name=3D= "formType"> - <% html_getOptionSelect(); %> - </select> - </td> - </tr> - =20 - </table> - <script> - =20 - var rightElements =3D new Array(<% html_getAttrL= ist(2); %>); - var leftElements =3D new Array(<% html_getAttrLi= st(1); %>); - =20 - //First List - var divColumnsToShowLeft =3D GetNodeByTagNameAnd= AttName("div","ColumnsToShowLeft")[0]; =20 - =20 - var leftColumnParams =3D=20 - { - selfRefName: "leftColumn", - itemList: leftElements, - divReceptor: divColumnsToShowLeft, - showButtons: false - } - var leftColumn =3D new SortedGraphicalList(leftC= olumnParams); =20 - =20 - //Second List - var divColumnsToShowRight =3D GetNodeByTagNameAn= dAttName("div","ColumnsToShowRight")[0]; =20 - var rightColumnParams =3D=20 - { - selfRefName: "rightColumn", - itemList: rightElements, - divReceptor: divColumnsToShowRight, - showButtons: false - } - var rightColumn =3D new SortedGraphicalList(righ= tColumnParams); =20 - =20 - </script> - </td> - </tr> - <tr> - <td colspan=3D"2"> - <table width=3D"100%" border=3D"0" cellSpacing=3D= "0" cellPadding=3D"0"> - <tr> - <td width=3D"100%" colspan=3D"2" class=3D= "separatorLine"> - </td> - </tr> - <tr> - </td> - </td> - </tr> - </table> - </td> - </tr> - <tr align=3D"center"> - <td> - <table> - <tr> - <td> - <input type=3D"button" onclick=3D"fn= _saveData(rightColumn);" name=3D"btnSave" value=3D"<% html_getBtnSaveValu= e(); %>"> - <% html_getButtonDelete(); %> - </td> - </tr> - </table> - </td> - </tr> - </table> - </form> - </body> -</html> +<% getContent("xsl/createform.xsl"); %> Modified: humano2/trunk/web/builder/site/formmanagement.aspx.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/formmanagement.aspx.cs 2005-06-20 17:2= 7:13 UTC (rev 1368) +++ humano2/trunk/web/builder/site/formmanagement.aspx.cs 2005-06-20 22:4= 8:44 UTC (rev 1369) @@ -32,7 +32,19 @@ /// </summary> public class formmanagement : basePage { - string ClassName =3D ""; + private int formId; + private string delete; + private string receivedCreateUpdate; + private int classId; + =20 + //Update this variables when create=3Dtrue is passed in paramete= r of page + private string receivedFormName; + private string receivedClassId; + private string receivedColumnsStr; =20 + private string receivedType; + =20 + /* + string ClassName =3D ""; string strAttrLeft =3D ""; string strAttrRigth =3D ""; string formName =3D ""; @@ -40,25 +52,50 @@ string formType =3D ""; =09 int first =3D 0; - int ClassId =3D 0; + int classId =3D 0; int formId =3D 0; int action =3D 0; =20 bool newForm =3D true; - =09 + =09 private const int CNS_NOTHING =3D 0; private const int CNS_CREATE =3D 1; private const int CNS_UPDATE =3D 2; private const int CNS_DELETE =3D 3; =09 + */ private void Page_Load(object sender, System.EventArgs e) { - SessionManager.Current.setNewLastAccess(); - getRequestParam(); - if (ClassId > 0 && action !=3D CNS_DELETE) + classId =3D Convert.ToInt32(Request["classId"]); + formId =3D Convert.ToInt32(Request["formId"]); + delete =3D Request["delete"]; + receivedCreateUpdate =3D Request["sendCreateUpdate"]; + =20 + Logger.Log("delete: " + delete, LogLevel.Trace); + Logger.Log("viewId: " + formId, LogLevel.Trace); + Logger.Log("receivedCreateUpdate: " + receivedCreateUpdate, = LogLevel.Trace); + =20 + if (delete =3D=3D "true") + { + deleteForm(); + return; + } + =20 + if(receivedCreateUpdate =3D=3D "true") + { + ProcessCreationUpdate(); + return; + } =20 + =20 + =20 + =20 + /* + SessionManager.Current.setNewLastAccess(); + //getRequestParam(); + if (classId > 0 && action !=3D CNS_DELETE) { - buildListAttrib(ClassId); - ClassName =3D getClassName(ClassId); + //buildListAttrib(classId); + ClassName =3D getClassName(classId); } =20 switch(action) @@ -68,14 +105,14 @@ case CNS_CREATE: createDbForm(); action =3D CNS_UPDATE; - buildListAttribFromForm(ClassId,formId); + buildListAttribFromForm(classId,formId); break; case CNS_UPDATE: if(formAttrib !=3D null) { createDbForm(); } - buildListAttribFromForm(ClassId,formId); + buildListAttribFromForm(classId,formId); break; case CNS_DELETE: deleteDbForm(formId); @@ -84,8 +121,50 @@ default: break; } + */ } - + =20 + override protected string createXml() + { + string strXml =3D ""; + =20 + strXml +=3D "<form>"; + strXml +=3D "<formDatas>"; + strXml +=3D "<id>"; + strXml +=3D formId; + strXml +=3D "</id>"; + =20 + strXml +=3D "<name>"; + strXml +=3D getFormName(formId); + strXml +=3D "</name>"; + =20 + if(formId =3D=3D 0) //To create=20 + { + strXml +=3D "<saveName>Create</saveName>"; + strXml +=3D "<displayDeleteButton>false</displ= ayDeleteButton>"; + } + else //To update=20 + { + strXml +=3D "<saveName>Update</saveName>"; + strXml +=3D "<displayDeleteButton>true</displa= yDeleteButton>"; + strXml +=3D "<classFormName>" + userCred.CoreA= dapter.GetClassNameById(classId) +"</classFormName>"; + strXml +=3D getFormContent(formId); + }=20 + strXml +=3D "<classId>" + classId + "</classId= >"; + strXml +=3D "</formDatas>"; + strXml +=3D "<classes>"; + Logger.Log("classId=3D " + classId,LogLevel.Trace); + if(classId > 0) //A class has been selected + { + strXml +=3D Interface.GetXmlAttribListForClass(classId,u= serCred); =20 + } + strXml +=3D Interface.GetClassListForUser(userCred= ); + strXml +=3D "</classes>"; + strXml +=3D "</form>"; + Logger.Log("XML=3D " + strXml,LogLevel.Trace); + return strXml; + } + =20 #region Web Form Designer generated code override protected void OnInit(EventArgs e) { @@ -103,325 +182,153 @@ private void InitializeComponent() { =20 this.Load +=3D new System.EventHandler(this.Page_Load); - } #endregion =20 #region my method - private void getRequestParam() + =20 + private string getFormContent(int formId) + { + //Get the columns + =20 + string strXml =3D ""; + string filter =3D "0|4|'" + formId + "'|0|0"; + DataTable dt =3D userCred.CoreAdapter.GenerateViewTools(120= 0,"0,1201,1204",filter,"","","",0); =20 + string [] columns =3D Convert.ToString(dt.Rows[0]["formAttri= butes"]).Split(",".ToCharArray()); + int sizeCols =3D columns.Length; + =20 + strXml +=3D "<columns>"; + for(int i=3D0;i<sizeCols;i++) + { + strXml +=3D "<column>"; + strXml +=3D columns[i]; =20 + strXml +=3D "</column>"; + } + strXml +=3D "</columns>"; + =20 + //Get the type + string type =3D Convert.ToString(dt.Rows[0]["formType"]); + strXml +=3D "<type>"; + strXml +=3D type; + strXml +=3D "</type>"; + =20 + return strXml; + } + =20 + private DataTable createFormDataTable() { - int modFormId =3D 0; - int modClassId =3D 0; - - ClassId =3D Convert.ToInt32( Request["classId"]); - if (Convert.ToInt32( Request["newform"]) > 0) - newForm =3D false; - - action =3D Convert.ToInt32( Request["opAction"]); - ClassName =3D Convert.ToString( Request["ClassName"]); - formName =3D Convert.ToString( Request["formName"]); - ClassId =3D Convert.ToInt32( Request["ClassId"]); - formType =3D Convert.ToString( Request["formType"]); - formAttrib =3D Convert.ToString( Request["LstAttrib"]); - formId =3D Convert.ToInt32( Request["formid"]); - modFormId =3D Convert.ToInt32( Request["modformid"]); - modClassId =3D Convert.ToInt32( Request["modClassId"]); - first =3D Convert.ToInt32( Request["first"]); - if (modFormId > 0 && modClassId > 0 && first =3D=3D 0) - { - action =3D CNS_UPDATE; - formId =3D modFormId; - ClassId =3D modClassId; - first =3D 1; - } - } - private void clearFormsElement() - { - formId =3D 0; - ClassId =3D 0; - ClassName =3D ""; - formName =3D ""; - first =3D 1; - action =3D CNS_NOTHING; - } -=09 - private string getClassName(int classId) - { - string strResult =3D ""; - string filtro =3D String.Format("0|4|'{0}'|0|0",classId); - - DataTable dtResult =3D userCred.CoreAdapter.GenerateViewTools(2,"0,66= ",filtro,"","","",0); =09 - if(dtResult.Rows.Count > 0) - { - strResult =3D dtResult.Rows[0]["name"].ToString(); - } - return strResult; - } + Logger.Log("<<createFormDataTable: BEGIN>>",LogLevel.Trace); + DataTable dt =3D new DataTable(); =20 - private void createDbForm() - { - DataTable dt =3D genDataTbl(); - - if(dt !=3D null)=20 - {=20 - if(action =3D=3D CNS_CREATE ) - { - formId =3D userCred.CoreAdapter.CreateForm (1200,dt, userCred); - sendMessageToUser(UserMessage.CREATEFORMOK); - } - if (action =3D=3D CNS_UPDATE ) - { - UpdateDbForm(formId,dt,userCred); - sendMessageToUser(UserMessage.UPDATEFORMOK); - } - =20 - RefreshLeftBuilderTree(); - } =09 - } - - private void deleteDbForm(int folderId) - { - userCred.CoreAdapter.DeleteInstance(folderId,userCred); - sendMessageToUser(UserMessage.DELETEFORMOK); - RefreshLeftBuilderTree(); - } - - private void UpdateDbForm(int formId, DataTable dt,SessionCredencial u= serCred) - { - if(action =3D=3D CNS_UPDATE ) - { - userCred.CoreAdapter.UpdateInstance (formId,dt, userCred); - } - } - - private DataTable genDataTbl() - { - DataTable dt =3D createFormDataTable(); - DataRow dr =3D dt.NewRow(); - dr["FormType"] =3D formType; - dr["FormName"] =3D formName;=20 - dr["FormClassId"] =3D ClassId ; - dr["FormAttributes"] =3D formAttrib;=20 - - dt.Rows.Add(dr); + dt.Columns.Add("FormType"); + dt.Columns.Add("FormName"); + dt.Columns.Add("FormClassId"); + dt.Columns.Add("FormAttributes"); + =20 + Logger.Log("<<createFormDataTable: END>>",LogLevel.Trace); return dt; } =20 - private DataTable createFormDataTable() - { - DataTable dt =3D new DataTable(); - dt.Columns.Add("FormName"); - dt.Columns.Add("FormAttributes"); - dt.Columns.Add("FormClassId"); - dt.Columns.Add("FormType"); - return dt; - } =20 =20 - private void buildListAttrib(int classId) - { - DataTable dtResult =3D userCred.CoreAdapter.GetAttributesFromClass(cl= assId); - int count =3D 1; - foreach(DataRow row in dtResult.Rows) - { - if(strAttrLeft.Length > 0) - { - strAttrLeft +=3D ","; - } - strAttrLeft +=3D String.Format("new ListElement(\"{1}\",\"{0}\",fals= e)",row["id_entity"],row["attName"]); - if (count < 4) - { - if (strAttrRigth.Length > 0) - { - strAttrRigth +=3D ","; - } - strAttrRigth +=3D String.Format("new ListElement(\"{1}\",\"{0}\",fa= lse)",row["id_entity"],row["attName"]); - } - count++; - } - } - private void buildListAttribFromForm(int classId,int formId) - { - string filtro =3D "0|4|'" + formId + "'|0|0"; - string strAttr =3D ""; - int flag; - - DataTable dtR1 =3D userCred.CoreAdapter.GenerateViewTools(1200,"1204= ,1203,1202,1201",filtro,"","","",0); - DataTable dtR2 =3D userCred.CoreAdapter.GetAttributesFromClass(classI= d); - if (dtR1.Rows.Count > 0) - { - strAttr =3D dtR1.Rows[0][0].ToString(); - formName =3D dtR1.Rows[0][2].ToString(); - formType =3D dtR1.Rows[0][3].ToString(); - } - string[] argv =3D strAttr.Split(','); - - //int count =3D 1; - strAttrRigth =3D ""; - foreach(DataRow row in dtR2.Rows) - { - flag =3D 0; - for(int i =3D 0; i < argv.Length;i++) - { - if(argv[i].Length > 0) - { - if (Convert.ToInt32(argv[i]) =3D=3D Convert.ToInt32(row["id_entity= "])) - { - flag =3D 1; - } - } - } - if(flag =3D=3D 1) - { - if(strAttrRigth.Length > 0) - { - strAttrRigth +=3D ","; - } - strAttrRigth +=3D String.Format("new ListElement(\"{1}\",\"{0}\",fa= lse)",row["id_entity"],row["attName"]); - } - } - } - public void html_getOptionSelect() - { - string strHtml =3D ""; - - if( formType !=3D "") - { - } - if(formType =3D=3D "CREATE") - { - strHtml +=3D "<option selected value=3D\"CREATE\">CREATE</option>"; - } - else - { - strHtml +=3D "<option value=3D\"CREATE\">CREATE</option>"; - } - if(formType =3D=3D "READ") - { - strHtml +=3D "<option selected value=3D\"READ\">READ</option>"; - } - else - { - strHtml +=3D "<option value=3D\"READ\">READ</option>"; - } - if(formType =3D=3D "UPDATE") - { - strHtml +=3D "<option selected value=3D\"UPDATE\">UPDATE</option>"; - } - else - { - strHtml +=3D "<option value=3D\"UPDATE\">UPDATE</option>"; - } - Response.Write(strHtml); - } + private string getFormName(int formId) + { + Logger.Log("<<getFormName>>",LogLevel.Trace); + Logger.Log("formId=3D " + formId,LogLevel.Trace); + string filter =3D "0|4|'" + formId + "'|0|0"; + DataTable dt =3D userCred.CoreAdapter.GenerateViewTools(120= 0,"0,1202",filter,"","","",0); =20 + string name =3D ""; + if(dt.Rows.Count =3D=3D 1) + { =20 + name =3DConvert.ToString(dt.Rows[0]["formName"]); + } + else + { + name =3D ""; =20 + } + =20 + return name; + } =20 - ///<summary> - ///Get the list of class for select - ///</summary> - public void getClassList() + private void deleteForm() { - string [] classNames; - int [] classIds; =20 - adapter dbAdapter =3D userCred.CoreAdapter; - dbAdapter.ClassByDomainId( userCred.DomainIds[userCred.CurrentDomain= Index], - out classNames, - out classIds);=09 - string strOpt =3D ""; - =09 - strOpt +=3D "<option value=3D\"0\">--Seleccionar--</option>"; - for(int c =3D 0; c < classNames.Length; c++) - { - strOpt +=3D String.Format("<option value=3D\"{0}\">{1}</option>",cla= ssIds[c].ToString(),classNames[c]);=20 - } - =20 - Response.Write(strOpt); } + =20 + =20 + =20 + private DataTable createFormTable() + { + if(receivedFormName =3D=3D "") + { + Logger.Log("No name for view", LogLevel.Trace); + return null; + } + =20 + // Class that the view belongs to. + int classId =3D Convert.ToInt32(receivedClassId); + if(classId =3D=3D 0)=20 + { // There was no class chosen, don't do anything. + Logger.Log("ClassId =3D=3D 0", LogLevel.Trace); + return null; + } + =20 + // List of attributes to show. + //string columnsStr =3D "0,"; + =20 + if(receivedColumnsStr =3D=3D "0") //No columns =3D> No Updat= e/Create + { + Logger.Log("No columns for view",LogLevel.Trace); + return null; =20 + } + =20 + DataTable dt =3D createFormDataTable(); + DataRow dr =3D dt.NewRow(); =20 - public void html_getFirst() - { - Response.Write(first); - } - - #endregion - #region html method - public void html_getAttrList(int val) - { - string defStr =3D "new ListElement(\"\",\"\",false)"; - if(val =3D=3D 1) - { - if (strAttrLeft.Length > 0) - { - Response.Write(strAttrLeft); - return; - } - }else{ - if(strAttrRigth.Length > 0) - { - Response.Write(strAttrRigth); - return; - } - } - - Response.Write(defStr); - } - - public void html_getAction() - { - Response.Write(action); - } - - public void html_getBtnSaveValue() - { - if (this.newForm =3D=3D true) - { - Response.Write("Save"); - }else{ - Response.Write("Update"); - } - } - - public void html_getClassName() - { - Response.Write(ClassName); - } - - public void html_getClassId() - { - Response.Write(ClassId); - } - public void html_getFormName() - { - Response.Write(formName); - } - public void html_getFormId() - { - Response.Write(formId); - } - public void html_getButtonDelete() - { - string strHtml =3D "<input type=3D\"button\" id=3D\"btnDelete\" "; - strHtml +=3D "name=3D\"btnDelete\" onClick=3D\"fn_deleteData();\" "; - strHtml +=3D "value=3D\"Delete\" "; - - if (action =3D=3D CNS_UPDATE) - { - Response.Write(strHtml); - } - } - - ///<summary> - ///Used to refresh the left tree that contains reports,forms,vie= ws and folders - ///</summary> - public void RefreshLeftBuilderTree() - { - Response.Write("<script language=3D\"Javascript\">\n"); - Response.Write("top.frames[\"mainFrame\"].location =3D \"" += Html.genAbsoluteUrl("/builder/site/functionindex.aspx") + "\";"); - Response.Write("</script>\n"); - } + dr["FormType"] =3D receivedType; + dr["FormName"] =3D receivedFormName;=20 + dr["FormClassId"] =3D classId; + dr["FormAttributes"] =3D receivedColumnsStr;=20 + =09 + dt.Rows.Add(dr); + =20 + return dt; + } + =20 + private void ProcessCreationUpdate() + { + Logger.Log("=3D=3Dformmanagement=3D=3D: <<ProcessCreationUpd= ate>>", LogLevel.Trace); + =20 + receivedClassId =3D Request["sendClassId"]; + receivedFormName =3D Request["sendName"]; + receivedColumnsStr =3D Request["sendColumnsStr"]; + receivedType =3D Request["sendType"]; + =20 + Logger.Log("receivedClassId: " + receivedClassId, LogLevel.T= race); + Logger.Log("receivedFormName: " + receivedFormName, LogLevel= .Trace); + Logger.Log("receivedColumnsStr: " + receivedColumnsStr, LogL= evel.Trace); + =20 + formId =3D Convert.ToInt32(Request.QueryString["formId"]); + Logger.Log("formId=3D" + formId,LogLevel.Trace); + //Creates the table now + DataTable formTable =3D createFormTable(); + if(formTable !=3D null)=20 + {=20 + if(formId =3D=3D 0) + { + Response.Write("Create"); + userCred.CoreAdapter.CreateForm(1200,formTable, user= Cred); + sendMessageToUser(UserMessage.CREATEFORMOK); + } + else=20 + { + Response.Write("Update"); + userCred.CoreAdapter.UpdateInstance(formId, formTabl= e, userCred); + sendMessageToUser(UserMessage.UPDATEFORMOK); + } + }=09 + } #endregion=20 - =09 - } } Modified: humano2/trunk/web/builder/site/js/createinterfacetools.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/js/createinterfacetools.js 2005-06-20 = 17:27:13 UTC (rev 1368) +++ humano2/trunk/web/builder/site/js/createinterfacetools.js 2005-06-20 = 22:48:44 UTC (rev 1369) @@ -209,6 +209,8 @@ } =20 =20 + +//FIXME: please factor these two function (that means: delete the first = one, and change createview.xsl / createreports.xsl) function Reload(page) { var indice =3D document.formulario.classList.selectedIndex; @@ -219,3 +221,9 @@ } } =20 +function ReloadWithClass(page,classId) +{ + alert(classId); + self.location =3D page + "?classId=3D"+classId; +} + Modified: humano2/trunk/web/builder/site/js/form.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/js/form.js 2005-06-20 17:27:13 UTC (re= v 1368) +++ humano2/trunk/web/builder/site/js/form.js 2005-06-20 22:48:44 UTC (re= v 1369) @@ -52,6 +52,7 @@ { columnsStr +=3D sortedList.GetItem(i).GetValue() + ","; } + =20 //Remove the last coma columnsStr =3D columnsStr;=20 columnsStr =3D columnsStr.substring(0,columnsStr.length-1); = =20 @@ -59,13 +60,18 @@ =20 //Now the sort //alert("sort SelfRefName:" + sort.GetSelfRefName()); - =20 - var orderStr =3D this.infosToSubmit.sort.ReturnValues();=20 + if(this.type =3D=3D 'REPORT' || this.type =3D=3D 'VIEW') + { + var orderStr =3D this.infosToSubmit.sort.ReturnValues();=20 + } //alert("orderStr: " + orderStr); =20 //The filter //alert("filter SelfRefName:" + filter.GetSelfRefName()); - var whereStr =3D this.infosToSubmit.filter.ReturnValues(); + if(this.type =3D=3D 'REPORT' || this.type =3D=3D 'VIEW') + { + var whereStr =3D this.infosToSubmit.filter.ReturnValues(); + } //alert("whereStr: " + whereStr); =20 if(this.type =3D=3D 'REPORT') @@ -79,13 +85,17 @@ var divSubmitAll =3D this.infosToSubmit.divSubmitAll; //alert(divSubmitAll); divSubmitAll.innerHTML +=3D=20 - =20 "<input type=3D\"hidden\" name=3D\"sendCreateUpdate\" value=3D\"= true\"></input>" +"<input type=3D\"hidden\" name=3D\"sendClassId\" value=3D\""+ c= lassId +"\"></input>" +"<input type=3D\"hidden\" name=3D\"sendName\" value=3D\"" + nam= e + "\"></input>" +"<input type=3D\"hidden\" name=3D\"sendColumnsStr\" value=3D\""= + columnsStr + "\"></input>" - +"<input type=3D\"hidden\" name=3D\"sendOrderStr\" value=3D\"" += orderStr + "\"></input>" - +"<input type=3D\"hidden\" name=3D\"sendWhereStr\" value=3D\"" += whereStr + "\"></input>"; + =20 + if(this.type =3D=3D 'REPORT' || this.type=3D=3D'VIEW') + { + divSubmitAll.innerHTML +=3D + "<input type=3D\"hidden\" name=3D\"sendOrderStr\" value=3D\"= " + orderStr + "\"></input>" + +"<input type=3D\"hidden\" name=3D\"sendWhereStr\" value=3D\= "" + whereStr + "\"></input>"; + } =20 if (this.type =3D=3D 'REPORT') { @@ -93,6 +103,15 @@ "<input type=3D\"hidden\" name=3D\"sendPersoColumnsStr\" val= ue=3D\"" + persoColumnsStr + "\"></input>" +"<input type=3D\"hidden\" name=3D\"sendHavingsStr\" value=3D= \"" + havingsStr + "\"></input>"; } =20 + =20 + var sendType =3D document.getElementById("formType").value; + alert("sendType:" + sendType); + if (this.type =3D=3D 'FORM') + { + divSubmitAll.innerHTML +=3D=20 + "<input type=3D\"hidden\" name=3D\"sendType\" value=3D\"" + = sendType + "\"></input>"; + } =20 + =20 //alert(divSubmitAll.innerHTML); return true; } @@ -105,7 +124,9 @@ case 'VIEW': =20 msg +=3D "view"; case 'REPORT': - msg +=3D "report"; =20 + msg +=3D "report"; =20 + case 'FORM': + name =3D "form"; } msg +=3D"?"; =20 @@ -118,7 +139,9 @@ case 'VIEW': =20 name =3D "viewId"; case 'REPORT': - name =3D "reportId"; =20 + name =3D "reportId"; =20 + case 'FORM': + name =3D "formId"; } var divSubmitAll =3D GetNodeByTagNameAndAttName("div","SubmitAll= ")[0]; //alert(divSubmitAll); Modified: humano2/trunk/web/builder/site/viewmain.aspx.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-20 17:27:13 U= TC (rev 1368) +++ humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-20 22:48:44 U= TC (rev 1369) @@ -33,9 +33,7 @@ private string viewName; private int viewId; private string delete; - =20 private string receivedCreateUpdate; - =20 //Update this variables when create=3Dtrue is passed in paramete= r of page private string receivedViewName; private string receivedClassId; @@ -119,7 +117,6 @@ strXml +=3D getViewContent(); Logger.Log("getViewContent(): " + getViewContent(),LogLe= vel.Trace); }=20 - =20 strXml +=3D "<classId>" + classId + "</classId>"; strXml +=3D "</viewDatas>"; strXml +=3D "<classes>"; @@ -140,7 +137,6 @@ =20 override protected void OnInit(EventArgs e) { - =20 InitializeComponent(); base.OnInit(e); } @@ -223,7 +219,6 @@ xmlRes +=3D "</condition>"; } xmlRes +=3D "</conditions>"; - =20 return xmlRes; } =20 @@ -255,7 +250,7 @@ ///</summary> private string [] getColumnsList() { - //string [] list; + //string [] list; //Get class id DataTable currView =3D null; currView =3D userCred.CoreAdapter.GetViewData(viewId); Added: humano2/trunk/web/builder/site/xsl/createform.xsl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/xsl/createform.xsl 2005-06-20 17:27:13= UTC (rev 1368) +++ humano2/trunk/web/builder/site/xsl/createform.xsl 2005-06-20 22:48:44= UTC (rev 1369) @@ -0,0 +1,306 @@ +<xsl:stylesheet version=3D"1.0" xmlns:xsl=3D"http://www.w3.org/1999/XSL/= Transform"> +<!-- $Id$ --> + <xsl:output method=3D"html" /> + <xsl:template match=3D"/"> + <html> + <head> + <title>Form Management</title> + <script language=3D"Javascript" src=3D"js/grafcomponents= /misc.js"></script> + <script language=3D"javascript" src=3D"js/grafcomponents= /test.js"></script> + <script language=3D"Javascript" src=3D"js/grafcomponents= /sortedlist.js"></script> + <script language=3D"Javascript" src=3D"js/grafcomponents= /sortedgraphicallist.js"></script> + <script language=3D"Javascript" src=3D"js/grafcomponents= /radiobuttonexpand.js"></script> + <script language=3D"Javascript" src=3D"js/grafcomponents= /inputline.js"></script> + <script language=3D"Javascript" src=3D"js/grafcomponents= /expandform.js"></script> + <script language=3D"Javascript" src=3D"js/createinterfac= etools.js" type=3D"text/javascript"></script> + <script language=3D"Javascript" src=3D"js/form.js" type=3D= "text/javascript"></script> + <link href=3D"css/createinterface.css" rel=3D"stylesheet= " type=3D"text/css"/> + <script language=3D"Javascript"> + /////////////// + /// The columns of attributes + var attribsArr =3D new Array(); + var item; + var i=3D0; + <xsl:for-each select=3D"/form/classes/class[count(at= tributes)>0]/attributes/attribute"> //Get all attributes + <xsl:variable name=3D"classId"> + <xsl:value-of select=3D"id" /> + </xsl:variable> + var item =3D new ListElement("<xsl:value-of sele= ct=3D"name" />","<xsl:value-of select=3D"id"/>",false); + attribsArr[i] =3D item; + i++; + </xsl:for-each> + var sizeAttribsArr =3D attribsArr.length; + var leftAttribsArr =3D new Array(); + var rightAttribsArr =3D new Array(); + <xsl:if test=3D"/form/formDatas/name=3D''"> <!-- Cre= ation --> + var splitColTab =3D BuildColumnsByDefault(attrib= sArr,4); + </xsl:if> + <xsl:if test=3D"form/formDatas/name!=3D''"> <!-- Upd= ate --> + //Columns + var reportColumnsArray =3D new Array(); + var i=3D0; + <xsl:for-each select=3D"/form/formDatas/columns/= column"> + reportColumnsArray[i++] =3D "<xsl:value-of s= elect=3D"." />"; + </xsl:for-each> + //alert(reportColumnsArray.length); =20 + var splitColTab =3D BuildPreselectedColumns(attr= ibsArr,reportColumnsArray); + </xsl:if> + leftAttribsArr =3D splitColTab["left"]; + rightAttribsArr =3D splitColTab["right"]; + </script> + </head> + <body> + <form name=3D"formulario" action=3D"#" method=3D"post"> + <table class=3D"conttablecenter2" width=3D"100%"> + <tr> + <td> + <table class=3D"smallgraytextnolink"> + <tr> + <td align=3D"right"> + Name: + </td> + <td align=3D"left"> + <xsl:variable name=3D"formNa= me"> + <xsl:value-of select=3D"= /form/formDatas/name" /> + </xsl:variable> + <input id=3D"formNameInput" = type=3D"text" name=3D"formName" value=3D"{$formName}"></input> + </td> + </tr> + <tr> + <td align=3D"right"> + Class: + </td> + <td align=3D"left"> + <select class=3D"drpdwn2" id= =3D"classList" onchange=3D"ReloadWithClass('formmanagement.aspx',options[= selectedIndex].value);"> + <xsl:for-each select=3D"= form/classes/class"> + <option> + <xsl:attribute n= ame=3D"name"> + classId + </xsl:attribute> + <xsl:attribute n= ame=3D"value"> + <xsl:value-o= f select=3D"id" /> + </xsl:attribute> + <xsl:value-of se= lect=3D"name" /> + <xsl:if test=3D"= id=3D/form/formDatas/classId"> + <xsl:attribu= te name=3D"selected"> + </xsl:attrib= ute> + </xsl:if> + </option>=20 + </xsl:for-each> + </select>=20 + </td> + </tr> + </table> + </td> + </tr> + =20 + <!-- After load of class --> + <xsl:if test=3D"count(/form/classes/class/attrib= utes)!=3D0"> + <tr> + <td colspan=3D"2"> + <table width=3D"100%" border=3D"0" c= ellSpacing=3D"0" cellPadding=3D"0"> + <tr> + <td width=3D"100%" colspan=3D= "2" class=3D"separatorLine"> + </td> + </tr> + <tr> + <td class=3D"lev1head" valig= n=3D"top"><font size=3D"2">Columns...</font></td> + </tr> + </table> + </td> + </tr> + + <tr> + <td class=3D"smallgraytextnolink" colsp= an=3D"2"> + <table> + <tr> + <td> + <div id=3D"ColumnsToShowLeft= " ondblclick=3D"leftColumn.Move(leftColumn.GetSelectedIndex(),rightColumn= ,false);"> + </div> + </td> + <td> + <center> + <input type=3D"button"=20 + width=3D"20" + value=3D">>"=20 + onclick =3D "leftCol= umn.Move(leftColumn.GetSelectedIndex(),rightColumn,false);"></input> + <br/> + <input type=3D"button"=20 + width=3D"20" + value=3D"<<= ;"=20 + onclick =3D "rig= htColumn.Move(rightColumn.GetSelectedIndex(),leftColumn,true);"></input> + </center> + </td> + <td> + <div id=3D"ColumnsToShowRigh= t" ondblclick=3D"rightColumn.Move(rightColumn.GetSelectedIndex(),leftColu= mn,true);"> + </div> + </td> + <td> + <a href=3D"#" onclick=3D"rig= htColumn.Top(rightColumn.GetSelectedIndex())"> + <img src=3D"img/upuparro= w.gif" border=3D"0"/> + </a> + <br/> + <a href=3D"#" onclick=3D"rig= htColumn.Up(rightColumn.GetSelectedIndex())"> + <img src=3D"img/uparrow.= gif" border=3D"0" /> + </a> + <br/> + <a href=3D"#" onclick=3D"rig= htColumn.Down(rightColumn.GetSelectedIndex())"> + <img src=3D"img/downarro= w.gif" border=3D"0" /> + </a> + <br/> + <a href=3D"#" onclick=3D"rig= htColumn.Bottom(rightColumn.GetSelectedIndex())"> + <img src=3D"img/downdown= arrow.gif" border=3D"0" /> + </a> + </td> + <td> + <input type=3D"button" value= =3D"SetToDefault"=20 + onclick=3D"leftColumn.Se= tToDefault();rightColumn.SetToDefault();"></input> + <br/> + <!-- Do not forget to enable= all item of the left list --> + <input type=3D"button" value= =3D"RemoveAll" onclick=3D"leftColumn.EnableAll();rightColumn.RemoveAll();= "></input> + </td> + </tr> + </table> + <script> + =20 + //First List + var divColumnsToShowLeft =3D Get= NodeByTagNameAndAttName("div","ColumnsToShowLeft")[0]; =20 + =20 + var leftColumnParams =3D=20 + { + selfRefName: "leftColumn", + itemList: leftAttribsArr, + divReceptor: divColumnsToSho= wLeft, + showButtons: false + } + var leftColumn =3D new SortedGra= phicalList(leftColumnParams); + = =20 + //Second List + var divColumnsToShowRight =3D Ge= tNodeByTagNameAndAttName("div","ColumnsToShowRight")[0]; =20 + var rightColumnParams =3D=20 + { + selfRefName: "rightColumn", + itemList: rightAttribsArr, + divReceptor: divColumnsToSho= wRight, + showButtons: false + } + var rightColumn =3D new SortedGr= aphicalList(rightColumnParams); =20 + alert("rightColumn:" + rightColu= mn); =20 + =20 + </script> + </td> + </tr> + =20 + <tr> + <td colspan=3D"2"> + <table width=3D"100%" border=3D"0" c= ellSpacing=3D"0" cellPadding=3D"0"> + <tr> + <td width=3D"100%" colspan=3D= "2" class=3D"separatorLine"> + </td> + </tr> + <tr> + <td class=3D"lev1head" valig= n=3D"top"><font size=3D"2">Type</font></td> + </tr> + </table> + </td> + </tr> + =20 + <tr> + <td align=3D"left"> + <select id=3D"formType" name=3D"formT= ype" class=3D"drpdwn2"> + <option value=3D"CREATE"> + <xsl:if test=3D"/form/formDa= tas/type=3D'CREATE'"> + <xsl:attribute name=3D"s= elected" /> + </xsl:if> + CREATE + </option> + <option value=3D"READ"> + <xsl:if test=3D"/form/formDa= tas/type=3D'READ'"> + <xsl:attribute name=3D"s= elected" /> + </xsl:if> + READ + </option> + <option value=3D"UPDATE"> + <xsl:if test=3D"/form/formDa= tas/type=3D'UPDATE'"> + <xsl:attribute name=3D"s= elected" /> + </xsl:if> + UPDATE + </option> + </select> + </td> + </tr> + =20 + <!--######################### Buttons ######= #################################### --> + <tr> + <td colspan=3D"2"> + <table width=3D"100%" border=3D"0" c= ellSpacing=3D"0" cellPadding=3D"0"> + <tr> + <td width=3D"100%" colspan=3D= "2" class=3D"separatorLine"> + </td> + </tr> + </table> + </td> + </tr> + <tr align=3D"center"> + <td> + <table> + <tr> + <td class=3D"ContentAlt"> + <div id=3D"CrudButtons1"= > + <input type=3D"submi= t"> + <xsl:attribute n= ame=3D"value"> + <xsl:value-o= f select=3D"/form/formDatas/saveName" /> + </xsl:attribute> + <xsl:attribute n= ame=3D"onclick"> + Form.UpdateS= ubmitAll(); + </xsl:attribute> + </input> + </div> + </td> + <td> + <div id=3D"CrudButtons2"= > + <xsl:if test=3D"/for= m/formDatas/displayDeleteButton=3D'true'" > + <input type=3D"s= ubmit" value=3D"Delete"> + <xsl:attribu= te name=3D"onclick"> + Form.Del= eteReport(); + </xsl:attrib= ute> + </input> + </xsl:if> + </div> + </td> + </tr> + </table> + </td> + </tr> + </xsl:if> + <!--######################### End:Buttons ##= ######################################## --> + </table> + <!-- This tag is used to create the inputs hidde= n to send all the data in one pass --> + <div id=3D"SubmitAll"> + <!-- Always submits the view id --> + <input type=3D"hidden" id=3D"formId"> + <xsl:attribute name=3D"value"> + <xsl:value-of select=3D"/form/formDa= tas/id" /> + </xsl:attribute> + </input>=20 + </div> + <script language=3D"Javascript"> + <xsl:if test=3D"/form/formDatas/classId!=3D'= '"> + var infosToSubmit =3D + { + <xsl:if test=3D"/form/formDatas/name= !=3D''"> <!-- UPDATE --> + id:<xsl:value-of select=3D"/form= /formDatas/id" />, + </xsl:if> + divName:document.getElementById('for= mNameInput'), + rightColumn: rightColumn, + divSubmitAll: document.getElementByI= d('SubmitAll') + } + var Form =3D new Form(<xsl:value-of sele= ct=3D"/form/formDatas/classId" />,"FORM", infosToSubmit); + alert("Form: " + Form); + </xsl:if> + </script> + </form> + </body> + </html> + </xsl:template> +</xsl:stylesheet> Modified: humano2/trunk/web/builder/site/xsl/createview.xsl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-20 17:27:13= UTC (rev 1368) +++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-20 22:48:44= UTC (rev 1369) @@ -186,14 +186,7 @@ </td> <!-- Only show class= es for select when creating --> <xsl:if test=3D"/vie= w/viewDatas/saveName=3D'Create'" >=20 - <td > - <!-- - <select class=3D= "drpdwn2" id=3D"classList" onchange=3D" UpdateHeader(); - = Form.UpdateLists(leftColumn,rightColumn,this.value); - = Form.UpdateSort(expandFormSort,this.value);=20 - = Form.UpdateFilter(expandFormFilter,this.value); - = ">=20 - = --> + <td> <select class=3D= "drpdwn2" id=3D"classList" onchange=3D"Reload('viewmain.aspx');"> <xsl:for-eac= h select=3D"view/classes/class"> <option> Modified: humano2/trunk/web/builder/site/xsl/functionindex.xsl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/xsl/functionindex.xsl 2005-06-20 17:27= :13 UTC (rev 1368) +++ humano2/trunk/web/builder/site/xsl/functionindex.xsl 2005-06-20 22:48= :44 UTC (rev 1369) @@ -76,7 +76,7 @@ <xsl:for-each select=3D"/vffr/forms/form"> <xsl:if test=3D"id!=3D''"> var child_<xsl:value-of select=3D"id" /> =3D new= WebFXTreeItem('<xsl:value-of select=3D"name" />', - = 'formmanagement.aspx?modformid=3D<xsl:value-of select=3D"id" = />&modclassId=3D<xsl:value-of select=3D"classId" />', + = 'formmanagement.aspx?formId=3D<xsl:value-of select=3D"id" />&= amp;classId=3D<xsl:value-of select=3D"classId" />', = '', = 'img/webfxtree/crearinstance.jpeg'); formBranch.add(child_<xsl:value-of select=3D"id"= />); |
|
From: <sv...@de...> - 2005-06-20 17:27:08
|
Author: marcelo Date: 2005-06-20 13:27:13 -0400 (Mon, 20 Jun 2005) New Revision: 1368 Modified: humano2/trunk/core/config.cs Log: UPDATED: version to 5.0.Beta7 Modified: humano2/trunk/core/config.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/core/config.cs 2005-06-20 15:08:00 UTC (rev 1367) +++ humano2/trunk/core/config.cs 2005-06-20 17:27:13 UTC (rev 1368) @@ -26,7 +26,7 @@ // The Version of the Humano2 core code const int major =3D 5; const int minor =3D 0; - const string patch =3D "beta5"; + const string patch =3D "beta7"; =09 // Contains the instance, once instanced. private static Config instance =3D null; |
|
From: <sv...@de...> - 2005-06-20 15:08:01
|
Author: pcamacho
Date: 2005-06-20 11:08:00 -0400 (Mon, 20 Jun 2005)
New Revision: 1367
Modified:
humano2/trunk/web/portal/site/showView.aspx.cs
Log:
FIX: big big and ugly patch for #206.
Modified: humano2/trunk/web/portal/site/showView.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/showView.aspx.cs 2005-06-20 13:48:08 UT=
C (rev 1366)
+++ humano2/trunk/web/portal/site/showView.aspx.cs 2005-06-20 15:08:00 UT=
C (rev 1367)
@@ -644,32 +644,87 @@
patchedTable.Columns.Add(newPatchedCol);
}
=20
- //Now change the lines with good values
- =20
+ //Now change the lines with good values =20
+ //Builds the empty rows
for(int i=3D0;i<viewRes.Rows.Count;i++)
{
- DataRow myRow =3D patchedTable.NewRow(); //Create the li=
ne once
+ DataRow myRow =3D patchedTable.NewRow(); =20
+ patchedTable.Rows.Add(myRow);
+ }
+ =20
+ indexColumns =3D 0;
+ for(int i=3D0;i<viewRes.Columns.Count;i++)
+ {
+ string [] colsArr =3D null;
+ string colName =3D viewRes.Columns[i].ColumnName;
+ bool specialCol =3D false;
+ if((colName.StartsWith("id_entity"))=20
+ || (colName=3D=3D"id_entity")
+ || (colName=3D=3D"row"))
+ {
+ if(colName=3D=3D"id_entity") //The first column must=
be always 0
+ {
+ indexColumns++; =20
+ }
+ specialCol =3D false;
+ }
+ else
+ {
+ string col =3D columnsList[indexColumns];
+ if(col.Split("^".ToCharArray()).Length=3D=3D2) //Per=
t attribute
+ {
+ colsArr =3D buildPertinenceColumn(viewTable,col,=
iniClass,idEntity);
+ specialCol =3D true; =20
+ }
+ else
+ {
+ specialCol =3D false; =20
+ }
+ indexColumns++;
+ }
+ =20
//Fill the row
- for(int j =3D 0; j< viewRes.Columns.Count; j++)
+ for(int j =3D 0; j< viewRes.Rows.Count; j++)
{
- myRow[j] =3D Convert.ToString(viewRes.Rows[i][j]);
- Console.Write(myRow[j] + " ");
+ if(specialCol)
+ {
+ patchedTable.Rows[j][i] =3D colsArr[j];//Conver=
t.ToString(viewRes.Rows[j][i]); =20
+ }
+ else
+ {
+ patchedTable.Rows[j][i] =3D Convert.ToString(vie=
wRes.Rows[j][i]); =20
+ }
}
- patchedTable.Rows.Add(myRow); =20
- Console.Write("\n");
}
return patchedTable;
} =20
=20
- /*
- private string buildPertinenceColumn(DataTable viewTable, string=
col, int iniClass, int idEntity)
+ ///<summary>
+ /// Due to a bug in viewtools, for every pertinence attribute of=
a class, we have to=20
+ /// do a request to viewtools to get the values of every column.=
Doing the one request=20
+ /// with viewtools for all columns does not work because only th=
e first column of pertinence is
+ /// is brought.
+ ///<summary>
+ private string [] buildPertinenceColumn(DataTable viewTable, str=
ing col, int iniClass, int idEntity)
{
- viewTable["columns"] =3D "0" + col;
+ Logger.Log("<<buildPertinenceColumn>>",LogLevel.Trace);
+ Logger.Log("column: " + col,LogLevel.Trace);
+ viewTable.Rows[0]["columns"] =3D "0," + col;
=20
adapter dbAdapter =3D userCred.CoreAdapter;
DataTable res =3D dbAdapter.ExecViewFromDataTable(iniClass, =
viewTable, idEntity, "", 0, 1);
+ =20
+ //Build the column
+ int size =3D res.Rows.Count;
+ string [] resArr =3D new string [size];
+ =20
+ for(int i=3D0; i< size; i++)
+ {
+ resArr[i] =3D Convert.ToString(res.Rows[i][2]); //col 0=
: id_entity of instance, col 1: id_entity of pert, col2 value of pert =20
+ }
+ return resArr;
}
- */
+ =20
=20
/////////////////////////////////////////////////////////////////=
//////////////////////////////////=20
///////////////////////////////////// END OF UGLY PATCH /////////=
//////////////////////////////////
|
|
From: <sv...@de...> - 2005-06-20 13:48:12
|
Author: pcamacho Date: 2005-06-20 09:48:08 -0400 (Mon, 20 Jun 2005) New Revision: 1366 Modified: humano2/trunk/Makefile Log: CHANGE: remove mssql directory in Makefile because it is not part of trun= k anymore. Modified: humano2/trunk/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/Makefile 2005-06-19 04:31:00 UTC (rev 1365) +++ humano2/trunk/Makefile 2005-06-20 13:48:08 UTC (rev 1366) @@ -15,7 +15,7 @@ #platform =3D msnet =20 #database =3D pgsql # Compiles only the PostgreSQL driver.=20 -database =3D pgsql mssql # Compiled both PostgreSQL and Microsoft SQL dr= iver. +database =3D pgsql # Compiled both PostgreSQL and Microsoft SQL driver. =20 csc =3D mcs # what is the C# compiler=20 opts =3D -g # the compiler options. |
|
From: <sv...@de...> - 2005-06-18 01:41:57
|
Author: marcelo Date: 2005-06-17 21:42:00 -0400 (Fri, 17 Jun 2005) New Revision: 1361 Removed: humano2/trunk/core/db/mssql/ Log: |
|
From: <sv...@de...> - 2005-06-18 01:33:36
|
Author: marcelo
Date: 2005-06-17 21:33:40 -0400 (Fri, 17 Jun 2005)
New Revision: 1360
Modified:
humano2/trunk/INSTALL-LINUX.en.txt
humano2/trunk/INSTALL-LINUX.es.txt
humano2/trunk/INSTALL-WINDOWS.es.txt
Log:
* Updated installation files.
Modified: humano2/trunk/INSTALL-LINUX.en.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/INSTALL-LINUX.en.txt 2005-06-18 00:23:37 UTC (rev 1359)
+++ humano2/trunk/INSTALL-LINUX.en.txt 2005-06-18 01:33:40 UTC (rev 1360)
@@ -62,18 +62,23 @@
<user> the database user you want to use to access the database.
<pass> the password for that user.
=20
- <dbdrivers> has to point to the complete path of the=20
- directory where the database driver is located. This is normally in=20
- bin .
- <session> The complete path of a temporary directory where the
- session files are to be stored. The user that runs the application=20
- server has to have read and WRITE access to this directory.
- <clientPath> The Complete path of a directory where the uploaded
- files will be stored. The user that runs the application=20
- server has to have read and WRITE access to this directory.
+ <basedir> This points to the instalation directory where Humano2
+ software is installed. =20
+ <dbdrivers> the directory where the database driver is located.=20
+ This is normally in bin.
+ <session> The temporary directory where the session files are to be
+ stored. The application server has to have read and WRITE access to
+ this directory.
+ <clientPath> The directory where the uploaded files will be stored.=20
+ The user that runs the application server has to have read and
+ WRITE access to this directory.
<webbase> The Complete URL of instalation. This is used for
redirections HTTP and other operations that need full URL paths.
=20
+ <level> This sets the debug output that the software generates. "0"
+ turns logging off (the default). For logging values consult
+ core/loglevel.cs. A value of "1000" is considered complete Logging.
+
2. Change the names of the files web/builder/Web.config.tmpl and=20
web/portal/Web.config.tmpl to Web.config (remove the .tmpl of the end=
of the=20
filename).
Modified: humano2/trunk/INSTALL-LINUX.es.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/INSTALL-LINUX.es.txt 2005-06-18 00:23:37 UTC (rev 1359)
+++ humano2/trunk/INSTALL-LINUX.es.txt 2005-06-18 01:33:40 UTC (rev 1360)
@@ -65,18 +65,25 @@
<user> El usuario de base de datos creado para acceder la base de dato=
s.
<pass> La password del usuario.
=20
+ <basedir> El directorio donde esta instalado el software de Humano2.
<dbdrivers> Apunta al directorio en donde se encuentra el driver para =
la
conexion a la base de datos PostgreSQL. Esto es normalmente en bin.
- <session> La ubicacion completo del directorio cual mantendra los arch=
ivos=20
- temporales de session. Notace que el servidor usuario bajo cual corre=
el=20
- servidor debe tener derechos de ESCRITURA y lectura en este directori=
o.
- <clientPath> La ubicacion completo del directorio cual mantendra los a=
rchivos=20
- subido en la plataforma. Notace que el servidor usuario bajo cual cor=
re el=20
- servidor debe tener derechos de ESCRITURA y lectura en este directori=
o.
+ <session> El directorio cual mantendra los archivos temporales de
+ session. Notace que el servidor debe tener derechos de ESCRITURA y
+ lectura en este directorio.=20
+ <clientPath> El directorio cual mantendra los archivos subido en la
+ plataforma. Notace que el servidor debe tener derechos de ESCRITURA
+ y lectura en este directorio.=20
<webbase> El URL completo donde estara accesible el systema. El system=
a=20
utilizara ese direccion para redirecionamiento y otras operaciones cu=
al=20
necesitan la direccion completa.=20
=20
+ <level> Ajuste la cantidad de informacion de depuracion generado por
+ el sistema en un bitacora. "0" prohi be cualquier bitacora
+ (predeterminado). Para valores especificos consulta
+ core/loglevel.cs. Un valor de "1000" muestra todos los mensajes de
+ depuraci=F3n.
+
2. Cambia el nombre de los archivos web/builder/Web.config.tmpl y=20
web/portal/Web.config.tmpl a Web.config=20
Edite estos archivos con su editor favorito (esto es en formato XML)
Modified: humano2/trunk/INSTALL-WINDOWS.es.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/INSTALL-WINDOWS.es.txt 2005-06-18 00:23:37 UTC (rev 135=
9)
+++ humano2/trunk/INSTALL-WINDOWS.es.txt 2005-06-18 01:33:40 UTC (rev 136=
0)
@@ -44,19 +44,6 @@
=20
=20
=20
-Creacion de la Base de Datos - MsSql:
-=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
- 1. Cree la base de datos "h2_solution".
-
- 2. Cree el usuario de base de datos "h2_dbase" con una contrasena
-
- 3. De acceso al usuario creado a la base de datos creada
-
- 4. Cargar del esquema de base de datos a la base de datos creada.
- Abrir y ejecutar en orden todos los archivos bajo INSTALLDIR\core\sche=
ma\MsSql
-
-
-
Configurando el sistema:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
|
|
From: <sv...@de...> - 2005-06-18 00:23:35
|
Author: marcelo Date: 2005-06-17 20:23:37 -0400 (Fri, 17 Jun 2005) New Revision: 1359 Added: humano2/tags/5.0.beta6/ Log: Weekly release beta #6 Copied: humano2/tags/5.0.beta6 (from rev 1358, humano2/trunk) |
|
From: <sv...@de...> - 2005-06-18 00:10:46
|
Author: marcelo Date: 2005-06-17 20:10:41 -0400 (Fri, 17 Jun 2005) New Revision: 1358 Removed: humano2/tags/5.0.beta6/ Log: forgot some stuff |
|
From: <sv...@de...> - 2005-06-18 00:07:29
|
Author: marcelo Date: 2005-06-17 20:07:32 -0400 (Fri, 17 Jun 2005) New Revision: 1357 Added: humano2/trunk/apps/import/app.config Log: * Forgot to include file for import process Added: humano2/trunk/apps/import/app.config =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/apps/import/app.config 2005-06-18 00:01:26 UTC (rev 135= 6) +++ humano2/trunk/apps/import/app.config 2005-06-18 00:07:32 UTC (rev 135= 7) @@ -0,0 +1,9 @@ +<?xml version=3D"1.0" encoding=3D"utf-8" ?> +<configuration> + <appSettings> + <add key=3D"configFile" value=3D"D:\H250-Trunk\config\config.xml" /= > + <add key=3D"Key0" value=3D"0" /> + <add key=3D"Key1" value=3D"1" /> + <add key=3D"Key2" value=3D"2" /> + </appSettings> +</configuration> \ No newline at end of file |
|
From: <sv...@de...> - 2005-06-18 00:01:31
|
Author: marcelo Date: 2005-06-17 20:01:26 -0400 (Fri, 17 Jun 2005) New Revision: 1356 Added: humano2/tags/5.0.beta6/ Log: Weekly beta release #6 Copied: humano2/tags/5.0.beta6 (from rev 1355, humano2/trunk) |
|
From: <sv...@de...> - 2005-06-17 23:59:49
|
Author: marcelo Date: 2005-06-17 19:59:52 -0400 (Fri, 17 Jun 2005) New Revision: 1355 Added: humano2/trunk/INSTALL-WINDOWS.es.txt Modified: humano2/trunk/changelog.txt Log: * Updated changelog.txt and included INSTALL-WINDOWS.es.txt Added: humano2/trunk/INSTALL-WINDOWS.es.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/INSTALL-WINDOWS.es.txt 2005-06-17 23:45:30 UTC (rev 135= 4) +++ humano2/trunk/INSTALL-WINDOWS.es.txt 2005-06-17 23:59:52 UTC (rev 135= 5) @@ -0,0 +1,99 @@ + +Como instalar Humano2 en Windows: +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D + +Esta y mas documentacion esta disponible en el sitio de desarrolladores +de Humano2: http://devel.humano2.org.=20 + +Si tiene preguntas o necesita soporte, puede suscribirse a las listas +de correo en http://list.humano2.org y hacer sus preguntas ahi. + + +Requerimientos: + 1. .NEt platform 1.1 + 2. PostgreSQL version 8.0 o posterior ( http://www.postgresql.org ) + o MsSQL server 2000 con SP4 + 3. VS .NEt (para compilar si no bajo la version compilada) + +Instalacion: + 1. Descomprima el archivo .zip que obtuvo. (por razones de ejemplo, est= e directorio se haga referencia en al forma de INSTALLDIR) + 2. Abra el administrador de Servicios Internet + 3. Dentro del servidor web, hay que crear dos directorios virtuales, PO= RTAL y BUILDER, estos deberian apuntar a INSTALLDIR\sites\portal y INSTAL= LDIR\sites\builder respectivamente. Estos directorio deben tener acceso a= ejecutar sequencia de comandos. + 4.Agrege index.aspx bajo documentos. + 5. Abra la solucion haciendo doble clic en INSTALLDIR\Humano2.sln + 6. Compila la solucion + 7. Seguir con Creacion de la Base de Datos + 8. Seguir con Configurando el sistema +=20 + +Creacion de la Base de Datos - Postgres: +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D + 1. Cree la base de datos "h2_solution" con la codificacion UNICODE + + 2. Cree el usuario de base de datos "h2_dbase" con una contrasena + + 3. Modifique el archivo pg_hba.conf para que la base de + datos acepte conexiones desde tu servidor web. Por ejemplo, si su=20 + servidor web y motor de base de datos estan en la misma maquina agre= ga=20 + la siguiente linea: + + host all all 127.0.0.1 255.255.255.255 m= d5 + + 4. Cargar del esquema de base de datos a la base de datos creada. + Abrir y ejecutar en orden todos los archivos bajo INSTALLDIR\core\sche= ma\pgsql + + + +Creacion de la Base de Datos - MsSql: +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D + 1. Cree la base de datos "h2_solution". + + 2. Cree el usuario de base de datos "h2_dbase" con una contrasena + + 3. De acceso al usuario creado a la base de datos creada + + 4. Cargar del esquema de base de datos a la base de datos creada. + Abrir y ejecutar en orden todos los archivos bajo INSTALLDIR\core\sche= ma\MsSql + + + +Configurando el sistema: +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + 1. Cambie el nombre del achivo INSTALLDIR\config\config.xml.tmpl a conf= ig.xml (eleminando el .tmpl=20 + del fin del nombre). Edite el archivo con su editor de texto favorito = y modifique los=20 + valores de: + <driver> El driver que se utilizara para conectarse a la base de datos= . + <host> La direccion del servidor o nombre de host que contiene el moto= r de base de datos. + <name> El nombre de la base de datos creada. + <user> El usuario de base de datos creado para acceder la base de dato= s. + <pass> La password del usuario. + + <dbdrivers> Apunta al directorio en donde se encuentra el driver para = la + conexion a la base de datos PostgreSQL. Esto es normalmente en bin. + <session> La ubicacion completo del directorio cual mantendra los arch= ivos=20 + temporales de session. Notace que el servidor usuario bajo cual corre= el=20 + servidor debe tener derechos de ESCRITURA y lectura en este directori= o. + <clientPath> La ubicacion completo del directorio cual mantendra los a= rchivos=20 + subido en la plataforma. Notace que el servidor usuario bajo cual cor= re el=20 + servidor debe tener derechos de ESCRITURA y lectura en este directori= o. + <webbase> El URL completo donde estara accesible el sistema. El sistem= a=20 + utilizara esa direccion para redirecionamiento y otras operaciones cu= al=20 + necesitan la direccion completa.=20 + + 2. Cambia el nombre de los archivos web/builder/Web.config.tmpl y=20 + web/portal/Web.config.tmpl a Web.config=20 + Edite estos archivos con su editor favorito (esto es en formato XML) + En el inicio de ambos archivos existe una linea: + + <add key=3D"configFile" value=3D"INSTALLDIR\config\config.xml" /> + + Modifique el valor del atributo "value" apuntando a la ubicacion (ru= ta=20 + completa)de su archivo config.xml. + + +Inicio: +=3D=3D=3D=3D=3D=3D=3D + + 1. Utilice un navegador para conectarse al servidor (eg. http://localho= st) +=20 Modified: humano2/trunk/changelog.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/changelog.txt 2005-06-17 23:45:30 UTC (rev 1354) +++ humano2/trunk/changelog.txt 2005-06-17 23:59:52 UTC (rev 1355) @@ -1,5 +1,24 @@ $Id$ =20 +=3D=3D 5.0.beta6 - 2005-06-03 Revision: 1355 =3D=3D + + * Builder + * Added capability to upload a file to be imported + =09 + * Portal + * Order of attributes in forms are now respected + * Iframe "flashing" when displaying pertinance fixed + * Iframes hide when click anywhere outsite Iframe + * List generated in Iframe are now ordered + * Exportation now exports with column names + =09 + * Other + * Updated Import proyect which is a stand alone executable which impor= ts flat files to the database + * Install instruction in spanish for windows.=09 + =09 + Full details at http://devel.humano2.org/trac/report/11 +=20 + =3D=3D 5.0.beta5 - 2005-06-03 Revision: 1288 =3D=3D =20 * Databases |
|
From: <sv...@de...> - 2005-06-17 23:45:29
|
Author: marcelo
Date: 2005-06-17 19:45:30 -0400 (Fri, 17 Jun 2005)
New Revision: 1354
Modified:
humano2/trunk/apps/import/Humano2.Apps.Import.csproj
humano2/trunk/components/viewTools/Humano2.Components.ViewTools.csproj
humano2/trunk/config/config.xml.tmpl
humano2/trunk/web/portal/site/viewpertinencelist.aspx
Log:
FIXED: gave fixed width to pertinence drop down in Firefox
UPDATED: project to exclude files
UPDATE: config.xml.tmpl to include example of MsSQl driver
Modified: humano2/trunk/apps/import/Humano2.Apps.Import.csproj
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/apps/import/Humano2.Apps.Import.csproj 2005-06-17 22:25=
:04 UTC (rev 1353)
+++ humano2/trunk/apps/import/Humano2.Apps.Import.csproj 2005-06-17 23:45=
:30 UTC (rev 1354)
@@ -89,6 +89,10 @@
<Files>
<Include>
<File
+ RelPath =3D "app.config"
+ BuildAction =3D "None"
+ />
+ <File
RelPath =3D "App.ico"
BuildAction =3D "Content"
/>
Modified: humano2/trunk/components/viewTools/Humano2.Components.ViewTools=
.csproj
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/components/viewTools/Humano2.Components.ViewTools.cspro=
j 2005-06-17 22:25:04 UTC (rev 1353)
+++ humano2/trunk/components/viewTools/Humano2.Components.ViewTools.cspro=
j 2005-06-17 23:45:30 UTC (rev 1354)
@@ -133,11 +133,6 @@
SubType =3D "Code"
BuildAction =3D "Compile"
/>
- <File
- RelPath =3D "Vista.cs"
- SubType =3D "Code"
- BuildAction =3D "Compile"
- />
</Include>
</Files>
</CSHARP>
Modified: humano2/trunk/config/config.xml.tmpl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/config/config.xml.tmpl 2005-06-17 22:25:04 UTC (rev 135=
3)
+++ humano2/trunk/config/config.xml.tmpl 2005-06-17 23:45:30 UTC (rev 135=
4)
@@ -2,7 +2,7 @@
<!DOCTYPE h2config>
<config>
<database>
- <driver>Humano2.Core.Db.Pgsql.dll</driver> <!-- Name of the driv=
er DLL file -->
+ <driver>Humano2.Core.Db.Pgsql.dll</driver> <!-- Name of the driv=
er DLL file, EN CASO DE MsSQL SERVER REMPLAZAR POR Humano2.Core.Db.Pgsql.=
dll-->
<host>127.0.0.1</host> <!-- IP of the database server (127.0.0=
.1 is the same as the webserver -->
<name>h2_solution</name> <!-- name of the database -->
<user>h2_dbase</user> <!-- name of the database user that the=
system uses to access the database -->
@@ -12,7 +12,7 @@
<basedir>C:\h2_install</basedir> <!-- The base directory where the Hum=
ano2 files are located. -->
<dbdrivers>bin</dbdrivers> <!-- Where is the database driver dir=
ecotory -->
<session>h2_sessions</session> <!-- Directory where are t=
he session xml files stored -->
- <webbase>http://localhost:8080</webbase> <!-- what's the base lo=
cation where the humano2 installation lives? -->=20
+ <webbase>http://localhost</webbase> <!-- what's the base locatio=
n where the humano2 installation lives? -->=20
<clientPath>upload</clientPath> <!-- Where the user will store h=
is files, and where other files related to him will remain -->
</locations>
<log>
Modified: humano2/trunk/web/portal/site/viewpertinencelist.aspx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/viewpertinencelist.aspx 2005-06-17 22:2=
5:04 UTC (rev 1353)
+++ humano2/trunk/web/portal/site/viewpertinencelist.aspx 2005-06-17 23:4=
5:30 UTC (rev 1354)
@@ -46,8 +46,8 @@
</script>
</HEAD>
<body leftMargin=3D"0" topMargin=3D"0" marginheight=3D"0" marginwidth=3D=
"0">
- <form id=3D"Form1" method=3D"post" runat=3D"server">
- <asp:listbox id=3D"ListBox1" runat=3D"server" Width=3D"192px" Height=3D=
"168px"></asp:listbox>
+ <form id=3D"Form1" method=3D"post" runat=3D"server"> <!-- FIXME: // Wi=
dth and height to be read from attributes -->
+ <asp:listbox id=3D"ListBox1" runat=3D"server" style=3D"height:168px;w=
idth:192px;"></asp:listbox>
</form>
</body>
</HTML>
|
|
From: <sv...@de...> - 2005-06-17 22:25:04
|
Author: pcamacho
Date: 2005-06-17 18:25:04 -0400 (Fri, 17 Jun 2005)
New Revision: 1353
Modified:
humano2/trunk/core/db/absComplex.cs
humano2/trunk/core/db/mssql/mssqlComplex.cs
humano2/trunk/core/db/pgsql/pgsqlComplex.cs
humano2/trunk/web/portal/site/showView.aspx.cs
Log:
FIX: patch for showview to display the columns of type pertinence like th=
is attFrom.attTo . This is due to a bug in=20
viewtools.
Modified: humano2/trunk/core/db/absComplex.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/core/db/absComplex.cs 2005-06-17 20:50:45 UTC (rev 1352=
)
+++ humano2/trunk/core/db/absComplex.cs 2005-06-17 22:25:04 UTC (rev 1353=
)
@@ -373,16 +373,26 @@
abstract public string [] GetParamsView(int id);
=20
/// <summary>
- /// Get the params (where, orderby etc...) of a report
+ /// Get the params (where, orderby etc...) of a report
/// </summary>
/// <param name=3D"id">id of report</param>
/// <returns>params of the report</returns>
abstract public string [] GetParamsReport(int id);
=20
+ ///<summary>
+ /// Get the user name of an attribute
+ ///</summary>
+ abstract public string GetUserAttName(int idAtt);
=20
///<summary>
+ /// Get the sys name of an attribute
+ ///</summary>
+ abstract public string GetSysAttName(int idAtt);
+ =20
+ =20
+ ///<summary>
/// Returns the name of the basic attribute (numeric, textline..=
.) father of an attribute passed in param =20
- ///</summary>
+ ///</summary>
/// <param name=3D"classId">The classId of an attribute</param>
/// <returns>the sys name of basic attribute</returns>
=20
Modified: humano2/trunk/core/db/mssql/mssqlComplex.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/core/db/mssql/mssqlComplex.cs 2005-06-17 20:50:45 UTC (=
rev 1352)
+++ humano2/trunk/core/db/mssql/mssqlComplex.cs 2005-06-17 22:25:04 UTC (=
rev 1353)
@@ -1175,6 +1175,39 @@
}
return res;
}
+ =20
+ =20
+ override public string GetUserAttName(int idAtt)
+ {
+ string req =3D "select \"attName\" from attribute where \"id=
_entity\" =3D '" + idAtt +"'";
+ string res =3D "";
+ DataTable dt =3D doSelect(req);
+ try
+ {
+ res =3D Convert.ToString(dt.Rows[0]["attName"]);
+ }
+ catch
+ {
+ Logger.Log("Problem trying to get the user name of att "=
+ idAtt, LogLevel.Trace);
+ }
+ return res;
+ }
+ =20
+ override public string GetSysAttName(int idAtt)
+ {
+ string req =3D "select \"sysAttName\" from attribute where \=
"id_entity\" =3D '" + idAtt +"'";
+ string res =3D "";
+ DataTable dt =3D doSelect(req);
+ try
+ {
+ res =3D Convert.ToString(dt.Rows[0]["sysAttName"]);
+ }
+ catch
+ {
+ Logger.Log("Problem trying to get the sys name of att " =
+ idAtt, LogLevel.Trace);
+ }
+ return res;
+ }
=20
override public string GetBasicAttributeSysName(int classId)
{
Modified: humano2/trunk/core/db/pgsql/pgsqlComplex.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/core/db/pgsql/pgsqlComplex.cs 2005-06-17 20:50:45 UTC (=
rev 1352)
+++ humano2/trunk/core/db/pgsql/pgsqlComplex.cs 2005-06-17 22:25:04 UTC (=
rev 1353)
@@ -658,7 +658,7 @@
return convertAttrib(idEntity, names, "attName", "sysAttName");
}
=20
- ///<summary>Converts the 'sysAttName' to the 'attName' o=
f a class</summary>
+ ///<summary>Converts the 'sysAttName' to the 'attName' of a clas=
s</summary>
override public string[] convertAttribSysNameToName(int idEntity, stri=
ng[] names)
{
return convertAttrib(idEntity, names, "sysAttName", "attName");
@@ -935,7 +935,7 @@
}
=20
/// <summary>
- /// Converts a system attribute name into a user attribute name
+ /// Converts a system attribute name into a user attribute name
/// </summary>
/// <param name=3D"sysAttName">system name for attribute </param=
>
/// <returns>user attribute name</returns>
@@ -955,8 +955,40 @@
return res;
}
=20
+ override public string GetUserAttName(int idAtt)
+ {
+ string req =3D "select \"attName\" from attribute where \"id=
_entity\" =3D '" + idAtt +"'";
+ string res =3D "";
+ DataTable dt =3D doSelect(req);
+ try
+ {
+ res =3D Convert.ToString(dt.Rows[0]["attName"]);
+ }
+ catch
+ {
+ Logger.Log("Problem trying to get the user name of att "=
+ idAtt, LogLevel.Trace);
+ }
+ return res;
+ }
+ =20
+ override public string GetSysAttName(int idAtt)
+ {
+ string req =3D "select \"sysAttName\" from attribute where \=
"id_entity\" =3D '" + idAtt +"'";
+ string res =3D "";
+ DataTable dt =3D doSelect(req);
+ try
+ {
+ res =3D Convert.ToString(dt.Rows[0]["sysAttName"]);
+ }
+ catch
+ {
+ Logger.Log("Problem trying to get the sys name of att " =
+ idAtt, LogLevel.Trace);
+ }
+ return res;
+ }
+ =20
/// <summary>
- /// Tells if an attribute is primary=20
+ /// Tells if an attribute is primary=20
/// </summary>
/// <param name=3D"sysAttName">system name for attribute </param=
>
/// <returns>true if attribute is primary</returns>
Modified: humano2/trunk/web/portal/site/showView.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/showView.aspx.cs 2005-06-17 20:50:45 UT=
C (rev 1352)
+++ humano2/trunk/web/portal/site/showView.aspx.cs 2005-06-17 22:25:04 UT=
C (rev 1353)
@@ -129,6 +129,7 @@
Logger.Log("Before ExecViewFromDataTabe. iniClass=3D " + Con=
vert.ToString(iniClass),LogLevel.Trace);
=20
DataTable viewRes =3D dbAdapter.ExecViewFromDataTable(iniCla=
ss, viewTable, idEntity, orderArr, currPage, 1);
+ viewRes =3D bigPatchForViewTools(viewRes,viewTable,iniClass,=
idEntity); //Only a big patch, see comment of the function....
=20
int pageCount=3D dbAdapter.NumberOfPagesInPagedView;
if (pageCount > 1)
@@ -146,6 +147,7 @@
foreach(DataRow row in viewRes.Rows)=20
{
row["instanceUrl"] =3D Html.genAbsoluteUrl("/portal/site=
/instance.aspx?id_entity=3D" + row[0]);
+ Logger.Log("instanceUrl=3D " + row["instanceUrl"],LogLev=
el.Trace);
}
=20
xmlString =3D "<instances>";
@@ -190,7 +192,7 @@
xmlSearch +=3D "</searchFields>";
xmlString +=3D xmlSearch;
xmlString +=3D "</instances>";
- =20
+ Logger.Log("idEntity:" + idEntity,LogLevel.Trace);
=20
//Add the header
xmlString =3D "<?xml version=3D\"1.0\" encoding=3D\"UTF-8\=
"?>"
@@ -205,7 +207,7 @@
DataTable dtParam =3D this.makeDataTableInViewTools();
DataRow dr =3D dtParam.NewRow();
=20
- dr["columna"] =3D getAttributeListForClass(iniClass);
+ dr["columns"] =3D getAttributeListForClass(iniClass);
//Logger.Log("search: list of attributes =3D " + dr["columna"],LogLev=
el.Trace);
=20
//Explicacion de los filtros...
@@ -276,11 +278,12 @@
}
return filter;
}
+ =20
private DataTable makeDataTableInViewTools()
{
DataTable dt1 =3D new DataTable();
DataColumn dc1;
- dc1 =3D new DataColumn("columna",typeof(string));
+ dc1 =3D new DataColumn("columns",typeof(string));
dt1.Columns.Add(dc1);
dc1 =3D new DataColumn("filtros",typeof(string));
dt1.Columns.Add(dc1);
@@ -325,10 +328,10 @@
continue; =20
}
xmlString +=3D"<attribute>"; =20
- =20
+ =20
//Get the real user column name that corresponds to system column na=
me
- string userColName =3D complex.ConvertSysAttNameToUserAttName(colNam=
e);
- int userColD =3D complex.ConvertSysAttNameToIdAttName(colName);
+ string userColName =3D buildCompleteUserAttName(colName);//complex.C=
onvertSysAttNameToUserAttName(colName);
+ string userColD =3D colName; //complex.ConvertSysAttNameToIdAttName(=
colName);
=20
xmlString +=3D "<value>"
+ userColName
@@ -344,19 +347,22 @@
private string xml_getContentTable(DataTable viewRes, int idEntity,str=
ing IdRead,absComplex complex)
{
string xmlString =3D "";
-
+ Logger.Log("xml_getContentTable",LogLevel.Trace);
foreach(DataRow row in viewRes.Rows)
{
xmlString +=3D "<instance>";
foreach( DataColumn col in row.Table.Columns )
{
+ Logger.Log("col.ColumnName: " + col.ColumnName,LogLe=
vel.Trace); =20
+ =20
if(col.ColumnName =3D=3D "instanceUrl") //Computes t=
he url for update and show.
{
string baseUrl =3D row["instanceUrl"] +=20
"&display=3DreadXslt.aspx&iniClass=3D" +=20
- iniClass + "&idView=3D" + idEntity +=20
- "&idView=3D" + idEntity + "&action=3D";
- xmlString +=3D xml_getUrl(baseUrl); =20
+ iniClass + "&idView=3D" + idEntity + "&action=3D";
+ xmlString +=3D xml_getUrl(baseUrl);=20
+ Logger.Log("baseUrl=3D " + baseUrl,LogLevel.Trac=
e);
+ Logger.Log("[[idEntity]]=3D " + idEntity,LogLeve=
l.Trace);
}
else if(col.ColumnName =3D=3D "id_entity")
{=20
@@ -397,12 +403,33 @@
}
private string xml_getEntity(DataRow row,DataColumn col,absComplex com=
plex,string IdRead)
{
- string xmlString =3D "";
+ Logger.Log("xml_getEntity: ", LogLevel.Trace);
+ =20
+ string xmlString =3D "";
xmlString +=3D "<value>"
+ "<text>" + row[col] + "</text>";
//Now check if the attribute is Primary
- xmlString +=3D "<isPrimary>";
- if(complex.IsPrimary(col.ColumnName))
+ string auxcolname =3D col.ColumnName;
+ bool isNumeric =3D!( (auxcolname =3D=3D "id_entity")=20
+ || (auxcolname.StartsWith("id_entity"))=
=20
+ || (auxcolname=3D=3D"row"));
+ string sysAttName=3D"";
+ =20
+ if(isNumeric)
+ {
+ string [] idAttArr =3D auxcolname.Split("^".ToCharArray(=
));
+ Logger.Log("idAttArr[0]:" + idAttArr[0],LogLevel.Trace);
+ sysAttName =3D complex.GetSysAttName(Convert.ToInt32(idA=
ttArr[0]));
+ }
+ else
+ {
+ sysAttName =3D auxcolname;
+ }
+ =20
+ Logger.Log("sysAttName:" + sysAttName,LogLevel.Trace);
+ =20
+ xmlString +=3D "<isPrimary>";
+ if(complex.IsPrimary(sysAttName))
{
xmlString +=3D "true";
}
@@ -414,7 +441,7 @@
xmlString +=3D "<show>0</show>";
xmlString +=3D "<isSelfLookup>";
=20
- if(complex.IsSelfLookUp(col.ColumnName))
+ if(complex.IsSelfLookUp(sysAttName))
{
xmlString +=3D "true";
}
@@ -433,32 +460,65 @@
{
string auxcolname;
string xmlString =3D "";
-
+ =20
auxcolname =3D col.ColumnName;
=20
xmlString +=3D "<value>"
+ "<text>" + row[col] + "</text>";
//Now check if the attribute is Primary
- xmlString +=3D "<isPrimary>";
- if(complex.IsPrimary(col.ColumnName))
- {
- xmlString +=3D "true";
- }
- else
- {
- xmlString +=3D "false";
- }
- xmlString +=3D "</isPrimary>";
=20
- xmlString +=3D "<isSelfLookup>";
- if(complex.IsSelfLookUp(col.ColumnName))
- {
- xmlString +=3D "true";
- }else{
- xmlString +=3D "false";
- }
- xmlString +=3D "</isSelfLookup>";
- =20
+ bool isNumeric =3D!( (auxcolname =3D=3D "id_entity")=20
+ || (auxcolname.StartsWith("id_entity"))=
=20
+ || (auxcolname=3D=3D"row"));
+ string sysAttName=3D"";
+ =20
+ if(isNumeric)
+ {
+ string [] idAttArr =3D auxcolname.Split("^".ToCharArray(=
));
+ Logger.Log("idAttArr[0]:" + idAttArr[0],LogLevel.Trace);
+ //sysAttName =3D complex.GetSysAttName(Convert.ToInt32(i=
dAttArr[0]));
+ //Take the first if there's no destination of the second=
if there's a destination
+ if(idAttArr.Length =3D=3D 2)
+ {
+ sysAttName =3D complex.GetSysAttName(Convert.ToInt32=
(idAttArr[1])); //Take the second part
+ }
+ else
+ {
+ sysAttName =3D complex.GetSysAttName(Convert.ToInt32=
(idAttArr[0]));
+ }
+ }
+ else //Don't change anything
+ {
+ sysAttName =3D auxcolname;
+ }
+ =20
+ xmlString +=3D "<isPrimary>";
+ =20
+ if(complex.IsPrimary(sysAttName))
+ {
+ xmlString +=3D "true";
+ }
+ else
+ {
+ xmlString +=3D "false";
+ }
+
+ xmlString +=3D "</isPrimary>";
+
+ xmlString +=3D "<isSelfLookup>";
+ if(complex.IsSelfLookUp(sysAttName))
+ {
+ Logger.Log("IsSelfLookUp!!",LogLevel.Trace);
+ xmlString +=3D "true";
+ }
+ else
+ {
+ Logger.Log("NOT IsSelfLookUp",LogLevel.Trace);
+ xmlString +=3D "false";
+ }
+ xmlString +=3D "</isSelfLookup>";
+ =20
+ =20
if(auxcolname.StartsWith("id_entity"))
{
xmlString +=3D "<show>0</show>";
@@ -531,5 +591,115 @@
rblSeparador.Visible=3Dfalse;
}
}
- }
+ =20
+ ////////////////////////////////////////////////////////////////=
////////////////////////////////////////// =20
+ ///UGLY PATCH !! FIXME SOON!!! FIXME SOON!!! //////////////////=
////////////////////////////////////////// =20
+ //BECAREFUL: This is only a patch that should be removed once Vi=
ewTools will be repaired: ///
+ // ViewTools can not display two columns that are pertinences to=
the same class. The columns displayed ///
+ // are the same, because Viewtools only take the first pertinenc=
e. In this case we have to get back ///
+ // the column corresponding to the attributes in the parameters =
passed to generate viewtools, and then ///
+ // get the real name of column and the good value to display... =
Well I understand myself Ithink... ///
+ // Hopefully ViewTools will be fixed soon... =
///
+ ////////////////////////////////////////////////////////////////=
//////////////////////////////////////////
+ ///<summary>Takes a datatable generated with viewtools and patch=
es it</summary>
+ ///<param name=3D"viewRes">The datatable generated by viewtools.=
Will be patched</param>
+ ///<param name=3D"viewTable">The parameters passed to viewtools =
(columns, filter, order etc...)</param>
+ ///<returns>The new really good patched datatable :)</returns>
+ private DataTable bigPatchForViewTools(DataTable viewRes, DataTa=
ble viewTable, int iniClass, int idEntity)
+ {
+ DataTable patchedTable =3D new DataTable(); //Will contain=
the good result
+ =20
+ ///builds the array with the columns to display
+ string columns =3D Convert.ToString(viewTable.Rows[0]["colum=
ns"]);
+ string [] columnsList =3D columns.Split(",".ToCharArray());
+ int indexColumns =3D 0; =20
+ Logger.Log("columns: " + columns, LogLevel.Trace);
+ =20
+ //First change the columns
+ foreach(DataColumn col in viewRes.Columns)=20
+ {
+ Logger.Log("indexColumns=3D" + indexColumns,LogLevel.Trace);
+ string colName =3D col.ColumnName;
+ Logger.Log("colName: " + colName,LogLevel.Trace);
+ string newPatchedColName =3D "";
+ =09
+ =20
+ if((colName.StartsWith("id_entity")=20
+ || (colName=3D=3D"id_entity")
+ || (colName=3D=3D"row"))
+ ) //the list of columns passed to viewTools does not=
have the idEntities...
+ {
+ newPatchedColName =3D colName; //Don't change anythi=
ng
+ if(colName=3D=3D"id_entity") //The first column must=
be always 0
+ {
+ indexColumns++; =20
+ }
+ }
+ else
+ {
+ newPatchedColName =3D columnsList[indexColumns]; =
//Put the attId, to be able then to get easily the name
+ indexColumns++;
+ }
+ DataColumn newPatchedCol =3D new DataColumn(newPatchedCo=
lName);
+ patchedTable.Columns.Add(newPatchedCol);
+ }
+ =20
+ //Now change the lines with good values
+ =20
+ for(int i=3D0;i<viewRes.Rows.Count;i++)
+ {
+ DataRow myRow =3D patchedTable.NewRow(); //Create the li=
ne once
+ //Fill the row
+ for(int j =3D 0; j< viewRes.Columns.Count; j++)
+ {
+ myRow[j] =3D Convert.ToString(viewRes.Rows[i][j]);
+ Console.Write(myRow[j] + " ");
+ }
+ patchedTable.Rows.Add(myRow); =20
+ Console.Write("\n");
+ }
+ return patchedTable;
+ } =20
+ =20
+ /*
+ private string buildPertinenceColumn(DataTable viewTable, string=
col, int iniClass, int idEntity)
+ {
+ viewTable["columns"] =3D "0" + col;
+ =20
+ adapter dbAdapter =3D userCred.CoreAdapter;
+ DataTable res =3D dbAdapter.ExecViewFromDataTable(iniClass, =
viewTable, idEntity, "", 0, 1);
+ }
+ */
+ =20
+ /////////////////////////////////////////////////////////////////=
//////////////////////////////////=20
+ ///////////////////////////////////// END OF UGLY PATCH /////////=
//////////////////////////////////
+ /////////////////////////////////////////////////////////////////=
//////////////////////////////////
+ =20
+ ///<summary>
+ //Builds the complete user attribute name, that means. If an att=
ribute is not a pertinence, display=20
+ ///the user att name for att, else returns fromUserAttName.toUse=
rAttName.
+ ///</summary>
+ private string buildCompleteUserAttName(string idAtt)
+ {
+ absCrud crud =3D Factory.Crud();
+ absComplex complex =3D crud.GetCore().Complex;
+ =20
+ string [] fromToAttArr =3D idAtt.Split("^".ToCharArray());
+ string fullUserAttName =3D "";
+ if(fromToAttArr.Length =3D=3D 2)
+ {
+ string fromAtt =3D fromToAttArr[0];
+ string toAtt =3D fromToAttArr[1];
+ string fromUserAttName =3D complex.GetUserAttName(Conver=
t.ToInt32(fromAtt));
+ string toUserAttName =3D complex.GetUserAttName(Convert.=
ToInt32(toAtt)); =20
+ fullUserAttName =3D fromUserAttName + "." + toUserAttNam=
e;
+ }
+ else
+ {
+ fullUserAttName =3D complex.GetUserAttName(Convert.ToInt3=
2(idAtt)); =20
+ }
+ =20
+ return fullUserAttName;
+ }
+ } =20
}
|
|
From: <sv...@de...> - 2005-06-17 21:43:18
|
Author: pcamacho
Date: 2005-06-17 16:50:45 -0400 (Fri, 17 Jun 2005)
New Revision: 1352
Modified:
humano2/trunk/web/builder/site/viewmain.aspx.cs
Log:
FIX: the interface for creation of view was not adding the column 0, whic=
h was inducing a bug in showview.
Modified: humano2/trunk/web/builder/site/viewmain.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-17 19:03:39 U=
TC (rev 1351)
+++ humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-17 20:50:45 U=
TC (rev 1352)
@@ -388,7 +388,7 @@
dr["viewName"] =3D receivedViewName;
=20
//dr["columns"] =3D userCred.CoreAdapter.CheckForPertinence(=
receivedColumnsStr); //If a column is a pertinence, change it
- dr["columns"] =3D receivedColumnsStr; //If a column is a per=
tinence, change it
+ dr["columns"] =3D "0," + receivedColumnsStr; //If a column i=
s a pertinence, change it
//Special case for IN filter
dr["where"] =3D Interface.ParseWhere(receivedWhereStr);=20
=20
|
|
From: <sv...@de...> - 2005-06-17 19:03:39
|
Author: pcamacho
Date: 2005-06-17 15:03:39 -0400 (Fri, 17 Jun 2005)
New Revision: 1351
Modified:
humano2/trunk/components/viewTools/ViewTools.cs
Log:
FIX: a function was missing... Sorry, I did not a make clean before doing=
commit
Modified: humano2/trunk/components/viewTools/ViewTools.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/components/viewTools/ViewTools.cs 2005-06-17 14:10:41 U=
TC (rev 1350)
+++ humano2/trunk/components/viewTools/ViewTools.cs 2005-06-17 19:03:39 U=
TC (rev 1351)
@@ -318,12 +318,10 @@
=09
//try
//{
- =20
int pos =3D var.IndexOf(";");
// string a =3D var.Substring(pos + 1,7);
if(var.IndexOf(" INTO temp")>0)
{
-
string createTable =3D var.Substring(0,pos);
var =3D var.Substring(var.IndexOf(";") + 1,var.Length - var.IndexO=
f(";") - 1);
pos =3D var.IndexOf(";");
@@ -384,8 +382,7 @@
return ds;
}
=20
- /*
- public XmlDocument GetSQLXML(DataTable parametros)
+ public XmlDocument GetSQLXML(DataTable parametros)
{
DataSet ds =3D GetSQLDataSet(parametros);
XmlDocument xml =3D new XmlDocument();
@@ -393,7 +390,6 @@
xml.LoadXml(ds.GetXml());=20
return xml;
}
- */
=20
public string SQLSelect(string param)
{
@@ -1231,7 +1227,8 @@
=20
if(columnIndex !=3D 0)
{
- Col =3D new ViewColumns(columnIndex,Complex.ColumnName(columnIndex)=
);
+ Logger.Log("columnIndex=3D" + columnIndex,LogLevel.Trace);
+ Col =3D new ViewColumns(columnIndex,Complex.ColumnNa=
me(columnIndex));
Col.Type =3D Complex.InstanceType(columnIndex);
}
else
|
|
From: <sv...@de...> - 2005-06-17 14:10:46
|
Author: pcamacho
Date: 2005-06-17 10:10:41 -0400 (Fri, 17 Jun 2005)
New Revision: 1350
Modified:
humano2/trunk/components/viewTools/ViewTools.cs
Log:
DEL: unused functions.
Modified: humano2/trunk/components/viewTools/ViewTools.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/components/viewTools/ViewTools.cs 2005-06-17 13:55:48 U=
TC (rev 1349)
+++ humano2/trunk/components/viewTools/ViewTools.cs 2005-06-17 14:10:41 U=
TC (rev 1350)
@@ -278,32 +278,7 @@
From =3D SQLFrom(strSelect,strWhere);
Where =3D SQLWhere(strWhere);
}
-
- private void ChangeFrom(string strSelect, string strWhere)
- {
- From =3D SQLFrom(strSelect, strWhere);
- }
-
- public void ChangeWhere(string strSelect, string strWhere)
- {
- Where =3D SQLWhere(strWhere);
- From =3D SQLFrom(strSelect, strWhere);
- }
-
- public void ChangeGroupBy(string param)
- {
- GroupBy =3D SQLGroupBy(param);
- }
-
- public void ChangeHaving(string param)
- {
- Having =3D SQLHaving(param);
- }
-
- public void ChangeOrderBy(string param)
- {
- OrderBy =3D SQLOrderBy(param);
- }
+ =20
public string GetSQLString(DataTable parametros)
{
return ParseQuery(parametros);
@@ -399,6 +374,7 @@
return res;
}
=20
+ =20
public DataSet GetSQLDataSet(DataTable parametros)
{
DataTable res =3D GetSQLDataTable(parametros);
@@ -407,7 +383,8 @@
ds.Tables.Add(res);
return ds;
}
-
+ =20
+ /*
public XmlDocument GetSQLXML(DataTable parametros)
{
DataSet ds =3D GetSQLDataSet(parametros);
@@ -416,7 +393,8 @@
xml.LoadXml(ds.GetXml());=20
return xml;
}
- =09
+ */
+ =20
public string SQLSelect(string param)
{
ViewTable[] affectedTables;
@@ -472,8 +450,8 @@
string tableName =3D "";
if(Page !=3D 0)
{
- Query.Append(Complex.BuildTempTable(ref tableName));
- TempTable =3D tableName;
+ Query.Append(Complex.BuildTempTable(ref tableName));
+ TempTable =3D tableName;
}
=09
Query.Append("SELECT ");
|
|
From: <sv...@de...> - 2005-06-17 13:55:45
|
Author: pcamacho Date: 2005-06-17 09:55:48 -0400 (Fri, 17 Jun 2005) New Revision: 1349 Removed: humano2/trunk/components/viewTools/Vista.cs Log: DEL: unuseful file. Please Marcelo, update the .sln file , thx! Deleted: humano2/trunk/components/viewTools/Vista.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/components/viewTools/Vista.cs 2005-06-17 05:23:04 UTC (= rev 1348) +++ humano2/trunk/components/viewTools/Vista.cs 2005-06-17 13:55:48 UTC (= rev 1349) @@ -1,182 +0,0 @@ -// -// The Humano2 Business solution. -// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com) -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// $Id$ -// - -using System; -using System.Data; -using System.Collections; - -using Humano2.Core.Db; - -namespace Humano2.Components.ViewTools -{ - -/// <summary> - /// Summary description for Vista. - /// </summary> - public class Vista - { - int _classId; - string _className; - string _columns; - string _filters; - string _ordering; - string _grouping; - string _functions; - - #region "CONSTRUCTORES" - public Vista() - { - } - - public Vista(int intClassId, string strClassName, string strColumns, s= tring strFilters, - string strOrdering, string strGrouping, string strFunctions) - { - this._grouping =3D strGrouping; - this._columns =3D strColumns; - this._filters =3D strFilters; - this._functions =3D strFunctions; - this._classId =3D intClassId; - this._className =3D strClassName; - this._ordering =3D strOrdering; - } - #endregion - - #region "PROPIEDADES" - public int IdClase - { - get - { - return this._classId; - } - set - { - this._classId =3D value; - } - } - - public string NombreClase - { - get - { - return this._className; - } - set - { - this._className =3D value; - } - } - - public string GroupBy - { - get - { - return this._grouping; - } - set - { - this._grouping =3D value; - } - } - - public string Columns - { - get - { - return this._columns; - } - set - { - this._columns =3D value; - } - } - - public string WhereFilters - { - get - { - return this._filters; - } - set - { - this._filters =3D value; - } - } - - public string HavingFilters - { - get - { - return this._functions; - } - set - { - this._functions =3D value; - } - } - - public string OrderBy - { - get - { - return this._ordering; - } - set - { - this._ordering =3D value; - } - } - #endregion - - #region "METODOS" - public DataTable GetDataTable(int TablaActual) - { - DataTable table =3D new DataTable(); - DataColumn Column; - ArrayList row =3D new ArrayList(); - //string[] fila =3D {"28^26,28,28^26|1","28^26^20|5|'29'"}; - - ViewTools vt; - =09 - Column =3D new DataColumn("Columns",typeof(string)); - table.Columns.Add(Column); - Column =3D new DataColumn("Where",typeof(string)); - table.Columns.Add(Column); - Column =3D new DataColumn("GroupBy",typeof(string)); - table.Columns.Add(Column); - Column =3D new DataColumn("Havings",typeof(string)); - table.Columns.Add(Column); - Column =3D new DataColumn("OrderBy",typeof(string)); - table.Columns.Add(Column); - - row.Add(Columns); - row.Add(WhereFilters); - row.Add(GroupBy); - row.Add(HavingFilters); - row.Add(OrderBy); - - table.Rows.Add((string[])row.ToArray(typeof(string))); - - vt =3D new ViewTools(); - vt.IdClass =3D TablaActual; - absCrud crud =3D Factory.Crud(); - Humano2.Core.Db.absComplex complex =3D crud.GetCore().Complex; - vt.Complex =3D complex; - return vt.GetSQLDataTable(table); - } - #endregion - } - - public class ViewException: System.Exception { - public ViewException(string msg) : base(msg) {} - } - -} |
|
From: <sv...@de...> - 2005-06-17 03:12:08
|
Author: marcelo
Date: 2005-06-16 23:12:11 -0400 (Thu, 16 Jun 2005)
New Revision: 1342
Modified:
humano2/trunk/components/webTools/Humano2.Components.WebTools.csproj
humano2/trunk/web/portal/site/instance.aspx.cs
Log:
FIXED: call to OrderAttributesInDataStructure to include baseUrl()
Modified: humano2/trunk/components/webTools/Humano2.Components.WebTools.c=
sproj
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/components/webTools/Humano2.Components.WebTools.csproj =
2005-06-17 02:26:13 UTC (rev 1341)
+++ humano2/trunk/components/webTools/Humano2.Components.WebTools.csproj =
2005-06-17 03:12:11 UTC (rev 1342)
@@ -134,6 +134,11 @@
BuildAction =3D "Compile"
/>
<File
+ RelPath =3D "interfacetools.cs"
+ SubType =3D "Code"
+ BuildAction =3D "Compile"
+ />
+ <File
RelPath =3D "privileges.cs"
SubType =3D "Code"
BuildAction =3D "Compile"
Modified: humano2/trunk/web/portal/site/instance.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/instance.aspx.cs 2005-06-17 02:26:13 UT=
C (rev 1341)
+++ humano2/trunk/web/portal/site/instance.aspx.cs 2005-06-17 03:12:11 UT=
C (rev 1342)
@@ -173,7 +173,7 @@
string structure =3D dbAdapter.ReadStructureAndXsls1(idEntit=
y,xslInclude,listAtt); //AQUI
Logger.Log("structure(before)=3D" + structure,LogLevel.Trac=
e);
//Reorder the attributes as they appear in the selected orde=
r (form)
- structure =3D Humano2.Components.WebTools.Xml.OrderAttribute=
sInDataStructure(structure, listAtt, "portal/site/xsl/orderattributes.xsl=
");
+ structure =3D Humano2.Components.WebTools.Xml.OrderAttribute=
sInDataStructure(structure, listAtt, baseUrl() +"xsl/orderattributes.xsl"=
);
Logger.Log("structure(after)=3D" + structure,LogLevel.Trace=
);
//SVERA string structure =3D dbAdapter.ReadStructureAndXsls1=
(idEntity,xslInclude,formAttribute);
//Construction of the XML string
|
|
From: <sv...@de...> - 2005-06-17 02:26:14
|
Author: marcelo Date: 2005-06-16 22:26:13 -0400 (Thu, 16 Jun 2005) New Revision: 1341 Modified: humano2/trunk/apps/import/ProcessDir.cs humano2/trunk/components/import/Import.cs Log: * Finished import process Modified: humano2/trunk/apps/import/ProcessDir.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/apps/import/ProcessDir.cs 2005-06-16 22:09:15 UTC (rev = 1340) +++ humano2/trunk/apps/import/ProcessDir.cs 2005-06-17 02:26:13 UTC (rev = 1341) @@ -1,6 +1,8 @@ using System; using System.IO; using Humano2.Components.Import; +using System.Configuration; +using System.Collections.Specialized; =20 namespace Humano2.Apps.Import { @@ -16,8 +18,9 @@ static void Main() { //string baseDir =3D Environment.CurrentDirectory + "import\\toBeProc= esed\\"; - string baseDir =3D @"D:\Proyect 5X\web\portal\site\import\toBeProcese= d\"; + string baseDir =3D @"D:\H250-Trunk\upload\import\toBeProcesed\"; =09 + string sAttr =3D ConfigurationSettings.AppSettings["configFile"]; =20 DirectoryInfo di =3D new DirectoryInfo(baseDir); FileInfo[] fi =3D di.GetFiles(); Modified: humano2/trunk/components/import/Import.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/components/import/Import.cs 2005-06-16 22:09:15 UTC (re= v 1340) +++ humano2/trunk/components/import/Import.cs 2005-06-17 02:26:13 UTC (re= v 1341) @@ -314,11 +314,11 @@ } } =20 - pertRow =3D dsAtts.Tables["boolean"].Select("id_entity =3D" + attsA= rr[i,2]); - if (pertRow.Length > 0 ) - { + //pertRow =3D dsAtts.Tables["boolean"].Select("id_entity =3D" + att= sArr[i,2]); + //if (pertRow.Length > 0 ) + //{ =20 - } + //} =09 } } |
|
From: <sv...@de...> - 2005-06-16 22:09:15
|
Author: pcamacho
Date: 2005-06-16 18:09:15 -0400 (Thu, 16 Jun 2005)
New Revision: 1340
Modified:
humano2/trunk/web/builder/site/createreport.aspx.cs
humano2/trunk/web/builder/site/js/createinterfacetools.js
humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphicallist.j=
s
humano2/trunk/web/builder/site/xsl/createview.xsl
Log:
FIX: in creation of view/report the columns when updating were not displa=
yed according to user's order.
Modified: humano2/trunk/web/builder/site/createreport.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-16 21:18:=
20 UTC (rev 1339)
+++ humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-16 22:09:=
15 UTC (rev 1340)
@@ -69,8 +69,7 @@
}
=20
override protected string createXml()
- {
- =20
+ {=20
DataTable currReport =3D null;
Logger.Log("ReportMain: reportId =3D " + Convert.ToString(re=
portId),LogLevel.Trace);
if(reportId !=3D 0)
Modified: humano2/trunk/web/builder/site/js/createinterfacetools.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/createinterfacetools.js 2005-06-16 =
21:18:20 UTC (rev 1339)
+++ humano2/trunk/web/builder/site/js/createinterfacetools.js 2005-06-16 =
22:09:15 UTC (rev 1340)
@@ -63,41 +63,44 @@
*/
function BuildPreselectedColumns(attribsArr,selectedColumnsArr)
{
- var j=3D0;
var i=3D0;
var leftAttribsArr =3D new Array();=20
var rightAttribsArr =3D new Array();
- //alert("size: " + sizeAttribsArr);
+ =20
+ //The left array first
for(i=3D0;i<sizeAttribsArr;i++)
{
var idAtt =3D attribsArr[i].GetValue();
- =20
if(IsInArray(idAtt,selectedColumnsArr) =3D=3D true)
{
- //The left array
var element =3D new ListElement( attribsArr[i].GetName(),
attribsArr[i].GetValue(),
true);
- leftAttribsArr[i] =3D element; =20
- //The right array: the element
- //alert(attribsArr[i].GetName());
- var element =3D new ListElement( attribsArr[i].GetName(),
- attribsArr[i].GetValue(),
- false);
- rightAttribsArr[j++] =3D element; =20
+ =20
}
else
{
- //The left array
- //alert(attribsArr[i].GetName());
var element =3D new ListElement( attribsArr[i].GetName(),
attribsArr[i].GetValue(),
false);
- leftAttribsArr[i] =3D element; =20
- //The right array: nothing=20
}
+ leftAttribsArr[i] =3D element; =20
}
=20
+ //Now the right (has to be done "alone" to keep the order of columns
+ var sizeSelectedColumnsArr =3D selectedColumnsArr.length;
+ var j=3D0;
+ for(i=3D0;i<sizeSelectedColumnsArr;i++)
+ {
+ var idAtt =3D selectedColumnsArr[i];
+ if(idAtt!=3D0) //Report case: the id with 0 is always in tab
+ {
+ var element =3D LookForItem(idAtt,attribsArr);
+ rightAttribsArr[j++] =3D element;=20
+ }
+ //alert(element.GetName());
+ }
+ =20
var res =3D new Array();
res["left"] =3D leftAttribsArr;
res["right"] =3D rightAttribsArr;
@@ -105,6 +108,33 @@
return res;
}
=20
+
+/**
+ * Looks for the first element in an array of ListElement with a specifi=
ed value
+ * @param idAtt the value to find the item
+ * @param attribArr the array of ListItem
+ * @return the item if found, null else.
+ */
+function LookForItem(idAtt,attribsArr)
+{
+ var element; =20
+ var size =3D attribsArr.length;
+ var i=3D0;
+ for(i=3D0;i<size;i++)
+ {
+ var item =3D attribsArr[i];
+ //alert("itemValue =3D" + item.GetValue() + "\n" + "idAtt=3D" + =
idAtt);
+ if(item.GetValue() =3D=3D idAtt) =20
+ {
+ var element =3D new ListElement( item.GetName(),
+ item.GetValue(),
+ false); =20
+ return element;
+ }
+ }
+ return null;
+}
+
function OperatorsGetSelectArray()
{
var optionArray =3D new Array();
Modified: humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphica=
llist.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphicallist.=
js 2005-06-16 21:18:20 UTC (rev 1339)
+++ humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphicallist.=
js 2005-06-16 22:09:15 UTC (rev 1340)
@@ -184,17 +184,17 @@
innerHtml +=3D "<select size=3D\"10\" style=3D\"width:220px;\" clas=
s=3D\"drpdwn2\">";
for(var i=3D0; i<sizeList;i++)
{
- //alert(this.fSortedList.GetItem(i).GetName());
- var displayName =3D this.fSortedList.GetItem(i).GetName();
- var value =3D this.fSortedList.GetItem(i).GetValue();
- var disabled =3D this.fSortedList.GetItem(i).GetDisabled();
- =20
- var displayOption =3D "";
- if (disabled =3D=3D true)
- {
- displayOption =3D "style=3D\"color:gray;\"";
- }
- innerHtml +=3D "<option value=3D\"" + value + "\" " + displa=
yOption + ">" + displayName + "</option>";
+ //alert(this.fSortedList.GetItem(i).GetName());
+ var displayName =3D this.fSortedList.GetItem(i).GetName();
+ var value =3D this.fSortedList.GetItem(i).GetValue();
+ var disabled =3D this.fSortedList.GetItem(i).GetDisabled();
+ =20
+ var displayOption =3D "";
+ if (disabled =3D=3D true)
+ {
+ displayOption =3D "style=3D\"color:gray;\"";
+ }
+ innerHtml +=3D "<option value=3D\"" + value + "\" " + displayOpt=
ion + ">" + displayName + "</option>";
}
innerHtml +=3D"</select>";
this.listBoxElement.innerHTML =3D innerHtml;
Modified: humano2/trunk/web/builder/site/xsl/createview.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-16 21:18:20=
UTC (rev 1339)
+++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-16 22:09:15=
UTC (rev 1340)
@@ -467,9 +467,6 @@
}
var Form =3D new Form(<xsl:value-of select=3D=
"/view/viewDatas/classId" />,"VIEW", infosToSubmit);
</xsl:if>
- <xsl:if test=3D"/view/viewDatas/classId!=3D''">
- var Form =3D new Form(<xsl:value-of select=3D=
"/view/viewDatas/classId" />,"VIEW");
- </xsl:if>
</script>
</form>
</body>
|
|
From: <sv...@de...> - 2005-06-16 21:18:19
|
Author: pcamacho
Date: 2005-06-16 17:18:20 -0400 (Thu, 16 Jun 2005)
New Revision: 1339
Modified:
humano2/trunk/components/webTools/interfacetools.cs
humano2/trunk/web/builder/site/createreport.aspx.cs
humano2/trunk/web/builder/site/viewmain.aspx.cs
Log:
CHANGE: factorisation again between viewmain and createreport... Still re=
mains things to simplify!
Modified: humano2/trunk/components/webTools/interfacetools.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/components/webTools/interfacetools.cs 2005-06-16 20:20:=
35 UTC (rev 1338)
+++ humano2/trunk/components/webTools/interfacetools.cs 2005-06-16 21:18:=
20 UTC (rev 1339)
@@ -247,5 +247,97 @@
string res =3D columns[1] + "|0";=20
return res; =20
}
+ =20
+ ///<summary>
+ ///Get the attributes of a class
+ ///<param name=3D"classId">The id of class</param>
+ ///<param name=3D"userCred">Session object of user</param>
+ ///<return>A xml string with the list of attributes for a class<=
/returns>
+ ///</summary>
+ public static string GetXmlAttribListForClass(int classId,SessionCrede=
ncial userCred)=20
+ {
+ string salida=3D"";
+ int attlogin =3D 0;
+ int idatt =3D 0;
+ DataTable dtpert;
+ DataTable dtrel;
+ int idClassRel =3D 0;
+ string className =3D "";
+
+ DataTable dt =3D userCred.CoreAdapter.GetAttributesFromClass(classId)=
;
+
+ adapter dbAdapter =3D new adapter();
+ className =3D dbAdapter.GetClassNameById(classId);
+ //className =3D dt.Rows[0]["name"].ToString();
+
+ salida +=3D "<class>";
+ salida +=3D "<id>" + classId + "</id>";
+ salida +=3D "<name>" + className + "</name>";
+ salida +=3D "<attributes>";
+ =09
+ foreach(DataRow row in dt.Rows)=20
+ {
+ string attName =3D Convert.ToString(row["attName"]);
+ string attType =3D Convert.ToString(row["attType"]);
+ if(attType=3D=3D"pertinence")
+ {
+ idatt =3D Convert.ToInt32(row["id_entity"]);
+ dtpert =3D userCred.CoreAdapter.GetClassesFromPertinence(idatt);
+ DataRow dr2 =3D dtpert.Rows[0];
+ idClassRel =3D Convert.ToInt32(dr2["to"].ToString());
+ =09
+ //For each attribute of pertinence put the id with t=
ogo and=20
+ // the pertname.attname
+ int [] listAttId =3D GetAttributeIdListForClass(idCl=
assRel,userCred);
+ string [] listAttName =3D getAttributeNameListForCla=
ss(idClassRel,userCred);
+ int size =3D listAttId.Length;
+ for(int i=3D0;i<size;i++)
+ {
+ attlogin =3D listAttId[i];
+ salida +=3D "<attribute>";
+ salida +=3D "<id>" + idatt + "^" + attlogin + "<=
/id>";
+ salida +=3D "<name>" + attName + "." + listAttN=
ame[i]+ "</name>";
+ salida +=3D "</attribute>";
+ }
+ }
+ else
+ {
+ salida +=3D "<attribute>";
+ salida +=3D "<id>" + row["id_entity"].ToString() + "</id>";
+ salida +=3D "<name>" + attName + "</name>";
+ salida +=3D "</attribute>";
+ }
+ }
+ salida +=3D "</attributes>";
+ salida +=3D "</class>";
+ =20
+ return salida;
+ }
+ =20
+ ///<summary> The list of all attributes id for a class</summary>
+ public static int[] GetAttributeIdListForClass(int classId, Sess=
ionCredencial userCred)
+ {
+ DataTable res =3D userCred.CoreAdapter.GetAttributesFromClas=
s(classId);
+ int [] idArr =3D new int[res.Rows.Count];
+ int i=3D0;
+ foreach(DataRow row in res.Rows)
+ {
+ idArr[i++] =3D Convert.ToInt32(row["id_entity"]);
+ }
+ return idArr;
+ }
+ =20
+ ///<summary> The list of all attributes name for a class </summa=
ry>
+ private static string[] getAttributeNameListForClass(int classId=
,SessionCredencial userCred)
+ {
+ DataTable res =3D userCred.CoreAdapter.GetAttributesFromClas=
s(classId);
+ string [] nameArr =3D new string[res.Rows.Count];
+ int i=3D0;
+ foreach(DataRow row in res.Rows)
+ {
+ nameArr[i++] =3D Convert.ToString(row["attName"]);
+ }
+ return nameArr;
+ }
}
}
Modified: humano2/trunk/web/builder/site/createreport.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-16 20:20:=
35 UTC (rev 1338)
+++ humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-16 21:18:=
20 UTC (rev 1339)
@@ -130,7 +130,7 @@
//relacionadas...
if(Convert.ToInt32(classId) > 0)
{
- strXml +=3D getXmlAttribListForClass(Convert.ToInt32(cla=
ssId));
+ strXml +=3D Interface.GetXmlAttribListForClass(Convert.T=
oInt32(classId),userCred);
}
strXml +=3D Interface.GetClassListForUser(userCred=
);
strXml +=3D "</classes>";
@@ -167,7 +167,6 @@
return res;
}
=20
- =20
private string getReportPersoColumnsXml(string columns)
{
string [] allColumns =3D columns.Split(new char[] {','});
@@ -346,7 +345,7 @@
=09
//For each attribute of pertinence put the id with t=
ogo
int attLogin =3D 0;
- int [] listAttId =3D getAttributeIdListForClass(idCl=
assRel);
+ int [] listAttId =3D Interface.GetAttributeIdListFor=
Class(idClassRel,userCred);
int size =3D listAttId.Length;
for(int k=3D0;k<size;k++)
{
@@ -413,8 +412,6 @@
return xmlRes;
}
=20
- =20
- =20
private void deleteReport()
{
Logger.Log("deleteReport called", LogLevel.Trace);
@@ -461,7 +458,6 @@
return dt;
}
=20
- =20
///<summary>
/// The persoCol string comes from the web in this format idAtt0=
|idFunc0;idAtt1|idFunc1; ...
/// It has to be converted to:=20
@@ -545,124 +541,8 @@
sendMessageToUser(UserMessage.UPDATEREPORTOK); //Cha=
nge
}
}=09
- =09
}
-
- ///<summary>
- ///Get the attributes of a class
- ///</summary>
- private string getXmlAttribListForClass(int classId)=20
- {
- string salida=3D"";
- int attlogin =3D 0;
- int idatt =3D 0;
- DataTable dtpert;
- DataTable dtrel;
- int idClassRel =3D 0;
- string className =3D "";
-
- DataTable dt =3D userCred.CoreAdapter.GetAttributesFromClass(classId)=
;
-
- adapter dbAdapter =3D new adapter();
- className =3D dbAdapter.GetClassNameById(classId);
- //className =3D dt.Rows[0]["name"].ToString();
-
- salida +=3D "<class>";
- salida +=3D "<id>" + classId + "</id>";
- salida +=3D "<name>" + className + "</name>";
- salida +=3D "<attributes>";
- =09
- foreach(DataRow row in dt.Rows)=20
- {
- string attName =3D Convert.ToString(row["attName"]);
- string attType =3D Convert.ToString(row["attType"]);
- if(attType=3D=3D"pertinence")
- {
- idatt =3D Convert.ToInt32(row["id_entity"]);
- dtpert =3D userCred.CoreAdapter.GetClassesFromPertinence(idatt);
- DataRow dr2 =3D dtpert.Rows[0];
- idClassRel =3D Convert.ToInt32(dr2["to"].ToString());
- =09
- //For each attribute of pertinence put the id with t=
ogo and=20
- // the pertname.attname
- int [] listAttId =3D getAttributeIdListForClass(idCl=
assRel);
- string [] listAttName =3D getAttributeNameListForCla=
ss(idClassRel);
- int size =3D listAttId.Length;
- for(int i=3D0;i<size;i++)
- {
- attlogin =3D listAttId[i];
- salida +=3D "<attribute>";
- salida +=3D "<id>" + idatt + "^" + attlogin + "<=
/id>";
- salida +=3D "<name>" + attName + "." + listAttN=
ame[i]+ "</name>";
- salida +=3D "</attribute>";
- }
- }
- else
- {
- salida +=3D "<attribute>";
- salida +=3D "<id>" + row["id_entity"].ToString() + "</id>";
- salida +=3D "<name>" + attName + "</name>";
- salida +=3D "</attribute>";
- }
- }
- salida +=3D "</attributes>";
- salida +=3D "</class>";
- =20
- return salida;
- }
- =20
- public int GetAttributePrimary(int idClass)
- {
- int iniClass;
- DataTable dt1;
- adapter dbAdapter =3D userCred.CoreAdapter;
-
- //DataTable dtParam =3D myform.makeDataTableInReportTools();
- DataTable dtParam =3D this.makeDataTableInViewTools();
- DataRow dr =3D dtParam.NewRow();
-
- //clase de los atributos.
- iniClass =3D 5;
-
- dr["columna"] =3D "0";
-
- //Explicacion de los filtros...
- //atributo 67|4|'true' =3D> isPrimary=3D'true'
- //atributo 40|4|idClass =3D> classId=3DidClass
- dr["filtros"] =3D "67|4|'true'|1|0;40|4|'"+idClass+"'|0|0";
-
- dtParam.Rows.Add(dr);
-
- dt1 =3D dbAdapter.GetDataTableView(dtParam, iniClass);
- if(dt1.Rows.Count=3D=3D1)
- {
- return Convert.ToInt32(dt1.Rows[0][0].ToString());
- }
- else
- {
- return -1;
- }
- }
- =20
- private DataTable makeDataTableInViewTools()
- {
- DataTable dt1 =3D new DataTable();
- DataColumn dc1;
- dc1 =3D new DataColumn("columna",typeof(string));
- dt1.Columns.Add(dc1);
- dc1 =3D new DataColumn("filtros",typeof(string));
- dt1.Columns.Add(dc1);
- dc1 =3D new DataColumn("group",typeof(string));
- dt1.Columns.Add(dc1);
- dc1 =3D new DataColumn("having",typeof(string));
- dt1.Columns.Add(dc1);
- dc1 =3D new DataColumn("order",typeof(string));
- dt1.Columns.Add(dc1);
- dc1 =3D new DataColumn("claves",typeof(string));
- dt1.Columns.Add(dc1);
- return dt1;
- }
-
+ =20
private DataTable createReportDataTable()
{
DataTable dt =3D new DataTable();
@@ -675,33 +555,5 @@
dt.Columns.Add("reportName");
return dt;
}
- =20
- =20
- ///<summary> The list of all attributes id for a class</summary>
- private int[] getAttributeIdListForClass(int classId)
- {
- DataTable res =3D userCred.CoreAdapter.GetAttributesFromClas=
s(classId);
- int [] idArr =3D new int[res.Rows.Count];
- int i=3D0;
- foreach(DataRow row in res.Rows)
- {
- idArr[i++] =3D Convert.ToInt32(row["id_entity"]);
- }
- =20
- return idArr;
- }
- =20
- ///<summary> The list of all attributes name for a class </summa=
ry>
- private string[] getAttributeNameListForClass(int classId)
- {
- DataTable res =3D userCred.CoreAdapter.GetAttributesFromClas=
s(classId);
- string [] nameArr =3D new string[res.Rows.Count];
- int i=3D0;
- foreach(DataRow row in res.Rows)
- {
- nameArr[i++] =3D Convert.ToString(row["attName"]);
- }
- return nameArr;
- }
}
}
Modified: humano2/trunk/web/builder/site/viewmain.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-16 20:20:35 U=
TC (rev 1338)
+++ humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-16 21:18:20 U=
TC (rev 1339)
@@ -68,7 +68,6 @@
=20
override protected string createXml()
{
- =20
DataTable currView =3D null;
Logger.Log("ViewMain: viewId =3D " + Convert.ToString(viewId=
),LogLevel.Trace);
if(viewId !=3D 0)
@@ -128,7 +127,7 @@
//relacionadas...
if(Convert.ToInt32(classId) > 0)
{
- strXml +=3D getXmlAttribListForClass(Convert.ToInt32(cla=
ssId));
+ strXml +=3D Interface.GetXmlAttribListForClass(Convert.T=
oInt32(classId),userCred);
}
strXml +=3D Interface.GetClassListForUser(userCred=
);
strXml +=3D "</classes>";
@@ -281,7 +280,7 @@
=09
//For each attribute of pertinence put the id with t=
ogo
int attLogin =3D 0;
- int [] listAttId =3D getAttributeIdListForClass(idCl=
assRel);
+ int [] listAttId =3D Interface.GetAttributeIdListFor=
Class(idClassRel,userCred);
int size =3D listAttId.Length;
for(int k=3D0;k<size;k++)
{
@@ -445,125 +444,9 @@
}
}=09
}
+ =20
+ =09
=20
- // Funcion agregada por negro que solo traera la informacion necesaria=
...
- private string getXmlAttribListForClass(int classId)=20
- {
- string salida=3D"";
- int attlogin =3D 0;
- int idatt =3D 0;
- DataTable dtpert;
- DataTable dtrel;
- int idClassRel =3D 0;
- string className =3D "";
-
- DataTable dt =3D userCred.CoreAdapter.GetAttributesFromClass(classId)=
;
-
- adapter dbAdapter =3D new adapter();
- className =3D dbAdapter.GetClassNameById(classId);
- //className =3D dt.Rows[0]["name"].ToString();
-
- salida +=3D "<class>";
- salida +=3D "<id>" + classId + "</id>";
- salida +=3D "<name>" + className + "</name>";
- salida +=3D "<attributes>";
- =09
- foreach(DataRow row in dt.Rows)=20
- {
- string attName =3D Convert.ToString(row["attName"]);
- string attType =3D Convert.ToString(row["attType"]);
-
- if(attType=3D=3D"pertinence")
- {
- idatt =3D Convert.ToInt32(row["id_entity"]);
- dtpert =3D userCred.CoreAdapter.GetClassesFromPertinence(idatt);
- if (dtpert.Rows.Count > 0 )
- {
- DataRow dr2 =3D dtpert.Rows[0];
- idClassRel =3D Convert.ToInt32(dr2["to"].ToString());
- =09
- //For each attribute of pertinence put the id with togo and=20
- // the pertname.attname
- int [] listAttId =3D getAttributeIdListForClass(idClassRel);
- string [] listAttName =3D getAttributeNameListForClass(idClassRel)=
;
- int size =3D listAttId.Length;
- for(int i=3D0;i<size;i++)
- {
- attlogin =3D listAttId[i];
- salida +=3D "<attribute>";
- salida +=3D "<id>" + idatt + "^" + attlogin + "</id>";
- salida +=3D "<name>" + attName + "." + listAttName[i]+ "</name>"=
;
- salida +=3D "</attribute>";
- }
- }
- }
- else
- {
- salida +=3D "<attribute>";
- salida +=3D "<id>" + row["id_entity"].ToString() + "</id>";
- salida +=3D "<name>" + attName + "</name>";
- salida +=3D "</attribute>";
- }
- }
- salida +=3D "</attributes>";
- salida +=3D "</class>";
-
- return salida;
- }
- =20
- public int GetAttributePrimary(int idClass)
- {
- int iniClass;
- DataTable dt1;
- adapter dbAdapter =3D userCred.CoreAdapter;
-
- //DataTable dtParam =3D myform.makeDataTableInViewTools();
- DataTable dtParam =3D this.makeDataTableInViewTools();
- DataRow dr =3D dtParam.NewRow();
-
- //clase de los atributos.
- iniClass =3D 5;
-
- dr["columna"] =3D "0";
-
-
- //Explicacion de los filtros...
- //atributo 67|4|'true' =3D> isPrimary=3D'true'
- //atributo 40|4|idClass =3D> classId=3DidClass
- dr["filtros"] =3D "67|4|'true'|1|0;40|4|'"+idClass+"'|0|0";
-
- dtParam.Rows.Add(dr);
-
- dt1 =3D dbAdapter.GetDataTableView(dtParam, iniClass);
- if(dt1.Rows.Count=3D=3D1)
- {
- return Convert.ToInt32(dt1.Rows[0][0].ToString());
- }
- else
- {
- return -1;
- }
- }
- =20
- private DataTable makeDataTableInViewTools()
- {
- DataTable dt1 =3D new DataTable();
- DataColumn dc1;
- dc1 =3D new DataColumn("columna",typeof(string));
- dt1.Columns.Add(dc1);
- dc1 =3D new DataColumn("filtros",typeof(string));
- dt1.Columns.Add(dc1);
- dc1 =3D new DataColumn("group",typeof(string));
- dt1.Columns.Add(dc1);
- dc1 =3D new DataColumn("having",typeof(string));
- dt1.Columns.Add(dc1);
- dc1 =3D new DataColumn("order",typeof(string));
- dt1.Columns.Add(dc1);
- dc1 =3D new DataColumn("claves",typeof(string));
- dt1.Columns.Add(dc1);
- return dt1;
- }
-
private DataTable createViewDataTable()
{
DataTable dt =3D new DataTable();
@@ -576,33 +459,5 @@
dt.Columns.Add("viewName");
return dt;
}
- =20
- =20
- ///<summary> The list of all attributes id for a class</summary>
- private int[] getAttributeIdListForClass(int classId)
- {
- DataTable res =3D userCred.CoreAdapter.GetAttributesFromClas=
s(classId);
- int [] idArr =3D new int[res.Rows.Count];
- int i=3D0;
- foreach(DataRow row in res.Rows)
- {
- idArr[i++] =3D Convert.ToInt32(row["id_entity"]);
- }
- =20
- return idArr;
- }
- =20
- ///<summary> The list of all attributes name for a class </summa=
ry>
- private string[] getAttributeNameListForClass(int classId)
- {
- DataTable res =3D userCred.CoreAdapter.GetAttributesFromClas=
s(classId);
- string [] nameArr =3D new string[res.Rows.Count];
- int i=3D0;
- foreach(DataRow row in res.Rows)
- {
- nameArr[i++] =3D Convert.ToString(row["attName"]);
- }
- return nameArr;
- }
}
}
|
|
From: <sv...@de...> - 2005-06-16 20:20:38
|
Author: pcamacho Date: 2005-06-16 16:20:35 -0400 (Thu, 16 Jun 2005) New Revision: 1338 Added: humano2/trunk/components/tests/attributes.xml humano2/trunk/components/tests/xmltools.cs humano2/trunk/web/portal/site/xsl/orderattributes.xsl Modified: humano2/trunk/components/import/Import.cs humano2/trunk/components/webTools/Adapter.cs humano2/trunk/components/webTools/xmltools.cs humano2/trunk/web/portal/site/instance.aspx.cs Log: FIX: bug #205. Use of xsl transformation to reorder the attributes when c= reating instance of form. Modified: humano2/trunk/components/import/Import.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/components/import/Import.cs 2005-06-16 19:11:17 UTC (re= v 1337) +++ humano2/trunk/components/import/Import.cs 2005-06-16 20:20:35 UTC (re= v 1338) @@ -7,7 +7,7 @@ // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// $Id: config.cs 295 2005-02-17 +// $Id$ =20 using System; using System.IO; @@ -315,7 +315,7 @@ } =20 pertRow =3D dsAtts.Tables["boolean"].Select("id_entity =3D" + attsA= rr[i,2]); - if (pertRow.Length > 0 ) + if (pertRow.Length > 0 ) { =20 } Property changes on: humano2/trunk/components/import/Import.cs ___________________________________________________________________ Name: svn:keywords + Id Added: humano2/trunk/components/tests/attributes.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/components/tests/attributes.xml 2005-06-16 19:11:17 UTC= (rev 1337) +++ humano2/trunk/components/tests/attributes.xml 2005-06-16 20:20:35 UTC= (rev 1338) @@ -0,0 +1,125 @@ +<structure> +<entity> + <id_entity>10162</id_entity> + <domainId>10160</domainId> + <class>2</class> + <createDate>2005-06-03T13:43:27.9166650-04:00</createDate> + <modDate>2005-06-03T13:43:27.9166650-04:00</modDate> + </entity> + <class> + <id_entity>10162</id_entity> + <classType>29</classType> + <sysName>d10160cTicket</sysName> + <name>Ticket</name> + <parentId>3</parentId> + <isAbstract>false</isAbstract> + <isHidden>false</isHidden> + </class> + <class> + <id_entity>3</id_entity> + <classType>1</classType> + <sysName>entity</sysName> + <name>entity</name> + <isAbstract>true</isAbstract> + <isHidden>false</isHidden> + </class> + <attribute> + <id_entity>10181</id_entity> + <classId>10162</classId> + <sysAttName>c10162Title</sysAttName> + <attName>Title</attName> + <order>-10.00</order> + <isObligatory>false</isObligatory> + <isActive>true</isActive> + <isSearchable>false</isSearchable> + <isEditable>true</isEditable> + <isSelfLookup>false</isSelfLookup> + <isPrimary>true</isPrimary> + <isUnique>false</isUnique> + <isVirtual>false</isVirtual> + <protection>false</protection> + <refClassSysName>textline</refClassSysName> + </attribute> + <attribute> + <id_entity>10208</id_entity> + <classId>10162</classId> + <sysAttName>c10162Date</sysAttName> + <attName>Date</attName> + <order>-9.00</order> + <isObligatory>false</isObligatory> + <isActive>true</isActive> + <isSearchable>false</isSearchable> + <isEditable>true</isEditable> + <isSelfLookup>false</isSelfLookup> + <isPrimary>false</isPrimary> + <isUnique>false</isUnique> + <isVirtual>false</isVirtual> + <protection>false</protection> + <refClassSysName>dateTime</refClassSysName> + </attribute> + <attribute> + <id_entity>10229</id_entity> + <classId>10162</classId> + <sysAttName>c10162Request by1</sysAttName> + <attName>Request by</attName> + <order>-5.00</order> + <isObligatory>false</isObligatory> + <isActive>true</isActive> + <isSearchable>true</isSearchable> + <isEditable>true</isEditable> + <isSelfLookup>false</isSelfLookup> + <isPrimary>false</isPrimary> + <isUnique>false</isUnique> + <isVirtual>false</isVirtual> + <protection>false</protection> + <refClassSysName>pertinence</refClassSysName> + </attribute> + <textline> + <id_entity>10181</id_entity> + <maxLength>20</maxLength> + </textline> + <dateTime> + <id_entity>10208</id_entity> + </dateTime> + <pertinence> + <id_entity>10229</id_entity> + <owner>10229</owner> + <to>7</to> + <ratio>n:1</ratio> + </pertinence> + <option> + <id_entity>116</id_entity> + <group>132</group> + <value>dd/mm/aaaa</value> + <isActiveOption>true</isActiveOption> + <orderOption>1.00</orderOption> + </option> + <option> + <id_entity>117</id_entity> + <group>132</group> + <value>mm/dd/aaaa</value> + <isActiveOption>true</isActiveOption> + <orderOption>2.00</orderOption> + </option> + <option> + <id_entity>118</id_entity> + <group>133</group> + <value>none</value> + <isActiveOption>true</isActiveOption> + <orderOption>1.00</orderOption> + </option> + <option> + <id_entity>119</id_entity> + <group>133</group> + <value>hh:mm</value> + <isActiveOption>true</isActiveOption> + <orderOption>2.00</orderOption> + </option> + <option> + <id_entity>120</id_entity> + <group>133</group> + <value>hh:mm:ss</value> + <isActiveOption>true</isActiveOption> + </option> +</structure> + Added: humano2/trunk/components/tests/xmltools.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/components/tests/xmltools.cs 2005-06-16 19:11:17 UTC (r= ev 1337) +++ humano2/trunk/components/tests/xmltools.cs 2005-06-16 20:20:35 UTC (r= ev 1338) @@ -0,0 +1,58 @@ +// +// The Humano2 Business solution. +// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com) +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. =20 +// +// $Id$ +// + +using System; +using System.Data; +using System.IO; +using Humano2.Components.WebTools; +using NUnit.Framework; + +namespace Humano2.Components.Test.Xml +{ + [TestFixture] + public class Xml + { + private string readFile(string FileName, int FileSize) + { + string filereadbuf; + char[] buf =3D new char[FileSize]; // lets define an array o= f type char field (i.e. variable) buf + // for more help please see .net sdk + StreamReader sr =3D new StreamReader(new FileStream(FileName= , FileMode.Open, FileAccess.Read)); + int retval =3D sr.ReadBlock(buf, 0, FileSize); // no. of byt= es read + //Console.Write ("Total Bytes Read =3D " + retval + "\n"); + filereadbuf =3D new string(buf); // store it in our field + =20 + sr.Close(); + return filereadbuf; + } + =20 + [Test] + public void OrderAttributesInDataStructure() + { + //Loads the xml in a string + string xmlStructure =3D readFile("../components/tests/attrib= utes.xml",3492); //We now the size of file + //Console.Write("Length: " + xmlStructure.Length + "\n"); + //Console.Write("Value: " + xmlStructure + "\n"); + Assert.IsTrue(xmlStructure.Length =3D=3D 3492); //The file h= as not changed + string xslPath =3D "../web/portal/site/xsl/orderattributes.x= sl"; + string xmlStructureOrdered =3D Humano2.Components.WebTools.X= ml.OrderAttributesInDataStructure(xmlStructure, + = "10229,10208,10181", + = xslPath); = =20 + string resWaited =3D=20 + "<structure><entity><id_entity>10162</id_entity><domainI= d>10160</domainId><class>2</class><createDate>2005-06-03T13:43:27.9166650= -04:00</createDate><modDate>2005-06-03T13:43:27.9166650-04:00</modDate></= entity><class><id_entity>10162</id_entity><classType>29</classType><sysNa= me>d10160cTicket</sysName><name>Ticket</name><parentId>3</parentId><isAbs= tract>false</isAbstract><isHidden>false</isHidden></class><class><id_enti= ty>3</id_entity><classType>1</classType><sysName>entity</sysName><name>en= tity</name><isAbstract>true</isAbstract><isHidden>false</isHidden></class= ><attribute><id_entity>10229</id_entity><classId>10162</classId><sysAttNa= me>c10162Request by1</sysAttName><attName>Request by</attName><order>-5.0= 0</order><isObligatory>false</isObligatory><isActive>true</isActive><isSe= archable>true</isSearchable><isEditable>true</isEditable><isSelfLookup>fa= lse</isSelfLookup><isPrimary>false</isPrimary><isUnique>false</isUnique><= isVirtual>false</isVirtual><protection>false</protection><refClassSysName= >pertinence</refClassSysName></attribute><attribute><id_entity>10208</id_= entity><classId>10162</classId><sysAttName>c10162Date</sysAttName><attNam= e>Date</attName><order>-9.00</order><isObligatory>false</isObligatory><is= Active>true</isActive><isSearchable>false</isSearchable><isEditable>true<= /isEditable><isSelfLookup>false</isSelfLookup><isPrimary>false</isPrimary= ><isUnique>false</isUnique><isVirtual>false</isVirtual><protection>false<= /protection><refClassSysName>dateTime</refClassSysName></attribute><attri= bute><id_entity>10181</id_entity><classId>10162</classId><sysAttName>c101= 62Title</sysAttName><attName>Title</attName><order>-10.00</order><isOblig= atory>false</isObligatory><isActive>true</isActive><isSearchable>false</i= sSearchable><isEditable>true</isEditable><isSelfLookup>false</isSelfLooku= p><isPrimary>true</isPrimary><isUnique>false</isUnique><isVirtual>false</= isVirtual><protection>false</protection><refClassSysName>textline</refCla= ssSysName></attribute><textline><id_entity>10181</id_entity><maxLength>20= </maxLength></textline><dateTime><id_entity>10208</id_entity></dateTime><= pertinence><id_entity>10229</id_entity><owner>10229</owner><to>7</to><rat= io>n:1</ratio></pertinence><option><id_entity>116</id_entity><group>132</= group><value>dd/mm/aaaa</value><isActiveOption>true</isActiveOption><orde= rOption>1.00</orderOption></option><option><id_entity>117</id_entity><gro= up>132</group><value>mm/dd/aaaa</value><isActiveOption>true</isActiveOpti= on><orderOption>2.00</orderOption></option><option><id_entity>118</id_ent= ity><group>133</group><value>none</value><isActiveOption>true</isActiveOp= tion><orderOption>1.00</orderOption></option><option><id_entity>119</id_e= ntity><group>133</group><value>hh:mm</value><isActiveOption>true</isActiv= eOption><orderOption>2.00</orderOption></option><option><id_entity>120</i= d_entity><group>133</group><value>hh:mm:ss</value><isActiveOption>true</i= sActiveOption></option></structure>"; + //Console.Write("res=3D" + xmlStructureOrdered.Replace(" ","= ") + "\n"); =20 + //Console.Write("waited=3D" + resWaited.Replace(" ","")); = = =20 + string resWithoutSpaceAndBackspace =3D xmlStructureOrdered.R= eplace(" ","").Replace("\n",""); + Assert.IsTrue(resWaited.Replace(" ","") =3D=3D resWithoutSpa= ceAndBackspace); = =20 + } + } +} Property changes on: humano2/trunk/components/tests/xmltools.cs ___________________________________________________________________ Name: svn:keywords + Id Modified: humano2/trunk/components/webTools/Adapter.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/components/webTools/Adapter.cs 2005-06-16 19:11:17 UTC = (rev 1337) +++ humano2/trunk/components/webTools/Adapter.cs 2005-06-16 20:20:35 UTC = (rev 1338) @@ -958,6 +958,8 @@ return ds; } =20 + =20 + //FIXME: factorize these two next functions /// <summary> /// Lee la estructura de una entity (Instancia) /// </summary> @@ -987,7 +989,9 @@ =20 public string ReadStructureAndXsls1(int idEntity,ArrayList includes,st= ring idAttributes) { - //Hago el read estructural + Logger.Log("=3D=3D Adapter.cs =3D=3D ReadStructureAndXsls1",LogLevel.= Trace); + =20 + //Hago el read estructural DataSet ds =3D crud.ReadStructure(idEntity,false,idAttributes); ds.DataSetName =3D "structure"; =20 @@ -999,6 +1003,7 @@ for(int i=3D0;i<attRows.Count;i++) { attClassSysName =3D Convert.ToString(attRows[i]["refClassSysName"]); + Logger.Log("attClassSysName=3D " + attClassSysName,LogLe= vel.Trace); if(!includes.Contains(attClassSysName)) { includes.Add(attClassSysName); Modified: humano2/trunk/components/webTools/xmltools.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/components/webTools/xmltools.cs 2005-06-16 19:11:17 UTC= (rev 1337) +++ humano2/trunk/components/webTools/xmltools.cs 2005-06-16 20:20:35 UTC= (rev 1338) @@ -133,5 +133,45 @@ } return result; } + =20 + ///<summary> + ///Takes a xml string representing a structure of a form with cl= ass and attributes. + ///The objective is to reorder the tags "attribute" using a list= of attributes (that comes from the table [form]) + ///</summary> + ///<param name=3D"xmlStructure"></param> + ///<param name=3D"attributesList">The list of id of attributes: = we want this order for the xml struture string</param> + ///<returns>the xml datastruture with the tags "attributes" in s= ame order as in attributesList</returns> + public static string OrderAttributesInDataStructure( string xmlD= ataStructure, string attributesList, string xslPath) + { + //First add the list of attribute in the xml that will be pr= ocessed by the xsk + string xmlAttributesList =3D ""; + string [] xmlAttArr =3D attributesList.Split(",".ToCharArray= ()); + int size =3D xmlAttArr.Length; + =20 + if(attributesList!=3D"")=20 + { + for(int i=3D0;i<size;i++) + { + xmlAttributesList +=3D "<id>" + xmlAttArr[i] + "</id= >"; =20 + } + } + else //Nothing to change exit + { + return xmlDataStructure; =20 + } + =20 + string xmlWithAttributesList =3D ""; + xmlWithAttributesList =3D + "<dataWithAttributes>" + + xmlDataStructure + + "<attributesList>" + + xmlAttributesList + + "</attributesList>" =20 + + "</dataWithAttributes>"; + //Logger.Log("xmlWithAttributesList: " + xmlWithAttributesLi= st,LogLevel.Trace); + string res =3D TransformXML(xmlWithAttributesList, xslPath, = null); + //Logger.Log("res: " + res,LogLevel.Trace); + return res; + } } } Modified: humano2/trunk/web/portal/site/instance.aspx.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/portal/site/instance.aspx.cs 2005-06-16 19:11:17 UT= C (rev 1337) +++ humano2/trunk/web/portal/site/instance.aspx.cs 2005-06-16 20:20:35 UT= C (rev 1338) @@ -35,44 +35,41 @@ =20 namespace Portal.site { - /// <summary> - /// Pagina encargada de desplegar las interfaces de read, update y crea= te - /// para instancias del modelo. - /// Recibe como parametro idEntity de la instancia o clase a crear (id_= entity) - /// El tipo de display a desplegar (display) - /// Atributos pre-seteados (id,value), solo valido para modo create - /// </summary> - public class instance : basePage - { - private void Page_Load(object sender, System.EventArgs e) - { - //Obtengo el adaptador con la base de datos. - adapter dbAdapter =3D userCred.CoreAdapter; - =20 - =20 + /// <summary> + /// Pagina encargada de desplegar las interfaces de read, update y c= reate + /// para instancias del modelo. + /// Recibe como parametro idEntity de la instancia o clase a crear (= id_entity) + /// El tipo de display a desplegar (display) + /// Atributos pre-seteados (id,value), solo valido para modo create + /// </summary> + public class instance : basePage + { + private void Page_Load(object sender, System.EventArgs e) + { + =20 + Logger.Log("=3D=3D instance.aspx.cs =3D=3D",LogLevel.Trace); + //Obtengo el adaptador con la base de datos. + adapter dbAdapter =3D userCred.CoreAdapter; + =20 //Paso los xsl que necesito a un nameValue. - //Debido a que .Net es idiot.. y agrega un "\r\n" en el ultimo elemen= to del - //del post hay que agregar un elemento mas. - //Los Xsl especificos que usaremos - ArrayList xslInclude =3D new ArrayList(); - =20 + //Debido a que .Net es idiot.. y agrega un "\r\n" en el ulti= mo elemento del + //del post hay que agregar un elemento mas. + //Los Xsl especificos que usaremos + ArrayList xslInclude =3D new ArrayList(); + =20 //WARNING: xslInclude is updated by this function, don't put= the call after the next loop!!!! string strXml =3D createXmlASP(dbAdapter,xslInclude); - =20 NameValueCollection xslToInclude =3D new NameValueCollectio= n(); - for(int i=3D0;i<xslInclude.Count;i++) - { - xslToInclude.Add("include",xslInclude[i].ToString()); - } - xslToInclude.Add("end",""); //.Net idiot... podria asegurar que esto = es un bug - =20 + for(int i=3D0;i<xslInclude.Count;i++) + { + xslToInclude.Add("include",xslInclude[i].ToString()); + } + xslToInclude.Add("end",""); //.Net idiot... podria asegurar = que esto es un bug =20 //Get the url to dowload the xsl object //Reconstruyo el url - string cUrl =3D Regex.Split(Request.Url.AbsoluteUri,"/[^/]*$")[0] += "/";=09 + string cUrl =3D Regex.Split(Request.Url.AbsoluteUri,"/[^/]= *$")[0] + "/";=09 string urlAspToXsl =3D cUrl + "readXslt.aspx"; - =09 - =20 //To show only the xml source bool onlyXml =3D Request["Xml"] =3D=3D "true";=20 if(onlyXml) @@ -81,221 +78,220 @@ string XmlTransformedResult =3D Humano2.Components.WebTo= ols.Xml.TransformXML(strXml, fullUrl, Response); Response.Write(XmlTransformedResult); =20 } - =20 - =20 //Ahora pido via web el xsl para generar la pagina html pedi= da - //La pagina que retormna el xsl resive los argumentos por post, - //asi que la tenemos que llamarla a mano - //La razon que sea via web, es para poder compartir el xsl con tercer= os. + //La pagina que retormna el xsl resive los argumentos por po= st, + //asi que la tenemos que llamarla a mano + //La razon que sea via web, es para poder compartir el xsl c= on terceros. string HtmlResult =3D Humano2.Components.WebTools.Xml.Transf= ormXMLASP(strXml,urlAspToXsl,xslToInclude,Response); - Response.Write(HtmlResult); - } - - =20 - /// <summary> - /// Get the XML used then to create Html code of the page - /// ATTENTION: This function is a little different from the = createXml one, because=20 - /// multiple xsl are involved. - ///<param name=3D'dbAdapter'>To get useful datas for the xml= </param> - ///<param name=3D'xslInclude'>An array list that is updated = by the dbAdapter</param> - /// </summary> - private string createXmlASP(adapter dbAdapter, ArrayList xsl= Include) + Response.Write(HtmlResult); + } + =20 + =20 + /// <summary> + /// Get the XML used then to create Html code of the page + /// ATTENTION: This function is a little different from the crea= teXml one, because=20 + /// multiple xsl are involved. + ///<param name=3D'dbAdapter'>To get useful datas for the xml</pa= ram> + ///<param name=3D'xslInclude'>An array list that is updated by t= he dbAdapter</param> + /// </summary> + private string createXmlASP(adapter dbAdapter, ArrayList xslIncl= ude) + { + //Para obtener la info que se nos manda. + int idEntity; + string displayType; + string theAction; + string pertinence; + string idView; + int formAttribute =3D 0; + string idforms =3D""; + //Logger.Log("createXmlASP: BEGIN",LogLevel.Trace); + //Generamos el XML con la informacion de la entidad pedida=20 + //El id de la instancia y us tipo de display + idEntity =3D Convert.ToInt32(Request.QueryString["id_enti= ty"]); + idforms =3D Request.QueryString["formsId"]; + displayType =3D Request.Params["display"]; + theAction =3D Request.Params["action"]; + idView =3D Request.Params["idView"]; + =20 + string listAtt=3D""; + DataSet dtrq; + =20 + if(idforms !=3D "" && idforms !=3D null) { - //Para obtener la info que se nos manda. - int idEntity; - string displayType; - string theAction; - string pertinence; - - string idView; - int formAttribute =3D 0; - string idforms =3D""; - - - - //Logger.Log("createXmlASP: BEGIN",LogLevel.Trace); - =20 - //Generamos el XML con la informacion de la entidad pedida=20 - =09 - //El id de la instancia y us tipo de display - idEntity =3D Convert.ToInt32(Request.QueryString["id_= entity"]); - idforms =3D Request.QueryString["formsId"]; - displayType =3D Request.Params["display"]; - theAction =3D Request.Params["action"]; - idView =3D Request.Params["idView"]; - - string listAtt=3D""; - DataSet dtrq; - =09 - if(idforms !=3D "" && idforms !=3D null) - { - formAttribute=3D Convert.ToInt32(idforms); - dtrq=3DdbAdapter.ReadDatarq(formAttribute,"1204"); - listAtt =3D dtrq.Tables[0].Rows[0]["data"].ToString(); - } - =09 - =09 - //Response.Write(idEntity); - - //agregamos tag que indica cuales son los objetos que cuelgan de mi - int classid =3D dbAdapter.GetClassByID(idEntity); - if(theAction.ToLower()!=3D"create" && theAction.ToLower()!=3D"delete= ") - { - pertinence =3D dbAdapter.PertinenceGet(Convert.ToString(classid),"f= "); - if(idEntity>0 && classid>0) - { - try - { - dbAdapter.FormulasForClass(classid,idEntity); - } - catch - { - //Nada - } - } - } - else - { - pertinence =3D ""; - } - =20 - string InfoClass; - =09 - - string nameClass =3D ""; - if(Convert.ToString(classid)!=3D"" && Convert.ToString(classid)!=3D"= 2") - nameClass =3D dbAdapter.GetClassNameById(classid); - else - nameClass =3D dbAdapter.GetClassNameById(idEntity); - - =09 -=09 - - InfoClass =3D "<Info><idClass>" + classid + "</idClass><nameClass>"= + nameClass + "</nameClass><id_entity>"+idEntity+"</id_entity><idView>"+= idView+"</idView></Info>"; - - =09 - //Verifico resibir un Xslt valido - if (displayType!=3DPortalXslt.readPageTag && - displayType!=3DPortalXslt.updatePageTag &&=20 - displayType!=3DPortalXslt.createPageTag) + formAttribute=3D Convert.ToInt32(idforms); + dtrq=3DdbAdapter.ReadDatarq(formAttribute,"1204"); + listAtt =3D dtrq.Tables[0].Rows[0]["data"].ToString(); + } + Logger.Log("listAtt=3D " + listAtt,LogLevel.Trace); + //Response.Write(idEntity); + //agregamos tag que indica cuales son los objetos que cuelga= n de mi + int classid =3D dbAdapter.GetClassByID(idEntity); + if(theAction.ToLower()!=3D"create" && theAction.ToLower()!=3D= "delete") + { + pertinence =3D dbAdapter.PertinenceGet(Convert.ToString(= classid),"f"); + if(idEntity>0 && classid>0) + { + try { - throw new Exception("Oops, invalid XSLT"); + dbAdapter.FormulasForClass(classid,idEntity); } - =09 - //Extraer Atributos a mostrar desde la clase FORM - //----------------------------------------------- - - //Intento leer la estrcutura de la instancia - string structure =3D dbAdapter.ReadStructureAndXsls1= (idEntity,xslInclude,listAtt); //AQUI - //SVERA string structure =3D dbAdapter.ReadStructure= AndXsls1(idEntity,xslInclude,formAttribute); - //Construction of the XML string - //Si corresponde intento leer los datos de la instan= cia - string data =3D ""; - string flagaction =3D ""; - - if(theAction =3D=3D "read") - flagaction +=3D "<flagaction>Read</flagactio= n>\n"; - else if(theAction =3D=3D "update") - flagaction +=3D "<flagaction>Update</flagact= ion>\n"; - else if(theAction =3D=3D "create") - flagaction +=3D "<flagaction>Create</flagact= ion>\n"; - else if(theAction =3D=3D "delete") - flagaction +=3D "<flagaction>Delete</flagact= ion>\n"; - - if(displayType=3D=3DPortalXslt.readPageTag) + catch { - data =3D dbAdapter.ReadDataAsXml(idEntity); + //Nada } - else if(displayType=3D=3DPortalXslt.updatePageTag) - { - data =3D dbAdapter.ReadDataAsXml(idEntity); - } - else if(displayType=3D=3DPortalXslt.createPageTag &&= Request.QueryString["id"]!=3Dnull) - { - string[] id =3D Request.QueryString["id= "].Split(','); - string[] value =3D Request.QueryString["va= lue"].Split(','); - - flagaction =3D "<flagaction>Create</flagacti= on>\n"; - =20 - data =3D "<data>\n"; - for(int i=3D0;i<id.Length;i++) - { - data +=3D "<hidden>\n"; - data +=3D "<id_entity>"+id[i]+"<id_e= ntity>\n"; - data +=3D "<data>"+value[i]+"<data>\= n"; - data +=3D "</hidden>\n"; - } - data +=3D "</data>\n"; - } - - //Logger.Log("createXmlASP: data(before)=3D" + data,= LogLevel.Trace); - //Construimos el Xml - string swXml =3D ""; - swXml +=3D "<?xml version=3D\"1.0\" encoding=3D\"UTF= -8\"?>"; - swXml +=3D "<?xml-stylesheet type=3D\"text/xsl\" hre= f=3D\"xsl/createPortal.xsl\"?>"; - swXml +=3D "<page>"; - swXml +=3D "<action>"; - swXml +=3D "<update>"+PortalInstanceC= rud.updatePage+"</update>"; - swXml +=3D "<delete>"+PortalInstanceC= rud.deletePage+"</delete>"; - swXml +=3D "<create>"+PortalInstanceC= rud.createPage+"</create>"; - swXml +=3D "</action>"; - swXml +=3D flagaction; - swXml +=3D "<classInstance>"; - swXml +=3D structure; - swXml +=3D clearDateTimeData(data); /= / don't forget to put date in good format - swXml +=3D "</classInstance>"; - swXml +=3D pertinence; =20 - swXml +=3D InfoClass; - swXml +=3D "</page>"; - =20 - //Logger.Log("createXmlASP: structure=3D" + structur= e,LogLevel.Trace); - //Logger.Log("createXmlASP: clearDateTime(data)=3D" = + clearDateTimeData(data),LogLevel.Trace); - //Logger.Log("swXml: " + swXml ,LogLevel.Trace); - return swXml; + } + } + else + { + pertinence =3D ""; + } =20 + string InfoClass; + string nameClass =3D ""; + if(Convert.ToString(classid)!=3D"" && Convert.ToString(class= id)!=3D"2") + { + nameClass =3D dbAdapter.GetClassNameById(classid); } + else + { + nameClass =3D dbAdapter.GetClassNameById(idEntity); + } + InfoClass =3D "<Info><idClass>" + classid + "</idClass><nam= eClass>" + nameClass + "</nameClass><id_entity>"+idEntity+"</id_entity><i= dView>"+idView+"</idView></Info>"; + //Verifico resibir un Xslt valido + if ( displayType!=3DPortalXslt.readPageTag && + displayType!=3DPortalXslt.updatePageTag &&=20 + displayType!=3DPortalXslt.createPageTag) + { + throw new Exception("Oops, invalid XSLT"); + } =20 - - /// <summary> - /// ATTENTION THIS IS ONLY A PATCH - /// The value of field are getted by the Adapter ReadDataAsX= ml method=20 - /// that returns a string. In this string we replace each da= te that is in format "date:time" - /// by the date in format "date" only...=20 - ///<param name=3D"structure"></param> - ///<returns></returns> - /// </summary> - private string clearDateTimeData(string data) + //Extraer Atributos a mostrar desde la clase FORM + //----------------------------------------------- + =20 + //Intento leer la estrcutura de la instancia + Logger.Log("idEntity=3D " + idEntity,LogLevel.Trace); + string structure =3D dbAdapter.ReadStructureAndXsls1(idEntit= y,xslInclude,listAtt); //AQUI + Logger.Log("structure(before)=3D" + structure,LogLevel.Trac= e); + //Reorder the attributes as they appear in the selected orde= r (form) + structure =3D Humano2.Components.WebTools.Xml.OrderAttribute= sInDataStructure(structure, listAtt, "portal/site/xsl/orderattributes.xsl= "); + Logger.Log("structure(after)=3D" + structure,LogLevel.Trace= ); + //SVERA string structure =3D dbAdapter.ReadStructureAndXsls1= (idEntity,xslInclude,formAttribute); + //Construction of the XML string + //Si corresponde intento leer los datos de la instancia + string data =3D ""; + string flagaction =3D ""; + =20 + //FIXME: change for a switch + if(theAction =3D=3D "read") { - //We use a xsl to do the transformation... :) - string urlXslToClearDate =3D baseUrl() + "xsl/cleardate= fromdata.xsl"; - string dateClearedData =3D Humano2.Components.WebTools.X= ml.TransformXML(data,urlXslToClearDate,Response); - //Logger.Log("\n\n[clearDateTimeData ]: " + dateClearedD= ata, LogLevel.Trace); - dateClearedData =3D dateClearedData.Replace("[","<"); = =20 - dateClearedData =3D dateClearedData.Replace("]",">"); = =20 - // NO SACAR: Ensucia los campos TEXT!! dateClearedData =3D= dateClearedData.Replace(" ",""); //trim - dateClearedData =3D dateClearedData.Trim(); - //Logger.Log("\n\n[clearDateTimeData ]: " + dateClearedD= ata, LogLevel.Trace); - return dateClearedData; + flagaction +=3D "<flagaction>Read</flagaction>\n"; } + else if(theAction =3D=3D "update") + { + flagaction +=3D "<flagaction>Update</flagaction>\n"; + } + else if(theAction =3D=3D "create") + { + flagaction +=3D "<flagaction>Create</flagaction>\n"; + } + else if(theAction =3D=3D "delete") + { + flagaction +=3D "<flagaction>Delete</flagaction>\n"; + } + =20 + =20 + if(displayType=3D=3DPortalXslt.readPageTag) + { + data =3D dbAdapter.ReadDataAsXml(idEntity); + } + else if(displayType=3D=3DPortalXslt.updatePageTag) + { + data =3D dbAdapter.ReadDataAsXml(idEntity); + } + else if(displayType=3D=3DPortalXslt.createPageTag && Request= .QueryString["id"]!=3Dnull) + { + string[] id =3D Request.QueryString["id"].Split(','= ); + string[] value =3D Request.QueryString["value"].Split(= ','); =20 - #region Web Form Designer generated code - override protected void OnInit(EventArgs e) - { - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // - InitializeComponent(); - base.OnInit(e); - } - =09 - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - { =20 - this.Load +=3D new System.EventHandler(this.Page_Load); - } - #endregion - } + flagaction =3D "<flagaction>Create</flagaction>\n"; + =20 + data =3D "<data>\n"; + for(int i=3D0;i<id.Length;i++) + { + data +=3D "<hidden>\n"; + data +=3D "<id_entity>"+id[i]+"<id_entity>\n"; + data +=3D "<data>"+value[i]+"<data>\n"; + data +=3D "</hidden>\n"; + } + data +=3D "</data>\n"; + } + =20 + //Logger.Log("createXmlASP: data(before)=3D" + data,LogLevel= .Trace); + //Construimos el Xml + string swXml =3D ""; + swXml +=3D "<?xml version=3D\"1.0\" encoding=3D\"UTF-8\"?>"; + swXml +=3D "<?xml-stylesheet type=3D\"text/xsl\" href=3D\"xs= l/createPortal.xsl\"?>"; + swXml +=3D "<page>"; + swXml +=3D "<action>"; + swXml +=3D "<update>"+PortalInstanceCrud.upda= tePage+"</update>"; + swXml +=3D "<delete>"+PortalInstanceCrud.dele= tePage+"</delete>"; + swXml +=3D "<create>"+PortalInstanceCrud.crea= tePage+"</create>"; + swXml +=3D "</action>"; + swXml +=3D flagaction; + swXml +=3D "<classInstance>"; + swXml +=3D structure; + swXml +=3D clearDateTimeData(data); // don't = forget to put date in good format + swXml +=3D "</classInstance>"; + swXml +=3D pertinence; =20 + swXml +=3D InfoClass; + swXml +=3D "</page>"; + =20 + //Logger.Log("createXmlASP: structure=3D" + structure,LogLev= el.Trace); + //Logger.Log("createXmlASP: clearDateTime(data)=3D" + clearD= ateTimeData(data),LogLevel.Trace); + //Logger.Log("swXml: " + swXml ,LogLevel.Trace); + return swXml; + } + =20 + /// <summary> + /// ATTENTION THIS IS ONLY A PATCH + /// The value of field are getted by the Adapter ReadDataAsXml m= ethod=20 + /// that returns a string. In this string we replace each date t= hat is in format "date:time" + /// by the date in format "date" only...=20 + ///<param name=3D"structure"></param> + ///<returns></returns> + /// </summary> + private string clearDateTimeData(string data) + { + //We use a xsl to do the transformation... :) + string urlXslToClearDate =3D baseUrl() + "xsl/cleardatefrom= data.xsl"; + string dateClearedData =3D Humano2.Components.WebTools.Xml.T= ransformXML(data,urlXslToClearDate,Response); + //Logger.Log("\n\n[clearDateTimeData ]: " + dateClearedData,= LogLevel.Trace); + dateClearedData =3D dateClearedData.Replace("[","<"); = =20 + dateClearedData =3D dateClearedData.Replace("]",">"); = =20 + // NO SACAR: Ensucia los campos TEXT!! dateClearedData =3D d= ateClearedData.Replace(" ",""); //trim + dateClearedData =3D dateClearedData.Trim(); + //Logger.Log("\n\n[clearDateTimeData ]: " + dateClearedData,= LogLevel.Trace); + return dateClearedData; + } + =20 + #region Web Form Designer generated code + override protected void OnInit(EventArgs e) + { + // + // CODEGEN: This call is required by the ASP.NET Web Form De= signer. + // + InitializeComponent(); + base.OnInit(e); + } + =20 + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { =20 + this.Load +=3D new System.EventHandler(this.Page_Load); + } + #endregion + } } Added: humano2/trunk/web/portal/site/xsl/orderattributes.xsl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/portal/site/xsl/orderattributes.xsl 2005-06-16 19:1= 1:17 UTC (rev 1337) +++ humano2/trunk/web/portal/site/xsl/orderattributes.xsl 2005-06-16 20:2= 0:35 UTC (rev 1338) @@ -0,0 +1,24 @@ +<xsl:stylesheet version=3D"1.0" xmlns:xsl=3D"http://www.w3.org/1999/XSL/= Transform"> <!-- xmlns:fo=3D"http://www.w3.org/1999/XSL/Format"> --> + <!-- $Id$ --> + <xsl:output method=3D"html" /> + <xsl:template match=3D"/"> + <structure> + <xsl:copy-of select=3D"/dataWithAttributes/structure/entity"= /> <!-- copy entity info --> + <xsl:for-each select=3D"/dataWithAttributes/structure/class"= > <!-- copy the classes --> + <xsl:copy-of select=3D"." /> + </xsl:for-each> + <!-- now copy the attributes in good order --> + <xsl:for-each select=3D"/dataWithAttributes/attributesList/i= d"> + <xsl:variable name=3D"currentId"> + <xsl:value-of select=3D"." /> + </xsl:variable> + <xsl:copy-of select=3D"/dataWithAttributes/structure/att= ribute[id_entity=3D$currentId]" /> + </xsl:for-each> + <!-- copy what remains --> + <xsl:for-each select=3D"/dataWithAttributes/structure/*[name= ()!=3D'class' and name()!=3D'attribute' and name()!=3D'entity']"> + <xsl:copy-of select=3D"."/> + </xsl:for-each> + </structure> + </xsl:template> +</xsl:stylesheet> + Property changes on: humano2/trunk/web/portal/site/xsl/orderattributes.xs= l ___________________________________________________________________ Name: svn:keywords + Id |
|
From: <sv...@de...> - 2005-06-16 19:11:13
|
Author: marcelo
Date: 2005-06-16 15:11:17 -0400 (Thu, 16 Jun 2005)
New Revision: 1337
Modified:
humano2/trunk/core/schema/mssql/mssql-3-view.sql
Log:
FIXED: Orden de ejecucion daba error.
Modified: humano2/trunk/core/schema/mssql/mssql-3-view.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/core/schema/mssql/mssql-3-view.sql 2005-06-16 18:34:48 =
UTC (rev 1336)
+++ humano2/trunk/core/schema/mssql/mssql-3-view.sql 2005-06-16 19:11:17 =
UTC (rev 1337)
@@ -19,6 +19,8 @@
"viewName" character varying(50)
);
=20
+INSERT INTO "class" VALUES (1011, 27, 'view', 'view', 3, 0, 0, NULL);
+
set identity_insert entity ON
INSERT INTO entity ("id_entity","domainId","class","delDate","status") V=
ALUES (1011, 10, 2, NULL, NULL);
INSERT INTO entity ("id_entity","domainId","class","delDate","status") V=
ALUES (1012, 10, 13, NULL, NULL);
@@ -32,8 +34,6 @@
INSERT INTO entity ("id_entity","domainId","class","delDate","status") =
VALUES (1405,10,1011,NULL,NULL);
set identity_insert entity Off
=20
-INSERT INTO "class" VALUES (1011, 27, 'view', 'view', 3, 0, 0, NULL);
-
INSERT INTO attribute VALUES (1012, 1011, 'columns', 'columns', 0.00, 0,=
1, 0, 1, 0, 0, 0, 0, NULL, 1, 0);
INSERT INTO attribute VALUES (1013, 1011, 'where', 'where', 0.00, 0, 1, =
0, 1, 0, 0, 0, 0, NULL, 1, 0);
INSERT INTO attribute VALUES (1014, 1011, 'groupby', 'groupby', 0.00, 0,=
1, 0, 1, 0, 0, 0, 0, NULL, 1, 0);
|