Source Code Cross Referenced for WorkflowServiceCallerBean.java in  » Workflow-Engines » JFolder » org » jfolder » services » workflow » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » JFolder » org.jfolder.services.workflow 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         * JFolder, Copyright 2001-2006 Gary Steinmetz
0003:         *
0004:         * Distributable under LGPL license.
0005:         * See terms of license at gnu.org.
0006:         */
0007:
0008:        package org.jfolder.services.workflow;
0009:
0010:        //base classes
0011:        import java.io.File;
0012:        import java.io.IOException;
0013:        import java.math.BigDecimal;
0014:        import java.net.URL;
0015:        import java.sql.Connection;
0016:        import java.sql.PreparedStatement;
0017:        import java.sql.SQLException;
0018:        import java.util.Collection;
0019:        import java.util.HashMap;
0020:        import java.util.Iterator;
0021:        import java.util.Properties;
0022:        import javax.xml.parsers.ParserConfigurationException;
0023:        import org.w3c.dom.Document;
0024:        import org.w3c.dom.Element;
0025:        import org.w3c.dom.Node;
0026:        import org.w3c.dom.NodeList;
0027:        import org.xml.sax.SAXException;
0028:
0029:        //project specific classes
0030:        import org.jfolder.common.UnexpectedSystemException;
0031:        import org.jfolder.common.tagging.ConceptTagCharacteristic;
0032:        import org.jfolder.common.tagging.ConceptTagCharacteristicHolder;
0033:        import org.jfolder.common.tagging.ConceptTagMenuBranch;
0034:        import org.jfolder.common.tagging.ConceptTagMenuContext;
0035:        import org.jfolder.common.tagging.ConceptTagPreferences;
0036:        import org.jfolder.common.tagging.ConceptTagSetContext;
0037:        import org.jfolder.common.tagging.ConceptTagSetHolder;
0038:        import org.jfolder.common.tagging.RootConceptTagHolder;
0039:        import org.jfolder.common.utils.misc.MiscHelper;
0040:        import org.jfolder.common.utils.xml.LinearXPath;
0041:        import org.jfolder.common.utils.xml.LinearXPathHelper;
0042:        import org.jfolder.common.utils.xml.XMLHelper;
0043:        import org.jfolder.config.instance.ConfigInstance;
0044:        import org.jfolder.config.instance.ConfigInstanceConfig;
0045:        import org.jfolder.config.instance.ConfigInstanceTagHelper;
0046:        import org.jfolder.security.audit.SecurityAudit;
0047:        import org.jfolder.security.audit.SecurityAuditQuery;
0048:        import org.jfolder.security.audit.SecurityAuditSet;
0049:        import org.jfolder.security.model.UserHolder;
0050:        import org.jfolder.services.base.AbstractBaseServiceCallerBean;
0051:        import org.jfolder.workflow.model.dms.WorkflowDocumentSetUpdates;
0052:        import org.jfolder.workflow.model.instance.WorkflowInstance;
0053:        import org.jfolder.workflow.model.instance.WorkflowInstanceUpdates;
0054:        import org.jfolder.workflow.model.trigger.WorkflowTrigger;
0055:        import org.jfolder.workflow.query.ResultSetContainer;
0056:        import org.jfolder.workflow.query.StatementContainer;
0057:
0058:        //other classes
0059:
0060:        public class WorkflowServiceCallerBean extends
0061:                AbstractBaseServiceCallerBean implements  WorkflowServiceCaller {
0062:
0063:            protected WorkflowServiceCallerBean(URL inUrl) {
0064:                super (inUrl);
0065:            }
0066:
0067:            /*public abstract class AbstractWorkflowServiceCallerBean
0068:            extends AbstractDMSServiceCallerBean implements WorkflowService {
0069:            
0070:            protected AbstractWorkflowServiceCallerBean() {
0071:            }
0072:            
0073:            //public GenericHSQLWorkflowLifecycleBean() {
0074:            //}
0075:            
0076:            //protected BaseDBQueryVendorProprietarySyntax
0077:            //    getBaseDBQueryVendorProprietarySyntax() {
0078:            //    
0079:            //    return new HSQLQueryVendorProprietarySyntax();
0080:            //}
0081:            
0082:            public String updateWorkflowInstance(WorkflowInstanceUpdates inWiu) {
0083:                
0084:                throw UnexpectedSystemException.notImplemented();
0085:                //Connection con = null;
0086:                //
0087:                //try {
0088:                //    String outValue = null;
0089:                //    
0090:                //    con = getDatabaseConnection();
0091:                //    
0092:                //    boolean notNew = (inWiu.getId() != null);
0093:                //    
0094:                //    BigDecimal workflowInstanceId = null;
0095:                //    if (!notNew) {
0096:                //        workflowInstanceId = getNextIndex(con);
0097:                //    }
0098:                //    else {
0099:                //        workflowInstanceId = new BigDecimal(inWiu.getId());
0100:                //    }
0101:                //    
0102:                //    //
0103:                //    //SECURITY AUDIT
0104:                //    //
0105:                //    SecurityAudit sa = inWiu.getSecurityAudit();
0106:                //    BigDecimal saId = processSecurityAudit(sa, con);
0107:                //    MiscHelper.println("saId = " + saId);
0108:                //    
0109:                //    //
0110:                //    //DOCUMENT GROUP SET
0111:                //    //
0112:                //    WorkflowDocumentSetUpdates wdsu =
0113:                //        inWiu.getWorkflowDocumentSetUpdates();
0114:                //    BigDecimal wdsuId = processDocumentSet(
0115:                //        notNew, wdsu, workflowInstanceId, con);
0116:                //    
0117:                //    //
0118:                //    //TRIGGER
0119:                //    //
0120:                //    WorkflowTriggerUpdates wtu = inWiu.getWorkflowTriggerUpdates();
0121:                //    BigDecimal wtuId = processTrigger(
0122:                //        notNew, wtu, workflowInstanceId, con);
0123:                //    
0124:                //    //
0125:                //    
0126:                //    //
0127:                //    //INSTANCE
0128:                //    //
0129:                //    processWorkflowInstance(notNew, workflowInstanceId, con);
0130:                //    
0131:                //    //UserHolder user = sa.getAuditUser();
0132:                //    //MiscHelper.println("user.getName() = " + user.getName() );
0133:                //    //MiscHelper.println("user.getSc() = " + user.getSecurityClass());
0134:                //    //MiscHelper.println("sa.getId() = " + sa.getAuditId());
0135:                //    //MiscHelper.println("sa.getComment() = " + sa.getAuditComment());
0136:                //    //MiscHelper.println("sa.getStatus() = " + sa.getAuditStatus());
0137:                //    //MiscHelper.println("sa.getTime() = " + sa.getAuditTimestamp());
0138:                //    //if (sa.isAuditExceptionPresent()) {
0139:                //    //    MiscHelper.println("sa.getAuditExceptionMessage() = "
0140:                //    //        + sa.getAuditExceptionMessage());
0141:                //    //    MiscHelper.println("sa.getAuditExceptionSource() = "
0142:                //    //        + sa.getAuditExceptionSource());
0143:                //    //}
0144:                //    //
0145:                //    //for (int i = 0; i < wtu.getPropertyUpdateCount(); i++) {
0146:                //    //    MiscHelper.println("propCommand = "
0147:                //    //        + wtu.getPropertyCommand(i));
0148:                //    //    MiscHelper.println("propName = " + wtu.getPropertyName(i));
0149:                //    //    MiscHelper.println("propValu = " + wtu.getPropertyValue(i));
0150:                //    //}
0151:                //    //
0152:                //    
0153:                //    
0154:                //    
0155:                //    outValue = workflowInstanceId.toString();
0156:                //    
0157:                //    return outValue;
0158:                //}
0159:                ////catch (SQLException sqle) {
0160:                ////    throw new UnexpectedSystemException(sqle);
0161:                ////}
0162:                //finally {
0163:                //    closeDbResources(con, null, null);
0164:                //}
0165:            }
0166:            
0167:            //private BigDecimal processDocumentSet(boolean inNotNew,
0168:            //    WorkflowDocumentSetUpdates inWdsu, BigDecimal inWorkflowInstanceId,
0169:            //    Connection inCon) {
0170:            //
0171:            //    PreparedStatement ps = null;
0172:            //
0173:            //    try {
0174:            //        
0175:            //        BigDecimal outValue = null;
0176:            //        
0177:            //        if (!inNotNew) {
0178:            //            
0179:            //            outValue = getNextIndex(inCon);
0180:            //            
0181:            //            ps = inCon.prepareStatement(
0182:            //                "insert into T_JF_DOCUMENT_SETS"
0183:            //                + " (id_pk, workflow_id_fk)"
0184:            //                + " values (?, ?)");
0185:            //            ps.setBigDecimal(1, outValue);
0186:            //            ps.setBigDecimal(2, inWorkflowInstanceId);
0187:            //        }
0188:            //        else {
0189:            //            //ps = inCon.prepareStatement(
0190:            //            //    "update T_JF_DOCUMENT_SETS"
0191:            //            //    + " set workflow_template_id_fk = ?,"
0192:            //            //    + " document_set_id_fk = ?,"
0193:            //            //    + " trigger_data_id_fk = ?"
0194:            //            //    + " where id_pk = ?");
0195:            //            //ps.setBigDecimal(1, new BigDecimal(1));
0196:            //            //ps.setBigDecimal(2, new BigDecimal(1));
0197:            //            //ps.setBigDecimal(3, new BigDecimal(1));
0198:            //            //ps.setBigDecimal(4, inWorkflowInstanceId);
0199:            //            
0200:            //            //do nothing
0201:            //        }
0202:            //        
0203:            //        if (ps != null) {
0204:            //            int updateCount = ps.executeUpdate();
0205:            //        
0206:            //            if (updateCount < 1) {
0207:            //                throw new UnexpectedSystemException("Old Copy");
0208:            //            }
0209:            //            else if (updateCount > 1) {
0210:            //                throw new UnexpectedSystemException("Inconsistent State");
0211:            //            }
0212:            //            else {
0213:            //            }
0214:            //        }
0215:            //        
0216:            //        return outValue;
0217:            //    }
0218:            //    catch (SQLException sqle) {
0219:            //        throw new UnexpectedSystemException(sqle);
0220:            //    }
0221:            //    finally {
0222:            //        closeDbResources(null, ps, null);
0223:            //    }
0224:            //}
0225:            
0226:            //private BigDecimal processTrigger(boolean inNotNew,
0227:            //    WorkflowTriggerUpdates inWdsu, BigDecimal inWorkflowInstanceId,
0228:            //    Connection inConnection) {
0229:            //    
0230:            //    BigDecimal outValue = null;
0231:            //    
0232:            //    return outValue;
0233:            //}
0234:            
0235:            //private void processWorkflowInstance(boolean inNotNew,
0236:            //    BigDecimal inWorkflowInstanceId, Connection inCon) {
0237:            //    
0238:            //    PreparedStatement ps = null;
0239:            //    
0240:            //    try {
0241:            //        if (!inNotNew) {
0242:            //            ps = inCon.prepareStatement(
0243:            //                "insert into T_JF_WORKFLOW_INSTANCES"
0244:            //                + " (id_pk, workflow_template_id_fk, document_set_id_fk,"
0245:            //                    + " trigger_data_id_fk)"
0246:            //                + " values (?, ?, ?, ?)");
0247:            //            ps.setBigDecimal(1, inWorkflowInstanceId);
0248:            //            ps.setBigDecimal(2, new BigDecimal(1));
0249:            //            ps.setBigDecimal(3, new BigDecimal(1));
0250:            //            ps.setBigDecimal(4, new BigDecimal(1));
0251:            //        }
0252:            //        else {
0253:            //            ps = inCon.prepareStatement(
0254:            //                "update T_JF_WORKFLOW_INSTANCES"
0255:            //                + " set workflow_template_id_fk = ?,"
0256:            //                + " document_set_id_fk = ?,"
0257:            //                + " trigger_data_id_fk = ?"
0258:            //                + " where id_pk = ?");
0259:            //            ps.setBigDecimal(1, new BigDecimal(1));
0260:            //            ps.setBigDecimal(2, new BigDecimal(1));
0261:            //            ps.setBigDecimal(3, new BigDecimal(1));
0262:            //            ps.setBigDecimal(4, inWorkflowInstanceId);
0263:            //        }
0264:            //        
0265:            //        int updateCount = ps.executeUpdate();
0266:            //        
0267:            //        if (updateCount < 1) {
0268:            //            throw new UnexpectedSystemException("Old Copy");
0269:            //        }
0270:            //        else if (updateCount > 1) {
0271:            //            throw new UnexpectedSystemException("Inconsistent State");
0272:            //        }
0273:            //        else {
0274:            //        }
0275:            //    }
0276:            //    catch (SQLException sqle) {
0277:            //        throw new UnexpectedSystemException(sqle);
0278:            //    }
0279:            //    finally {
0280:            //        closeDbResources(null, ps, null);
0281:            //    }
0282:            //}
0283:            
0284:            //private BigDecimal processSecurityAudit(SecurityAudit inSa,
0285:            //    Connection inCon) {
0286:            //    
0287:            //    PreparedStatement ps = null;
0288:            //    
0289:            //    try {
0290:            //        
0291:            //        BigDecimal outValue = null;
0292:            //        
0293:            //        outValue = getNextIndex(inCon);
0294:            //        UserHolder uh = inSa.getAuditUser();
0295:            //        
0296:            //        ps = inCon.prepareStatement("insert into T_JF_SECURITY_AUDITS "
0297:            //            + "(id_pk, audit_version, audit_user_name, "
0298:            //                + "audit_user_security_class, audit_id, audit_status, "
0299:            //                + "audit_comment, audit_timestamp, "
0300:            //                + "audit_exception_message, audit_exception_source) "
0301:            //            + "values (?,?,?,?,?,?,?,?,?,?)");
0302:            //        ps.setBigDecimal(1, outValue);
0303:            //        //TO DO: change below
0304:            //        ps.setInt(2, 1);
0305:            //        ps.setString(3, uh.getName());
0306:            //        ps.setString(4, uh.getSecurityClass());
0307:            //        ps.setInt(5, inSa.getAuditId());
0308:            //        ps.setString(6, inSa.getAuditStatus());
0309:            //        ps.setString(7, inSa.getAuditComment());
0310:            //        ps.setLong(8, inSa.getAuditTimestamp());
0311:            //        ps.setString(9, inSa.getAuditExceptionMessage());
0312:            //        ps.setString(10, inSa.getAuditExceptionSource());
0313:            //        int updateCount = ps.executeUpdate();
0314:            //        //MiscHelper.println("update Count = " + updateCount);
0315:            //        //con.commit();
0316:            //        
0317:            //        //MiscHelper.println("autoCommit = " + con.getAutoCommit());
0318:            //        
0319:            //        return outValue;
0320:            //    }
0321:            //    catch (SQLException sqle) {
0322:            //        throw new UnexpectedSystemException(sqle);
0323:            //    }
0324:            //    finally {
0325:            //        closeDbResources(null, ps, null);
0326:            //    }
0327:            //}
0328:            
0329:            //private final static void closeDbResources(Connection inCon,
0330:            //    Statement inStatement, ResultSet inRs) {
0331:            //    
0332:            //    StringBuffer sb = new StringBuffer();
0333:            //    
0334:            //    try {
0335:            //        if (inRs != null) {
0336:            //            inRs.close();
0337:            //        }
0338:            //    }
0339:            //    catch (SQLException sqle) {
0340:            //        sb.append("|" + sqle.getMessage() + "|");
0341:            //    }
0342:            //    
0343:            //    try {
0344:            //        if (inStatement != null) {
0345:            //            inStatement.close();
0346:            //        }
0347:            //    }
0348:            //    catch (SQLException sqle) {
0349:            //        sb.append("|" + sqle.getMessage() + "|");
0350:            //    }
0351:            //    
0352:            //    try {
0353:            //        if (inCon != null) {
0354:            //            inCon.close();
0355:            //        }
0356:            //    }
0357:            //    catch (SQLException sqle) {
0358:            //        sb.append("|" + sqle.getMessage() + "|");
0359:            //    }
0360:            //    
0361:            //    if (sb.length() > 0) {
0362:            //        throw new UnexpectedSystemException(sb.toString());
0363:            //    }
0364:            //}
0365:            
0366:            public WorkflowInstance retrieveWorkflowInstance(String inId) {
0367:                throw UnexpectedSystemException.notImplemented();
0368:            }
0369:            
0370:            public String submitTriggerData(String inHandle, WorkflowTrigger inTd) {
0371:                
0372:                throw UnexpectedSystemException.notImplemented();
0373:                
0374:                //Connection con = null;
0375:                //PreparedStatement ps = null;
0376:                //
0377:                //try {
0378:                //    
0379:                //    String outValue = inHandle;
0380:                //    
0381:                //    con = getDatabaseConnection();
0382:                //    if (outValue == null) {
0383:                //        outValue = getNextIndex(con).toString();
0384:                //    }
0385:                //    
0386:                //    ps = con.prepareStatement("insert into " + T_TRIGGERS + " (" + ID
0387:                //        + ", " + WORKFLOW_ID + ", " + HANDLE + ", " + CONTENT + ", "
0388:                //        + AUDIT_ID + ", " + AUDIT_USER_ID + ", " + AUDIT_TIMESTAMP
0389:                //        + ", " + AUDIT_STATUS + ", " + AUDIT_COMMENT + ", "
0390:                //        + AUDIT_EXCEPTION_MESSAGE + ", " + AUDIT_EXCEPTION_SOURCE
0391:                //        + ")  values (null,?,?,?,?,?,?,?,?,?,?)");
0392:                //    //ps.setString(1, inTd.getWorkflowId());//TO DO: correct
0393:                //    ps.setString(2, outValue);
0394:                //    ps.setString(3, inTd.getDataAsString());
0395:                //    
0396:                //    //ps.setInt(4, inTd.getAuditId());
0397:                //    //ps.setInt(5, getFileIdOfUser(inTd.getAuditUser()));
0398:                //    //ps.setLong(6, inTd.getAuditTimestamp());
0399:                //    //ps.setString(7, inTd.getAuditStatus());
0400:                //    //ps.setString(8, inTd.getAuditComment());
0401:                //    //ps.setString(9, inTd.getAuditExceptionMessage());
0402:                //    //ps.setString(10, inTd.getAuditExceptionSource());
0403:                //    ps.execute();
0404:                //    
0405:                //    putTextMessageOnQueue(outValue, null, getTriggerQueue());
0406:                //    
0407:                //    return outValue;
0408:                //}
0409:                //catch (SQLException sqle) {
0410:                //    throw new UnexpectedSystemException(sqle);
0411:                //}
0412:                //finally {
0413:                //    try {
0414:                //        if (ps != null) {
0415:                //            ps.close();
0416:                //        }
0417:                //        if (con != null) {
0418:                //            con.close();
0419:                //        }
0420:                //    }
0421:                //    catch (SQLException sqle) {
0422:                //        throw new UnexpectedSystemException(sqle);
0423:                //    }
0424:                //}
0425:            }
0426:            public void updateTriggerDataStatus(String inHandle, WorkflowTrigger inTd) {
0427:                
0428:                throw UnexpectedSystemException.notImplemented();
0429:                //Connection con = null;
0430:                //PreparedStatement ps = null;
0431:                //try {
0432:                //    con = getDatabaseConnection();
0433:                //    
0434:                //    String update = "update " + T_TRIGGERS;
0435:                //    String set = " set " + WORKFLOW_ID + " = ?, "
0436:                //        + AUDIT_STATUS + " = ?,"
0437:                //        + AUDIT_EXCEPTION_MESSAGE + " = ?,"
0438:                //        + AUDIT_EXCEPTION_SOURCE + " = ?";
0439:                //    String where = " where " + HANDLE + " = ? and "
0440:                //        + AUDIT_ID + " = ?";
0441:                //    String query = update + set + where;
0442:                //    ps = con.prepareStatement(query);
0443:                //    //
0444:                //    //ps.setString(1, inTd.getWorkflowId());//TO DO: correct
0445:                //    //ps.setString(2, inTd.getAuditStatus());
0446:                //    //ps.setString(3, inTd.getAuditExceptionMessage());
0447:                //    //ps.setString(4, inTd.getAuditExceptionSource());
0448:                //    //
0449:                //    ps.setString(5, inHandle);
0450:                //    //ps.setInt(6, inTd.getAuditId());
0451:                //    //
0452:                //    ps.execute();
0453:                //}
0454:                //catch (SQLException sqle) {
0455:                //    throw new UnexpectedSystemException(sqle);
0456:                //}
0457:                //finally {
0458:                //    try {
0459:                //        if (ps != null) {
0460:                //            ps.close();
0461:                //        }
0462:                //        if (con != null) {
0463:                //            con.close();
0464:                //        }
0465:                //    }
0466:                //    catch (SQLException sqle) {
0467:                //        throw new UnexpectedSystemException(sqle);
0468:                //    }
0469:                //}
0470:            }
0471:            public WorkflowTrigger retrieveTriggerData(String inHandle) {
0472:                
0473:                throw UnexpectedSystemException.notImplemented();
0474:                //Connection con = null;
0475:                //PreparedStatement ps = null;
0476:                //ResultSet rs = null;
0477:                //
0478:                //try {
0479:                //    WorkflowTrigger outValue = null;
0480:                //    
0481:                //    con = getDatabaseConnection();
0482:                //    
0483:                //    String select = ("select " + WORKFLOW_ID + ", " + CONTENT + ", "
0484:                //        + AUDIT_ID + ", " + AUDIT_TIMESTAMP + ", "
0485:                //        + AUDIT_STATUS + ", "
0486:                //        + AUDIT_COMMENT + ", " + AUDIT_EXCEPTION_MESSAGE + ", "
0487:                //        + AUDIT_EXCEPTION_SOURCE + ", " + USER_NAME + ", "
0488:                //        + SECURITY_CLASS);
0489:                //    String from = (" from " + T_TRIGGERS + ", " + T_USERS);
0490:                //    String where = (" where " + (T_TRIGGERS + "." + HANDLE)
0491:                //        + " = ? and " + (T_TRIGGERS + "." + AUDIT_USER_ID) + " = "
0492:                //        + (T_USERS + "." + ID));
0493:                //    String orderBy = (" order by " + AUDIT_ID + " desc");
0494:                //    
0495:                //    String query = select + from + where + orderBy;
0496:                //    //MiscHelper.println("hsql.retrieveTriggerData.query - " + query);
0497:                //    
0498:                //    ps = con.prepareStatement(query);
0499:                //    ps.setString(1, inHandle);
0500:                //    rs = ps.executeQuery();
0501:                //    
0502:                //    if (rs.next()) {
0503:                //        String workflowId = rs.getString(1);
0504:                //        String content = rs.getString(2);
0505:                //        int auditId = rs.getInt(3);
0506:                //        long auditTimestamp = rs.getLong(4);
0507:                //        String auditStatus = rs.getString(5);
0508:                //        String auditComment = rs.getString(6);
0509:                //        String auditExceptionMessage = rs.getString(7);
0510:                //        String auditExceptionSource = rs.getString(8);
0511:                //        String auditUserName = rs.getString(9);
0512:                //        String auditSecurityClass = rs.getString(10);
0513:                //        
0514:                //        UserHolderContext uhc =
0515:                //            SecurityLifecycleHelper.getUserHolderContext(
0516:                //            auditUserName, auditSecurityClass);
0517:                //        
0518:                //        SecurityLifecycle sl =
0519:                //            SecurityLifecycleHelper.getSecurityLifecycle();
0520:                //        
0521:                //        UserHolder uh = sl.getUser(uhc);
0522:                //        
0523:                //        SecurityAudit wa = SecurityAudit.newInstance(
0524:                //            uh, auditId, auditComment, auditStatus, auditTimestamp);
0525:                //        
0526:                //        //TO DO: change below
0527:                //        if (auditExceptionMessage != null
0528:                //            || auditExceptionSource != null) {
0529:                //            wa.setAuditException(auditExceptionMessage,
0530:                //                auditExceptionSource);
0531:                //        }
0532:                //        
0533:                //        outValue = WorkflowTrigger.newInstance();
0534:                //    }
0535:                //    else {
0536:                //        throw new UnexpectedSystemException(
0537:                //            "No trigger for handle - '" + inHandle + "'");
0538:                //    }
0539:                //    
0540:                //    return outValue;
0541:                //}
0542:                //catch (SQLException sqle) {
0543:                //    throw new UnexpectedSystemException(sqle);
0544:                //}
0545:                //finally {
0546:                //    try {
0547:                //        if (rs != null) {
0548:                //            rs.close();
0549:                //        }
0550:                //        if (ps != null) {
0551:                //            ps.close();
0552:                //        }
0553:                //        if (con != null) {
0554:                //            con.close();
0555:                //        }
0556:                //    }
0557:                //    catch (SQLException sqle) {
0558:                //        throw new UnexpectedSystemException(sqle);
0559:                //    }
0560:                //}
0561:            }
0562:            
0563:            public ProjectScript[] accessDeployedScripts() {
0564:                
0565:                ProjectScript outValue[] = null;
0566:                
0567:                //
0568:                Object values[] = new Object[0];
0569:                
0570:                //
0571:                String types[] = new String[0];
0572:                
0573:                //
0574:                outValue = (ProjectScript[])invoke(
0575:                    "accessDeployedScripts", values, types);
0576:                
0577:                return outValue;
0578:                
0579:                //throw UnexpectedSystemException.notImplemented();
0580:                //MiscHelper.println("<!-- GenHSQLWfLcBean getDeployedScripts DB -->");
0581:                //WorkflowStore ws = WorkflowStoreFactory.getWorkflowStore();
0582:                //WorkflowDatabase wd = WorkflowDatabase.newInstance();
0583:                //Connection sampleConn = ws.getConnection();
0584:                //try {
0585:                //    wd.dropAllEntities(sampleConn, ws);
0586:                //    wd.createAllEntities(sampleConn, ws);
0587:                //}
0588:                //catch (Exception e) {
0589:                //    MiscHelper.println(e.getMessage());
0590:                //    e.printStackTrace();
0591:                //}
0592:                //finally {
0593:                //    ws.closeSQLObjects(sampleConn, null, null);
0594:                //}
0595:                //MiscHelper.println("<!--------------------------------------->");
0596:                //
0597:                //Connection con = null;
0598:                //PreparedStatement ps = null;
0599:                //ResultSet rs = null;
0600:                //
0601:                //try {
0602:                //    ProjectScript outValue[] = null;
0603:                //    
0604:                //    ConfigServiceCaller csc =
0605:                //        ConfigServiceCallerFactory.getConfigServiceCaller();
0606:                //    //ConfigLifecycle cm =
0607:                //    //ConfigLifecycleFactory.getConfigLifecycle();
0608:                //    
0609:                //    File scriptsDir = getScriptsDir();
0610:                //    
0611:                //    con = getDatabaseConnection();
0612:                //    
0613:                //    ps = con.prepareStatement("select " + SCRIPT_NAME + " from "
0614:                //        + T_DEPLOYED_SCRIPTS + " order by " + ID);
0615:                //    rs = ps.executeQuery();
0616:                //    ArrayList scriptList = new ArrayList();
0617:                //    while (rs.next()) {
0618:                //        String nextScript = rs.getString(1);
0619:                //        File nextScriptFile = new File(
0620:                //            scriptsDir, nextScript + ".xml");
0621:                //        if (nextScriptFile.exists()) {
0622:                //            scriptList.add(nextScriptFile);
0623:                //        }
0624:                //    }
0625:                //    
0626:                //    outValue = new ProjectScript[scriptList.size()];
0627:                //    for (int i = 0; i < scriptList.size(); i++) {
0628:                //        File nextFile = (File)scriptList.get(i);
0629:                //        String nextName =
0630:                //            MiscHelper.removeFileExtension(nextFile.getName());
0631:                //        outValue[i] = new GenericFileProjectScript(
0632:                //            nextFile, nextName);
0633:                //    }
0634:                //    
0635:                //    //cm.close();
0636:                //    
0637:                //    return outValue;
0638:                //}
0639:                //catch (SQLException sqle) {
0640:                //    throw new UnexpectedSystemException(sqle);
0641:                //}
0642:                //finally {
0643:                //    try {
0644:                //        if (rs != null) {
0645:                //            rs.close();
0646:                //        }
0647:                //        if (ps != null) {
0648:                //            ps.close();
0649:                //        }
0650:                //        if (con != null) {
0651:                //            con.close();
0652:                //        }
0653:                //    }
0654:                //    catch (SQLException sqle) {
0655:                //        throw new UnexpectedSystemException(sqle);
0656:                //    }
0657:                //}
0658:                //
0659:            }
0660:            
0661:            public void setDeployedScripts(ProjectScript inWs[]) {
0662:                
0663:                throw UnexpectedSystemException.notImplemented();
0664:                //Connection con = null;
0665:                //PreparedStatement ps = null;
0666:                //PreparedStatement ps2 = null;
0667:                //
0668:                //try {
0669:                //    ConfigServiceCaller csc =
0670:                //        ConfigServiceCallerFactory.getConfigServiceCaller();
0671:                //    //ConfigLifecycle cm =
0672:                //    ConfigLifecycleFactory.getConfigLifecycle();
0673:                //    
0674:                //    //delete existing deployed files
0675:                //    File scriptsDir = getScriptsDir();
0676:                //    File deployedScripts[] = scriptsDir.listFiles();
0677:                //    for (int i = 0; i < deployedScripts.length; i++) {
0678:                //        if (deployedScripts[i].isFile()
0679:                //            && deployedScripts[i].getName().endsWith(".xml")) {
0680:                //            deployedScripts[i].delete();
0681:                //        }
0682:                //    }
0683:                //    con = getDatabaseConnection();
0684:                //    ps = con.prepareStatement("delete from " + T_DEPLOYED_SCRIPTS);
0685:                //    ps.execute();
0686:                //    
0687:                //    //create new deployed files
0688:                //    for (int i = 0; i < inWs.length; i++) {
0689:                //        
0690:                //        ProjectScript nextScript = inWs[i];
0691:                //        
0692:                //        File nextScriptFile = new File(scriptsDir,
0693:                //            nextScript.getName() + ".xml");
0694:                //        
0695:                //        MiscHelper.writeTextFile(nextScriptFile,
0696:                //            nextScript.getContent());
0697:                //        
0698:                //        ps2 = con.prepareStatement("insert into " + T_DEPLOYED_SCRIPTS
0699:                //            + " (" + ID + ", " + SCRIPT_NAME + ")  values (null,?)");
0700:                //        ps2.setString(1, nextScript.getName());
0701:                //        ps2.execute();
0702:                //        //TO DO: fix below, use array
0703:                //        ps2.close();
0704:                //        ps2 = null;
0705:                //    }
0706:                //    
0707:                //    //cm.close();
0708:                //}
0709:                //catch (SQLException sqle) {
0710:                //    throw new UnexpectedSystemException(sqle);
0711:                //}
0712:                //finally {
0713:                //    try {
0714:                //        if (ps != null) {
0715:                //            ps.close();
0716:                //        }
0717:                //        if (ps2 != null) {
0718:                //            ps2.close();
0719:                //        }
0720:                //        if (con != null) {
0721:                //            con.close();
0722:                //        }
0723:                //    }
0724:                //    catch (SQLException sqle) {
0725:                //        throw new UnexpectedSystemException(sqle);
0726:                //    }
0727:                //}
0728:            }
0729:            
0730:            //protected int getFileIdOfUser(UserHolder inUh) {
0731:            //    
0732:            //    Connection con = null;
0733:            //    PreparedStatement ps = null;
0734:            //    ResultSet rs = null;
0735:            //    PreparedStatement ps2 = null;
0736:            //    //ResultSet rs2 = null;
0737:            //    PreparedStatement ps3 = null;
0738:            //    ResultSet rs3 = null;
0739:            //    
0740:            //    try {
0741:            //        int outValue = 0;
0742:            //        
0743:            //        String name = inUh.getName();
0744:            //        String securityClass = inUh.getSecurityClass();
0745:            //        
0746:            //        //check if id is already present
0747:            //        con = getDatabaseConnection();
0748:            //        ps = con.prepareStatement(
0749:            //            "select " + ID + " from " + T_USERS + " where "
0750:            //            + USER_NAME + " = ? and " + SECURITY_CLASS + " = ?");
0751:            //        ps.setString(1, name);
0752:            //        ps.setString(2, securityClass);
0753:            //        rs = ps.executeQuery();
0754:            //        
0755:            //        //get id
0756:            //        if (rs.next()) {
0757:            //            outValue = rs.getInt(1);
0758:            //        }
0759:            //        else {
0760:            //            //insert user into
0761:            //            ps2 = con.prepareStatement("insert into " + T_USERS
0762:            //                + " (" + ID + ", " + USER_NAME + ", " + SECURITY_CLASS
0763:            //                + ") values (null,?,?)");
0764:            //            ps2.setString(1, name);
0765:            //            ps2.setString(2, securityClass);
0766:            //            ps2.execute();
0767:            //            
0768:            //            //get user id
0769:            //            ps3 = con.prepareStatement("CALL IDENTITY()");
0770:            //            rs3 = ps3.executeQuery();
0771:            //            //rs3 = ps2.executeQuery("CALL IDENTITY()");
0772:            //            while (rs3.next()) {
0773:            //                outValue = rs3.getInt(1);
0774:            //            }
0775:            //        }
0776:            //        
0777:            //        return outValue;
0778:            //    }
0779:            //    catch (SQLException sqle) {
0780:            //        throw new UnexpectedSystemException(sqle);
0781:            //    }
0782:            //    finally {
0783:            //        try {
0784:            //            if (rs != null) {
0785:            //                rs.close();
0786:            //            }
0787:            //            if (ps != null) {
0788:            //                ps.close();
0789:            //            }
0790:            //            //if (rs2 != null) {
0791:            //            //    rs.close();
0792:            //            //}
0793:            //            if (ps2 != null) {
0794:            //                ps.close();
0795:            //            }
0796:            //            if (rs3 != null) {
0797:            //                rs.close();
0798:            //            }
0799:            //            if (ps3 != null) {
0800:            //                ps.close();
0801:            //            }
0802:            //            if (con != null) {
0803:            //                con.close();
0804:            //            }
0805:            //        }
0806:            //        catch (SQLException sqle) {
0807:            //            throw new UnexpectedSystemException(sqle);
0808:            //        }
0809:            //    }
0810:            //}
0811:            
0812:            //public WorkflowInstance retrieveWorkflowInstance(String inId) {
0813:            //    
0814:            //    Connection con = null;
0815:            //    PreparedStatement ps = null;
0816:            //    ResultSet rs = null;
0817:            //    
0818:            //    try {
0819:            //        WorkflowInstance outValue = null;
0820:            //
0821:            //        con = getDatabaseConnection();
0822:            //
0823:            //        ps = con.prepareStatement(
0824:            //            "select " + WF_INSTANCE + " from " + T_WORKFLOWS
0825:            //                + " where " + ID + " = ?");
0826:            //        ps.setString(1, inId);
0827:            //        ps.execute();
0828:            //
0829:            //        rs = ps.getResultSet();
0830:            //        if (rs.next()) {
0831:            //
0832:            //            String r = rs.getString(1);
0833:            //            StringBuffer sb = new StringBuffer(r);
0834:            //            
0835:            //            //MiscHelper.println("hsql.retrieveWi = " + sb);
0836:            //            
0837:            //            outValue = VersionHelper.fromXMLToWorkflowInstance(
0838:            //                sb.toString());
0839:            //        }
0840:            //        else {
0841:            //            throw new UnexpectedSystemException(
0842:            //                "No workflow-instance found with id '" + inId + "'.");
0843:            //        }
0844:            //
0845:            //        return outValue;
0846:            //    }
0847:            //    catch (SQLException sqle) {
0848:            //        throw new UnexpectedSystemException(sqle);
0849:            //    }
0850:            //    finally {
0851:            //        try {
0852:            //            if (rs != null) {
0853:            //                rs.close();
0854:            //            }
0855:            //            if (ps != null) {
0856:            //                ps.close();
0857:            //            }
0858:            //            if (con != null) {
0859:            //                con.close();
0860:            //            }
0861:            //        }
0862:            //        catch (SQLException sqle) {
0863:            //            throw new UnexpectedSystemException(sqle);
0864:            //        }
0865:            //    }
0866:            //}
0867:            
0868:            //protected BigDecimal getNextIndex(Connection inCon) {
0869:            //    
0870:            //    Statement st = null;
0871:            //    
0872:            //    try {
0873:            //        
0874:            //        BigDecimal outValue = null;
0875:            //        
0876:            //        st = inCon.createStatement();
0877:            //        int resultRow = st.executeUpdate(
0878:            //            "INSERT INTO seqTable(id) VALUES (NULL)");
0879:            //        ResultSet rset = st.executeQuery("SELECT MAX(id) FROM seqTable");
0880:            //        int rint = 0;
0881:            //        while (rset.next()) {
0882:            //                rint = rset.getInt(1);
0883:            //        }
0884:            //        outValue = new BigDecimal((double)rint);
0885:            //        st.close();
0886:            //        
0887:            //        return outValue;
0888:            //    }
0889:            //    catch (SQLException sqle) {
0890:            //        throw new UnexpectedSystemException(sqle);
0891:            //    }
0892:            //    finally {
0893:            //        try {
0894:            //            if (st != null) {
0895:            //                st.close();
0896:            //            }
0897:            //        }
0898:            //        catch (SQLException sqle) {
0899:            //            throw new UnexpectedSystemException(sqle);
0900:            //        }
0901:            //    }
0902:            //}
0903:            
0904:            //protected void updateWorkflowInstance(Connection inCon,
0905:            //    String inPfId, WorkflowInstance inWorkflow) {
0906:            //    
0907:            //    PreparedStatement ps = null;
0908:            //    
0909:            //    try {
0910:            //        BigInteger currentStateCode = inWorkflow.getStateCode();
0911:            //        BigInteger updatedStateCode =
0912:            //            currentStateCode.add(new BigInteger("1"));
0913:            //
0914:            //        String workflowText = VersionHelper.fromWorkflowInstanceToXML(
0915:            //            inWorkflow, updatedStateCode);
0916:            //        //MiscHelper.println(
0917:            //        //    "GenericHSQLWorkflowLifecycleBean - workflowTx");
0918:            //        //MiscHelper.println(workflowText);
0919:            //
0920:            //        ps = inCon.prepareStatement(
0921:            //            "update " + T_WORKFLOWS + " set "
0922:            //            + WF_INSTANCE + " = ?, " + STATE_CODE + " = ? where "
0923:            //            + ID + " = ? and " + STATE_CODE + " = ?");
0924:            //
0925:            //        ps.setString(1, new String(workflowText));
0926:            //        ps.setBigDecimal(2, new BigDecimal(updatedStateCode));
0927:            //        ps.setBigDecimal(3, new BigDecimal(inPfId));
0928:            //        ps.setBigDecimal(4, new BigDecimal(currentStateCode));
0929:            //
0930:            //        ps.execute();
0931:            //        int updateCount = ps.getUpdateCount();
0932:            //        
0933:            //        if (updateCount != 1) {
0934:            //            throw new UnexpectedSystemException(
0935:            //                "Workflow-instance with id (" + inPfId
0936:            //                + ") has already been updated.");
0937:            //        }
0938:            //    }
0939:            //    catch (SQLException sqle) {
0940:            //        throw new UnexpectedSystemException(sqle);
0941:            //    }
0942:            //    catch (IOException ioe) {
0943:            //        throw new UnexpectedSystemException(ioe);
0944:            //    }
0945:            //    finally {
0946:            //        try {
0947:            //            if (ps != null) {
0948:            //                ps.close();
0949:            //            }
0950:            //        }
0951:            //        catch (SQLException sqle) {
0952:            //            throw new UnexpectedSystemException(sqle);
0953:            //        }
0954:            //    }
0955:            //}
0956:            
0957:            //protected void insertWorkflowInstance(Connection inCon,
0958:            //    String inPfId, WorkflowInstance inWorkflow) {
0959:            //    
0960:            //    PreparedStatement ps = null;
0961:            //    
0962:            //    try {
0963:            //        //TO DO: update query variables
0964:            //        
0965:            //        //MiscHelper.println("inWorkflow = " + inWorkflow);
0966:            //        //MiscHelper.println("getStateCode = "
0967:            //        //+ inWorkflow.getStateCode());
0968:            //        //MiscHelper.println("xml = "
0969:            //        //    + VersionHelper.fromWorkflowInstanceToXML(inWorkflow,
0970:            //        //        inWorkflow.getStateCode()));
0971:            //        Document workflowDocument = XMLHelper.loadDocument(
0972:            //            VersionHelper.fromWorkflowInstanceToXML(inWorkflow,
0973:            //            inWorkflow.getStateCode()));
0974:            //        StringWriter sw = new StringWriter();
0975:            //        
0976:            //        XMLHelper.writeDocument(workflowDocument, sw);
0977:            //        
0978:            //        String workflowXml = sw.toString();
0979:            //        
0980:            //        StringReader sr = new StringReader(workflowXml);
0981:            //        
0982:            //        ps = inCon.prepareStatement(
0983:            //            "insert into " + T_WORKFLOWS
0984:            //            + " (" + ID + ", " + WF_INSTANCE + ", " + STATE_CODE
0985:            //            + ") values (?,?,?)");
0986:            //        
0987:            //        //MiscHelper.println("workflowXml.len() = "
0988:            //        //+ workflowXml.length());
0989:            //        ps.setString(1, inPfId);
0990:            //        //ps.setCharacterStream(2, sr, workflowXml.length());
0991:            //        ps.setString(2, workflowXml);
0992:            //        ps.setBigDecimal(3, new BigDecimal(inWorkflow.getStateCode()));
0993:            //        ps.execute();
0994:            //        
0995:            //    }
0996:            //    catch (SQLException sqle) {
0997:            //        throw new UnexpectedSystemException(sqle);
0998:            //    }
0999:            //    catch (ParserConfigurationException pce) {
1000:            //        throw new UnexpectedSystemException(pce);
1001:            //    }
1002:            //    catch (SAXException saxe) {
1003:            //        throw new UnexpectedSystemException(saxe);
1004:            //    }
1005:            //    catch (IOException ioe) {
1006:            //        throw new UnexpectedSystemException(ioe);
1007:            //    }
1008:            //    finally {
1009:            //        try {
1010:            //            if (ps != null) {
1011:            //                ps.close();
1012:            //            }
1013:            //        }
1014:            //        catch (SQLException sqle) {
1015:            //            throw new UnexpectedSystemException(sqle);
1016:            //        }
1017:            //    }
1018:            //}
1019:            
1020:            //protected void insertWorkflowAttribute(Connection inCon,
1021:            //    String inPfId, String inAttrName, ValueAndClassForConceptTag inVac,
1022:            //    int inPubAttr, int inSysAttr) throws SQLException {
1023:            //    
1024:            //    //TO DO: check for attribute type, view, set flag for class type
1025:            //    
1026:            //    PreparedStatement ps = null;
1027:            //    
1028:            //    try {
1029:            //        final String INSERT_QUERY =
1030:            //            "insert into " + T_ATTRIBUTES + " ("
1031:            //            + ID + ", " + JF_ID + ", "
1032:            //            + ATTR_NAME + ", " + DECIMAL_VALUE + ", "
1033:            //            + BOOLEAN_VALUE + ", "
1034:            //            + STRING_VALUE + ", " + LONG_STRING_VALUE + ", "
1035:            //            + BaseDBQueryVendor.ATTR_TYPE + ", "
1036:            //            + BaseDBQueryVendor.ATTR_ACCESS + ", "
1037:            //            + BaseDBQueryVendor.ATTR_CLASS
1038:            //            + ") values (?,?,?,?,?,?,?,?,?,?)";
1039:            //            //+ ") values (pf_sequence.nextval,?,?,?,?,?,?,?,?,?)";
1040:            //        Object value = inVac.getValue();
1041:            //        Class valueClass = inVac.getValueClass();
1042:            //    
1043:            //        ps = inCon.prepareStatement(INSERT_QUERY);
1044:            //    
1045:            //        BigDecimal inId = getNextIndex(inCon);
1046:            //        
1047:            //        ps.setBigDecimal(1, inId);
1048:            //        ps.setString(2, inPfId);
1049:            //        ps.setString(3, inAttrName.toUpperCase());
1050:            //        ps.setInt(8, inSysAttr);
1051:            //        ps.setInt(9, inPubAttr);
1052:            //    
1053:            //        if (MiscHelper.isClassNumber(valueClass)) {
1054:            //            //set class
1055:            //            ps.setInt(10, BaseDBQueryVendor.DECIMAL);
1056:            //        
1057:            //            //TO DO: check for null
1058:            //            if (value != null) {
1059:            //                ps.setBigDecimal(4,
1060:            //                    MiscHelper.fromNumberToBigDecimal(value));
1061:            //            }
1062:            //            else {
1063:            //                ps.setNull(4, Types.NUMERIC);
1064:            //            }
1065:            //            ps.setNull(5, Types.NUMERIC);
1066:            //            ps.setNull(6, Types.VARCHAR);
1067:            //            ps.setNull(7, Types.CLOB);
1068:            //        }
1069:            //        else if (value.getClass().getName().equals(
1070:            //            Boolean.class.getName())) {
1071:            //            //set class
1072:            //            ps.setInt(10, BaseDBQueryVendor.BOOLEAN);
1073:            //        
1074:            //            //TO DO: check for null
1075:            //            Boolean bValue = (Boolean)value;
1076:            //        
1077:            //            ps.setNull(4, Types.NUMERIC);
1078:            //            if (bValue == null) {
1079:            //                ps.setNull(5, Types.NUMERIC);
1080:            //            }
1081:            //            else if (bValue.booleanValue()) {
1082:            //                ps.setInt(5, 1);
1083:            //            }
1084:            //            else {
1085:            //                ps.setInt(5, 0);
1086:            //            }
1087:            //            ps.setNull(6, Types.VARCHAR);
1088:            //            ps.setNull(7, Types.CLOB);
1089:            //        
1090:            //        }
1091:            //        else {
1092:            //            //set class
1093:            //            ps.setInt(10, BaseDBQueryVendor.STRING);
1094:            //        
1095:            //            //TO DO: check for null
1096:            //            String sValue = null;
1097:            //            if (value != null) {
1098:            //                sValue = value.toString();
1099:            //            }
1100:            //        
1101:            //            ps.setNull(4, Types.NUMERIC);
1102:            //            ps.setNull(5, Types.NUMERIC);
1103:            //        
1104:            //            if (sValue == null) {
1105:            //                ps.setNull(6, Types.VARCHAR);
1106:            //                ps.setNull(7, Types.CLOB);
1107:            //            }
1108:            //            else if (sValue.length() <= 250) {
1109:            //                ps.setString(6, sValue);
1110:            //                ps.setNull(7, Types.CLOB);
1111:            //            }
1112:            //            else {
1113:            //                ps.setNull(6, Types.VARCHAR);
1114:            //                //ps.setCharacterStream(7, new StringReader(sValue),
1115:            //                    //  sValue.length());
1116:            //                ps.setString(7, new String(sValue));
1117:            //            }
1118:            //        }
1119:            //    
1120:            //        ps.execute();
1121:            //    }
1122:            //    finally {
1123:            //        try {
1124:            //            if (ps != null) {
1125:            //                ps.close();
1126:            //            }
1127:            //        }
1128:            //        catch (SQLException sqle) {
1129:            //            throw new UnexpectedSystemException(sqle);
1130:            //        }
1131:            //    }
1132:            //}
1133:            
1134:            //protected void updateWorkflowAttribute(Connection inCon,
1135:            //    String inPfId, String inAttrName, ValueAndClassForConceptTag inVac,
1136:            //    int inSysAttr) throws SQLException {
1137:            //    
1138:            //    //TO DO: check for attribute type, view, set flag for class type
1139:            //    
1140:            //    PreparedStatement ps = null;
1141:            //    try {
1142:            //        final String UPDATE_BOOLEAN =
1143:            //            "update " + T_ATTRIBUTES + " set "
1144:            //            + BOOLEAN_VALUE + " = ? where "
1145:            //            + JF_ID + " = ? and "
1146:            //            + ATTR_NAME + " = ? and "
1147:            //            + BaseDBQueryVendor.ATTR_TYPE + " = ?";
1148:            //    
1149:            //        final String UPDATE_DECIMAL =
1150:            //            "update " + T_ATTRIBUTES + " set " + DECIMAL_VALUE
1151:            //            + " = ? where "
1152:            //            + JF_ID + " = ? and " + ATTR_NAME + " = ? and "
1153:            //            + ATTR_TYPE + " = ?";
1154:            //    
1155:            //        final String UPDATE_STRING =
1156:            //            "update " + T_ATTRIBUTES + " set " + STRING_VALUE + " = ?, "
1157:            //            + LONG_STRING_VALUE + " = ? where " + JF_ID + " = ? and "
1158:            //            + ATTR_NAME + " = ? and " + ATTR_TYPE + " = ?";
1159:            //    
1160:            //        Object value = inVac.getValue();
1161:            //        Class valueClass = inVac.getValueClass();
1162:            //        inAttrName = inAttrName.toUpperCase();
1163:            //    
1164:            //        if (MiscHelper.isClassNumber(valueClass)) {
1165:            //        
1166:            //            ps = inCon.prepareStatement(UPDATE_DECIMAL);
1167:            //        
1168:            //            if (value != null) {
1169:            //                ps.setBigDecimal(1,
1170:            //                    MiscHelper.fromNumberToBigDecimal(value));
1171:            //            }
1172:            //            else {
1173:            //                ps.setNull(1, Types.NUMERIC);
1174:            //            }
1175:            //            ps.setString(2, inPfId);
1176:            //            ps.setString(3, inAttrName);
1177:            //            ps.setInt(4, inSysAttr);
1178:            //        }
1179:            //        else if (value.getClass().getName().equals(
1180:            //            Boolean.class.getName())) {
1181:            //        
1182:            //            ps = inCon.prepareStatement(UPDATE_BOOLEAN);
1183:            //        
1184:            //            Boolean bValue = (Boolean)value;
1185:            //        
1186:            //            if (bValue == null) {
1187:            //                ps.setNull(1, Types.NUMERIC);
1188:            //            }
1189:            //            else if (bValue.booleanValue()) {
1190:            //                ps.setInt(1, 1);
1191:            //            }
1192:            //            else {
1193:            //                ps.setInt(1, 0);
1194:            //            }
1195:            //            ps.setString(2, inPfId);
1196:            //            ps.setString(3, inAttrName);
1197:            //            ps.setInt(4, inSysAttr);
1198:            //        }
1199:            //        else {
1200:            //        
1201:            //            ps = inCon.prepareStatement(UPDATE_STRING);
1202:            //        
1203:            //            String sValue = null;
1204:            //            if (value != null) {
1205:            //                sValue = value.toString();
1206:            //            }
1207:            //        
1208:            //            if (sValue == null) {
1209:            //                ps.setNull(1, Types.VARCHAR);
1210:            //                //ps.setNull(2, Types.CLOB);
1211:            //                ps.setNull(2, Types.VARCHAR);
1212:            //            }
1213:            //            else if (sValue.length() <= 250) {
1214:            //                ps.setString(1, sValue);
1215:            //                //ps.setNull(2, Types.CLOB);
1216:            //                ps.setNull(2, Types.VARCHAR);
1217:            //            }
1218:            //            else {
1219:            //                ps.setNull(1, Types.VARCHAR);
1220:            //                //ps.setCharacterStream(2, new StringReader(sValue),
1221:            //                    //  sValue.length());
1222:            //                ps.setString(2, new String(sValue));
1223:            //            }
1224:            //            ps.setString(3, inPfId);
1225:            //            ps.setString(4, inAttrName);
1226:            //            ps.setInt(5, inSysAttr);
1227:            //        }
1228:            //    
1229:            //        ps.execute();
1230:            //    }
1231:            //    finally {
1232:            //        try {
1233:            //            if (ps != null) {
1234:            //                ps.close();
1235:            //            }
1236:            //        }
1237:            //        catch (SQLException sqle) {
1238:            //            throw new UnexpectedSystemException(sqle);
1239:            //        }
1240:            //    }
1241:            //}
1242:            //protected final static String T_JFOLDER_WORKFLOWS =
1243:            //    "T_JFOLDER_WORKFLOWS";
1244:            //protected final static String T_USERS = "T_USERS";
1245:            //protected final static String T_WORKFLOWS = "T_WORKFLOWS";
1246:            //protected final static String T_DEPLOYED_SCRIPTS = "T_DEPLOYED_SCRIPTS";
1247:            //protected final static String T_ATTRIBUTES =
1248:            //    BaseDBQueryVendor.T_ATTRIBUTES;
1249:            //protected final static String T_TRIGGERS = "T_TRIGGERS";
1250:            //
1251:            //protected final static String WF_INSTANCE = "WF_INSTANCE";
1252:            //protected final static String STATE_CODE = "STATE_CODE";
1253:            //protected final static String ID = BaseDBQueryVendor.ID;
1254:            //protected final static String SECURITY_CLASS = "SECURITY_CLASS";
1255:            //protected final static String USER_NAME = "USER_NAME";
1256:            //protected final static String SCRIPT_NAME = "SCRIPT_NAME";
1257:            //protected final static String WORKFLOW_ID = "WORKFLOW_ID";
1258:            //protected final static String HANDLE = "HANDLE";
1259:            //protected final static String CONTENT = "CONTENT";
1260:            //protected final static String AUDIT_ID = "AUDIT_ID";
1261:            //protected final static String AUDIT_USER_ID = "AUDIT_USER_ID";
1262:            //protected final static String AUDIT_TIMESTAMP = "AUDIT_TIMESTAMP";
1263:            //protected final static String AUDIT_STATUS = "AUDIT_STATUS";
1264:            //protected final static String AUDIT_COMMENT = "AUDIT_COMMENT";
1265:            //protected final static String AUDIT_EXCEPTION_MESSAGE =
1266:            //    "AUDIT_EXCEPTION_MESSAGE";
1267:            //protected final static String AUDIT_EXCEPTION_SOURCE =
1268:            //    "AUDIT_EXCEPTION_SOURCE";
1269:            
1270:            //
1271:            //protected final static String JF_ID = BaseDBQueryVendor.JF_ID;
1272:            //protected final static String ATTR_NAME = BaseDBQueryVendor.ATTR_NAME;
1273:            //protected final static String ATTR_TYPE = BaseDBQueryVendor.ATTR_TYPE;
1274:            //protected final static String DECIMAL_VALUE =
1275:            //    BaseDBQueryVendor.DECIMAL_VALUE;
1276:            //protected final static String BOOLEAN_VALUE =
1277:            //    BaseDBQueryVendor.BOOLEAN_VALUE;
1278:            //protected final static String STRING_VALUE =
1279:            //    BaseDBQueryVendor.STRING_VALUE;
1280:            //protected final static String LONG_STRING_VALUE =
1281:            //    BaseDBQueryVendor.LONG_STRING_VALUE;
1282:            
1283:            
1284:            //public BaseDBWorkflowLifecycleBean() {
1285:            //}
1286:            
1287:            //public void close() {
1288:            //    //not implemented, included in WorkflowLifecycle, not used
1289:            //}
1290:            
1291:            
1292:            //protected abstract BaseDBQueryVendorProprietarySyntax
1293:            //    getBaseDBQueryVendorProprietarySyntax();
1294:            
1295:            //protected abstract void updateWorkflowAttribute(Connection inCon,
1296:            //    String inPfId, String inAttrName, ValueAndClassForConceptTag inVac,
1297:            //    int inSysAttr) throws SQLException;
1298:            
1299:            //protected abstract void insertWorkflowAttribute(Connection inCon,
1300:            //    String inPfId, String inAttrName, ValueAndClassForConceptTag inVac,
1301:            //    int inPubAttr, int inSysAttr) throws SQLException;
1302:            
1303:            //protected abstract int getFileIdOfUser(UserHolder inUh);
1304:            
1305:            //protected abstract BigDecimal getNextIndex(Connection inCon);
1306:            
1307:            //protected abstract void insertWorkflowInstance(Connection inCon,
1308:            //    String inPfId, WorkflowInstance inWorkflow);
1309:            
1310:            //protected abstract void updateWorkflowInstance(Connection inCon,
1311:            //    String inPfId, WorkflowInstance inWorkflow);
1312:            
1313:            //public abstract String submitTriggerData(String inHandle,
1314:            //    TriggerData inTd);
1315:            
1316:            //public abstract void updateTriggerDataStatus(String inHandle,
1317:            //    TriggerData inTd);
1318:            
1319:            //public abstract TriggerData retrieveTriggerData(String inHandle);
1320:            
1321:            //properties functions
1322:            public void loadApplicationProperties(String inApp, Properties inProps) {
1323:                
1324:                throw UnexpectedSystemException.notImplemented();
1325:                //try {
1326:                //    File propsDir = getPropertiesDir();
1327:                //    File propsFile = new File(propsDir, inApp + ".properties");
1328:                //    FileOutputStream fos = new FileOutputStream(propsFile);
1329:                //
1330:                //    inProps.store(fos, "Application - " + inApp);
1331:                //}
1332:                //catch (FileNotFoundException fnfe) {
1333:                //    throw new UnexpectedSystemException(fnfe);
1334:                //}
1335:                //catch (IOException ioe) {
1336:                //    throw new UnexpectedSystemException(ioe);
1337:                //}
1338:            }
1339:            
1340:            public Properties getApplicationProperties(String inApp) {
1341:                
1342:                throw UnexpectedSystemException.notImplemented();
1343:                //try {
1344:                //    
1345:                //    Properties outValue = new Properties();
1346:                //    
1347:                //    File propsDir = getPropertiesDir();
1348:                //    File propsFile = new File(propsDir, inApp + ".properties");
1349:                //    FileInputStream fis = new FileInputStream(propsFile);
1350:                //    outValue.load(fis);
1351:                //    
1352:                //    return outValue;
1353:                //}
1354:                //catch (FileNotFoundException fnfe) {
1355:                //    throw new UnexpectedSystemException(fnfe);
1356:                //}
1357:                //catch (IOException ioe) {
1358:                //    throw new UnexpectedSystemException(ioe);
1359:                //}
1360:            }
1361:            
1362:            public void unloadApplicationProperties(String inApp) {
1363:                throw UnexpectedSystemException.notImplemented();
1364:                //File propsDir = getPropertiesDir();
1365:                //File propsFile = new File(propsDir, inApp + ".properties");
1366:                //propsFile.delete();
1367:            }
1368:            
1369:            //public void updateWorkflowInstance(WorkflowInstance inWi) {
1370:            //    
1371:            //    //throw UnexpectedSystemException.notImplemented();
1372:            //    Connection con = null;
1373:            //    
1374:            //    try {
1375:            //    
1376:            //        //MiscHelper.println(
1377:            //        //"GenericHSQLWorkflowLifecycleBean - updateWf");
1378:            //        
1379:            //        con = getDatabaseConnection();
1380:            //    
1381:            //        AttributeSet as = inWi.getAttributeSet();
1382:            //        ValueAndClassForConceptTag idVac =
1383:            //            as.getPublicSysAttr(AttributeSet.ID);
1384:            //        ValueAndClassForConceptTag statusVac =
1385:            //            as.getPublicSysAttr(AttributeSet.STATUS);
1386:            //    
1387:            //        String id = (String)idVac.getValue();
1388:            //        String status = (String)statusVac.getValue();
1389:            //    
1390:            //        updateWorkflowInstance(con, id, inWi);
1391:            //        storeWorkflowAttributes(con, id, as, false);
1392:            //    
1393:            //        //con.commit();//TO DO: remove this
1394:            //    
1395:            //        if (status.equals(TraceAudit.STATUS_ACTIVE)) {
1396:            //            putTextMessageOnQueue(id, null, getWorkflowQueue());
1397:            //        }
1398:            //    }
1399:            //    //catch (SQLException sqle) {
1400:            //    //    throw new UnexpectedSystemException(sqle);
1401:            //    //}
1402:            //    finally {
1403:            //        try {
1404:            //            if (con != null) {
1405:            //                con.close();
1406:            //            }
1407:            //        }
1408:            //        catch (SQLException sqle) {
1409:            //            throw new UnexpectedSystemException(sqle);
1410:            //        }
1411:            //    }
1412:            //
1413:            //    //TO DO: should this function return anything?
1414:            //
1415:            //}
1416:            
1417:            //TO DO: determine good function name and return type
1418:            //TO DO: is there a regular expressions library
1419:            //TO DO: determine if returning list of string ID's is okay
1420:            //TO DO: determine what should be returned in a query
1421:            //TO DO: determine what return will work with messaging and database
1422:            
1423:            //TO DO: determine good function name and return type
1424:            //TO DO: determine if returning list of string ID's is okay
1425:            //TO DO: determine what should be returned in a query
1426:            //TO DO: determine what return will work with messaging and database
1427:            public ResultSetContainer queryWorkflowInstances(
1428:                StatementContainer inStatement) {
1429:                
1430:                throw UnexpectedSystemException.notImplemented();
1431:                //Connection con = null;
1432:                //
1433:                //try {
1434:                //    ResultSetContainer outValue = null;
1435:                //
1436:                //    con = getDatabaseConnection();
1437:                //    
1438:                //    BaseDBQueryVendor bdbqv = BaseDBQueryVendor.newBaseDBQueryVendor(
1439:                //        getBaseDBQueryVendorProprietarySyntax(), true);
1440:                //    
1441:                //    outValue = bdbqv.executeStatement(con, inStatement);
1442:                //    
1443:                //    return outValue;
1444:                //
1445:                //}
1446:                ////catch (SQLException sqle) {
1447:                ////    throw new UnexpectedSystemException(sqle);
1448:                ////}
1449:                //finally {
1450:                //    try {
1451:                //        if (con != null) {
1452:                //            con.close();
1453:                //        }
1454:                //    }
1455:                //    catch (SQLException sqle) {
1456:                //        throw new UnexpectedSystemException(sqle);
1457:                //    }
1458:                //}
1459:            }
1460:            
1461:            public ProjectApplicationSet accessProjectApplicationSet(UserHolder inUh) {
1462:                
1463:                
1464:                ProjectApplicationSet outValue = null;
1465:                
1466:                //
1467:                Object values[] = new Object[1];
1468:                values[0] = inUh;
1469:                
1470:                //
1471:                String types[] = new String[1];
1472:                types[0] = UserHolder.class.getName();
1473:                
1474:                //
1475:                outValue = (ProjectApplicationSet)invoke(
1476:                    "accessProjectApplicationSet", values, types);
1477:                
1478:                return outValue;
1479:                
1480:                //throw UnexpectedSystemException.notImplemented();
1481:                //GenericFileProjectApplicationSet outValue =
1482:                //    new GenericFileProjectApplicationSet(
1483:                //        getApplicationsDirectory(inUh));
1484:                //
1485:                ////MiscHelper.println(
1486:                ////    "getWorkflowApplicationSet::getApplicationsDirectory(inUh) = "
1487:                ////    + getApplicationsDirectory(inUh).getAbsolutePath());
1488:                //
1489:                //File appList[] = getApplicationsDirectory(inUh).listFiles();
1490:                //for (int i = 0; i < appList.length; i++) {
1491:                //    if (appList[i].isDirectory()) {
1492:                //        GenericFileProjectApplication nextWa =
1493:                //            new GenericFileProjectApplication(appList[i]);
1494:                //        outValue.registerApplication(nextWa);
1495:                //    }
1496:                //}
1497:                //
1498:                //outValue.load();
1499:                //
1500:                //return outValue;
1501:            }
1502:            
1503:            public void setProjectApplicationSet(ProjectApplicationSet inWas,
1504:                UserHolder inUh) {
1505:                
1506:                throw UnexpectedSystemException.notImplemented();
1507:                //reset deployed applications
1508:                //File appList[] = getApplicationsDirectory(inUh).listFiles();
1509:                //for (int i = 0; i < appList.length; i++) {
1510:                //    MiscHelper.deleteFileOrDirectory(appList[i]);
1511:                //}
1512:                //
1513:                //((GenericFileProjectApplicationSet)inWas).store();
1514:            }
1515:            
1516:            //protected File getApplicationsDirectory(UserHolder inUh) {
1517:            //    
1518:            //    File outValue = null;
1519:            //    
1520:            //    ConfigServiceCaller csc =
1521:            //        ConfigServiceCallerFactory.getConfigServiceCaller();
1522:            //    //ConfigLifecycle cm = ConfigLifecycleFactory.getConfigLifecycle();
1523:            //    
1524:            //    //File pfDir =
1525:            //    //    GenericFileProjectApplicationSet.getJFolderDirectory(cm);
1526:            //    File usersDir =
1527:            //        GenericFileProjectApplicationSet.getRuntimeProjectSubDir("users");
1528:            //    //if (!usersDir.exists()) {
1529:            //    //    usersDir.mkdirs();
1530:            //    //}
1531:            //    
1532:            //    int id = getFileIdOfUser(inUh);
1533:            //    File userDir = new File(usersDir, id + "");
1534:            //    if (!userDir.exists()) {
1535:            //        userDir.mkdirs();
1536:            //    }
1537:            //    
1538:            //    outValue = new File(userDir, "applications");
1539:            //    if (!outValue.exists()) {
1540:            //        outValue.mkdirs();
1541:            //    }
1542:            //    
1543:            //    //cm.close();
1544:            //    
1545:            //    return outValue;
1546:            //}
1547:            
1548:            //public void fireTriggerData(TriggerDataPrecursor inTrigger) {
1549:            //    
1550:            //    throw UnexpectedSystemException.notImplemented();
1551:            //    //putTextMessageOnQueue(
1552:            //    //    inTrigger.getDataAsString(), null, getTriggerQueue());
1553:            //}
1554:            
1555:            //public TriggerDataHistory getTriggerDataHistory(String inHandle) {
1556:            //    throw UnexpectedSystemException.notImplemented();
1557:            //}
1558:            //public TriggerDataLabels getFailedTriggerSubmissions() {
1559:            //    throw UnexpectedSystemException.notImplemented();
1560:            //}
1561:            
1562:            //public void startWorkflowInstance(WorkflowInstancePrecursor inWp) {
1563:            //    
1564:            //    Connection con = null;
1565:            //    
1566:            //    try {
1567:            //        
1568:            //        //4 scenarios when starting a workflow-instance
1569:            //        //Scenario 1 - trigger good, new workflow-instance
1570:            //        //Scenario 2 - trigger bad, new workflow-instance
1571:            //        //Scenario 3 - trigger good, existing workflow-instance
1572:            //        //Scenario 4 - trigger bad, existing workflow-instance
1573:            //        
1574:            //        con = getDatabaseConnection();
1575:            //        
1576:            //        TriggerData t = inWp.getTriggerData();
1577:            //        
1578:            //        //boolean triggerBad = t.isAuditExceptionPresent();
1579:            //        //boolean existingWorkflow = tc.isWorkflowPresent();
1580:            //        
1581:            //        String pfId = getNextIndex(con).toString();
1582:            //        
1583:            //        //if (!existingWorkflow) {
1584:            //        //    pfId = getNextIndex(con).toString();
1585:            //        //}
1586:            //        //else {
1587:            //        //    pfId = tc.getWorkflowId();
1588:            //        //}
1589:            //        //
1590:            //        //if (!triggerBad) {
1591:            //            
1592:            //            AttributeSet as = inWp.getAttributeSet();
1593:            //            RootConceptTagHolder rth = inWp.getRootScriptTagHolder();
1594:            //            HistoryAudit h = inWp.getHistoryAudit();
1595:            //            
1596:            //            //if (!existingWorkflow) {
1597:            //                //this is the only attribute added in this function
1598:            //                as.addPublicSysAttr(AttributeSet.ID,
1599:            //                    ValueAndClassForConceptTagFactory.newValueAndClass(
1600:            //                        pfId, String.class));
1601:            //                WorkflowInstance w =
1602:            //                    WorkflowInstanceFactory.newWorkflowInstance(
1603:            //                        h, rth, as, t, pfId,
1604:            //                        WorkflowInstance.INITIAL_STATE);
1605:            //                insertWorkflowInstance(con, pfId, w);
1606:            //            //}
1607:            //            //else {
1608:            //            //    WorkflowInstance w = null;
1609:            //            //    updateWorkflowInstance(con, pfId, w);
1610:            //            //}
1611:            //            
1612:            //            storeWorkflowAttributes(con, pfId, as, true);
1613:            //            
1614:            //            Object s = as.getPublicSysAttr(
1615:            //AttributeSet.STATUS).getValue();
1616:            //        
1617:            //            if (s.equals(TraceAudit.STATUS_ACTIVE)) {
1618:            //                putTextMessageOnQueue(pfId, null, getWorkflowQueue());
1619:            //            }
1620:            //        //}
1621:            //        //else {
1622:            //        //    if (!existingWorkflow) {
1623:            //        //        //this is the only attribute added in this function
1624:            //        //        WorkflowInstance w = null;
1625:            //        //        insertWorkflowInstance(con, pfId, w);
1626:            //        //    }
1627:            //        //    else {
1628:            //        //        WorkflowInstance w = null;
1629:            //        //        updateWorkflowInstance(con, pfId, w);
1630:            //        //    }
1631:            //        //}
1632:            //        
1633:            //    }
1634:            //    //catch (SQLException sqle) {
1635:            //    //    throw new UnexpectedSystemException(sqle);
1636:            //    //}
1637:            //    finally {
1638:            //        try {
1639:            //            if (con != null) {
1640:            //                con.close();
1641:            //            }
1642:            //        }
1643:            //        catch (SQLException sqle) {
1644:            //            throw new UnexpectedSystemException(sqle);
1645:            //        }
1646:            //    }
1647:            //}
1648:            
1649:            public SecurityAuditSet getSecurityAudits(SecurityAuditQuery inSaq) {
1650:                throw UnexpectedSystemException.notImplemented();
1651:            }
1652:            
1653:            //protected void storeWorkflowAttributes(Connection inCon,
1654:            //    String inPfId, AttributeSet inAs, boolean inIsInsert) {
1655:            //    
1656:            //    try {
1657:            //        
1658:            //        Iterator iter = null;
1659:            //        
1660:            //        //public system attributes
1661:            //        iter = inAs.getPublicSysAttrNames();
1662:            //        while (iter.hasNext()) {
1663:            //            String attrName = (String)iter.next();
1664:            //            ValueAndClassForConceptTag vac =
1665:            //                inAs.getPublicSysAttr(attrName);
1666:            //            int pubAttr = BaseDBQueryVendor.PUBLIC;
1667:            //            int sysAttr = BaseDBQueryVendor.SYSTEM;
1668:            //            if (inIsInsert) {
1669:            //                insertWorkflowAttribute(inCon, inPfId, attrName, vac,
1670:            //                    pubAttr, sysAttr);
1671:            //            }
1672:            //            else {
1673:            //                updateWorkflowAttribute(inCon, inPfId, attrName, vac,
1674:            //                    sysAttr);
1675:            //            }
1676:            //        }
1677:            //        
1678:            //        //private system attributes
1679:            //        iter = inAs.getPrivateSysAttrNames();
1680:            //        while (iter.hasNext()) {
1681:            //            String attrName = (String)iter.next();
1682:            //            ValueAndClassForConceptTag vac =
1683:            //                inAs.getPrivateSysAttr(attrName);
1684:            //            int pubAttr = BaseDBQueryVendor.PRIVATE;
1685:            //            int sysAttr = BaseDBQueryVendor.SYSTEM;
1686:            //            if (inIsInsert) {
1687:            //                insertWorkflowAttribute(inCon, inPfId, attrName, vac,
1688:            //                    pubAttr, sysAttr);
1689:            //            }
1690:            //            else {
1691:            //                updateWorkflowAttribute(inCon, inPfId, attrName, vac,
1692:            //                    sysAttr);
1693:            //            }
1694:            //        }
1695:            //        
1696:            //        //public application attributes
1697:            //        iter = inAs.getPublicAppAttrNames();
1698:            //        while (iter.hasNext()) {
1699:            //            String attrName = (String)iter.next();
1700:            //            ValueAndClassForConceptTag vac =
1701:            //                inAs.getPublicAppAttr(attrName);
1702:            //            int pubAttr = BaseDBQueryVendor.PUBLIC;
1703:            //            int sysAttr = BaseDBQueryVendor.APPLICATION;
1704:            //            if (inIsInsert) {
1705:            //                insertWorkflowAttribute(inCon, inPfId, attrName, vac,
1706:            //                    pubAttr, sysAttr);
1707:            //            }
1708:            //            else {
1709:            //                updateWorkflowAttribute(inCon, inPfId, attrName, vac,
1710:            //                    sysAttr);
1711:            //            }
1712:            //        }
1713:            //        
1714:            //        //private application attributes
1715:            //        iter = inAs.getPrivateAppAttrNames();
1716:            //        while (iter.hasNext()) {
1717:            //            String attrName = (String)iter.next();
1718:            //            ValueAndClassForConceptTag vac =
1719:            //                inAs.getPrivateAppAttr(attrName);
1720:            //            int pubAttr = BaseDBQueryVendor.PRIVATE;
1721:            //            int sysAttr = BaseDBQueryVendor.APPLICATION;
1722:            //            if (inIsInsert) {
1723:            //                insertWorkflowAttribute(inCon, inPfId, attrName, vac,
1724:            //                    pubAttr, sysAttr);
1725:            //            }
1726:            //            else {
1727:            //                updateWorkflowAttribute(inCon, inPfId, attrName, vac,
1728:            //                    sysAttr);
1729:            //            }
1730:            //        }
1731:            //        
1732:            //    }
1733:            //    catch (SQLException sqle) {
1734:            //        throw new UnexpectedSystemException(sqle);
1735:            //    }
1736:            //}
1737:            
1738:            //private helper methods
1739:            //protected final static Connection getDatabaseConnection() {
1740:            //    try {
1741:            //        Connection outValue = null;
1742:            //        
1743:            //        Context context = new InitialContext();
1744:            //        Object dsObject = context.lookup(
1745:            //            "java:comp/env/jdbc/WorkflowLifecycle/DBStore");
1746:            //        DataSource ds = (DataSource)PortableRemoteObject.narrow(
1747:            //            dsObject, DataSource.class);
1748:            //        
1749:            //        outValue = ds.getConnection();
1750:            //        
1751:            //        return outValue;
1752:            //    }
1753:            //    catch (SQLException sqle) {
1754:            //        throw new UnexpectedSystemException(sqle);
1755:            //    }
1756:            //    catch (NamingException ne) {
1757:            //        throw new UnexpectedSystemException(ne);
1758:            //    }
1759:            //}
1760:            
1761:            //protected final static File getScriptsDir() {
1762:            //    return GenericFileProjectApplicationSet.getRuntimeProjectSubDir(
1763:            //        "scripts");
1764:            //}
1765:            
1766:            //protected final static File getPropertiesDir() {
1767:            //    return GenericFileProjectApplicationSet.getRuntimeProjectSubDir(
1768:            //        "properties");
1769:            //}
1770:            
1771:            //document functions
1772:            //public DocumentGroup getDocumentGroup(String inId, Integer inVersion) {
1773:            //    throw UnexpectedSystemException.notImplemented();
1774:            //}
1775:            
1776:            //public void updateDocumentGroup(DocumentGroupUpdates inDgu) {
1777:            //    throw UnexpectedSystemException.notImplemented();
1778:            //}
1779:            
1780:            }*/
1781:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.