Package de.innovationgate.wgpublisher.expressions.tmlscript

Examples of de.innovationgate.wgpublisher.expressions.tmlscript.TMLScriptException


          scriptCode.append("if (run) {");
          scriptCode.append("run(params);");
          scriptCode.append("}");               
          execute(scriptCode.toString(), retrieveContext(content, params));
      } catch (Exception e) {
        throw new TMLScriptException("Error calling hdbmodel process '" + _moduleName + "'.", e);
      }
  }
View Full Code Here


                Thread.sleep(100);
            }
            catch (InterruptedException e) {
            }
            if (System.currentTimeMillis() > timeout) {
                throw new TMLScriptException("Method waitForAuthUpdates() encountered timout of " + timeoutSeconds +  "seconds");
            }
           
            // Iterate modules
            Iterator modIt = modules.iterator();
            while (modIt.hasNext()) {
View Full Code Here

       
        // Get HDB instance
        TMLContext targetContext = gettargetcontext();
        WGHierarchicalDatabase hdb = WGHierarchicalDatabase.getInstance(targetContext.db().getDbReference());
        if (hdb == null) {
            throw new TMLScriptException("Cannot use tmlform.storeInHDB() in database " + targetContext.db().getDbReference() + " where HDB is not enabled");
        }
       
        // Create parameter object
        HDBModelParams params = new HDBModelParams(HDBModel.TYPE_CONTENT);
        params.setForm(this);
        params.setCustomParam(parameter);

        // Perform update
      String source = getforminfo().getSource();
      if (source.equals("content")) {
          WGContent content = gettargetcontext().content();
          params.setContentClass(content.getContentClass());
          try {
              hdb.updateContent(content, params);
              return true;
          }
          catch (WGHierarchicalDatabaseEventCanceledException e) {
              addmessage(e.getMessage());
              return false;
          }
      }
     
      // Perform create from here on
      if (!source.equals("none") && !source.equals("newcontent")) {
          throw new IllegalStateException("Cannot use tmlform.storeInHDB() when form source is not 'content', 'newcontent' or 'none'");
      }
     
        // Get desired content class
        String contentClass = getforminfo().getContentClass();
        if (contentClass == null) {
            throw new TMLScriptException("Cannot use tmlform.storeInHDB() on form " + getformid() + " that is defined without attribute 'contentclass'");
        }
        params.setContentClass(contentClass);
     
      // Get the model
      HDBModel model = (HDBModel) targetContext.db().getAttribute(WGACore.DBATTRIB_HDBMODEL);
      if (model == null) {
          throw new TMLScriptException("Cannot use tmlform.storeInHDB() in database " + targetContext.db().getDbReference() + " where HDB model is not available");
      }
     
      // Create the content
      try {
            _createdDoc = model.createContent(params, gettargetcontext().content());
            return true;
        }
      catch (WGHierarchicalDatabaseEventCanceledException e) {
            addmessage(e.getMessage());
            return false;
        }
        catch (HDBModelException e) {
            throw new TMLScriptException("Exception creating HDB model content", e);
        }
       
       
       
    }
View Full Code Here

      }
      catch (WGHierarchicalDatabaseEventCanceledException e) {
          throw e;
      }
      catch (Exception e) {
        throw new TMLScriptException("Error calling event listener '" + _moduleName + "." + functionName + "()'.", e);
      }
    }
View Full Code Here

TOP

Related Classes of de.innovationgate.wgpublisher.expressions.tmlscript.TMLScriptException

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.