Package com.knowgate.hipergate

Examples of com.knowgate.hipergate.Product


  public boolean delete(JDCConnection oConn) throws SQLException {

    DBSubset oAttachs = new DBSubset(DB.k_activity_attachs, DB.gu_product,
                                     DB.gu_activity + "='" + getString(DB.gu_activity) + "'" , 10);
    int iAttachs = oAttachs.load(oConn);
    Product oProd = new Product();
    for (int a=0;a<iAttachs; a++) {
      oProd.replace(DB.gu_product, oAttachs.getString(0,a));
      oProd.delete(oConn);
    } // next (a)
    oProd = null;
    oAttachs = null;

    if (oConn.getDataBaseProduct()==JDCConnection.DBMS_POSTGRESQL) {
View Full Code Here


    String sFileServer = Environment.getProfileVar(sProfile, "fileserver", "localhost");

    String sWrkAHome = sStorage + "domains" + File.separator + iDom.toString() + File.separator + "workareas" + File.separator + getString(DB.gu_workarea) + File.separator;
    if (DebugFile.trace) DebugFile.writeln("workarea home = "+sWrkAHome);

    Product oProd = new Product();
    oProd.put(DB.nm_product,Gadgets.left(sFileName, 128));
    oProd.put(DB.gu_owner, sGuWriter);
    oProd.put(DB.dt_uploaded, dtNow);
    if (sDescription!=null) oProd.put(DB.de_product, Gadgets.left(sDescription,254));
    oProd.store(oConn);

    ProductLocation oLoca = new ProductLocation();
    oLoca.put(DB.gu_owner, sGuWriter);
    oLoca.put(DB.gu_product, oProd.get(DB.gu_product));
    oLoca.put(DB.dt_uploaded, dtNow);
    oLoca.setPath  (sFileProtocol, sFileServer, sWrkAHome + sCatPath, sFileName, sFileName);
    oLoca.setLength(oFile.length());
    oLoca.replace(DB.id_cont_type, oLoca.getContainerType());
    oLoca.store(oConn);

    if (sFileProtocol.equalsIgnoreCase("ftp://"))
      oLoca.upload(oConn, oFileSys, "file://" + sDirPath, sFileName, "ftp://" + sFileServer + sWrkAHome + sCatPath, sFileName);
    else
      oLoca.upload(oConn, oFileSys, "file://" + sDirPath, sFileName, sFileProtocol + sWrkAHome + sCatPath, sFileName);

    ActivityAttachment oAttach = new ActivityAttachment();
    oAttach.put(DB.gu_activity, getString(DB.gu_activity));
    oAttach.put(DB.gu_product, oProd.getString(DB.gu_product));
    oAttach.put(DB.gu_location, oLoca.getString(DB.gu_location));
    oAttach.put(DB.gu_writer, sGuWriter);
    oAttach.store(oConn);

    if (bDeleteOriginalFile) {
View Full Code Here

   * @throws SQLException
   */
  public boolean delete(JDCConnection oConn) throws SQLException {
    boolean bRetVal;

    Product oProd = new Product(oConn, getString(DB.gu_product));
    bRetVal = oProd.delete(oConn);

    if (bRetVal) bRetVal = super.delete(oConn);

    return bRetVal;
  }
View Full Code Here

   * @return DBSubset listing attachments or <b>null</b> if this message has no attachments
   * @throws SQLException
   * @since 3.0
   */
  public DBSubset getAttachments(JDCConnection oConn) throws SQLException {
    Product oProd;
    if (isNull(DB.gu_product))
      return null;
    else {
      oProd = new Product(getString(DB.gu_product));
      return oProd.getLocations(oConn);
    }
  } // getAttachments
View Full Code Here

   * the NewsMessage itself. Then k_sp_del_newsmsg stored procedure is called.
   * @param oConn Database Connection
   * @throws SQLException
   */
  public boolean delete(JDCConnection oConn) throws SQLException {
    Product oProd;
    Statement oStmt;
    CallableStatement oCall;
    String sSQL;

    if (DebugFile.trace) {
      DebugFile.writeln("Begin NewsMessage.delete([Connection])");
      DebugFile.incIdent();
      DebugFile.writeln("gu_msg=" + getStringNull(DB.gu_msg,"null"));
    }

    if (!isNull(DB.gu_product)) {
      oProd = new Product(oConn, getString(DB.gu_product));

      oStmt = oConn.createStatement();
      sSQL = "UPDATE " + DB.k_newsmsgs + " SET " + DB.gu_product + "=NULL WHERE " + DB.gu_msg + "='" + getString(DB.gu_msg) + "'";
      if (DebugFile.trace) DebugFile.writeln("Statement.executeUpdate(" + sSQL + ")");
      oStmt.executeUpdate(sSQL);
      oStmt.close();

      oProd.delete(oConn);

      remove(DB.gu_product);
    } // fi

    sSQL = "{ call k_sp_del_newsmsg ('" + getString(DB.gu_msg) + "') }";
View Full Code Here

TOP

Related Classes of com.knowgate.hipergate.Product

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.