|
From: <sv...@de...> - 2005-05-26 16:17:16
|
Author: pcamacho
Date: 2005-05-26 12:17:12 -0400 (Thu, 26 May 2005)
New Revision: 1151
Modified:
humano2/trunk/components/webTools/Adapter.cs
humano2/trunk/core/db/absComplex.cs
humano2/trunk/core/db/mssql/mssqlComplex.cs
humano2/trunk/core/db/pgsql/pgsqlComplex.cs
humano2/trunk/core/db/pgsql/pgsqlCrud.cs
humano2/trunk/web/portal/site/addOption.aspx.cs
humano2/trunk/web/portal/site/showView.aspx.cs
humano2/trunk/web/portal/site/topbar.aspx
Log:
FIX: bug #122.
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-05-26 16:09:36 UTC =
(rev 1150)
+++ humano2/trunk/components/webTools/Adapter.cs 2005-05-26 16:17:12 UTC =
(rev 1151)
@@ -312,64 +312,7 @@
return resp;
=20
} =20
- /* =20
- //Variables para extraer las funciones de coliumnas de tipo "vista"
- string columnValue=3D"";
- =09
-
- DataSet myDataSet=3D new DataSet();
- // Now we read the view via it's viewId, to recover it's values.
- myDataSet =3D ReadDataWithName(viewId, "data");
- Logger.Log(DbUtils.DumpData(myDataSet),LogLevel.Trace);
- //FIXME: there has to be a way to not walk over all elements (three "=
for" loops!)
- //FIXME: Maybe the best way is to use "viewTools" to get the view ele=
ments.
- foreach(DataTable myTable in myDataSet.Tables)
- { // walk over the tables in the DataSet.
- foreach(DataRow myRow in myTable.Rows)
- { // walk over the rows in the tables.
- foreach (DataColumn myColumn in myTable.Columns)
- { // walk over the columns of each row.
- int columnName;
- try { columnName =3D Convert.ToInt32( myRow[myColumn] ); }
- catch(System.InvalidCastException ) { continue; }
- catch(System.FormatException) { continue; }
-
- Logger.Log("columnName: " + columnName,LogLevel.=
Trace);
- switch(columnName) // See if the entites are parts of the view tab=
le taht we need.
- {
- =20
- case (int) ViewConsts.Columns: // If the row contains "columns" pa=
rt of the "view"
- vtInstance["columns"] =3D myRow["data"].ToString();
- break;
- case (int) ViewConsts.Where: // If the row contains "where" part o=
f the "view"
- vtInstance["where"] =3D myRow["data"].ToString();
- break;
- case (int) ViewConsts.GroupBy: // If the row contains "groupby" pa=
rt of the "view".
- vtInstance["groupby"] =3D myRow["data"].ToString();
- break;
- case (int) ViewConsts.Having: // If the row contains "having" part=
of the "view"
- vtInstance["havings"] =3D myRow["data"].ToString();
- break;
- case (int) ViewConsts.Order: // If the row contains "order" part o=
f the "view"
- vtInstance["order"] =3D myRow["data"].ToString();
- break;
-
- case (int) ViewConsts.Class:
- =20
- string info =3D myRow["data"].ToString();
- Logger.Log("info: " + info,LogLevel.Trace);
- =20
- break;
- }
- }
- }
- }
- =09
- vtTable.Rows.Add(vtInstance);
-
- return vtTable;=20
- }
- */
+ =20
=20
///<summary>Execute a View from a DataTable.</summary>
///<param name=3D"vtTable">A datatable with the data relevant to th=
e View.</param>
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-05-26 16:09:36 UTC (rev 1150=
)
+++ humano2/trunk/core/db/absComplex.cs 2005-05-26 16:17:12 UTC (rev 1151=
)
@@ -357,6 +357,12 @@
/// <return>true if attribute is primary</returns>
abstract public bool IsPrimary(string sysAttName);
=20
+ /// <summary>
+ /// Tells if an attribute is primary=20
+ /// </summary>
+ /// <param name=3D"sysAttName">id of attribute </param>
+ /// <return>true if attribute is primary</returns>
+ abstract public bool IsPrimary(int attId);
=20
abstract public bool IsSelfLookUp(string sysAttName);
=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-05-26 16:09:36 UTC (=
rev 1150)
+++ humano2/trunk/core/db/mssql/mssqlComplex.cs 2005-05-26 16:17:12 UTC (=
rev 1151)
@@ -964,6 +964,33 @@
=20
return isPrimary;
}
+ =20
+ /// <summary>
+ /// Tells if an attribute is primary=20
+ /// </summary>
+ /// <param name=3D"sysAttName">id of attribute </param>
+ /// <return>true if attribute is primary</returns>
+ override public bool IsPrimary(int attId)
+ {
+ string req =3D "select \"isPrimary\" from attribute where \"=
id_entity\" =3D '" + attId + "'";
+ string res =3D "";
+ DataTable dt =3D doSelect(req);
+ try
+ {
+ res =3D Convert.ToString(dt.Rows[0]["isPrimary"]);
+ }
+ catch
+ {
+ //Logger.Log("IsPrimary: problem when executing query fo=
r isPrimary flag ",LogLevel.Trace);
+ }
+ =20
+ //Logger.Log("IsPrimary: res=3D " + res,LogLevel.Trace);
+ bool isPrimary =3D (res =3D=3D "1");
+ =20
+ return isPrimary;
+ }
+ =20
+ =20
=20
override public bool IsSelfLookUp(string sysAttName)
{
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-05-26 16:09:36 UTC (=
rev 1150)
+++ humano2/trunk/core/db/pgsql/pgsqlComplex.cs 2005-05-26 16:17:12 UTC (=
rev 1151)
@@ -409,7 +409,7 @@
while(parentId !=3D 5)
{
oldParentId =3D parentId;
- Logger.Log("GetBasicAttributeSysName: parentId=3D " + pa=
rentId, LogLevel.Trace);
+ //Logger.Log("GetBasicAttributeSysName: parentId=3D " + =
parentId, LogLevel.Trace);
string queryParent =3D "select \"parentId\" from class w=
here id_entity=3D" + parentId;
object resParent =3D conn.doScalar(queryParent);
if(resParent =3D=3D null)
@@ -444,7 +444,7 @@
foreach(string col in args)
{
var =3D col.Split(",".ToCharArray());
- Logger.Log("BuildTempTable: col[" + loop + "]=3D " + col=
,LogLevel.Trace);
+ //Logger.Log("BuildTempTable: col[" + loop + "]=3D " + c=
ol,LogLevel.Trace);
name =3D var[0];
name =3D name.Substring(name.IndexOf(".")+1);
if ((loop > 0) && (name =3D=3D "id_entity"))=20
@@ -452,16 +452,16 @@
name =3D name + loop.ToString();
}
//FIXME: This "AttributeTypeMapping" needs to change to support dyna=
mic derived types in view.
- Logger.Log("BuildTempTable: var[2].ToString()=3D " + var[2].ToString=
(),LogLevel.Trace);
+ //Logger.Log("BuildTempTable: var[2].ToString()=3D " + var[2].ToStri=
ng(),LogLevel.Trace);
type =3D core.Crud.AttributeTypeMapping(var[0].ToString(=
)); //var[0] is of the form "d109cVerifAttribs"."c10007Text1" for example
=
//The data we need is c10007Text1
if (type =3D=3D null)=20
{
- Logger.Log("BuildTempTable: type=3D=3Dnull",LogLevel=
.Trace);
+ //Logger.Log("BuildTempTable: type=3D=3Dnull",LogLev=
el.Trace);
type =3D var[2].ToString(); //FIXME ok but it is a b=
ig patch
}
table.Append(name + " " + type + ",");
- Logger.Log("BuildTempTable. name=3D " + name + ", type=3D=
" + type,LogLevel.Trace);
+ //Logger.Log("BuildTempTable. name=3D " + name + ", typ=
e=3D " + type,LogLevel.Trace);
loop++;
}
table.Append("\"row\" Serial);\n");
@@ -1006,6 +1006,32 @@
=20
return isPrimary;
}
+ =20
+ /// <summary>
+ /// Tells if an attribute is primary=20
+ /// </summary>
+ /// <param name=3D"sysAttName">id of attribute </param>
+ /// <return>true if attribute is primary</returns>
+ override public bool IsPrimary(int attId)
+ {
+ string req =3D "select \"isPrimary\" from attribute where \"=
id_entity\" =3D '" + attId + "'";
+ string res =3D "";
+ DataTable dt =3D doSelect(req);
+ try
+ {
+ res =3D Convert.ToString(dt.Rows[0]["isPrimary"]);
+ }
+ catch
+ {
+ //Logger.Log("IsPrimary: problem when executing query fo=
r isPrimary flag ",LogLevel.Trace);
+ }
+ =20
+ //Logger.Log("IsPrimary: res=3D " + res,LogLevel.Trace);
+ bool isPrimary =3D (res =3D=3D "True");
+ =20
+ return isPrimary;
+ }
+ =20
override public bool IsSelfLookUp(string sysAttName)
{
string req =3D "select \"isSelfLookup\" from attribute where \"sysAtt=
Name\" =3D '" + sysAttName + "'";
Modified: humano2/trunk/core/db/pgsql/pgsqlCrud.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/pgsqlCrud.cs 2005-05-26 16:09:36 UTC (rev=
1150)
+++ humano2/trunk/core/db/pgsql/pgsqlCrud.cs 2005-05-26 16:17:12 UTC (rev=
1151)
@@ -1756,28 +1756,27 @@
=20
absCrud crud =3D Factory.Crud();
absComplex complex =3D crud.GetCore().Complex;
- Logger.Log("finSqlTypeForAttribute: name=3D " + name,LogLeve=
l.Trace);
+ //Logger.Log("finSqlTypeForAttribute: name=3D " + name,LogLe=
vel.Trace);
=20
string [] nameSplit =3D name.Split((".").ToCharArray());
string aux =3D nameSplit[1]; //The before last element of sp=
lit has got the good data (sysName of attribute)
aux =3D aux.Replace("\"",""); //Remove "
- Logger.Log("findSqlTypeForAttribute: aux =3D " + aux, LogLe=
vel.Trace);
+ //Logger.Log("findSqlTypeForAttribute: aux =3D " + aux, Log=
Level.Trace);
=20
int id_entity =3D complex.ConvertSysAttNameToIdAttName(aux);
=20
- =20
string res;
=20
if(id_entity =3D=3D -1)
{
- Logger.Log("findSqlTypeForAttribute: id_entity =3D=3D -1=
",LogLevel.Trace);
+ //Logger.Log("findSqlTypeForAttribute: id_entity =3D=3D =
-1",LogLevel.Trace);
res =3D null;
}
else
{ =20
int classIdOfAttribute =3D complex.getClassIdofInstance(=
id_entity);=20
string basicAttributeSysName =3D complex.GetBasicAttribu=
teSysName(classIdOfAttribute);
- Logger.Log("findSqlTypeForAttribute: basicAttributeSysNa=
me=3D " + basicAttributeSysName,LogLevel.Trace);
+ //Logger.Log("findSqlTypeForAttribute: basicAttributeSys=
Name=3D " + basicAttributeSysName,LogLevel.Trace);
res =3DattMap[basicAttributeSysName];
}
return res;
Modified: humano2/trunk/web/portal/site/addOption.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/addOption.aspx.cs 2005-05-26 16:09:36 U=
TC (rev 1150)
+++ humano2/trunk/web/portal/site/addOption.aspx.cs 2005-05-26 16:17:12 U=
TC (rev 1151)
@@ -8,8 +8,9 @@
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
-using Humano2.Core;
-using Humano2.Core.Db;
+
+using Humano2.Core;
+using Humano2.Core.Db;
using Humano2.Components.WebTools;
=20
namespace Portal
@@ -20,27 +21,68 @@
public class addOption : System.Web.UI.Page
{
=09
+ private adapter dbAdapter;
+ =20
private void Page_Load(object sender, System.EventArgs e)
{
+ dbAdapter =3D new adapter();
+ =20
string strXml=3D"";=09
int classId=3DConvert.ToInt32(Request.QueryString["classId"]);
=20
-
- adapter dbAdapter =3D new adapter();
+ //adapter dbAdapter =3D new adapter();
DataTable attributeTable =3D dbAdapter.GetAttributesFromClass(classId=
);
=20
strXml =3D"<script>\r\n";
strXml +=3D"function AddattOption(){\r\n";
foreach(DataRow currAtt in attributeTable.Rows)=20
{
- strXml +=3D "parent.AddAtt('" + currAtt["id_entity"] + "','" + currA=
tt["attName"] + "');\r\n";
- }=09
+ int idAtt =3D Convert.ToInt32(currAtt["id_entity"]);
+ if(currAtt["attType"].ToString()!=3D"pertinence")
+ {
+ strXml +=3D "parent.AddAtt('" + idAtt;=20
+ }
+ else
+ {
+ DataTable dtpert =3D dbAdapter.GetClassesFromPertine=
nce(Convert.ToInt32(currAtt["id_entity"]));
+ DataRow dr2 =3D dtpert.Rows[0];
+ int idClassRel =3D Convert.ToInt32(dr2["to"].ToString());
+ =09
+ //For each attribute of pertinence put the id with t=
ogo
+ int relAttId =3D getPrimaryAttributeIdForClass(idCla=
ssRel);
+ strXml +=3D "parent.AddAtt('" + idAtt + "^" + relAtt=
Id;
+ }
+ =20
+ strXml +=3D "','" + currAtt["attName"] + "');\r\n"; //T=
he name of attribute=20
+ }
//AttAdd.Text=3DstrXml;
strXml +=3D"}\r\n";
strXml +=3D"</script>\r\n";
+ Logger.Log("addOption.aspx.cs. strXml=3D " + strXml,LogLevel=
.Trace);
Response.Write(strXml);
}
-
+ =20
+ private int getPrimaryAttributeIdForClass(int classId)
+ {
+ Logger.Log("getPrimaryAttributeIdForClass (before)",LogLevel=
.Trace);
+ absCrud crud =3D Factory.Crud();
+ absComplex complex =3D crud.GetCore().Complex;
+ =20
+ DataTable res =3D dbAdapter.GetAttributesFromClass(classId);
+ int idAtt =3D 0;
+ int i=3D0;
+ foreach(DataRow row in res.Rows)
+ {
+ if(complex.IsPrimary(Convert.ToInt32(row["id_entity"])))
+ {
+ idAtt =3D Convert.ToInt32(row["id_entity"]);
+ break; =20
+ }
+ }
+ Logger.Log("getPrimaryAttributeIdForClass (after)",LogLevel.=
Trace);
+ return idAtt;
+ }
+ =20
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
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-05-26 16:09:36 UT=
C (rev 1150)
+++ humano2/trunk/web/portal/site/showView.aspx.cs 2005-05-26 16:17:12 UT=
C (rev 1151)
@@ -101,13 +101,10 @@
if (isSearch =3D=3D 0)
{
idEntity =3D Convert.ToInt32(Request.QueryString["id_entity"]);
- Logger.Log("idEntity: " + idEntity,LogLevel.Trace);
}
- else
- {
- idEntity =3D iniClass;
- }
+ =09
=20
+ Logger.Log("idEntity: " + idEntity,LogLevel.Trace);
string orderArr =3D Convert.ToString(Request.QueryString["or=
der"]);
=20
int currPage =3D Convert.ToInt32(Request.QueryString["page"]=
);
@@ -117,11 +114,11 @@
}
=20
//Logger.Log("showView createXml: currPage" + currPage, LogL=
evel.Trace);
- if(isSearch =3D=3D 0)
- {
- Logger.Log("Before GetViewDataTableFromId: idEntity " +=
idEntity,LogLevel.Trace);
- viewTable =3D dbAdapter.GetViewDataTableFromId(idEntity, out iniClas=
s);
- }
+ =20
+ if(isSearch =3D=3D 0)
+ {
+ viewTable =3D dbAdapter.GetViewDataTableFromId(idEntity,=
out iniClass);
+ }
else
{
viewTable =3D getStructForSearch(iniClass,idAttributes,idOperators,v=
aluesToSearch);
@@ -130,7 +127,7 @@
// If there are multiple "order" arguments, they should be s=
eperated by ",";
// The framework already puts a "," between multiple "order =
arguments.
Logger.Log("Before ExecViewFromDataTabe. iniClass=3D " + Con=
vert.ToString(iniClass),LogLevel.Trace);
- Logger.Log("idEntity: " + idEntity,LogLevel.Trace);
+ =20
DataTable viewRes =3D dbAdapter.ExecViewFromDataTable(iniCla=
ss, viewTable, idEntity, orderArr, currPage, 1);
=20
int pageCount=3D dbAdapter.NumberOfPagesInPagedView;
@@ -212,7 +209,7 @@
//Logger.Log("search: list of attributes =3D " + dr["columna"],LogLev=
el.Trace);
=20
//Explicacion de los filtros...
- char separator =3D '^';
+ char separator =3D '$';
dr["filtros"] =3D getFilters(idAttributes,idOperators,valuesToSearch,=
separator);
Logger.Log("search: filtros =3D " + dr["filtros"],LogLevel.Trace);
=20
@@ -223,18 +220,59 @@
=20
private string getAttributeListForClass(int classId)
{
- string columnsList =3D "0,";
+ absCrud crud =3D Factory.Crud();
+ absComplex complex =3D crud.GetCore().Complex;
+ =20
+ string columnsList =3D "0,";
DataTable res =3D userCred.CoreAdapter.GetAttributesFromClass(classId=
);
=20
foreach(DataRow row in res.Rows)
{
- columnsList +=3D row["id_entity"] + ","; =20
+ int idAtt =3D Convert.ToInt32(row["id_entity"]);
+ =09
+ if(row["attType"].ToString()!=3D"pertinence")
+ {
+ columnsList +=3D idAtt; =20
+ }
+ else
+ {
+ DataTable dtpert =3D userCred.CoreAdapter.GetClasses=
FromPertinence(idAtt);
+ DataRow dr2 =3D dtpert.Rows[0];
+ int idClassRel =3D Convert.ToInt32(dr2["to"].ToString());
+ //For each attribute of pertinence put the id with t=
ogo
+ int relAttId =3D getPrimaryAttributeIdForClass(idCla=
ssRel);
+ columnsList +=3D idAtt + "^" + relAttId;
+ }
+ columnsList +=3D ",";
}
=20
columnsList =3D columnsList.Substring(0,columnsList.Length-1); //Remo=
ve last ","
=20
return columnsList;
}
+ =20
+ =20
+ private int getPrimaryAttributeIdForClass(int classId)
+ {
+ Logger.Log("getPrimaryAttributeIdForClass (before)",LogLevel=
.Trace);
+ absCrud crud =3D Factory.Crud();
+ absComplex complex =3D crud.GetCore().Complex;
+ =20
+ DataTable res =3D userCred.CoreAdapter.GetAttributesFromClas=
s(classId);
+ int idAtt =3D 0;
+ int i=3D0;
+ foreach(DataRow row in res.Rows)
+ {
+ if(complex.IsPrimary(Convert.ToInt32(row["id_entity"])))
+ {
+ idAtt =3D Convert.ToInt32(row["id_entity"]);
+ break; =20
+ }
+ }
+ Logger.Log("getPrimaryAttributeIdForClass (after)",LogLevel.=
Trace);
+ return idAtt;
+ }
+ =20
private string getFilters(string idAttributes, string idOperators, str=
ing valuesToCompare, char separator)
{
string filter =3D"";
Modified: humano2/trunk/web/portal/site/topbar.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/topbar.aspx 2005-05-26 16:09:36 UTC (re=
v 1150)
+++ humano2/trunk/web/portal/site/topbar.aspx 2005-05-26 16:17:12 UTC (re=
v 1151)
@@ -1,89 +1,87 @@
<%@ Page language=3D"c#" Codebehind=3D"topbar.aspx.cs" AutoEventWireup=3D=
"false" Inherits=3D"Portal.site.topbar" %>
<html>
- <head>
- <title>topbar</title>
- <link href=3D"css/default.css" rel=3D"stylesheet" type=3D=
"text/css">
- <link href=3D"css/top.css" rel=3D"stylesheet" type=3D"te=
xt/css">
- <script language=3D"javascript">
- function salir()
- {
- top.document.location.href=3D"login.aspx=
";
- }
- =20
- function showType()
- {
- //var baseUrl =3D "instance.aspx?display=
=3DcreateXslt.aspx&action=3Dcreate&id_entity=3D";
- var baseUrl =3D "Data_structured.aspx?di=
splay=3DcreateXslt.aspx&action=3Dcreate&id_entity=3D";
- var dropdowner =3D document.Form1.create=
Type;
- var classId =3D dropdowner.options[dropd=
owner.selectedIndex].value;
- if(classId =3D=3D -1)=20
- {
- return;
- }
- var mainUrl =3D baseUrl + classId;
- parent.mainFrame.location =3D mainUrl;
- dropdowner.selectedIndex=3D0
- }
- =20
- function ChargeAtt(obj){
- var obj2 =3D document.Form1.ddl4
- for (var i =3D obj2.length - 1 ; i >=3D 0 ; i--)=20
- {
- obj2.options[i] =3D null;
- }
- if(obj.value!=3D'' && obj.value!=3D'0'){
- //document.frames['FrameTempLoad'].location.href=3D'Add_object_ba=
rra_left.aspx?TypeEntity=3D'+obj.value+'&&accion=3D1'
- document.getElementById('FrameTempLoad').src=3D'addOption.aspx?cl=
assId=3D'+obj.value
- } =20
- } =20
- =20
- function AddAtt(value,text){
- var obj =3D document.Form1.ddl4
- var nopcion =3D new Option(); =09
- nopcion.text =3D text;
- nopcion.value =3D value;
- obj[obj.length] =3D nopcion;
- } =20
-
-
- function EntitySearch()
- {
- if (document.Form1.strSearchedText.value=3D=3D'')
- {
- alert("Insert a text to search.");
- return false;
- }
-
- if (document.Form1.intEntityType.selectedIndex=3D=3D0)
- {
- alert("Select a class for search.");
- return false;
- } =09
- =09
- //window.parent.frames["mainFrame"].location.href=3D"search.aspx=
?iniClass=3D"+document.Form1.intEntityType[document.Form1.intEntityType.s=
electedIndex].value+"&idAttribute=3D"+document.Form1.ddl4[document.Form1.=
ddl4.selectedIndex].value+"&idOperator=3D7&textToSearch=3D"+document.Form=
1.strSearchedText.value
- window.parent.frames["mainFrame"].location.href=3D"Data_structur=
ed.aspx?iniClass=3D"+document.Form1.intEntityType[document.Form1.intEntit=
yType.selectedIndex].value+"&idAttribute=3D"+document.Form1.ddl4[document=
.Form1.ddl4.selectedIndex].value+"&idOperator=3D7&textToSearch=3D"+docume=
nt.Form1.strSearchedText.value
- =09
- }=09
- =09
- =20
- </script>
- <link href=3D"css/styles_home.css" rel=3D"stylesheet" ty=
pe=3D"text/css"/>
- </head>
- <body bgcolor=3D"#bfd2ea">
- <form method=3D"post" onsubmit=3D"return EntitySearch()"=
name=3D"Form1" id=3D"Form1">
- <div id=3D"createType">
- <!--Here we create the real content of t=
he page via xsl -->
- <% getContent("xsl/topbar.xsl"); %>
- <%=20
- //Response.Write (createXml());=20
- //Response.End();
- %>
- <br/>
- </div>
- <div id=3D"logout">
- <!-- Don't delete this button (asp call)=
-->
- </div>
- <iframe id=3D"FrameTempLoad" name=3D"FrameTempLo=
ad" frameborder=3D"0" width=3D"1" height=3D"1" ></iframe>
- </form>
- </body>
+ <head>
+ <title>topbar</title>
+ <link href=3D"css/default.css" rel=3D"stylesheet" type=3D"text/c=
ss">
+ <link href=3D"css/top.css" rel=3D"stylesheet" type=3D"text/css">
+ <script language=3D"javascript">
+ function salir()
+ {
+ top.document.location.href=3D"login.aspx";
+ }
+ =20
+ function showType()
+ {
+ //var baseUrl =3D "instance.aspx?display=3DcreateXslt.as=
px&action=3Dcreate&id_entity=3D";
+ var baseUrl =3D "Data_structured.aspx?display=3DcreateXs=
lt.aspx&action=3Dcreate&id_entity=3D";
+ var dropdowner =3D document.Form1.createType;
+ var classId =3D dropdowner.options[dropdowner.selectedIn=
dex].value;
+ if(classId =3D=3D -1)=20
+ {
+ return;
+ }
+ var mainUrl =3D baseUrl + classId;
+ parent.mainFrame.location =3D mainUrl;
+ dropdowner.selectedIndex=3D0
+ }
+ =20
+ function ChargeAtt(obj)
+ {
+ var obj2 =3D document.Form1.ddl4
+ for (var i =3D obj2.length - 1 ; i >=3D 0 ; i--)=20
+ {
+ obj2.options[i] =3D null;
+ }
+ if(obj.value!=3D'' && obj.value!=3D'0')
+ {
+ //document.frames['FrameTempLoad'].location.href=3D'=
Add_object_barra_left.aspx?TypeEntity=3D'+obj.value+'&&accion=3D1'
+ document.getElementById('FrameTempLoad').src=3D'addO=
ption.aspx?classId=3D'+obj.value
+ } =20
+ } =20
+ =20
+ function AddAtt(value,text)
+ {
+ var obj =3D document.Form1.ddl4
+ var nopcion =3D new Option(); =09
+ nopcion.text =3D text;
+ nopcion.value =3D value;
+ obj[obj.length] =3D nopcion;
+ } =20
+ =20
+ =20
+ function EntitySearch()
+ {
+ if (document.Form1.strSearchedText.value=3D=3D'')
+ {
+ alert("Insert a text to search.");
+ return false;
+ }
+ if (document.Form1.intEntityType.selectedIndex=3D=3D0)
+ {
+ alert("Select a class for search.");
+ return false;
+ } =09
+ //window.parent.frames["mainFrame"].location.href=3D"sea=
rch.aspx?iniClass=3D"+document.Form1.intEntityType[document.Form1.intEnti=
tyType.selectedIndex].value+"&idAttribute=3D"+document.Form1.ddl4[documen=
t.Form1.ddl4.selectedIndex].value+"&idOperator=3D7&textToSearch=3D"+docum=
ent.Form1.strSearchedText.value
+ window.parent.frames["mainFrame"].location.href=3D"Data_=
structured.aspx?iniClass=3D"+document.Form1.intEntityType[document.Form1.=
intEntityType.selectedIndex].value+"&idAttribute=3D"+document.Form1.ddl4[=
document.Form1.ddl4.selectedIndex].value+"&idOperator=3D7&textToSearch=3D=
"+document.Form1.strSearchedText.value =09
+ }=09
+ </script>
+ <link href=3D"css/styles_home.css" rel=3D"stylesheet" type=3D"te=
xt/css"/>
+ </head>
+ <body bgcolor=3D"#bfd2ea">
+ <form method=3D"post" onsubmit=3D"return EntitySearch()" name=3D"For=
m1" id=3D"Form1">
+ <div id=3D"createType">
+ <!--Here we create the real content of the page via xsl -->
+ <% getContent("xsl/topbar.xsl"); %>
+ <%=20
+ //Response.Write (createXml());=20
+ //Response.End();
+ %>
+ <br/>
+ </div>
+ <div id=3D"logout">
+ <!-- Don't delete this button (asp call) -->
+ </div>
+ <iframe id=3D"FrameTempLoad" name=3D"FrameTempLoad" frameborder=3D"0=
" width=3D"1" height=3D"1" ></iframe>
+ </form>
+ </body>
</html>
|