1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430
|
private void scan_module_form(String s) {
FormModule frm = FormModule.open(s);
JOptionPane c = new JOptionPane();
FileWriter fw;
try{
fw = new FileWriter("D:\\structure.txt");
col1=frm.getName();
col2=frm.getAbsolutePath();
col3=frm.getConsoleWindow();
col4=frm.getFirstNavigationBlockName();
col5=frm.getMenuModule();
String requet1="insert into Form values('"+col1+"',"+"'"+col2+"','" +col3+"','"+col4+"','"+col5+"')";
try{
if(rt.connect("BD1","ok","ok")){
System.out.println("connexion établie:niveau module");
rt.stmt.executeUpdate(requet1);
//rt.curJava = rt.stmt.executeUpdate(requet1);
}
else
System.out.println("Echec Connexion niveau module");}
catch (SQLException f) {
if (f instanceof SQLException){
if( f.getErrorCode()==1)
JOptionPane.showMessageDialog(c,"Le module est déja scanné","Terminé",JOptionPane.INFORMATION_MESSAGE);
else{
System.out.println("*****module******SQL Error Code is: " + ((SQLException)f).getErrorCode());
System.out.println("*****module******SQL Message Code is: " + f.getMessage());
System.out.println("*****module******SQL State is: " + ((SQLException)f).getSQLState());
}
}
System.out.println("*****module******Insert failed. " + ((SQLException)f).getMessage());
return;
}
//Recherche Des Canvas Niveau Form
JdapiIterator Canvas = frm.getCanvases();
while (Canvas.hasNext())
{
Canvas canv = (Canvas)Canvas.next();
// insert_canvas(frm,canv);
String c1=canv.getName();
String c2=frm.getName();
String c3=frm.getAbsolutePath();
String c4=GetCanvType(canv.getCanvasType());
String c5=canv.getWindowName();
int x6=canv.getHeight();
int x7=canv.getWidth();
String c8=canv.getVisualAttributeName();
String c9="";
try{
if(rt.connect("BD1","ok","ok")){
System.out.println("connexion établie canvas");
rt.spcanv.setString(1,c1);
rt.spcanv.setString(2,c2);
rt.spcanv.setString(3,c3);
rt.spcanv.setString(4,c4);
rt.spcanv.setString(5,c5);
rt.spcanv.setInt(6,x6);
rt.spcanv.setInt(7,x7);
rt.spcanv.setString(8,c8);
rt.spcanv.setString(9,c9);
rt.spcanv.execute();
}
else
System.out.println("Echec Connexion niveau canvas");
}
catch (SQLException f) {
if (f instanceof SQLException){
System.out.println("***canvas****SQL Error Code is: " + ((SQLException)f).getErrorCode());
System.out.println("****canvas*****SQL Message Code is: " + f.getMessage());
System.out.println("****canvas****SQL State is: " + ((SQLException)f).getSQLState());
}
System.out.println("****canvas****Insert failed. " + ((SQLException)f).getMessage());
return;
}
JdapiIterator graphs= canv.getGraphicses();
JdapiIterator tab=canv.getTabPages();
if((canv.getCanvasType())==4){
while(tab.hasNext()){
TabPage sss=(TabPage)tab.next();
String ong1=sss.getName();
String ong2=canv.getName();
String ong3=frm.getName();
String ong4=frm.getAbsolutePath();
try{
if(rt.connect("BD1","ok","ok")){
rt.spcanvong.setString(1,ong1);
rt.spcanvong.setString(2,ong2);
rt.spcanvong.setString(3,ong3);
rt.spcanvong.setString(4,ong4);
rt.spcanvong.execute();
}
else
System.out.println("Echec Connexion niveau onglet_canvas");
}
catch (SQLException f) {
if (f instanceof SQLException){
System.out.println("**onglet_canvas****SQL Error Code is: " + ((SQLException)f).getErrorCode());
System.out.println("***onglet_canvas*****SQL Message Code is: " + f.getMessage());
System.out.println("****onglet_canvas****SQL State is: " + ((SQLException)f).getSQLState());
}
System.out.println("****onglet_canvas****Insert failed. " + ((SQLException)f).getMessage());
return;
}
//insert_canvas_onglet(sss,canv,frm);
// fw.write("\t**** sss.getname****:"+ sss.getName()+"\n");
JdapiIterator grahtab=sss.getGraphicses();
while(grahtab.hasNext()){
Graphics xxx=(Graphics)grahtab.next();
String ongraph1=xxx.getName();
String ongraph2=sss.getName();
String ongraph3=canv.getName();
String ongraph4=frm.getName();
String ongraph5=frm.getAbsolutePath();
String ongraph6=GetGraphType(xxx.getGraphicsType());
try{
if(rt.connect("BD1","ok","ok")){
rt.spgraphong.setString(1,ongraph1);
rt.spgraphong.setString(2,ongraph2);
rt.spgraphong.setString(3,ongraph3);
rt.spgraphong.setString(4,ongraph4);
rt.spgraphong.setString(5,ongraph5);
rt.spgraphong.setString(6,ongraph6);
rt.spgraphong.execute();
}
else
System.out.println("Echec Connexion niveau onglet_graphique");
}
catch (SQLException f) {
if (f instanceof SQLException){ System.out.println("**onglet_graphique***SQL Error Code is: " + ((SQLException)f).getErrorCode()); System.out.println("**onglet_graphique****SQL Message Code is: " + f.getMessage()); System.out.println("***onglet_graphique***SQL State is: " + ((SQLException)f).getSQLState());
}
System.out.println("***onglet_graphique***Insert failed. " + ((SQLException)f).getMessage());
return;
}
}
}
}
else{
while (graphs.hasNext()){
Graphics grah=(Graphics)graphs.next();
String g1=grah.getName();
String g2=canv.getName();
String g3=frm.getName();
String g4=frm.getAbsolutePath();
String g5=GetGraphType(grah.getGraphicsType());
try{
if(rt.connect("BD1","ok","ok")){
rt.spgraph.setString(1,g1);
rt.spgraph.setString(2,g2);
rt.spgraph.setString(3,g3);
rt.spgraph.setString(4,g4);
rt.spgraph.setString(5,g5);
rt.spgraph.execute();
}
else
System.out.println("Echec Connexion niveau graphique");
}
catch (SQLException f) {
if (f instanceof SQLException){
System.out.println("**graphique***SQL Error Code is: " + ((SQLException)f).getErrorCode());
System.out.println("**graphique****SQL Message Code is: " + f.getMessage());
System.out.println("***graphique***SQL State is: " + ((SQLException)f).getSQLState());
}
System.out.println("***graphique***Insert failed. " + ((SQLException)f).getMessage());
return;
}
}
}
}
//Recherche Des Block Niveau Form
JdapiIterator blockForm = frm.getBlocks();
while (blockForm.hasNext()){
Block blk = (Block)blockForm.next();
String blk1=blk.getQualifiedName(false);
String blk2=frm.getName();
String blk3=frm.getAbsolutePath();
String blk4=blk.getDMLDataName();
String blk5=blk.getPreviousNavigationBlockName();
String blk6=blk.getNextNavigationBlockName();
boolean b7=blk.isDatabaseBlock();
boolean b8=blk.isQueryAllowed();
boolean b9=blk.isInsertAllowed();
boolean b10=blk.isUpdateAllowed();
boolean b11=blk.isDeleteAllowed();
String blk12=blk.getWhereClause();
String blk13=blk.getOrderByClause();
String blk14=blk.getVisualAttributeName();
String blk15="";
fw.write("\t*BlocNom:"+blk1+"\n");
fw.write("\t\tModNom:"+blk2+"\n");
fw.write("\t\tModChemin:"+blk3+"\n");
fw.write("\t\tSource:"+blk4+"\n");
fw.write("\t\tBlocNavPrec:"+blk5+"\n");
fw.write("\t\tBlocNavSuiv:"+blk6+"\n");
fw.write("\t\tBlocBasé:"+b7+"\n");
fw.write("\t\tInterrogationAutorisée:"+b8+"\n");
fw.write("\t\tInsertionAutorisée:"+b9+"\n");
fw.write("\t\tMiseAJourAutorisée:"+b10+"\n");
fw.write("\t\tSuppressionAutorisée:"+b11+"\n");
fw.write("\t\tWhere Clause:"+blk12+"\n");
fw.write("\t\tOderBy Clause:"+blk13+"\n");
fw.write("\t\tAttrVis:"+blk14+"\n");
fw.write("\t\tBib_Obj_Nom:"+blk15+"\n");
fw.write("\n");
try{
if(rt.connect("BD1","ok","ok")){
System.out.println("connexion établie niveau bloc");
rt.spbloc.setString(1,blk1);
rt.spbloc.setString(2,blk2);
rt.spbloc.setString(3,blk3);
rt.spbloc.setString(4,blk4);
rt.spbloc.setString(5,blk5);
rt.spbloc.setString(6,blk6);
rt.spbloc.setBoolean(7,b7);
rt.spbloc.setBoolean(8,b8);
rt.spbloc.setBoolean(9,b9);
rt.spbloc.setBoolean(10,b10);
rt.spbloc.setBoolean(11,b11);
rt.spbloc.setString(12,blk12);
rt.spbloc.setString(13,blk13);
rt.spbloc.setString(14,blk14);
rt.spbloc.setString(15,blk15);
rt.spbloc.execute();
}
else
System.out.println("Echec Connexion niveau bloc");
}
catch (SQLException f) {
if (f instanceof SQLException){
System.out.println("***bloc****SQL Error Code is: " + ((SQLException)f).getErrorCode());
System.out.println("***bloc****SQL Message Code is: " + f.getMessage());
System.out.println("***bloc****SQL State is: " + ((SQLException)f).getSQLState());
}
System.out.println("***bloc****Insert failed. " + ((SQLException)f).getMessage());
return;
}
//Recherche Des Triggers Niveau Block
JdapiIterator TrigBlock = blk.getTriggers();
while (TrigBlock.hasNext()){
Trigger TrigB = (Trigger)TrigBlock.next();
String decb1= TrigB.getName();
String decb2=blk.getQualifiedName(false);
String decb3=frm.getName();
String decb4=frm.getAbsolutePath();
String decb5= TrigB.getTriggerText();
String decb6="";
fw.write("\t\t*DecNom:"+decb1+"\n");
fw.write("\t\t\tBlocNom:"+decb2+"\n");
fw.write("\t\t\tModNom:"+decb3+"\n");
fw.write("\t\t\tModChemin:"+decb4+"\n");
// fw.write("\t\t\tDecText:"+decb5+"\n");
fw.write("\t\t\tItemNom:"+decb6+"\n");
fw.write("\n");
try{
if(rt.connect("BD1","ok","ok")){
System.out.println("connexion établie declencnheur bloc");
rt.spdecb.setString(1, decb1);
rt.spdecb.setString(2,decb2);
rt.spdecb.setString(3,decb3);
rt.spdecb.setString(4,decb4);
rt.spdecb.setString(5,decb5);
rt.spdecb.setString(6,decb6);
rt.spdecb.execute();
}
else
System.out.println("Echec Connexion declencheur bloc");}
catch (SQLException f) {
if (f instanceof SQLException)
{
System.out.println("***declencheur bloc****SQL Error Code is: " + ((SQLException)f).getErrorCode());
System.out.println("***declencheur bloc****SQL Message Code is: " + f.getMessage());
System.out.println("***declencheur bloc****SQL State is: " + ((SQLException)f).getSQLState());
}
System.out.println("***declencheur bloc****Insert failed. " + ((SQLException)f).getMessage());
return;
}
}
//Recherche Des Items Niveau Block
JdapiIterator itemBlock = blk.getItems();
while (itemBlock.hasNext()){
Item itm = (Item)itemBlock.next();
String col1 = itm.getName();
String col2=frm.getName();
String col3=frm.getAbsolutePath();
String col4=blk.getQualifiedName(false);
String col5=itm.getCanvasName();
String col6=itm.getColumnName();
String col7=blk.getDMLDataName();
String col8=GetItemType(itm.getItemType());
String col9=itm.getLovName();
String col10=itm.getVisualAttributeName();
String col11=itm.getLabel();
String col12 =itm.getNextNavigationItemName();
String col13=itm.getPreviousNavigationItemName();
int x14=itm.getXPosition();
int x15=itm.getYPosition();
int x16=itm.getWidth();
int x17=itm.getHeight();
fw.write("\t\t*Nom Item:"+col1+"\n");
fw.write("\t\t\tModNom:"+col2+"\n");
fw.write("\t\t\tModChemin:"+col3+"\n");
fw.write("\t\t\tBlocNom:"+col4+"\n");
fw.write("\t\t\tCanvasNom:"+col5+"\n");
fw.write("\t\t\tColNom:"+col6+"\n");
fw.write("\t\t\tSourceNom:"+col7+"\n");
fw.write("\t\t\tItemType:"+col8+"\n");
fw.write("\t\t\tLovNom:"+col9+"\n");
fw.write("\t\t\tAttrVis:"+col10+"\n");
fw.write("\t\t\tLabel:"+col11+"\n");
fw.write("\t\t\tITEMSuiv:"+col12+"\n");
fw.write("\t\t\tITEMPrec:"+col13+"\n");
fw.write("\t\t\tPosition X:"+x14+"\n");
fw.write("\t\t\tPosition Y:"+x15+"\n");
fw.write("\t\t\tLargeur:"+x16+"\n");
fw.write("\t\t\tLongueur X:"+x14+"\n");
/* try{
if(rt.connect("BD1","ok","ok")){
System.out.println("connexion établie niveau item");
rt.spitem.setString(1, col1);
rt.spitem.setString(2, col2);
rt.spitem.setString(3, col3);
rt.spitem.setString(4, col4);
rt.spitem.setString(5, col5);
rt.spitem.setString(6, col6);
rt.spitem.setString(7, col7);
rt.spitem.setString(8, col8);
rt.spitem.setString(9, col9);
rt.spitem.setString(10, col10);
rt.spitem.setString(11, col11);
rt.spitem.setString(12, col12);
rt.spitem.setString(13, col13);
rt.spitem.setInt(14, x14);
rt.spitem.setInt(15, x15);
rt.spitem.setInt(16, x16);
rt.spitem.setInt(17, x17);
rt.spitem.execute();
System.out.println("insertion de lelement"+col1);
}
else
System.out.println("Echec Connexion");}
catch (SQLException f) {
if (f instanceof SQLException)
{
System.out.println("***niveau item****SQL Error Code is: " + ((SQLException)f).getErrorCode());
System.out.println("***niveau item****SQL Message Code is: " + f.getMessage());
System.out.println("***niveau item****SQL State is: " + ((SQLException)f).getSQLState());
}
System.out.println("***niveau item****Insert failed. " + ((SQLException)f).getMessage());
return;
}*/
//Recherche Des Triggers Niveau Item
JdapiIterator TrigItem = itm.getTriggers();
while (TrigItem.hasNext()){
Trigger trigitem = ( Trigger)TrigItem.next();
String decbi1= trigitem.getName();
String decbi2=itm.getName();
String decbi3=blk.getQualifiedName(false);
String decbi4=frm.getName();
String decbi5=frm.getAbsolutePath();
String decbi6= trigitem.getTriggerText();
String decbi7="";
fw.write("\t\t*DecNom:"+decbi1+"\n");
fw.write("\t\t\tItemNom:"+decbi2+"\n");
fw.write("\t\t\tBlocNom:"+decbi3+"\n");
fw.write("\t\t\tModNom:"+decbi4+"\n");
fw.write("\t\t\tModChemin:"+decbi5+"\n");
// fw.write("\t\t\tDecText:"+decbi6+"\n");
fw.write("\t\t\tBib_Obj_Nom:"+decbi7+"\n");
fw.write("\n");
try{
if(rt.connect("BD1","ok","ok")){
System.out.println("connexion établie declencheur item");
rt.spdeci.setString(1, decbi1);
rt.spdeci.setString(2,decbi2);
rt.spdeci.setString(3,decbi3);
rt.spdeci.setString(4,decbi4);
rt.spdeci.setString(5,decbi5);
rt.spdeci.setString(6,decbi6);
rt.spdeci.setString(7,decbi7);
rt.spdeci.execute();
}
else
System.out.println("Echec Connexion declencheur item");}
catch (SQLException f) {
if (f instanceof SQLException)
{
System.out.println("****declencheur item*****SQL Error Code is: " + ((SQLException)f).getErrorCode());
System.out.println("****declencheur item*****SQL Message Code is: " + f.getMessage());
System.out.println("****declencheur item*****SQL State is: " + ((SQLException)f).getSQLState());
}
System.out.println("****declencheur item*****Insert failed. " + ((SQLException)f).getMessage());
return;
}
}
}
} |
Partager