Package org.projectforge.scripting

Examples of org.projectforge.scripting.ScriptDO


          if (rows != null) {
            for (final DatabaseResultRow row : rows) {
              final Integer pk = (Integer) row.getEntry("pk").getValue();
              final String oldScript = (String) row.getEntry("old_script").getValue();
              final String oldScriptBackup = (String) row.getEntry("old_script_backup").getValue();
              final ScriptDO script = new ScriptDO();
              script.setScriptAsString(oldScript);
              script.setScriptBackupAsString(oldScriptBackup);
              dao.update("update t_script set script=?, script_backup=? where pk=?", script.getScript(), script.getScriptBackup(), pk);
            }
          }
        }
        if (dao.doTableAttributesExist(AuftragsPositionDO.class, "periodOfPerformanceBegin", "periodOfPerformanceEnd") == false) {
          dao.addTableAttributes(AuftragsPositionDO.class, "periodOfPerformanceBegin", "periodOfPerformanceEnd");
View Full Code Here


  {
    final List<IColumn<ScriptDO, String>> columns = new ArrayList<IColumn<ScriptDO, String>>();
    final CellItemListener<ScriptDO> cellItemListener = new CellItemListener<ScriptDO>() {
      public void populateItem(final Item<ICellPopulator<ScriptDO>> item, final String componentId, final IModel<ScriptDO> rowModel)
      {
        final ScriptDO script = rowModel.getObject();
        appendCssClasses(item, script.getId(), script.isDeleted());
      }
    };
    columns.add(new CellItemListenerPropertyColumn<ScriptDO>(new Model<String>(getString("scripting.script.name")), "name", "name",
        cellItemListener) {
      /**
       * @see org.projectforge.web.wicket.CellItemListenerPropertyColumn#populateItem(org.apache.wicket.markup.repeater.Item,
       *      java.lang.String, org.apache.wicket.model.IModel)
       */
      @Override
      public void populateItem(final Item<ICellPopulator<ScriptDO>> item, final String componentId, final IModel<ScriptDO> rowModel)
      {
        final ScriptDO script = rowModel.getObject();
        item.add(new ListSelectActionPanel(componentId, rowModel, ScriptExecutePage.class, script.getId(), ScriptListPage.this, script
            .getName()));
        cellItemListener.populateItem(item, componentId, rowModel);
        addRowClick(item);
      }
    });
    columns.add(new CellItemListenerPropertyColumn<ScriptDO>(new Model<String>(getString("description")), "description", "description",
        cellItemListener));
    columns.add(new AbstractColumn<ScriptDO, String>(new Model<String>(getString("scripting.script.parameter"))) {
      public void populateItem(final Item<ICellPopulator<ScriptDO>> cellItem, final String componentId, final IModel<ScriptDO> rowModel)
      {
        final ScriptDO script = rowModel.getObject();
        final Label label = new Label(componentId, new Model<String>(script.getParameterNames(true)));
        cellItem.add(label);
        cellItemListener.populateItem(cellItem, componentId, rowModel);
      }
    });
    dataTable = createDataTable(columns, "name", SortOrder.ASCENDING);
View Full Code Here

    }
  }

  protected ScriptDO loadScript()
  {
    final ScriptDO script = scriptDao.getById(id);
    if (script == null) {
      log.error("Script with id '" + id + "' not found");
      throw new UserException("scripting.script.error.notFound");
    }
    return script;
View Full Code Here

TOP

Related Classes of org.projectforge.scripting.ScriptDO

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.