You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ma...@apache.org on 2017/07/16 20:58:23 UTC
[1/5] oodt git commit: OODT-837: cleanup.
Repository: oodt
Updated Branches:
refs/heads/master 508c85668 -> 2fc7bced9
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStep.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStep.java b/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStep.java
deleted file mode 100644
index d6b3900..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStep.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.filemgringest;
-
-import org.apache.commons.lang.exception.ExceptionUtils;
-import org.apache.oodt.cas.metadata.Metadata;
-import org.pentaho.di.core.exception.KettleException;
-import org.pentaho.di.core.row.RowDataUtil;
-import org.pentaho.di.core.row.RowMetaInterface;
-import org.pentaho.di.trans.Trans;
-import org.pentaho.di.trans.TransMeta;
-import org.pentaho.di.trans.step.*;
-
-import java.io.File;
-import java.util.Arrays;
-
-/**
- * This class is part of the demo step plug-in implementation.
- * It demonstrates the basics of developing a plug-in step for PDI.
- *
- * The demo step adds a new string field to the row stream and sets its
- * value to "Hello World!". The user may select the name of the new field.
- *
- * This class is the implementation of StepInterface.
- * Classes implementing this interface need to:
- *
- * - initialize the step
- * - execute the row processing logic
- * - dispose of the step
- *
- * Please do not create any local fields in a StepInterface class. Store any
- * information related to the processing logic in the supplied step data interface
- * instead.
- *
- */
-
-public class FilemgrIngestStep extends BaseStep implements StepInterface {
-
- private OODTConfig oodt = new OODTConfig();
- private OODTProcesses oodtproc = new OODTProcesses();
- /**
- * The constructor should simply pass on its arguments to the parent class.
- *
- * @param s step description
- * @param stepDataInterface step data class
- * @param c step copy
- * @param t transformation description
- * @param t transformation description
- * @param dis transformation executing
- */
- public FilemgrIngestStep(StepMeta s, StepDataInterface stepDataInterface, int c, TransMeta t, Trans dis) {
- super(s, stepDataInterface, c, t, dis);
- }
-
- /**
- * This method is called by PDI during transformation startup.
- *
- * It should initialize required for step execution.
- *
- * The meta and data implementations passed in can safely be cast
- * to the step's respective implementations.
- *
- * It is mandatory that super.init() is called to ensure correct behavior.
- *
- * Typical tasks executed here are establishing the connection to a database,
- * as wall as obtaining resources, like file handles.
- *
- * @param smi step meta interface implementation, containing the step settings
- * @param sdi step data interface implementation, used to store runtime information
- *
- * @return true if initialization completed successfully, false if there was an error preventing the step from working.
- *
- */
- public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
- // Casting to step-specific implementation classes is safe
- FilemgrIngestStepMeta meta = (FilemgrIngestStepMeta) smi;
- FilemgrIngestStepData data = (FilemgrIngestStepData) sdi;
-
- try {
- oodt.loadIngester(meta.getServerURLField());
- } catch (InstantiationException e) {
- logError(e.getMessage());
-
- }
-
- return super.init(meta, data);
- }
-
- /**
- * Once the transformation starts executing, the processRow() method is called repeatedly
- * by PDI for as long as it returns true. To indicate that a step has finished processing rows
- * this method must call setOutputDone() and return false;
- *
- * Steps which process incoming rows typically call getRow() to read a single row from the
- * input stream, change or add row content, call putRow() to pass the changed row on
- * and return true. If getRow() returns null, no more rows are expected to come in,
- * and the processRow() implementation calls setOutputDone() and returns false to
- * indicate that it is done too.
- *
- * Steps which generate rows typically construct a new row Object[] using a call to
- * RowDataUtil.allocateRowData(numberOfFields), add row content, and call putRow() to
- * pass the new row on. Above process may happen in a loop to generate multiple rows,
- * at the end of which processRow() would call setOutputDone() and return false;
- *
- * @param smi the step meta interface containing the step settings
- * @param sdi the step data interface that should be used to store
- *
- * @return true to indicate that the function should be called again, false if the step is done
- */
- public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException {
-
- // safely cast the step settings (meta) and runtime info (data) to specific implementations
- FilemgrIngestStepMeta meta = (FilemgrIngestStepMeta) smi;
- FilemgrIngestStepData data = (FilemgrIngestStepData) sdi;
-
- // get incoming row, getRow() potentially blocks waiting for more rows, returns null if no more rows expected
- Object[] r = getRow();
-
- // if no more rows are expected, indicate step is finished and processRow() should not be called again
- if (r == null){
- setOutputDone();
- return false;
- }
-
- // the "first" flag is inherited from the base step implementation
- // it is used to guard some processing tasks, like figuring out field indexes
- // in the row structure that only need to be done once
- if (first) {
- first = false;
- // clone the input row structure and place it in our data object
- data.outputRowMeta = (RowMetaInterface) getInputRowMeta().clone();
- // use meta.getFields() to change it, so it reflects the output row structure
- meta.getFields(data.outputRowMeta, getStepname(), null, null, this, null, null);
- }
-
- String[] names = getInputRowMeta().getFieldNames();
- int idx = Arrays.asList(names).indexOf(meta.getFilenameField());
- int idx2 = Arrays.asList(names).indexOf(meta.getMetadataField());
-
-
-
- /*try {
- logError("does file exist?"+oodtproc.isAlreadyInDatabase(oodt, (String)r[idx]));
- } catch (Exception e) {
- LOG.log(Level.SEVERE, e.getMessage());
- }*/
-
- try {
-
- System.setProperty("org.apache.oodt.cas.filemgr.mime.type.repository", "/tmp/mime-types.xml");
- Metadata m = oodtproc.getMetadata((String)r[idx2]);
- String productid = oodtproc.ingest(oodt, new File((String)r[idx]), m);
-
-
- // safely add the string "Hello World!" at the end of the output row
- // the row array will be resized if necessary
- Object[] outputRow = RowDataUtil.addValueData(r, data.outputRowMeta.size() - 1, productid);
-
- // put the row to the output row stream
- putRow(data.outputRowMeta, outputRow);
-
- // log progress if it is time to to so
- if (checkFeedback(getLinesRead())) {
- logBasic("Linenr " + getLinesRead()); // Some basic logging
- }
-
- // indicate that processRow() should be called again
-
- } catch (Exception e) {
- logError(ExceptionUtils.getStackTrace(e));
- putError(getInputRowMeta(), r, 1L, e.getMessage(), null,
- "ERR_OODTINGEST_OUTPUT_01");
- }
- return true;
- }
-
- /**
- * This method is called by PDI once the step is done processing.
- *
- * The dispose() method is the counterpart to init() and should release any resources
- * acquired for step execution like file handles or database connections.
- *
- * The meta and data implementations passed in can safely be cast
- * to the step's respective implementations.
- *
- * It is mandatory that super.dispose() is called to ensure correct behavior.
- *
- * @param smi step meta interface implementation, containing the step settings
- * @param sdi step data interface implementation, used to store runtime information
- */
- public void dispose(StepMetaInterface smi, StepDataInterface sdi) {
-
- // Casting to step-specific implementation classes is safe
- FilemgrIngestStepMeta meta = (FilemgrIngestStepMeta) smi;
- FilemgrIngestStepData data = (FilemgrIngestStepData) sdi;
-
- super.dispose(meta, data);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStepData.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStepData.java b/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStepData.java
deleted file mode 100644
index c5fba4f..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStepData.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.filemgringest;
-
-import org.pentaho.di.core.row.RowMetaInterface;
-import org.pentaho.di.trans.step.BaseStepData;
-import org.pentaho.di.trans.step.StepDataInterface;
-
-/**
- * This class is part of the demo step plug-in implementation.
- * It demonstrates the basics of developing a plug-in step for PDI.
- *
- * The demo step adds a new string field to the row stream and sets its
- * value to "Hello World!". The user may select the name of the new field.
- *
- * This class is the implementation of StepDataInterface.
- *
- * Implementing classes inherit from BaseStepData, which implements the entire
- * interface completely.
- *
- * In addition classes implementing this interface usually keep track of
- * per-thread resources during step execution. Typical examples are:
- * result sets, temporary data, caching indexes, etc.
- *
- * The implementation for the demo step stores the output row structure in
- * the data class.
- *
- */
-public class FilemgrIngestStepData extends BaseStepData implements StepDataInterface {
-
- public RowMetaInterface outputRowMeta;
-
- public String fieldname;
-
- public FilemgrIngestStepData()
- {
- super();
- }
-}
-
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStepDialog.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStepDialog.java b/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStepDialog.java
deleted file mode 100644
index 9625b73..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStepDialog.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.filemgringest;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.*;
-import org.pentaho.di.core.Const;
-import org.pentaho.di.core.exception.KettleStepException;
-import org.pentaho.di.core.row.RowMetaInterface;
-import org.pentaho.di.core.row.ValueMetaInterface;
-import org.pentaho.di.i18n.BaseMessages;
-import org.pentaho.di.trans.TransMeta;
-import org.pentaho.di.trans.step.BaseStepMeta;
-import org.pentaho.di.trans.step.StepDialogInterface;
-import org.pentaho.di.trans.step.StepMeta;
-import org.pentaho.di.ui.trans.step.BaseStepDialog;
-
-/**
- * This class is part of the demo step plug-in implementation.
- * It demonstrates the basics of developing a plug-in step for PDI.
- *
- * The demo step adds a new string field to the row stream and sets its
- * value to "Hello World!". The user may select the name of the new field.
- *
- * This class is the implementation of StepDialogInterface.
- * Classes implementing this interface need to:
- *
- * - build and open a SWT dialog displaying the step's settings (stored in the step's meta object)
- * - write back any changes the user makes to the step's meta object
- * - report whether the user changed any settings when confirming the dialog
- *
- */
-public class FilemgrIngestStepDialog extends BaseStepDialog implements StepDialogInterface {
-
- /**
- * The PKG member is used when looking up internationalized strings.
- * The properties file with localized keys is expected to reside in
- * {the package of the class specified}/messages/messages_{locale}.properties
- */
- private static Class<?> PKG = FilemgrIngestStepMeta.class; // for i18n purposes
-
- // this is the object the stores the step's settings
- // the dialog reads the settings from it when opening
- // the dialog writes the settings to it when confirmed
- private FilemgrIngestStepMeta meta;
-
- // text field holding the name of the field to add to the row stream
- //private Text wHelloFieldName;
-
- // text field holding the name of the field to check the filename against
- private CCombo wFilenameField;
- private Text wServerURLField;
- private Text wResultField;
- private CCombo wMetadataField;
- private Button m_getFieldsBut;
-
- /**
- * The constructor should simply invoke super() and save the incoming meta
- * object to a local variable, so it can conveniently read and write settings
- * from/to it.
- *
- * @param parent the SWT shell to open the dialog in
- * @param in the meta object holding the step's settings
- * @param transMeta transformation description
- * @param sname the step name
- */
- public FilemgrIngestStepDialog(Shell parent, Object in, TransMeta transMeta, String sname) {
- super(parent, (BaseStepMeta) in, transMeta, sname);
- meta = (FilemgrIngestStepMeta) in;
- }
-
- /**
- * This method is called by Spoon when the user opens the settings dialog of the step.
- * It should open the dialog and return only once the dialog has been closed by the user.
- *
- * If the user confirms the dialog, the meta object (passed in the constructor) must
- * be updated to reflect the new step settings. The changed flag of the meta object must
- * reflect whether the step configuration was changed by the dialog.
- *
- * If the user cancels the dialog, the meta object must not be updated, and its changed flag
- * must remain unaltered.
- *
- * The open() method must return the name of the step after the user has confirmed the dialog,
- * or null if the user cancelled the dialog.
- */
- public String open() {
-
- // store some convenient SWT variables
- Shell parent = getParent();
- Display display = parent.getDisplay();
-
- // SWT code for preparing the dialog
- shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX);
- props.setLook(shell);
- setShellImage(shell, meta);
-
- // Save the value of the changed flag on the meta object. If the user cancels
- // the dialog, it will be restored to this saved value.
- // The "changed" variable is inherited from BaseStepDialog
- changed = meta.hasChanged();
-
- // The ModifyListener used on all controls. It will update the meta object to
- // indicate that changes are being made.
- ModifyListener lsMod = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- meta.setChanged();
- }
- };
-
- // ------------------------------------------------------- //
- // SWT code for building the actual settings dialog //
- // ------------------------------------------------------- //
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = Const.FORM_MARGIN;
- formLayout.marginHeight = Const.FORM_MARGIN;
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "FilemgrIngestStep.Name"));
-
- int middle = props.getMiddlePct();
- int margin = Const.MARGIN;
-
- // Stepname line
- wlStepname = new Label(shell, SWT.RIGHT);
- wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
- props.setLook(wlStepname);
- fdlStepname = new FormData();
- fdlStepname.left = new FormAttachment(0, 0);
- fdlStepname.right = new FormAttachment(middle, -margin);
- fdlStepname.top = new FormAttachment(0, margin);
- wlStepname.setLayoutData(fdlStepname);
-
- wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- wStepname.setText(stepname);
- props.setLook(wStepname);
- wStepname.addModifyListener(lsMod);
- fdStepname = new FormData();
- fdStepname.left = new FormAttachment(middle, 0);
- fdStepname.top = new FormAttachment(0, margin);
- fdStepname.right = new FormAttachment(100, 0);
- wStepname.setLayoutData(fdStepname);
-
- // output field value
- Label wlValName = new Label(shell, SWT.RIGHT);
- wlValName.setText(BaseMessages.getString(PKG, "FilemgrIngest.FieldName.Label"));
- props.setLook(wlValName);
- FormData fdlValName = new FormData();
- fdlValName.left = new FormAttachment(0, 0);
- fdlValName.right = new FormAttachment(middle, -margin);
- fdlValName.top = new FormAttachment(wStepname, margin);
- wlValName.setLayoutData(fdlValName);
-
-
- wFilenameField = new CCombo(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wFilenameField);
- wFilenameField.addModifyListener(lsMod);
- FormData fdValName = new FormData();
- fdValName.left = new FormAttachment(middle, 0);
- ///fdValName.right = new FormAttachment(m_getFieldsBut, -margin);
- fdValName.right = new FormAttachment(100,0);
- fdValName.top = new FormAttachment(wStepname, margin);
- wFilenameField.setLayoutData(fdValName);
-
-
-/*
- m_getFieldsBut = new Button(shell, SWT.PUSH | SWT.CENTER);
- props.setLook(m_getFieldsBut);
- m_getFieldsBut.setText(BaseMessages.getString(PKG,
- "SSTableOutputDialog.GetFields.Button"));
- FormData fd = new FormData();
- fd.right = new FormAttachment(100, 0);
- fdValName.top = new FormAttachment(wStepname, margin);
- m_getFieldsBut.setLayoutData(fd);
- m_getFieldsBut.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- setupFieldsCombo();
- }
- });*/
- // output field value
- Label wlMetadataName = new Label(shell, SWT.RIGHT);
- wlMetadataName.setText(BaseMessages.getString(PKG, "FilemgrIngest.MetadataFieldName.Label"));
- props.setLook(wlMetadataName);
- FormData fdlMetadataName = new FormData();
- fdlMetadataName.left = new FormAttachment(0, 0);
- fdlMetadataName.right = new FormAttachment(middle, -margin);
- fdlMetadataName.top = new FormAttachment(wFilenameField, margin);
- wlMetadataName.setLayoutData(fdlMetadataName);
-
- wMetadataField = new CCombo(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wMetadataField);
- wMetadataField.addModifyListener(lsMod);
- FormData fdMetadataName = new FormData();
- fdMetadataName.left = new FormAttachment(middle, 0);
- fdMetadataName.right = new FormAttachment(100, 0);
- fdMetadataName.top = new FormAttachment(wFilenameField, margin);
- wMetadataField.setLayoutData(fdMetadataName);
-
-
- // servername field value
- Label wlServerName = new Label(shell, SWT.RIGHT);
- wlServerName.setText(BaseMessages.getString(PKG, "FilemgrIngest.ServerURL.Label"));
- props.setLook(wlServerName);
- FormData fdlServerName = new FormData();
- fdlServerName.left = new FormAttachment(0, 0);
- fdlServerName.right = new FormAttachment(middle, -margin);
- fdlServerName.top = new FormAttachment(wMetadataField, margin);
- wlServerName.setLayoutData(fdlServerName);
-
- wServerURLField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wServerURLField);
- wServerURLField.addModifyListener(lsMod);
- FormData fdServerName = new FormData();
- fdServerName.left = new FormAttachment(middle, 0);
- fdServerName.right = new FormAttachment(100, 0);
- fdServerName.top = new FormAttachment(wMetadataField, margin);
- wServerURLField.setLayoutData(fdServerName);
-
- // servername field value
- Label wlResultName = new Label(shell, SWT.RIGHT);
- wlResultName.setText(BaseMessages.getString(PKG, "FilemgrIngest.Result.Label"));
- props.setLook(wlResultName);
- FormData fdlResultName = new FormData();
- fdlResultName.left = new FormAttachment(0, 0);
- fdlResultName.right = new FormAttachment(middle, -margin);
- fdlResultName.top = new FormAttachment(wServerURLField, margin);
- wlResultName.setLayoutData(fdlResultName);
-
- wResultField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wResultField);
- wResultField.addModifyListener(lsMod);
- FormData fdResultName = new FormData();
- fdResultName.left = new FormAttachment(middle, 0);
- fdResultName.right = new FormAttachment(100, 0);
- fdResultName.top = new FormAttachment(wServerURLField, margin);
- wResultField.setLayoutData(fdResultName);
-
-
- // OK and cancel buttons
- wOK = new Button(shell, SWT.PUSH);
- wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
-
- BaseStepDialog.positionBottomButtons(shell, new Button[] { wOK, wCancel }, margin, wResultField);
-
- // Add listeners for cancel and OK
- lsCancel = new Listener() {
- public void handleEvent(Event e) {cancel();}
- };
- lsOK = new Listener() {
- public void handleEvent(Event e) {ok();}
- };
-
- wCancel.addListener(SWT.Selection, lsCancel);
- wOK.addListener(SWT.Selection, lsOK);
-
- // default listener (for hitting "enter")
- lsDef = new SelectionAdapter() {
- public void widgetDefaultSelected(SelectionEvent e) {ok();}
- };
- wStepname.addSelectionListener(lsDef);
- wFilenameField.addSelectionListener(lsDef);
- wServerURLField.addSelectionListener(lsDef);
- wResultField.addSelectionListener(lsDef);
- // Detect X or ALT-F4 or something that kills this window and cancel the dialog properly
- shell.addShellListener(new ShellAdapter() {
- public void shellClosed(ShellEvent e) {cancel();}
- });
-
- // Set/Restore the dialog size based on last position on screen
- // The setSize() method is inherited from BaseStepDialog
- setSize();
-
- // populate the dialog with the values from the meta object
- populateDialog();
-
- // restore the changed flag to original value, as the modify listeners fire during dialog population
- meta.setChanged(changed);
-
- // open dialog and enter event loop
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- // at this point the dialog has closed, so either ok() or cancel() have been executed
- // The "stepname" variable is inherited from BaseStepDialog
- return stepname;
- }
-
- /**
- * This helper method puts the step configuration stored in the meta object
- * and puts it into the dialog controls.
- */
- private void populateDialog() {
- setupFieldsCombo();
- wStepname.selectAll();
- wFilenameField.setText(meta.getFilenameField());
- wServerURLField.setText(meta.getServerURLField());
- wResultField.setText(meta.getResultField());
- wMetadataField.setText(meta.getMetadataField());
-
- }
-
- /**
- * Called when the user cancels the dialog.
- */
- private void cancel() {
- // The "stepname" variable will be the return value for the open() method.
- // Setting to null to indicate that dialog was cancelled.
- stepname = null;
- // Restoring original "changed" flag on the met aobject
- meta.setChanged(changed);
- // close the SWT dialog window
- dispose();
- }
-
- /**
- * Called when the user confirms the dialog
- */
- private void ok() {
- // The "stepname" variable will be the return value for the open() method.
- // Setting to step name from the dialog control
- stepname = wStepname.getText();
- // Setting the settings to the meta object
- //meta.setOutputField(wFilenameField.getText());
- meta.setFilenameField(wFilenameField.getText());
- meta.setServerURLField(wServerURLField.getText());
- meta.setResultField(wResultField.getText());
- meta.setMetadataField(wMetadataField.getText());
- // close the SWT dialog window
- dispose();
- }
-
- protected void setupFieldsCombo() {
-
- StepMeta stepMeta = transMeta.findStep(stepname);
- if (stepMeta != null) {
- try {
- RowMetaInterface row = transMeta.getPrevStepFields(stepMeta);
-
- if (row.size() == 0) {
- /*MessageDialog.openError(shell, BaseMessages.getString(PKG,
- "SSTableOutputData.Message.NoIncomingFields.Title"), BaseMessages
- .getString(PKG, "SSTableOutputData.Message.NoIncomingFields"));*/
- return;
- }
- wFilenameField.removeAll();
- for (int i = 0; i < row.size(); i++) {
- ValueMetaInterface vm = row.getValueMeta(i);
- wFilenameField.add(vm.getName());
- }
-
- wMetadataField.removeAll();
- for (int i = 0; i < row.size(); i++) {
- ValueMetaInterface vm = row.getValueMeta(i);
- wMetadataField.add(vm.getName());
- }
-
- } catch (KettleStepException e) {
- LOG.log(Level.SEVERE, e.getMessage());
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStepMeta.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStepMeta.java b/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStepMeta.java
deleted file mode 100644
index 0849b8f..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/FilemgrIngestStepMeta.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.filemgringest;
-
-import org.eclipse.swt.widgets.Shell;
-import org.pentaho.di.core.CheckResult;
-import org.pentaho.di.core.CheckResultInterface;
-import org.pentaho.di.core.annotations.Step;
-import org.pentaho.di.core.database.DatabaseMeta;
-import org.pentaho.di.core.exception.KettleException;
-import org.pentaho.di.core.exception.KettleStepException;
-import org.pentaho.di.core.exception.KettleValueException;
-import org.pentaho.di.core.exception.KettleXMLException;
-import org.pentaho.di.core.row.RowMetaInterface;
-import org.pentaho.di.core.row.ValueMeta;
-import org.pentaho.di.core.row.ValueMetaInterface;
-import org.pentaho.di.core.variables.VariableSpace;
-import org.pentaho.di.core.xml.XMLHandler;
-import org.pentaho.di.i18n.BaseMessages;
-import org.pentaho.di.repository.ObjectId;
-import org.pentaho.di.repository.Repository;
-import org.pentaho.di.trans.Trans;
-import org.pentaho.di.trans.TransMeta;
-import org.pentaho.di.trans.step.*;
-import org.pentaho.metastore.api.IMetaStore;
-import org.w3c.dom.Node;
-
-import java.util.List;
-
-/**
- * This class is part of the demo step plug-in implementation.
- * It demonstrates the basics of developing a plug-in step for PDI.
- *
- * The demo step adds a new string field to the row stream and sets its
- * value to "Hello World!". The user may select the name of the new field.
- *
- * This class is the implementation of StepMetaInterface.
- * Classes implementing this interface need to:
- *
- * - keep track of the step settings
- * - serialize step settings both to xml and a repository
- * - provide new instances of objects implementing StepDialogInterface, StepInterface and StepDataInterface
- * - report on how the step modifies the meta-data of the row-stream (row structure and field types)
- * - perform a sanity-check on the settings provided by the user
- *
- */
-
-@Step(
- id = "FilemgrIngest",
- image = "org/apache/oodt/filemgrcheck/resources/check/oodt.jpg",
- i18nPackageName="bi.meteorite.filemgringest",
- name="FilemgrIngestStep.Name",
- description = "FilemgrIngestStep.TooltipDesc",
- categoryDescription="i18n:org.pentaho.di.trans.step:BaseStep.Category.BigData"
-)
-public class FilemgrIngestStepMeta extends BaseStepMeta implements StepMetaInterface {
-
- /**
- * The PKG member is used when looking up internationalized strings.
- * The properties file with localized keys is expected to reside in
- * {the package of the class specified}/messages/messages_{locale}.properties
- */
- private static Class<?> PKG = FilemgrIngestStepMeta.class; // for i18n purposes
-
- /**
- * Stores the name of the field added to the row-stream.
- */
- private String outputField;
- private String filenameField;
- private String serverURLField;
- private String resultField;
- private String metadataField;
-
- /**
- * Constructor should call super() to make sure the base class has a chance to initialize properly.
- */
- public FilemgrIngestStepMeta() {
- super();
- }
-
- /**
- * Called by Spoon to get a new instance of the SWT dialog for the step.
- * A standard implementation passing the arguments to the constructor of the step dialog is recommended.
- *
- * @param shell an SWT Shell
- * @param meta description of the step
- * @param transMeta description of the the transformation
- * @param name the name of the step
- * @return new instance of a dialog for this step
- */
- public StepDialogInterface getDialog(Shell shell, StepMetaInterface meta, TransMeta transMeta, String name) {
- return new FilemgrIngestStepDialog(shell, meta, transMeta, name);
- }
-
- /**
- * Called by PDI to get a new instance of the step implementation.
- * A standard implementation passing the arguments to the constructor of the step class is recommended.
- *
- * @param stepMeta description of the step
- * @param stepDataInterface instance of a step data class
- * @param cnr copy number
- * @param transMeta description of the transformation
- * @param disp runtime implementation of the transformation
- * @return the new instance of a step implementation
- */
- public StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta, Trans disp) {
- return new FilemgrIngestStep(stepMeta, stepDataInterface, cnr, transMeta, disp);
- }
-
- /**
- * Called by PDI to get a new instance of the step data class.
- */
- public StepDataInterface getStepData() {
- return new FilemgrIngestStepData();
- }
-
- /**
- * This method is called every time a new step is created and should allocate/set the step configuration
- * to sensible defaults. The values set here will be used by Spoon when a new step is created.
- */
- public void setDefault() {
- outputField = "demo_field";
- filenameField = "";
- serverURLField = "http://localhost:9000";
- resultField = "result";
- metadataField = "";
- }
-
- /**
- * Getter for the name of the field added by this step
- * @return the name of the field added
- */
- public String getOutputField() {
- return outputField;
- }
-
- /**
- * Setter for the name of the field added by this step
- * @param outputField the name of the field added
- */
- public void setOutputField(String outputField) {
- this.outputField = outputField;
- }
-
-
- public String getFilenameField(){
- return filenameField;
- }
-
- public void setFilenameField(String filenameField){
- this.filenameField = filenameField;
- }
- /**
- * This method is used when a step is duplicated in Spoon. It needs to return a deep copy of this
- * step meta object. Be sure to create proper deep copies if the step configuration is stored in
- * modifiable objects.
- *
- * See org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta.clone() for an example on creating
- * a deep copy.
- *
- * @return a deep copy of this
- */
- public Object clone() {
- Object retval = super.clone();
- return retval;
- }
-
- /**
- * This method is called by Spoon when a step needs to serialize its configuration to XML. The expected
- * return value is an XML fragment consisting of one or more XML tags.
- *
- * Please use org.pentaho.di.core.xml.XMLHandler to conveniently generate the XML.
- *
- * @return a string containing the XML serialization of this step
- */
- public String getXML() throws KettleValueException {
-
- // only one field to serialize
- String xml = " ";
- xml += " " +XMLHandler.addTagValue("outputfield", outputField);
- xml += " " +XMLHandler.addTagValue("filenamefield", filenameField);
- xml += " " +XMLHandler.addTagValue("serverurlfield", serverURLField);
- xml += " " +XMLHandler.addTagValue("resultfield", resultField);
- xml += " " +XMLHandler.addTagValue("metadatafield", metadataField);
- return xml;
- }
-
- /**
- * This method is called by PDI when a step needs to load its configuration from XML.
- *
- * Please use org.pentaho.di.core.xml.XMLHandler to conveniently read from the
- * XML node passed in.
- *
- * @param stepnode the XML node containing the configuration
- * @param databases the databases available in the transformation
- * @param metaStore the metaStore to optionally read from
- */
- public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore) throws KettleXMLException {
-
- try {
- setOutputField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "outputfield")));
- setFilenameField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "filenamefield")));
- setServerURLField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "serverurlfield")));
- setResultField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "resultfield")));
- setMetadataField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode,"metadatafield")));
- } catch (Exception e) {
- throw new KettleXMLException("Demo plugin unable to read step info from XML node", e);
- }
-
- }
- /**
- * This method is called by Spoon when a step needs to serialize its configuration to a repository.
- * The repository implementation provides the necessary methods to save the step attributes.
- *
- * @param rep the repository to save to
- * @param metaStore the metaStore to optionally write to
- * @param id_transformation the id to use for the transformation when saving
- * @param id_step the id to use for the step when saving
- */
- public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step) throws KettleException
- {
- try{
- rep.saveStepAttribute(id_transformation, id_step, "outputfield", outputField); //$NON-NLS-1$
- }
- catch(Exception e){
- throw new KettleException("Unable to save step into repository: "+id_step, e);
- }
- }
-
- /**
- * This method is called by PDI when a step needs to read its configuration from a repository.
- * The repository implementation provides the necessary methods to read the step attributes.
- *
- * @param rep the repository to read from
- * @param metaStore the metaStore to optionally read from
- * @param id_step the id of the step being read
- * @param databases the databases available in the transformation
- */
- public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases) throws KettleException {
- try{
- outputField = rep.getStepAttributeString(id_step, "outputfield"); //$NON-NLS-1$
- }
- catch(Exception e){
- throw new KettleException("Unable to load step from repository", e);
- }
- }
-
- /**
- * This method is called to determine the changes the step is making to the row-stream.
- * To that end a RowMetaInterface object is passed in, containing the row-stream structure as it is when entering
- * the step. This method must apply any changes the step makes to the row stream. Usually a step adds fields to the
- * row-stream.
- *
- * @param inputRowMeta the row structure coming in to the step
- * @param name the name of the step making the changes
- * @param info row structures of any info steps coming in
- * @param nextStep the description of a step this step is passing rows to
- * @param space the variable space for resolving variables
- * @param repository the repository instance optionally read from
- * @param metaStore the metaStore to optionally read from
- */
- public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException{
-
- /*
- * This implementation appends the outputField to the row-stream
- */
-
- // a value meta object contains the meta data for a field
- ValueMetaInterface v = new ValueMeta(outputField, ValueMeta.TYPE_STRING);
-
- // setting trim type to "both"
- v.setTrimType(ValueMeta.TRIM_TYPE_BOTH);
-
- // the name of the step that adds this field
- v.setOrigin(name);
-
- // modify the row structure and add the field this step generates
- inputRowMeta.addValueMeta(v);
-
- }
-
- /**
- * This method is called when the user selects the "Verify Transformation" option in Spoon.
- * A list of remarks is passed in that this method should add to. Each remark is a comment, warning, error, or ok.
- * The method should perform as many checks as necessary to catch design-time errors.
- *
- * Typical checks include:
- * - verify that all mandatory configuration is given
- * - verify that the step receives any input, unless it's a row generating step
- * - verify that the step does not receive any input if it does not take them into account
- * - verify that the step finds fields it relies on in the row-stream
- *
- * @param remarks the list of remarks to append to
- * @param transMeta the description of the transformation
- * @param stepMeta the description of the step
- * @param prev the structure of the incoming row-stream
- * @param input names of steps sending input to the step
- * @param output names of steps this step is sending output to
- * @param info fields coming in from info steps
- * @param metaStore metaStore to optionally read from
- */
- public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String input[], String output[], RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
-
- CheckResult cr;
-
- // See if there are input streams leading to this step!
- if (input.length > 0) {
- cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "Demo.CheckResult.ReceivingRows.OK"), stepMeta);
- remarks.add(cr);
- } else {
- cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "Demo.CheckResult.ReceivingRows.ERROR"), stepMeta);
- remarks.add(cr);
- }
-
- }
-
-
- public void setServerURLField(String serverURLField) {
- this.serverURLField = serverURLField;
- }
-
- public String getServerURLField() {
- return serverURLField;
- }
-
-
- public void setResultField(String resultField) {
- this.resultField = resultField;
- }
-
- public String getResultField() {
- return resultField;
- }
-
- public void setMetadataField(String metadataField) {
- this.metadataField = metadataField;
- }
-
- public String getMetadataField() {
- return metadataField;
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgringest/OODTConfig.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/OODTConfig.java b/tools/pdi_plugin/src/org/apache/oodt/filemgringest/OODTConfig.java
deleted file mode 100644
index 496b64e..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/OODTConfig.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgringest;
-
-import org.apache.oodt.cas.filemgr.ingest.Ingester;
-
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Created by bugg on 07/03/14.
- */
-public class OODTConfig {
-
- private static final Logger LOG = Logger.getLogger(OODTConfig.class.getName());
-
- private URL fmUrl;
-
- private Ingester ingester;
-
- public Ingester getIngester() {
- return this.ingester;
- }
-
- public URL getFmUrl(){
- return this.fmUrl;
- }
-
-
- void loadIngester(String fmUrlStr) throws InstantiationException {
- try {
-
- String ingesterClass = "org.apache.oodt.cas.filemgr.ingest.StdIngester";
-
- String dataTransferClass ="org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory";
-
- String cacheFactoryClass = null;
- //"org.apache.oodt.cas.filemgr.ingest.cache.factory";
-
- LOG.log(Level.INFO, "Configuring and building ingester: ["
- + ingesterClass + "]: data transfer: ["
- + dataTransferClass + "]: to ingest to file manager: ["
- + fmUrlStr + "]");
-
- if (cacheFactoryClass != null) {
- LOG.log(Level.INFO, "Configuring Ingester cache: ["
- + cacheFactoryClass + "]");
- }
-
- this.ingester = PushPullObjectFactory.createIngester(
- ingesterClass, cacheFactoryClass);
-
- this.fmUrl = safeGetUrlFromString(fmUrlStr);
-
- } catch (ClassNotFoundException e1) {
- e1.printStackTrace();
- } catch (InvocationTargetException e1) {
- e1.printStackTrace();
- } catch (NoSuchMethodException e1) {
- e1.printStackTrace();
- } catch (IllegalAccessException e1) {
- e1.printStackTrace();
- }
-
- }
-
-
- private static URL safeGetUrlFromString(String urlStr) {
- URL url = null;
-
- try {
- url = new URL(urlStr);
- } catch (MalformedURLException e) {
- LOG.log(Level.WARNING, "Unable to generate url from url string: ["
- + urlStr + "]: Message: " + e.getMessage());
- }
-
- return url;
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgringest/OODTProcesses.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/OODTProcesses.java b/tools/pdi_plugin/src/org/apache/oodt/filemgringest/OODTProcesses.java
deleted file mode 100644
index ec24d4d..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/OODTProcesses.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgringest;
-
-import com.google.gson.Gson;
-import com.google.gson.internal.LinkedTreeMap;
-
-import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
-import org.apache.oodt.cas.filemgr.structs.exceptions.IngestException;
-import org.apache.oodt.cas.metadata.Metadata;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.logging.Logger;
-
-/**
- * Created by bugg on 07/03/14.
- */
-public class OODTProcesses {
-
- private static final Logger LOG = Logger.getLogger(OODTProcesses.class.getName());
-
- private String filemgrUrl;
-
- public boolean isAlreadyInDatabase(OODTConfig config, String filename) throws CatalogException {
- return config.getIngester() != null && config.getIngester().hasProduct(
- config.getFmUrl(), filename);
- }
-
- Metadata getMetadata(String json) {
- Gson gson=new Gson();
- Hashtable table = new Hashtable<String, String>();
- table = (Hashtable<String, String>) gson.fromJson(json, table.getClass());
- Hashtable<String,Object> ht = new Hashtable<String,Object>();
-
- ArrayList l = (ArrayList) table.get("data");
- if(l!=null) {
- LinkedTreeMap d = (LinkedTreeMap) l.get(0);
- ht.putAll(d);
-
- }
- else{
- ht.putAll(table);
- }
-
- Metadata m = new Metadata();
-
- m.addMetadata(ht);
- return m;
-
- }
-
- String ingest(OODTConfig config, File product, Metadata productMetdata) throws IngestException {
- // try {
- String productId = config.getIngester().ingest(config.getFmUrl(),
- product, productMetdata);
-/* LOG.log(Level.INFO, "Successfully ingested product: [" + product
- + "]: product id: " + productId);
- } catch (Exception e) {
- LOG.log(Level.WARNING,
- "ProductCrawler: Exception ingesting product: [" + product
- + "]: Message: " + e.getMessage()
- + ": attempting to continue crawling", e);
- return false;
- }*/
- return productId;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgringest/PushPullObjectFactory.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/PushPullObjectFactory.java b/tools/pdi_plugin/src/org/apache/oodt/filemgringest/PushPullObjectFactory.java
deleted file mode 100644
index 6f81182..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/PushPullObjectFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.filemgringest;
-
-//OODT imports
-import org.apache.oodt.cas.filemgr.ingest.Cache;
-import org.apache.oodt.cas.filemgr.ingest.CacheFactory;
-import org.apache.oodt.cas.filemgr.ingest.Ingester;
-
-//JDK imports
-import java.lang.reflect.InvocationTargetException;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class PushPullObjectFactory {
-
- private PushPullObjectFactory() throws InstantiationException {
- throw new InstantiationException("Don't construct factory classes!");
- }
-
- public static <T> T createNewInstance(Class<T> clazz) throws InstantiationException {
- try {
- return clazz.newInstance();
- } catch (Exception e) {
- throw new InstantiationException(
- "Failed to create new object : "
- + e.getMessage());
- }
- }
-
- public static Ingester createIngester(String ingesterClass,
- String cacheFactoryClass) throws InstantiationException,
- IllegalAccessException, ClassNotFoundException,
- IllegalArgumentException, SecurityException,
- InvocationTargetException, NoSuchMethodException {
- String dataTransferFactory = "org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory";
- System.out.println("TRANSFER: " + dataTransferFactory);
- if (cacheFactoryClass == null || cacheFactoryClass.equals("")) {
- return (Ingester) Class.forName(ingesterClass).getConstructor(
- dataTransferFactory.getClass()).newInstance(
- dataTransferFactory);
- } else {
- Class<CacheFactory> cacheFactory = (Class<CacheFactory>) Class
- .forName(cacheFactoryClass);
- Cache cache = cacheFactory.newInstance().createCache();
- return (Ingester) Class.forName(ingesterClass).getConstructor(
- dataTransferFactory.getClass(), cache.getClass())
- .newInstance(dataTransferFactory, cache);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgringest/messages/messages_en_US.properties
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/messages/messages_en_US.properties b/tools/pdi_plugin/src/org/apache/oodt/filemgringest/messages/messages_en_US.properties
deleted file mode 100644
index 7e6008f..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/messages/messages_en_US.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-FilemgrIngestStep.Name=OODT Filemgr File Ingest
-FilemgrIngestStep.TooltipDesc=Check if the OODT Filemgr has a file in its repository
-
-FilemgrIngest.FieldName.Label=Filename Field
-
-FilemgrIngest.MetadataFieldName.Label=Metadata Field
-
-FilemgrIngest.ServerURL.Label=Filemgr URL
-FilemgrIngest.Result.Label=Result Field
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgringest/resources/oodt.jpg
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/resources/oodt.jpg b/tools/pdi_plugin/src/org/apache/oodt/filemgringest/resources/oodt.jpg
deleted file mode 100644
index 5810409..0000000
Binary files a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/resources/oodt.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgringest/resources/oodt.png
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgringest/resources/oodt.png b/tools/pdi_plugin/src/org/apache/oodt/filemgringest/resources/oodt.png
deleted file mode 100644
index e69de29..0000000
[3/5] oodt git commit: OODT-837: cleanup.
Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/build.xml
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/build.xml b/tools/pdi_plugin/build.xml
deleted file mode 100644
index db9e523..0000000
--- a/tools/pdi_plugin/build.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-http://www.apache.org/licenses/LICENSE-2.0
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<!--===========================================================================
- This is the build file for the PDI SDK Step Plugin
-
- This build file will use the subfloor.xml file as the default build
- process and should only override the tasks that need to differ from
- the common build file.
-============================================================================-->
-<project name="kettle-sdk-step-plugin" basedir="." default="default">
-
- <description>
- This build file works with the subfloor.xml file.
- </description>
-
- <!-- Import the subfloor-pkg.xml file which contains all the default tasks -->
- <import file="build-res/subfloor-pkg.xml" />
-
- <!--
- AS STATED ABOVE, THE ONLY TASKS THAT SHOULD EXIST IN THIS BUILD FILE ARE
- THE TASKS THAT NEED TO DIFFER FROM THE DEFAULT IMPLEMENTATION OF THE TASKS
- FOUND IN common_build.xml.
- -->
-
- <!--
- override to:
- - include the source directly (this is SDK demo code)
- - include kettle dependency jars
- - include the build folder (used by the SDK user to build the plugin)
- - include eclipse project files for convenience
- -->
- <target name="assemble.copy-libs">
-
- <copy todir="${approot.stage.dir}/lib">
- <fileset dir="${lib.dir}"/>
- </copy>
-
- <copy todir="${approot.stage.dir}/src">
- <fileset dir="src" excludes="**/.DS_Store" />
- </copy>
-
- <copy todir="${approot.stage.dir}/build">
- <fileset dir="build" />
- </copy>
-
- <!--<copy file="eclipse/classpath.xml" tofile="${approot.stage.dir}/.classpath">
- <filterset>
- <filter token="PROJECT-REVISION" value="${project.revision}"/>
- <filter token="METASTORE-REVISION" value="${dependency.pentaho-metadata.revision}"/>
- </filterset>
- </copy>-->
- <!--<copy file="eclipse/project.xml" tofile="${approot.stage.dir}/.project" />-->
-
- </target>
-
-</project>
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/build/build.properties
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/build/build.properties b/tools/pdi_plugin/build/build.properties
deleted file mode 100644
index 50da26c..0000000
--- a/tools/pdi_plugin/build/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-# Please adjust to point to your data-integration folder if you'd like the
-# ant script to be able to install the compiled plugin automatically
-kettle-dir=/Applications/pentaho/design-tools/data-integration
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/build/build.xml
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/build/build.xml b/tools/pdi_plugin/build/build.xml
deleted file mode 100644
index 4f00648..0000000
--- a/tools/pdi_plugin/build/build.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0"?>
-<project name="PdiSdkDemoStepPlugin" default="dist" basedir="..">
- <description>
- Build file for a PDI step plugin
- </description>
-
- <!-- you can use this file to set the kettle-dir property or change it directly below -->
- <property file="build/build.properties" />
-
- <!-- set global properties for this build -->
- <property name="src" location="src" />
- <property name="classes" location="classes" />
- <property name="dist" location="dist" />
- <property name="diststep" location="${dist}/steps/Demo" />
- <property name="pluginname" value="Demo" />
- <property name="jarfilename" value="demo-step.jar" />
-
- <!-- used to compile code -->
- <path id="compile.classpath">
- <fileset dir="${basedir}/lib">
- <include name="**/*.jar" />
- </fileset>
- </path>
-
- <target name="init">
- <tstamp />
- </target>
-
- <target name="compile" depends="init" description="compile the source ">
- <mkdir dir="${classes}" />
- <javac source="1.6" target="1.6" srcdir="${src}" destdir="${classes}" debuglevel="lines,vars,source" debug="true">
- <classpath refid="compile.classpath" />
-
- </javac>
- </target>
-
- <target name="dist" depends="compile" description="generate the distribution">
-
- <mkdir dir="${diststep}" />
-
- <!-- jar things up, also add the properties files (messages) and the icon -->
- <copy todir="${classes}">
- <fileset dir="${src}" includes="**/*.properties" />
- <fileset dir="${src}" includes="**/*.png" />
- </copy>
-
- <!-- jar class up -->
- <jar jarfile="${diststep}/${jarfilename}" basedir="${classes}"/>
-
- </target>
-
- <target name="install" depends="dist" description="compile and install into local PDI installation">
-
- <echo message="Looking for local PDI installation in ${kettle-dir}"/>
-
- <!-- change these to adapt to your environment -->
- <property name="kettle-dir" location="your_kettle_5.x_dir_here" />
- <available file="${kettle-dir}" type="dir" property="kettle-dir.present" />
-
- <fail unless="kettle-dir.present" message="PDI installation not found. Please specify the path to your PDI installation in build/build.properties" />
-
- <!-- remove previous installations -->
- <delete dir="${kettle-dir}/plugins/steps/${pluginname}" />
-
- <!-- put fresh files in place -->
- <mkdir dir="${kettle-dir}/plugins/steps/${pluginname}" />
-
- <copy todir="${kettle-dir}/plugins/steps/${pluginname}">
- <fileset dir="${diststep}" includes="**/*.*" />
- <fileset dir="${diststep}" includes="**" />
- </copy>
-
-
- <echo message="Installed the plugin in PDI. To test, please restart Spoon."/>
-
- </target>
-
- <target name="clean" description="clean up">
- <delete dir="${classes}" />
- <delete dir="${dist}" />
- </target>
-
-</project>
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/ivy.xml
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/ivy.xml b/tools/pdi_plugin/ivy.xml
deleted file mode 100644
index f952bae..0000000
--- a/tools/pdi_plugin/ivy.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
- <info organisation="${ivy.artifact.group}" module="${ivy.artifact.id}" revision="${project.revision}"/>
-
- <configurations>
- <conf name="default"/>
- <conf name="test" visibility="private"/>
- <conf name="source"/>
- </configurations>
-
- <dependencies defaultconf="default">
-
- <dependency org="org.apache.oodt" name="cas-filemgr" rev="0.7" transitive="false" changing="true"/>
- <dependency org="org.apache.oodt" name="cas-metadata" rev="0.7" transitive="false" changing="true"/>
- <dependency org="org.apache.ws.xmlrpc" name="xmlrpc" rev="2.0.1">
- <exclude org="xml-apis" module="xml-apis"/>
- <exclude org="junit" module="junit"/>
- </dependency>
- <dependency org="org.json" name="json" rev="20140107"/>
- <dependency org="com.google.code.gson" name="gson" rev="2.2.4"/>
-
-
- <!-- kettle dependencies -->
- <dependency org="pentaho-kettle" name="kettle-core" rev="TRUNK-SNAPSHOT" changing="true"/>
- <dependency org="pentaho-kettle" name="kettle-engine" rev="TRUNK-SNAPSHOT" changing="true"/>
- <dependency org="pentaho-kettle" name="kettle-ui-swt" rev="TRUNK-SNAPSHOT" changing="true"/>
- <dependency org="pentaho" name="pentaho-metadata" rev="TRUNK-SNAPSHOT" changing="true" transitive="true"/>
-
- <!-- swt dependencies -->
- <dependency org="org.eclipse.swt" name="swt-win32" rev="3.3.0.3346" transitive="false" changing="false"/>
-
- <!-- testing dependencies -->
- <dependency org="junit" name="junit" rev="3.8.1" transitive="false" conf="test->default"/>
- <dependency org="log4j" name="log4j" rev="1.2.16" transitive="false" conf="test->default"/>
-
- </dependencies>
-</ivy-module>
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/ivysettings.xml
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/ivysettings.xml b/tools/pdi_plugin/ivysettings.xml
deleted file mode 100644
index 2d97c5c..0000000
--- a/tools/pdi_plugin/ivysettings.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ivysettings>
- <properties environment="env" />
- <property name="ivy.local.default.root" value="${ivy.default.ivy.user.dir}/local" override="true" />
- <property name="ivy.local.default.artifact.pattern" value="[organisation]/[module]/[revision]/[type]s/[artifact]-[revision].[ext]"
- override="false" />
-
-
- <!-- Repository for Pentaho-hosted artifacts -->
- <property name="pentaho.resolve.repo" value="http://ivy-nexus.pentaho.org/content/groups/omni" override="false" />
- <!-- Repository for External-hosted artifacts (Optional. Defaults to Pentaho-hosted.) -->
- <property name="public.resolve.repo" value="${pentaho.resolve.repo}" override="false" />
-
-
- <settings defaultResolver="pentaho-chained-resolver" />
- <include url="${ivy.default.settings.dir}/ivysettings-public.xml" />
- <include url="${ivy.default.settings.dir}/ivysettings-local.xml" />
- <resolvers>
- <chain name="pentaho-chained-resolver">
- <resolver ref="local" />
- <dual name="pentaho">
- <url name="pentaho-ivy" checkmodified="true" changingPattern="*-SNAPSHOT">
- <ivy pattern="${pentaho.resolve.repo}/[organisation]/[module]/[revision]/[module]-[revision].ivy.xml" />
- </url>
- <ibiblio name="pentaho-mvn" m2compatible="true" root="${pentaho.resolve.repo}" />
- </dual>
- <ibiblio name="public-maven" root="${public.resolve.repo}" m2compatible="true" />
- <resolver ref="public" />
- </chain>
- </resolvers>
- <caches lockStrategy="artifact-lock" resolutionCacheDir="${ivy.default.ivy.user.dir}/resol-cache${env.EXECUTOR_NUMBER}" />
-</ivysettings>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/package-ivy.xml
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/package-ivy.xml b/tools/pdi_plugin/package-ivy.xml
deleted file mode 100644
index b47c2b9..0000000
--- a/tools/pdi_plugin/package-ivy.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
- <info organisation="${ivy.artifact.group}" module="${ivy.artifact.id}" revision="${project.revision}" />
- <configurations>
- <conf name="default" />
- <conf name="test" visibility="private" />
- </configurations>
-
- <publications>
- <artifact name="${ivy.artifact.id}" type="zip" />
- </publications>
-
- <dependencies defaultconf="default->default">
- </dependencies>
-</ivy-module>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/plugins
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/plugins b/tools/pdi_plugin/plugins
deleted file mode 100644
index b8291a2..0000000
Binary files a/tools/pdi_plugin/plugins and /dev/null differ
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStep.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStep.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStep.java
deleted file mode 100644
index 2cb5a77..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStep.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrcheck;
-
-import org.pentaho.di.core.exception.KettleException;
-import org.pentaho.di.core.row.RowDataUtil;
-import org.pentaho.di.core.row.RowMetaInterface;
-import org.pentaho.di.trans.Trans;
-import org.pentaho.di.trans.TransMeta;
-import org.pentaho.di.trans.step.*;
-
-import java.util.Arrays;
-
-/**
- * This class is part of the demo step plug-in implementation.
- * It demonstrates the basics of developing a plug-in step for PDI.
- *
- * The demo step adds a new string field to the row stream and sets its
- * value to "Hello World!". The user may select the name of the new field.
- *
- * This class is the implementation of StepInterface.
- * Classes implementing this interface need to:
- *
- * - initialize the step
- * - execute the row processing logic
- * - dispose of the step
- *
- * Please do not create any local fields in a StepInterface class. Store any
- * information related to the processing logic in the supplied step data interface
- * instead.
- *
- */
-
-public class FilemgrCheckStep extends BaseStep implements StepInterface {
-
- private OODTConfig oodt = new OODTConfig();
- private OODTProcesses oodtproc = new OODTProcesses();
- /**
- * The constructor should simply pass on its arguments to the parent class.
- *
- * @param s step description
- * @param stepDataInterface step data class
- * @param c step copy
- * @param t transformation description
- * @param dis transformation executing
- */
- public FilemgrCheckStep(StepMeta s, StepDataInterface stepDataInterface, int c, TransMeta t, Trans dis) {
- super(s, stepDataInterface, c, t, dis);
- }
-
- /**
- * This method is called by PDI during transformation startup.
- *
- * It should initialize required for step execution.
- *
- * The meta and data implementations passed in can safely be cast
- * to the step's respective implementations.
- *
- * It is mandatory that super.init() is called to ensure correct behavior.
- *
- * Typical tasks executed here are establishing the connection to a database,
- * as wall as obtaining resources, like file handles.
- *
- * @param smi step meta interface implementation, containing the step settings
- * @param sdi step data interface implementation, used to store runtime information
- *
- * @return true if initialization completed successfully, false if there was an error preventing the step from working.
- *
- */
- public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
- // Casting to step-specific implementation classes is safe
- FilemgrCheckStepMeta meta = (FilemgrCheckStepMeta) smi;
- FilemgrCheckStepData data = (FilemgrCheckStepData) sdi;
-
- try {
- logError("loading ingester");
- oodt.loadIngester(meta.getServerURLField());
- } catch (InstantiationException e) {
- LOG.log(Level.SEVERE, e.getMessage());
- }
-
- return super.init(meta, data);
- }
-
- /**
- * Once the transformation starts executing, the processRow() method is called repeatedly
- * by PDI for as long as it returns true. To indicate that a step has finished processing rows
- * this method must call setOutputDone() and return false;
- *
- * Steps which process incoming rows typically call getRow() to read a single row from the
- * input stream, change or add row content, call putRow() to pass the changed row on
- * and return true. If getRow() returns null, no more rows are expected to come in,
- * and the processRow() implementation calls setOutputDone() and returns false to
- * indicate that it is done too.
- *
- * Steps which generate rows typically construct a new row Object[] using a call to
- * RowDataUtil.allocateRowData(numberOfFields), add row content, and call putRow() to
- * pass the new row on. Above process may happen in a loop to generate multiple rows,
- * at the end of which processRow() would call setOutputDone() and return false;
- *
- * @param smi the step meta interface containing the step settings
- * @param sdi the step data interface that should be used to store
- *
- * @return true to indicate that the function should be called again, false if the step is done
- */
- public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException {
-
- // safely cast the step settings (meta) and runtime info (data) to specific implementations
- FilemgrCheckStepMeta meta = (FilemgrCheckStepMeta) smi;
- FilemgrCheckStepData data = (FilemgrCheckStepData) sdi;
-
- // get incoming row, getRow() potentially blocks waiting for more rows, returns null if no more rows expected
- Object[] r = getRow();
-
- // if no more rows are expected, indicate step is finished and processRow() should not be called again
- if (r == null){
- setOutputDone();
- return false;
- }
-
- // the "first" flag is inherited from the base step implementation
- // it is used to guard some processing tasks, like figuring out field indexes
- // in the row structure that only need to be done once
- if (first) {
- first = false;
- // clone the input row structure and place it in our data object
- data.outputRowMeta = (RowMetaInterface) getInputRowMeta().clone();
- // use meta.getFields() to change it, so it reflects the output row structure
- meta.getFields(data.outputRowMeta, getStepname(), null, null, this, null, null);
- }
-
- String[] names = getInputRowMeta().getFieldNames();
-
- logError("fieldname = "+meta.getFilenameField());
- int idx = Arrays.asList(names).indexOf(meta.getFilenameField());
-
- logError("IDX=" +Integer.toString(idx));
-
- try {
- logError("does file exist?"+oodtproc.isAlreadyInDatabase(oodt, (String)r[idx]));
- } catch (Exception e) {
- LOG.log(Level.SEVERE, e.getMessage());
- }
-
- // safely add the string "Hello World!" at the end of the output row
- // the row array will be resized if necessary
- Object[] outputRow = RowDataUtil.addValueData(r, data.outputRowMeta.size() - 1, "Hello World!");
-
- // put the row to the output row stream
- putRow(data.outputRowMeta, outputRow);
-
- // log progress if it is time to to so
- if (checkFeedback(getLinesRead())) {
- logBasic("Linenr " + getLinesRead()); // Some basic logging
- }
-
- // indicate that processRow() should be called again
- return true;
- }
-
- /**
- * This method is called by PDI once the step is done processing.
- *
- * The dispose() method is the counterpart to init() and should release any resources
- * acquired for step execution like file handles or database connections.
- *
- * The meta and data implementations passed in can safely be cast
- * to the step's respective implementations.
- *
- * It is mandatory that super.dispose() is called to ensure correct behavior.
- *
- * @param smi step meta interface implementation, containing the step settings
- * @param sdi step data interface implementation, used to store runtime information
- */
- public void dispose(StepMetaInterface smi, StepDataInterface sdi) {
-
- // Casting to step-specific implementation classes is safe
- FilemgrCheckStepMeta meta = (FilemgrCheckStepMeta) smi;
- FilemgrCheckStepData data = (FilemgrCheckStepData) sdi;
-
- super.dispose(meta, data);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStepData.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStepData.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStepData.java
deleted file mode 100644
index 30c5f31..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStepData.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrcheck;
-
-import org.pentaho.di.core.row.RowMetaInterface;
-import org.pentaho.di.trans.step.BaseStepData;
-import org.pentaho.di.trans.step.StepDataInterface;
-
-/**
- * This class is part of the demo step plug-in implementation.
- * It demonstrates the basics of developing a plug-in step for PDI.
- *
- * The demo step adds a new string field to the row stream and sets its
- * value to "Hello World!". The user may select the name of the new field.
- *
- * This class is the implementation of StepDataInterface.
- *
- * Implementing classes inherit from BaseStepData, which implements the entire
- * interface completely.
- *
- * In addition classes implementing this interface usually keep track of
- * per-thread resources during step execution. Typical examples are:
- * result sets, temporary data, caching indexes, etc.
- *
- * The implementation for the demo step stores the output row structure in
- * the data class.
- *
- */
-public class FilemgrCheckStepData extends BaseStepData implements StepDataInterface {
-
- public RowMetaInterface outputRowMeta;
-
- public String fieldname;
-
- public FilemgrCheckStepData()
- {
- super();
- }
-}
-
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStepDialog.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStepDialog.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStepDialog.java
deleted file mode 100644
index 78ef67b..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStepDialog.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrcheck;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.*;
-import org.pentaho.di.core.Const;
-import org.pentaho.di.i18n.BaseMessages;
-import org.pentaho.di.trans.TransMeta;
-import org.pentaho.di.trans.step.BaseStepMeta;
-import org.pentaho.di.trans.step.StepDialogInterface;
-import org.pentaho.di.ui.trans.step.BaseStepDialog;
-
-/**
- * This class is part of the demo step plug-in implementation.
- * It demonstrates the basics of developing a plug-in step for PDI.
- *
- * The demo step adds a new string field to the row stream and sets its
- * value to "Hello World!". The user may select the name of the new field.
- *
- * This class is the implementation of StepDialogInterface.
- * Classes implementing this interface need to:
- *
- * - build and open a SWT dialog displaying the step's settings (stored in the step's meta object)
- * - write back any changes the user makes to the step's meta object
- * - report whether the user changed any settings when confirming the dialog
- *
- */
-public class FilemgrCheckStepDialog extends BaseStepDialog implements StepDialogInterface {
-
- /**
- * The PKG member is used when looking up internationalized strings.
- * The properties file with localized keys is expected to reside in
- * {the package of the class specified}/messages/messages_{locale}.properties
- */
- private static Class<?> PKG = FilemgrCheckStepMeta.class; // for i18n purposes
-
- // this is the object the stores the step's settings
- // the dialog reads the settings from it when opening
- // the dialog writes the settings to it when confirmed
- private FilemgrCheckStepMeta meta;
-
- // text field holding the name of the field to add to the row stream
- //private Text wHelloFieldName;
-
- // text field holding the name of the field to check the filename against
- private Text wFilenameField;
- private Text wServerURLField;
- private Text wResultField;
- /**
- * The constructor should simply invoke super() and save the incoming meta
- * object to a local variable, so it can conveniently read and write settings
- * from/to it.
- *
- * @param parent the SWT shell to open the dialog in
- * @param in the meta object holding the step's settings
- * @param transMeta transformation description
- * @param sname the step name
- */
- public FilemgrCheckStepDialog(Shell parent, Object in, TransMeta transMeta, String sname) {
- super(parent, (BaseStepMeta) in, transMeta, sname);
- meta = (FilemgrCheckStepMeta) in;
- }
-
- /**
- * This method is called by Spoon when the user opens the settings dialog of the step.
- * It should open the dialog and return only once the dialog has been closed by the user.
- *
- * If the user confirms the dialog, the meta object (passed in the constructor) must
- * be updated to reflect the new step settings. The changed flag of the meta object must
- * reflect whether the step configuration was changed by the dialog.
- *
- * If the user cancels the dialog, the meta object must not be updated, and its changed flag
- * must remain unaltered.
- *
- * The open() method must return the name of the step after the user has confirmed the dialog,
- * or null if the user cancelled the dialog.
- */
- public String open() {
-
- // store some convenient SWT variables
- Shell parent = getParent();
- Display display = parent.getDisplay();
-
- // SWT code for preparing the dialog
- shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX);
- props.setLook(shell);
- setShellImage(shell, meta);
-
- // Save the value of the changed flag on the meta object. If the user cancels
- // the dialog, it will be restored to this saved value.
- // The "changed" variable is inherited from BaseStepDialog
- changed = meta.hasChanged();
-
- // The ModifyListener used on all controls. It will update the meta object to
- // indicate that changes are being made.
- ModifyListener lsMod = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- meta.setChanged();
- }
- };
-
- // ------------------------------------------------------- //
- // SWT code for building the actual settings dialog //
- // ------------------------------------------------------- //
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = Const.FORM_MARGIN;
- formLayout.marginHeight = Const.FORM_MARGIN;
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "Demo.Shell.Title"));
-
- int middle = props.getMiddlePct();
- int margin = Const.MARGIN;
-
- // Stepname line
- wlStepname = new Label(shell, SWT.RIGHT);
- wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
- props.setLook(wlStepname);
- fdlStepname = new FormData();
- fdlStepname.left = new FormAttachment(0, 0);
- fdlStepname.right = new FormAttachment(middle, -margin);
- fdlStepname.top = new FormAttachment(0, margin);
- wlStepname.setLayoutData(fdlStepname);
-
- wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- wStepname.setText(stepname);
- props.setLook(wStepname);
- wStepname.addModifyListener(lsMod);
- fdStepname = new FormData();
- fdStepname.left = new FormAttachment(middle, 0);
- fdStepname.top = new FormAttachment(0, margin);
- fdStepname.right = new FormAttachment(100, 0);
- wStepname.setLayoutData(fdStepname);
-
- // output field value
- Label wlValName = new Label(shell, SWT.RIGHT);
- wlValName.setText(BaseMessages.getString(PKG, "FilemgrCheck.FieldName.Label"));
- props.setLook(wlValName);
- FormData fdlValName = new FormData();
- fdlValName.left = new FormAttachment(0, 0);
- fdlValName.right = new FormAttachment(middle, -margin);
- fdlValName.top = new FormAttachment(wStepname, margin);
- wlValName.setLayoutData(fdlValName);
-
- wFilenameField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wFilenameField);
- wFilenameField.addModifyListener(lsMod);
- FormData fdValName = new FormData();
- fdValName.left = new FormAttachment(middle, 0);
- fdValName.right = new FormAttachment(100, 0);
- fdValName.top = new FormAttachment(wStepname, margin);
- wFilenameField.setLayoutData(fdValName);
-
-
- // servername field value
- Label wlServerName = new Label(shell, SWT.RIGHT);
- wlServerName.setText(BaseMessages.getString(PKG, "FilemgrCheck.ServerURL.Label"));
- props.setLook(wlServerName);
- FormData fdlServerName = new FormData();
- fdlServerName.left = new FormAttachment(0, 0);
- fdlServerName.right = new FormAttachment(middle, -margin);
- fdlServerName.top = new FormAttachment(wFilenameField, margin);
- wlServerName.setLayoutData(fdlServerName);
-
- wServerURLField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wServerURLField);
- wServerURLField.addModifyListener(lsMod);
- FormData fdServerName = new FormData();
- fdServerName.left = new FormAttachment(middle, 0);
- fdServerName.right = new FormAttachment(100, 0);
- fdServerName.top = new FormAttachment(wFilenameField, margin);
- wServerURLField.setLayoutData(fdServerName);
-
- // servername field value
- Label wlResultName = new Label(shell, SWT.RIGHT);
- wlResultName.setText(BaseMessages.getString(PKG, "FilemgrCheck.Result.Label"));
- props.setLook(wlResultName);
- FormData fdlResultName = new FormData();
- fdlResultName.left = new FormAttachment(0, 0);
- fdlResultName.right = new FormAttachment(middle, -margin);
- fdlResultName.top = new FormAttachment(wServerURLField, margin);
- wlResultName.setLayoutData(fdlResultName);
-
- wResultField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wResultField);
- wResultField.addModifyListener(lsMod);
- FormData fdResultName = new FormData();
- fdResultName.left = new FormAttachment(middle, 0);
- fdResultName.right = new FormAttachment(100, 0);
- fdResultName.top = new FormAttachment(wServerURLField, margin);
- wResultField.setLayoutData(fdResultName);
-
-
- // OK and cancel buttons
- wOK = new Button(shell, SWT.PUSH);
- wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
-
- BaseStepDialog.positionBottomButtons(shell, new Button[] { wOK, wCancel }, margin, wResultField);
-
- // Add listeners for cancel and OK
- lsCancel = new Listener() {
- public void handleEvent(Event e) {cancel();}
- };
- lsOK = new Listener() {
- public void handleEvent(Event e) {ok();}
- };
-
- wCancel.addListener(SWT.Selection, lsCancel);
- wOK.addListener(SWT.Selection, lsOK);
-
- // default listener (for hitting "enter")
- lsDef = new SelectionAdapter() {
- public void widgetDefaultSelected(SelectionEvent e) {ok();}
- };
- wStepname.addSelectionListener(lsDef);
- wFilenameField.addSelectionListener(lsDef);
- wServerURLField.addSelectionListener(lsDef);
- wResultField.addSelectionListener(lsDef);
- // Detect X or ALT-F4 or something that kills this window and cancel the dialog properly
- shell.addShellListener(new ShellAdapter() {
- public void shellClosed(ShellEvent e) {cancel();}
- });
-
- // Set/Restore the dialog size based on last position on screen
- // The setSize() method is inherited from BaseStepDialog
- setSize();
-
- // populate the dialog with the values from the meta object
- populateDialog();
-
- // restore the changed flag to original value, as the modify listeners fire during dialog population
- meta.setChanged(changed);
-
- // open dialog and enter event loop
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- // at this point the dialog has closed, so either ok() or cancel() have been executed
- // The "stepname" variable is inherited from BaseStepDialog
- return stepname;
- }
-
- /**
- * This helper method puts the step configuration stored in the meta object
- * and puts it into the dialog controls.
- */
- private void populateDialog() {
- wStepname.selectAll();
- wFilenameField.setText(meta.getFilenameField());
- wServerURLField.setText(meta.getServerURLField());
- wResultField.setText(meta.getResultField());
- }
-
- /**
- * Called when the user cancels the dialog.
- */
- private void cancel() {
- // The "stepname" variable will be the return value for the open() method.
- // Setting to null to indicate that dialog was cancelled.
- stepname = null;
- // Restoring original "changed" flag on the met aobject
- meta.setChanged(changed);
- // close the SWT dialog window
- dispose();
- }
-
- /**
- * Called when the user confirms the dialog
- */
- private void ok() {
- // The "stepname" variable will be the return value for the open() method.
- // Setting to step name from the dialog control
- stepname = wStepname.getText();
- // Setting the settings to the meta object
- //meta.setOutputField(wFilenameField.getText());
- meta.setFilenameField(wFilenameField.getText());
- meta.setServerURLField(wServerURLField.getText());
- meta.setResultField(wResultField.getText());
- // close the SWT dialog window
- dispose();
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStepMeta.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStepMeta.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStepMeta.java
deleted file mode 100644
index 7fb5b97..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/FilemgrCheckStepMeta.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrcheck;
-
-import org.eclipse.swt.widgets.Shell;
-import org.pentaho.di.core.CheckResult;
-import org.pentaho.di.core.CheckResultInterface;
-import org.pentaho.di.core.annotations.Step;
-import org.pentaho.di.core.database.DatabaseMeta;
-import org.pentaho.di.core.exception.KettleException;
-import org.pentaho.di.core.exception.KettleStepException;
-import org.pentaho.di.core.exception.KettleValueException;
-import org.pentaho.di.core.exception.KettleXMLException;
-import org.pentaho.di.core.row.RowMetaInterface;
-import org.pentaho.di.core.row.ValueMeta;
-import org.pentaho.di.core.row.ValueMetaInterface;
-import org.pentaho.di.core.variables.VariableSpace;
-import org.pentaho.di.core.xml.XMLHandler;
-import org.pentaho.di.i18n.BaseMessages;
-import org.pentaho.di.repository.ObjectId;
-import org.pentaho.di.repository.Repository;
-import org.pentaho.di.trans.Trans;
-import org.pentaho.di.trans.TransMeta;
-import org.pentaho.di.trans.step.*;
-import org.pentaho.metastore.api.IMetaStore;
-import org.w3c.dom.Node;
-
-import java.util.List;
-
-/**
- * This class is part of the demo step plug-in implementation.
- * It demonstrates the basics of developing a plug-in step for PDI.
- *
- * The demo step adds a new string field to the row stream and sets its
- * value to "Hello World!". The user may select the name of the new field.
- *
- * This class is the implementation of StepMetaInterface.
- * Classes implementing this interface need to:
- *
- * - keep track of the step settings
- * - serialize step settings both to xml and a repository
- * - provide new instances of objects implementing StepDialogInterface, StepInterface and StepDataInterface
- * - report on how the step modifies the meta-data of the row-stream (row structure and field types)
- * - perform a sanity-check on the settings provided by the user
- *
- */
-
-@Step(
- id = "FilemgrCheck",
- image = "org/apache/oodt/filemgrcheck/resources/check/oodt.jpg",
- i18nPackageName="bi.meteorite.filemgrcheck",
- name="FilemgrCheckStep.Name",
- description = "FilemgrCheckStep.TooltipDesc",
- categoryDescription="i18n:org.pentaho.di.trans.step:BaseStep.Category.BigData"
-)
-public class FilemgrCheckStepMeta extends BaseStepMeta implements StepMetaInterface {
- /**
- * The PKG member is used when looking up internationalized strings.
- * The properties file with localized keys is expected to reside in
- * {the package of the class specified}/messages/messages_{locale}.properties
- */
- private static Class<?> PKG = FilemgrCheckStepMeta.class; // for i18n purposes
-
- /**
- * Stores the name of the field added to the row-stream.
- */
- private String outputField;
- private String filenameField;
- private String serverURLField;
- private String resultField;
-
- /**
- * Constructor should call super() to make sure the base class has a chance to initialize properly.
- */
- public FilemgrCheckStepMeta() {
- super();
- }
-
- /**
- * Called by Spoon to get a new instance of the SWT dialog for the step.
- * A standard implementation passing the arguments to the constructor of the step dialog is recommended.
- *
- * @param shell an SWT Shell
- * @param meta description of the step
- * @param transMeta description of the the transformation
- * @param name the name of the step
- * @return new instance of a dialog for this step
- */
- public StepDialogInterface getDialog(Shell shell, StepMetaInterface meta, TransMeta transMeta, String name) {
- return new FilemgrCheckStepDialog(shell, meta, transMeta, name);
- }
-
- /**
- * Called by PDI to get a new instance of the step implementation.
- * A standard implementation passing the arguments to the constructor of the step class is recommended.
- *
- * @param stepMeta description of the step
- * @param stepDataInterface instance of a step data class
- * @param cnr copy number
- * @param transMeta description of the transformation
- * @param disp runtime implementation of the transformation
- * @return the new instance of a step implementation
- */
- public StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta, Trans disp) {
- return new FilemgrCheckStep(stepMeta, stepDataInterface, cnr, transMeta, disp);
- }
-
- /**
- * Called by PDI to get a new instance of the step data class.
- */
- public StepDataInterface getStepData() {
- return new FilemgrCheckStepData();
- }
-
- /**
- * This method is called every time a new step is created and should allocate/set the step configuration
- * to sensible defaults. The values set here will be used by Spoon when a new step is created.
- */
- public void setDefault() {
- outputField = "demo_field";
- filenameField = "fieldname";
- serverURLField = "http://localhost:9000";
- resultField = "result";
- }
-
- /**
- * Getter for the name of the field added by this step
- * @return the name of the field added
- */
- public String getOutputField() {
- return outputField;
- }
-
- /**
- * Setter for the name of the field added by this step
- * @param outputField the name of the field added
- */
- public void setOutputField(String outputField) {
- this.outputField = outputField;
- }
-
-
- public String getFilenameField(){
- return filenameField;
- }
-
- public void setFilenameField(String filenameField){
- this.filenameField = filenameField;
- }
- /**
- * This method is used when a step is duplicated in Spoon. It needs to return a deep copy of this
- * step meta object. Be sure to create proper deep copies if the step configuration is stored in
- * modifiable objects.
- *
- * See org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta.clone() for an example on creating
- * a deep copy.
- *
- * @return a deep copy of this
- */
- public Object clone() {
- Object retval = super.clone();
- return retval;
- }
-
- /**
- * This method is called by Spoon when a step needs to serialize its configuration to XML. The expected
- * return value is an XML fragment consisting of one or more XML tags.
- *
- * Please use org.pentaho.di.core.xml.XMLHandler to conveniently generate the XML.
- *
- * @return a string containing the XML serialization of this step
- */
- public String getXML() throws KettleValueException {
-
- // only one field to serialize
- String xml = " ";
- xml += " " +XMLHandler.addTagValue("outputfield", outputField);
- xml += " " +XMLHandler.addTagValue("filenamefield", filenameField);
- xml += " " +XMLHandler.addTagValue("serverurlfield", serverURLField);
- xml += " " +XMLHandler.addTagValue("resultfield", resultField);
- return xml;
- }
-
- /**
- * This method is called by PDI when a step needs to load its configuration from XML.
- *
- * Please use org.pentaho.di.core.xml.XMLHandler to conveniently read from the
- * XML node passed in.
- *
- * @param stepnode the XML node containing the configuration
- * @param databases the databases available in the transformation
- * @param metaStore the metaStore to optionally read from
- */
- public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore) throws KettleXMLException {
-
- try {
- setOutputField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "outputfield")));
- setFilenameField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "filenamefield")));
- setServerURLField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "serverurlfield")));
- setResultField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "resultfield")));
- } catch (Exception e) {
- throw new KettleXMLException("Demo plugin unable to read step info from XML node", e);
- }
-
- }
- /**
- * This method is called by Spoon when a step needs to serialize its configuration to a repository.
- * The repository implementation provides the necessary methods to save the step attributes.
- *
- * @param rep the repository to save to
- * @param metaStore the metaStore to optionally write to
- * @param id_transformation the id to use for the transformation when saving
- * @param id_step the id to use for the step when saving
- */
- public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step) throws KettleException
- {
- try{
- rep.saveStepAttribute(id_transformation, id_step, "outputfield", outputField); //$NON-NLS-1$
- }
- catch(Exception e){
- throw new KettleException("Unable to save step into repository: "+id_step, e);
- }
- }
-
- /**
- * This method is called by PDI when a step needs to read its configuration from a repository.
- * The repository implementation provides the necessary methods to read the step attributes.
- *
- * @param rep the repository to read from
- * @param metaStore the metaStore to optionally read from
- * @param id_step the id of the step being read
- * @param databases the databases available in the transformation
- * @param counters the counters available in the transformation
- */
- public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases) throws KettleException {
- try{
- outputField = rep.getStepAttributeString(id_step, "outputfield"); //$NON-NLS-1$
- }
- catch(Exception e){
- throw new KettleException("Unable to load step from repository", e);
- }
- }
-
- /**
- * This method is called to determine the changes the step is making to the row-stream.
- * To that end a RowMetaInterface object is passed in, containing the row-stream structure as it is when entering
- * the step. This method must apply any changes the step makes to the row stream. Usually a step adds fields to the
- * row-stream.
- *
- * @param inputRowMeta the row structure coming in to the step
- * @param name the name of the step making the changes
- * @param info row structures of any info steps coming in
- * @param nextStep the description of a step this step is passing rows to
- * @param space the variable space for resolving variables
- * @param repository the repository instance optionally read from
- * @param metaStore the metaStore to optionally read from
- */
- public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException{
-
- /*
- * This implementation appends the outputField to the row-stream
- */
-
- // a value meta object contains the meta data for a field
- ValueMetaInterface v = new ValueMeta(outputField, ValueMeta.TYPE_STRING);
-
- // setting trim type to "both"
- v.setTrimType(ValueMeta.TRIM_TYPE_BOTH);
-
- // the name of the step that adds this field
- v.setOrigin(name);
-
- // modify the row structure and add the field this step generates
- inputRowMeta.addValueMeta(v);
-
- }
-
- /**
- * This method is called when the user selects the "Verify Transformation" option in Spoon.
- * A list of remarks is passed in that this method should add to. Each remark is a comment, warning, error, or ok.
- * The method should perform as many checks as necessary to catch design-time errors.
- *
- * Typical checks include:
- * - verify that all mandatory configuration is given
- * - verify that the step receives any input, unless it's a row generating step
- * - verify that the step does not receive any input if it does not take them into account
- * - verify that the step finds fields it relies on in the row-stream
- *
- * @param remarks the list of remarks to append to
- * @param transmeta the description of the transformation
- * @param stepMeta the description of the step
- * @param prev the structure of the incoming row-stream
- * @param input names of steps sending input to the step
- * @param output names of steps this step is sending output to
- * @param info fields coming in from info steps
- * @param metaStore metaStore to optionally read from
- */
- public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String input[], String output[], RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
-
- CheckResult cr;
-
- // See if there are input streams leading to this step!
- if (input.length > 0) {
- cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "Demo.CheckResult.ReceivingRows.OK"), stepMeta);
- remarks.add(cr);
- } else {
- cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "Demo.CheckResult.ReceivingRows.ERROR"), stepMeta);
- remarks.add(cr);
- }
-
- }
-
-
- public void setServerURLField(String serverURLField) {
- this.serverURLField = serverURLField;
- }
-
- public String getServerURLField() {
- return serverURLField;
- }
-
-
- public void setResultField(String resultField) {
- this.resultField = resultField;
- }
-
- public String getResultField() {
- return resultField;
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/OODTConfig.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/OODTConfig.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/OODTConfig.java
deleted file mode 100644
index 9e7e529..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/OODTConfig.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrcheck;
-
-import org.apache.oodt.cas.filemgr.ingest.Ingester;
-
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Created by bugg on 07/03/14.
- */
-public class OODTConfig {
-
- private static final Logger LOG = Logger.getLogger(OODTConfig.class.getName());
-
- private URL fmUrl;
-
- private Ingester ingester;
-
- public Ingester getIngester() {
- return this.ingester;
- }
-
- public URL getFmUrl(){
- return this.fmUrl;
- }
-
-
- void loadIngester(String fmUrlStr) throws InstantiationException {
- try {
-
- String ingesterClass = "org.apache.oodt.cas.filemgr.ingest.StdIngester";
-
- String dataTransferClass ="org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory";
-
- String cacheFactoryClass = null;
- //"org.apache.oodt.cas.filemgr.ingest.cache.factory";
-
- LOG.log(Level.INFO, "Configuring and building ingester: ["
- + ingesterClass + "]: data transfer: ["
- + dataTransferClass + "]: to ingest to file manager: ["
- + fmUrlStr + "]");
-
- if (cacheFactoryClass != null) {
- LOG.log(Level.INFO, "Configuring Ingester cache: ["
- + cacheFactoryClass + "]");
- }
-
- this.ingester = PushPullObjectFactory.createIngester(
- ingesterClass, cacheFactoryClass);
-
- this.fmUrl = safeGetUrlFromString(fmUrlStr);
-
- } catch (ClassNotFoundException e1) {
- e1.printStackTrace();
- } catch (InvocationTargetException e1) {
- e1.printStackTrace();
- } catch (NoSuchMethodException e1) {
- e1.printStackTrace();
- } catch (IllegalAccessException e1) {
- e1.printStackTrace();
- }
-
- }
-
-
- private static URL safeGetUrlFromString(String urlStr) {
- URL url = null;
-
- try {
- url = new URL(urlStr);
- } catch (MalformedURLException e) {
- LOG.log(Level.WARNING, "Unable to generate url from url string: ["
- + urlStr + "]: Message: " + e.getMessage());
- }
-
- return url;
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/OODTProcesses.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/OODTProcesses.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/OODTProcesses.java
deleted file mode 100644
index 9977b65..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/OODTProcesses.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrcheck;
-
-import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
-
-/**
- * Created by bugg on 07/03/14.
- */
-public class OODTProcesses {
-
-
- public boolean isAlreadyInDatabase(OODTConfig config, String filename) throws CatalogException {
- return config.getIngester() != null ? config.getIngester().hasProduct(
- config.getFmUrl(), filename)
- : false;
- }
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/PushPullObjectFactory.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/PushPullObjectFactory.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/PushPullObjectFactory.java
deleted file mode 100644
index aa94372..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/PushPullObjectFactory.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrcheck;
-
-//OODT imports
-import org.apache.oodt.cas.filemgr.ingest.Cache;
-import org.apache.oodt.cas.filemgr.ingest.CacheFactory;
-import org.apache.oodt.cas.filemgr.ingest.Ingester;
-
-//JDK imports
-import java.lang.reflect.InvocationTargetException;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class PushPullObjectFactory {
-
- private PushPullObjectFactory() throws InstantiationException {
- throw new InstantiationException("Don't construct factory classes!");
- }
-
- public static <T> T createNewInstance(Class<T> clazz) throws InstantiationException {
- try {
- return clazz.newInstance();
- } catch (Exception e) {
- throw new InstantiationException(
- "Failed to create new object : "
- + e.getMessage());
- }
- }
-
- public static Ingester createIngester(String ingesterClass,
- String cacheFactoryClass) throws InstantiationException,
- IllegalAccessException, ClassNotFoundException,
- IllegalArgumentException, SecurityException,
- InvocationTargetException, NoSuchMethodException {
- String dataTransferFactory = "org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory";
- System.out.println("TRANSFER: " + dataTransferFactory);
- if (cacheFactoryClass == null || cacheFactoryClass.equals("")) {
- return (Ingester) Class.forName(ingesterClass).getConstructor(
- dataTransferFactory.getClass()).newInstance(
- dataTransferFactory);
- } else {
- Class<CacheFactory> cacheFactory = (Class<CacheFactory>) Class
- .forName(cacheFactoryClass);
- Cache cache = cacheFactory.newInstance().createCache();
- return (Ingester) Class.forName(ingesterClass).getConstructor(
- dataTransferFactory.getClass(), cache.getClass())
- .newInstance(dataTransferFactory, cache);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/messages/messages_en_US.properties
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/messages/messages_en_US.properties b/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/messages/messages_en_US.properties
deleted file mode 100644
index a7af034..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/messages/messages_en_US.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-FilemgrCheckStep.Name=OODT Filemgr File Check
-FilemgrCheckStep.TooltipDesc=Check if the OODT Filemgr has a file in its repository
-
-FilemgrCheck.FieldName.Label=Stream Field Name
-FilemgrCheck.ServerURL.Label=Filemgr URL
-FilemgrCheck.Result.Label=Result Field
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/resources/check/oodt.jpg
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/resources/check/oodt.jpg b/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/resources/check/oodt.jpg
deleted file mode 100644
index 5810409..0000000
Binary files a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/resources/check/oodt.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/resources/check/oodt.png
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/resources/check/oodt.png b/tools/pdi_plugin/src/org/apache/oodt/filemgrcheck/resources/check/oodt.png
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStep.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStep.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStep.java
deleted file mode 100644
index 47f3a31..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStep.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.filemgrdelete;
-
-import org.pentaho.di.core.exception.KettleException;
-import org.pentaho.di.core.row.RowDataUtil;
-import org.pentaho.di.core.row.RowMetaInterface;
-import org.pentaho.di.trans.Trans;
-import org.pentaho.di.trans.TransMeta;
-import org.pentaho.di.trans.step.*;
-
-import java.util.Arrays;
-
-/**
- * This class is part of the demo step plug-in implementation.
- * It demonstrates the basics of developing a plug-in step for PDI.
- *
- * The demo step adds a new string field to the row stream and sets its
- * value to "Hello World!". The user may select the name of the new field.
- *
- * This class is the implementation of StepInterface.
- * Classes implementing this interface need to:
- *
- * - initialize the step
- * - execute the row processing logic
- * - dispose of the step
- *
- * Please do not create any local fields in a StepInterface class. Store any
- * information related to the processing logic in the supplied step data interface
- * instead.
- *
- */
-
-public class FilemgrDeleteStep extends BaseStep implements StepInterface {
-
- private OODTConfig oodt = new OODTConfig();
- private OODTProcesses oodtproc = new OODTProcesses();
- /**
- * The constructor should simply pass on its arguments to the parent class.
- *
- * @param s step description
- * @param stepDataInterface step data class
- * @param c step copy
- * @param t transformation description
- * @param dis transformation executing
- */
- public FilemgrDeleteStep(StepMeta s, StepDataInterface stepDataInterface, int c, TransMeta t, Trans dis) {
- super(s, stepDataInterface, c, t, dis);
- }
-
- /**
- * This method is called by PDI during transformation startup.
- *
- * It should initialize required for step execution.
- *
- * The meta and data implementations passed in can safely be cast
- * to the step's respective implementations.
- *
- * It is mandatory that super.init() is called to ensure correct behavior.
- *
- * Typical tasks executed here are establishing the connection to a database,
- * as wall as obtaining resources, like file handles.
- *
- * @param smi step meta interface implementation, containing the step settings
- * @param sdi step data interface implementation, used to store runtime information
- *
- * @return true if initialization completed successfully, false if there was an error preventing the step from working.
- *
- */
- public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
- // Casting to step-specific implementation classes is safe
- FilemgrDeleteStepMeta meta = (FilemgrDeleteStepMeta) smi;
- FilemgrDeleteStepData data = (FilemgrDeleteStepData) sdi;
-
-
- logDetailed("loading ingester");
- oodt.loadXMLRpcClient(meta.getServerURLField());
- logDetailed("finished loading ingester");
- return super.init(meta, data);
- }
-
- /**
- * Once the transformation starts executing, the processRow() method is called repeatedly
- * by PDI for as long as it returns true. To indicate that a step has finished processing rows
- * this method must call setOutputDone() and return false;
- *
- * Steps which process incoming rows typically call getRow() to read a single row from the
- * input stream, change or add row content, call putRow() to pass the changed row on
- * and return true. If getRow() returns null, no more rows are expected to come in,
- * and the processRow() implementation calls setOutputDone() and returns false to
- * indicate that it is done too.
- *
- * Steps which generate rows typically construct a new row Object[] using a call to
- * RowDataUtil.allocateRowData(numberOfFields), add row content, and call putRow() to
- * pass the new row on. Above process may happen in a loop to generate multiple rows,
- * at the end of which processRow() would call setOutputDone() and return false;
- *
- * @param smi the step meta interface containing the step settings
- * @param sdi the step data interface that should be used to store
- *
- * @return true to indicate that the function should be called again, false if the step is done
- */
- public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException {
-
- // safely cast the step settings (meta) and runtime info (data) to specific implementations
- FilemgrDeleteStepMeta meta = (FilemgrDeleteStepMeta) smi;
- FilemgrDeleteStepData data = (FilemgrDeleteStepData) sdi;
-
- // get incoming row, getRow() potentially blocks waiting for more rows, returns null if no more rows expected
- Object[] r = getRow();
-
- // if no more rows are expected, indicate step is finished and processRow() should not be called again
- if (r == null){
- setOutputDone();
- return false;
- }
-
- // the "first" flag is inherited from the base step implementation
- // it is used to guard some processing tasks, like figuring out field indexes
- // in the row structure that only need to be done once
- if (first) {
- first = false;
- // clone the input row structure and place it in our data object
- data.outputRowMeta = (RowMetaInterface) getInputRowMeta().clone();
- // use meta.getFields() to change it, so it reflects the output row structure
- meta.getFields(data.outputRowMeta, getStepname(), null, null, this, null, null);
- }
-
- String[] names = getInputRowMeta().getFieldNames();
- int idx = Arrays.asList(names).indexOf(meta.getFilenameField());
-
- boolean worked = false;
- try {
- logDetailed("Deleting Product: "+(String)r[idx]);
- worked = oodtproc.deleteProductByName(oodt, (String)r[idx]);
- } catch (Exception e) {
- LOG.log(Level.SEVERE, e.getMessage());
- }
-
- // safely add the string "Hello World!" at the end of the output row
- // the row array will be resized if necessary
- Object[] outputRow = RowDataUtil.addValueData(r, data.outputRowMeta.size() - 1, worked);
-
- // put the row to the output row stream
- putRow(data.outputRowMeta, outputRow);
-
- // log progress if it is time to to so
- if (checkFeedback(getLinesRead())) {
- logBasic("Linenr " + getLinesRead()); // Some basic logging
- }
-
- // indicate that processRow() should be called again
- return true;
- }
-
- /**
- * This method is called by PDI once the step is done processing.
- *
- * The dispose() method is the counterpart to init() and should release any resources
- * acquired for step execution like file handles or database connections.
- *
- * The meta and data implementations passed in can safely be cast
- * to the step's respective implementations.
- *
- * It is mandatory that super.dispose() is called to ensure correct behavior.
- *
- * @param smi step meta interface implementation, containing the step settings
- * @param sdi step data interface implementation, used to store runtime information
- */
- public void dispose(StepMetaInterface smi, StepDataInterface sdi) {
-
- // Casting to step-specific implementation classes is safe
- FilemgrDeleteStepMeta meta = (FilemgrDeleteStepMeta) smi;
- FilemgrDeleteStepData data = (FilemgrDeleteStepData) sdi;
-
- super.dispose(meta, data);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStepData.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStepData.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStepData.java
deleted file mode 100644
index 819d9d8..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStepData.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.filemgrdelete;
-
-import org.pentaho.di.core.row.RowMetaInterface;
-import org.pentaho.di.trans.step.BaseStepData;
-import org.pentaho.di.trans.step.StepDataInterface;
-
-/**
- * This class is part of the demo step plug-in implementation.
- * It demonstrates the basics of developing a plug-in step for PDI.
- *
- * The demo step adds a new string field to the row stream and sets its
- * value to "Hello World!". The user may select the name of the new field.
- *
- * This class is the implementation of StepDataInterface.
- *
- * Implementing classes inherit from BaseStepData, which implements the entire
- * interface completely.
- *
- * In addition classes implementing this interface usually keep track of
- * per-thread resources during step execution. Typical examples are:
- * result sets, temporary data, caching indexes, etc.
- *
- * The implementation for the demo step stores the output row structure in
- * the data class.
- *
- */
-public class FilemgrDeleteStepData extends BaseStepData implements StepDataInterface {
-
- public RowMetaInterface outputRowMeta;
-
- public String fieldname;
-
- public FilemgrDeleteStepData()
- {
- super();
- }
-}
-
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStepDialog.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStepDialog.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStepDialog.java
deleted file mode 100644
index 3fa9008..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStepDialog.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.filemgrdelete;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.*;
-import org.pentaho.di.core.Const;
-import org.pentaho.di.i18n.BaseMessages;
-import org.pentaho.di.trans.TransMeta;
-import org.pentaho.di.trans.step.BaseStepMeta;
-import org.pentaho.di.trans.step.StepDialogInterface;
-import org.pentaho.di.ui.trans.step.BaseStepDialog;
-
-/**
- * This class is part of the demo step plug-in implementation.
- * It demonstrates the basics of developing a plug-in step for PDI.
- *
- * The demo step adds a new string field to the row stream and sets its
- * value to "Hello World!". The user may select the name of the new field.
- *
- * This class is the implementation of StepDialogInterface.
- * Classes implementing this interface need to:
- *
- * - build and open a SWT dialog displaying the step's settings (stored in the step's meta object)
- * - write back any changes the user makes to the step's meta object
- * - report whether the user changed any settings when confirming the dialog
- *
- */
-public class FilemgrDeleteStepDialog extends BaseStepDialog implements StepDialogInterface {
-
- /**
- * The PKG member is used when looking up internationalized strings.
- * The properties file with localized keys is expected to reside in
- * {the package of the class specified}/messages/messages_{locale}.properties
- */
- private static Class<?> PKG = FilemgrDeleteStepMeta.class; // for i18n purposes
-
- // this is the object the stores the step's settings
- // the dialog reads the settings from it when opening
- // the dialog writes the settings to it when confirmed
- private FilemgrDeleteStepMeta meta;
-
- // text field holding the name of the field to add to the row stream
- //private Text wHelloFieldName;
-
- // text field holding the name of the field to check the filename against
- private Text wFilenameField;
- private Text wServerURLField;
- private Text wResultField;
- /**
- * The constructor should simply invoke super() and save the incoming meta
- * object to a local variable, so it can conveniently read and write settings
- * from/to it.
- *
- * @param parent the SWT shell to open the dialog in
- * @param in the meta object holding the step's settings
- * @param transMeta transformation description
- * @param sname the step name
- */
- public FilemgrDeleteStepDialog(Shell parent, Object in, TransMeta transMeta, String sname) {
- super(parent, (BaseStepMeta) in, transMeta, sname);
- meta = (FilemgrDeleteStepMeta) in;
- }
-
- /**
- * This method is called by Spoon when the user opens the settings dialog of the step.
- * It should open the dialog and return only once the dialog has been closed by the user.
- *
- * If the user confirms the dialog, the meta object (passed in the constructor) must
- * be updated to reflect the new step settings. The changed flag of the meta object must
- * reflect whether the step configuration was changed by the dialog.
- *
- * If the user cancels the dialog, the meta object must not be updated, and its changed flag
- * must remain unaltered.
- *
- * The open() method must return the name of the step after the user has confirmed the dialog,
- * or null if the user cancelled the dialog.
- */
- public String open() {
-
- // store some convenient SWT variables
- Shell parent = getParent();
- Display display = parent.getDisplay();
-
- // SWT code for preparing the dialog
- shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX);
- props.setLook(shell);
- setShellImage(shell, meta);
-
- // Save the value of the changed flag on the meta object. If the user cancels
- // the dialog, it will be restored to this saved value.
- // The "changed" variable is inherited from BaseStepDialog
- changed = meta.hasChanged();
-
- // The ModifyListener used on all controls. It will update the meta object to
- // indicate that changes are being made.
- ModifyListener lsMod = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- meta.setChanged();
- }
- };
-
- // ------------------------------------------------------- //
- // SWT code for building the actual settings dialog //
- // ------------------------------------------------------- //
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = Const.FORM_MARGIN;
- formLayout.marginHeight = Const.FORM_MARGIN;
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "Demo.Shell.Title"));
-
- int middle = props.getMiddlePct();
- int margin = Const.MARGIN;
-
- // Stepname line
- wlStepname = new Label(shell, SWT.RIGHT);
- wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
- props.setLook(wlStepname);
- fdlStepname = new FormData();
- fdlStepname.left = new FormAttachment(0, 0);
- fdlStepname.right = new FormAttachment(middle, -margin);
- fdlStepname.top = new FormAttachment(0, margin);
- wlStepname.setLayoutData(fdlStepname);
-
- wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- wStepname.setText(stepname);
- props.setLook(wStepname);
- wStepname.addModifyListener(lsMod);
- fdStepname = new FormData();
- fdStepname.left = new FormAttachment(middle, 0);
- fdStepname.top = new FormAttachment(0, margin);
- fdStepname.right = new FormAttachment(100, 0);
- wStepname.setLayoutData(fdStepname);
-
- // output field value
- Label wlValName = new Label(shell, SWT.RIGHT);
- wlValName.setText(BaseMessages.getString(PKG, "FilemgrDelete.FieldName.Label"));
- props.setLook(wlValName);
- FormData fdlValName = new FormData();
- fdlValName.left = new FormAttachment(0, 0);
- fdlValName.right = new FormAttachment(middle, -margin);
- fdlValName.top = new FormAttachment(wStepname, margin);
- wlValName.setLayoutData(fdlValName);
-
- wFilenameField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wFilenameField);
- wFilenameField.addModifyListener(lsMod);
- FormData fdValName = new FormData();
- fdValName.left = new FormAttachment(middle, 0);
- fdValName.right = new FormAttachment(100, 0);
- fdValName.top = new FormAttachment(wStepname, margin);
- wFilenameField.setLayoutData(fdValName);
-
-
- // servername field value
- Label wlServerName = new Label(shell, SWT.RIGHT);
- wlServerName.setText(BaseMessages.getString(PKG, "FilemgrDelete.ServerURL.Label"));
- props.setLook(wlServerName);
- FormData fdlServerName = new FormData();
- fdlServerName.left = new FormAttachment(0, 0);
- fdlServerName.right = new FormAttachment(middle, -margin);
- fdlServerName.top = new FormAttachment(wFilenameField, margin);
- wlServerName.setLayoutData(fdlServerName);
-
- wServerURLField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wServerURLField);
- wServerURLField.addModifyListener(lsMod);
- FormData fdServerName = new FormData();
- fdServerName.left = new FormAttachment(middle, 0);
- fdServerName.right = new FormAttachment(100, 0);
- fdServerName.top = new FormAttachment(wFilenameField, margin);
- wServerURLField.setLayoutData(fdServerName);
-
- // servername field value
- Label wlResultName = new Label(shell, SWT.RIGHT);
- wlResultName.setText(BaseMessages.getString(PKG, "FilemgrDelete.Result.Label"));
- props.setLook(wlResultName);
- FormData fdlResultName = new FormData();
- fdlResultName.left = new FormAttachment(0, 0);
- fdlResultName.right = new FormAttachment(middle, -margin);
- fdlResultName.top = new FormAttachment(wServerURLField, margin);
- wlResultName.setLayoutData(fdlResultName);
-
- wResultField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wResultField);
- wResultField.addModifyListener(lsMod);
- FormData fdResultName = new FormData();
- fdResultName.left = new FormAttachment(middle, 0);
- fdResultName.right = new FormAttachment(100, 0);
- fdResultName.top = new FormAttachment(wServerURLField, margin);
- wResultField.setLayoutData(fdResultName);
-
-
- // OK and cancel buttons
- wOK = new Button(shell, SWT.PUSH);
- wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
-
- BaseStepDialog.positionBottomButtons(shell, new Button[] { wOK, wCancel }, margin, wResultField);
-
- // Add listeners for cancel and OK
- lsCancel = new Listener() {
- public void handleEvent(Event e) {cancel();}
- };
- lsOK = new Listener() {
- public void handleEvent(Event e) {ok();}
- };
-
- wCancel.addListener(SWT.Selection, lsCancel);
- wOK.addListener(SWT.Selection, lsOK);
-
- // default listener (for hitting "enter")
- lsDef = new SelectionAdapter() {
- public void widgetDefaultSelected(SelectionEvent e) {ok();}
- };
- wStepname.addSelectionListener(lsDef);
- wFilenameField.addSelectionListener(lsDef);
- wServerURLField.addSelectionListener(lsDef);
- wResultField.addSelectionListener(lsDef);
- // Detect X or ALT-F4 or something that kills this window and cancel the dialog properly
- shell.addShellListener(new ShellAdapter() {
- public void shellClosed(ShellEvent e) {cancel();}
- });
-
- // Set/Restore the dialog size based on last position on screen
- // The setSize() method is inherited from BaseStepDialog
- setSize();
-
- // populate the dialog with the values from the meta object
- populateDialog();
-
- // restore the changed flag to original value, as the modify listeners fire during dialog population
- meta.setChanged(changed);
-
- // open dialog and enter event loop
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- // at this point the dialog has closed, so either ok() or cancel() have been executed
- // The "stepname" variable is inherited from BaseStepDialog
- return stepname;
- }
-
- /**
- * This helper method puts the step configuration stored in the meta object
- * and puts it into the dialog controls.
- */
- private void populateDialog() {
- wStepname.selectAll();
- wFilenameField.setText(meta.getFilenameField());
- wServerURLField.setText(meta.getServerURLField());
- wResultField.setText(meta.getResultField());
- }
-
- /**
- * Called when the user cancels the dialog.
- */
- private void cancel() {
- // The "stepname" variable will be the return value for the open() method.
- // Setting to null to indicate that dialog was cancelled.
- stepname = null;
- // Restoring original "changed" flag on the met aobject
- meta.setChanged(changed);
- // close the SWT dialog window
- dispose();
- }
-
- /**
- * Called when the user confirms the dialog
- */
- private void ok() {
- // The "stepname" variable will be the return value for the open() method.
- // Setting to step name from the dialog control
- stepname = wStepname.getText();
- // Setting the settings to the meta object
- //meta.setOutputField(wFilenameField.getText());
- meta.setFilenameField(wFilenameField.getText());
- meta.setServerURLField(wServerURLField.getText());
- meta.setResultField(wResultField.getText());
- // close the SWT dialog window
- dispose();
- }
-}
[2/5] oodt git commit: OODT-837: cleanup.
Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStepMeta.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStepMeta.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStepMeta.java
deleted file mode 100644
index e89484c..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/FilemgrDeleteStepMeta.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.filemgrdelete;
-
-import org.eclipse.swt.widgets.Shell;
-import org.pentaho.di.core.CheckResult;
-import org.pentaho.di.core.CheckResultInterface;
-import org.pentaho.di.core.annotations.Step;
-import org.pentaho.di.core.database.DatabaseMeta;
-import org.pentaho.di.core.exception.KettleException;
-import org.pentaho.di.core.exception.KettleStepException;
-import org.pentaho.di.core.exception.KettleValueException;
-import org.pentaho.di.core.exception.KettleXMLException;
-import org.pentaho.di.core.row.RowMetaInterface;
-import org.pentaho.di.core.row.ValueMeta;
-import org.pentaho.di.core.row.ValueMetaInterface;
-import org.pentaho.di.core.variables.VariableSpace;
-import org.pentaho.di.core.xml.XMLHandler;
-import org.pentaho.di.i18n.BaseMessages;
-import org.pentaho.di.repository.ObjectId;
-import org.pentaho.di.repository.Repository;
-import org.pentaho.di.trans.Trans;
-import org.pentaho.di.trans.TransMeta;
-import org.pentaho.di.trans.step.*;
-import org.pentaho.metastore.api.IMetaStore;
-import org.w3c.dom.Node;
-
-import java.util.List;
-
-/**
- * This class is part of the demo step plug-in implementation.
- * It demonstrates the basics of developing a plug-in step for PDI.
- *
- * The demo step adds a new string field to the row stream and sets its
- * value to "Hello World!". The user may select the name of the new field.
- *
- * This class is the implementation of StepMetaInterface.
- * Classes implementing this interface need to:
- *
- * - keep track of the step settings
- * - serialize step settings both to xml and a repository
- * - provide new instances of objects implementing StepDialogInterface, StepInterface and StepDataInterface
- * - report on how the step modifies the meta-data of the row-stream (row structure and field types)
- * - perform a sanity-check on the settings provided by the user
- *
- */
-
-@Step(
- id = "FilemgrCheck",
- image = "org/apache/oodt/filemgrcheck/resources/check/oodt.jpg",
- i18nPackageName="bi.meteorite.filemgrcheck",
- name="FilemgrCheckStep.Name",
- description = "FilemgrCheckStep.TooltipDesc",
- categoryDescription="i18n:org.pentaho.di.trans.step:BaseStep.Category.Transform"
-)
-public class FilemgrDeleteStepMeta extends BaseStepMeta implements StepMetaInterface {
-
- /**
- * The PKG member is used when looking up internationalized strings.
- * The properties file with localized keys is expected to reside in
- * {the package of the class specified}/messages/messages_{locale}.properties
- */
- private static Class<?> PKG = FilemgrDeleteStepMeta.class; // for i18n purposes
-
- /**
- * Stores the name of the field added to the row-stream.
- */
- private String outputField;
- private String filenameField;
- private String serverURLField;
- private String resultField;
-
- /**
- * Constructor should call super() to make sure the base class has a chance to initialize properly.
- */
- public FilemgrDeleteStepMeta() {
- super();
- }
-
- /**
- * Called by Spoon to get a new instance of the SWT dialog for the step.
- * A standard implementation passing the arguments to the constructor of the step dialog is recommended.
- *
- * @param shell an SWT Shell
- * @param meta description of the step
- * @param transMeta description of the the transformation
- * @param name the name of the step
- * @return new instance of a dialog for this step
- */
- public StepDialogInterface getDialog(Shell shell, StepMetaInterface meta, TransMeta transMeta, String name) {
- return new FilemgrDeleteStepDialog(shell, meta, transMeta, name);
- }
-
- /**
- * Called by PDI to get a new instance of the step implementation.
- * A standard implementation passing the arguments to the constructor of the step class is recommended.
- *
- * @param stepMeta description of the step
- * @param stepDataInterface instance of a step data class
- * @param cnr copy number
- * @param transMeta description of the transformation
- * @param disp runtime implementation of the transformation
- * @return the new instance of a step implementation
- */
- public StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta, Trans disp) {
- return new FilemgrDeleteStep(stepMeta, stepDataInterface, cnr, transMeta, disp);
- }
-
- /**
- * Called by PDI to get a new instance of the step data class.
- */
- public StepDataInterface getStepData() {
- return new FilemgrDeleteStepData();
- }
-
- /**
- * This method is called every time a new step is created and should allocate/set the step configuration
- * to sensible defaults. The values set here will be used by Spoon when a new step is created.
- */
- public void setDefault() {
- outputField = "demo_field";
- filenameField = "fieldname";
- serverURLField = "http://localhost:9000";
- resultField = "result";
- }
-
- /**
- * Getter for the name of the field added by this step
- * @return the name of the field added
- */
- public String getOutputField() {
- return outputField;
- }
-
- /**
- * Setter for the name of the field added by this step
- * @param outputField the name of the field added
- */
- public void setOutputField(String outputField) {
- this.outputField = outputField;
- }
-
-
- public String getFilenameField(){
- return filenameField;
- }
-
- public void setFilenameField(String filenameField){
- this.filenameField = filenameField;
- }
- /**
- * This method is used when a step is duplicated in Spoon. It needs to return a deep copy of this
- * step meta object. Be sure to create proper deep copies if the step configuration is stored in
- * modifiable objects.
- *
- * See org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta.clone() for an example on creating
- * a deep copy.
- *
- * @return a deep copy of this
- */
- public Object clone() {
- Object retval = super.clone();
- return retval;
- }
-
- /**
- * This method is called by Spoon when a step needs to serialize its configuration to XML. The expected
- * return value is an XML fragment consisting of one or more XML tags.
- *
- * Please use org.pentaho.di.core.xml.XMLHandler to conveniently generate the XML.
- *
- * @return a string containing the XML serialization of this step
- */
- public String getXML() throws KettleValueException {
-
- // only one field to serialize
- String xml = " ";
- xml += " " +XMLHandler.addTagValue("outputfield", outputField);
- xml += " " +XMLHandler.addTagValue("filenamefield", filenameField);
- xml += " " +XMLHandler.addTagValue("serverurlfield", serverURLField);
- xml += " " +XMLHandler.addTagValue("resultfield", resultField);
- return xml;
- }
-
- /**
- * This method is called by PDI when a step needs to load its configuration from XML.
- *
- * Please use org.pentaho.di.core.xml.XMLHandler to conveniently read from the
- * XML node passed in.
- *
- * @param stepnode the XML node containing the configuration
- * @param databases the databases available in the transformation
- * @param metaStore the metaStore to optionally read from
- */
- public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore) throws KettleXMLException {
-
- try {
- setOutputField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "outputfield")));
- setFilenameField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "filenamefield")));
- setServerURLField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "serverurlfield")));
- setResultField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "resultfield")));
- } catch (Exception e) {
- throw new KettleXMLException("Demo plugin unable to read step info from XML node", e);
- }
-
- }
- /**
- * This method is called by Spoon when a step needs to serialize its configuration to a repository.
- * The repository implementation provides the necessary methods to save the step attributes.
- *
- * @param rep the repository to save to
- * @param metaStore the metaStore to optionally write to
- * @param id_transformation the id to use for the transformation when saving
- * @param id_step the id to use for the step when saving
- */
- public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step) throws KettleException
- {
- try{
- rep.saveStepAttribute(id_transformation, id_step, "outputfield", outputField); //$NON-NLS-1$
- }
- catch(Exception e){
- throw new KettleException("Unable to save step into repository: "+id_step, e);
- }
- }
-
- /**
- * This method is called by PDI when a step needs to read its configuration from a repository.
- * The repository implementation provides the necessary methods to read the step attributes.
- *
- * @param rep the repository to read from
- * @param metaStore the metaStore to optionally read from
- * @param id_step the id of the step being read
- * @param databases the databases available in the transformation
- */
- public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases) throws KettleException {
- try{
- outputField = rep.getStepAttributeString(id_step, "outputfield"); //$NON-NLS-1$
- }
- catch(Exception e){
- throw new KettleException("Unable to load step from repository", e);
- }
- }
-
- /**
- * This method is called to determine the changes the step is making to the row-stream.
- * To that end a RowMetaInterface object is passed in, containing the row-stream structure as it is when entering
- * the step. This method must apply any changes the step makes to the row stream. Usually a step adds fields to the
- * row-stream.
- *
- * @param inputRowMeta the row structure coming in to the step
- * @param name the name of the step making the changes
- * @param info row structures of any info steps coming in
- * @param nextStep the description of a step this step is passing rows to
- * @param space the variable space for resolving variables
- * @param repository the repository instance optionally read from
- * @param metaStore the metaStore to optionally read from
- */
- public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException{
-
- /*
- * This implementation appends the outputField to the row-stream
- */
-
- // a value meta object contains the meta data for a field
- ValueMetaInterface v = new ValueMeta(outputField, ValueMeta.TYPE_STRING);
-
- // setting trim type to "both"
- v.setTrimType(ValueMeta.TRIM_TYPE_BOTH);
-
- // the name of the step that adds this field
- v.setOrigin(name);
-
- // modify the row structure and add the field this step generates
- inputRowMeta.addValueMeta(v);
-
- }
-
-
- /**
- * This method is called when the user selects the "Verify Transformation" option in Spoon.
- * A list of remarks is passed in that this method should add to. Each remark is a comment, warning, error, or ok.
- * The method should perform as many checks as necessary to catch design-time errors.
- *
- * Typical checks include:
- * - verify that all mandatory configuration is given
- * - verify that the step receives any input, unless it's a row generating step
- * - verify that the step does not receive any input if it does not take them into account
- * - verify that the step finds fields it relies on in the row-stream
- *
- * @param remarks
- * @param transMeta
- * @param stepMeta
- * @param prev
- * @param input
- * @param output
- * @param info
- * @param space
- * @param repository
- * @param metaStore
- */
- public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String input[], String output[], RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
-
- CheckResult cr;
-
- // See if there are input streams leading to this step!
- if (input.length > 0) {
- cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "Demo.CheckResult.ReceivingRows.OK"), stepMeta);
- remarks.add(cr);
- } else {
- cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "Demo.CheckResult.ReceivingRows.ERROR"), stepMeta);
- remarks.add(cr);
- }
-
- }
-
-
- public void setServerURLField(String serverURLField) {
- this.serverURLField = serverURLField;
- }
-
- public String getServerURLField() {
- return serverURLField;
- }
-
-
- public void setResultField(String resultField) {
- this.resultField = resultField;
- }
-
- public String getResultField() {
- return resultField;
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/OODTConfig.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/OODTConfig.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/OODTConfig.java
deleted file mode 100644
index 0ebe318..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/OODTConfig.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.filemgrdelete;
-
-
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
-
-import java.net.URL;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Created by bugg on 07/03/14.
- */
-public class OODTConfig {
-
- private static final Logger LOG = Logger.getLogger(OODTConfig.class.getName());
-
- private URL fmUrl;
-
- public URL getFmUrl(){
- return this.fmUrl;
- }
-
- private static XmlRpcFileManagerClient client = null;
-
- public boolean loadXMLRpcClient(String fmUrlStr){
- try {
- client = new XmlRpcFileManagerClient(new URL(fmUrlStr));
- } catch (Exception e) {
- LOG.log(Level.SEVERE,
- "Unable to create file manager client: Message: "
- + e.getMessage() + ": errors to follow");
- }
- return true;
- }
-
- public XmlRpcFileManagerClient getXMLRpcClient(){
- return client;
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/OODTProcesses.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/OODTProcesses.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/OODTProcesses.java
deleted file mode 100644
index c33bcb7..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/OODTProcesses.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrdelete;
-
-import org.apache.oodt.cas.filemgr.structs.Product;
-import org.apache.oodt.cas.filemgr.structs.Reference;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
-
-import java.io.File;
-import java.net.URI;
-import java.util.List;
-
-/**
- * Created by bugg on 07/03/14.
- */
-public class OODTProcesses {
-
- public boolean deleteProductByName(OODTConfig config, String filename) throws Exception {
- XmlRpcFileManagerClient client = config.getXMLRpcClient();
- Product p = client.getProductByName(filename);
- List<Reference> refs = client.getProductReferences(p);
- if (refs == null) {
- throw new Exception("FileManager returned null References");
- }
- for (Reference ref : refs) {
- if (!client.removeFile(new File(new URI(ref.getDataStoreReference()))
- .getAbsolutePath())) {
- throw new Exception("Failed to delete file '"
- + ref.getDataStoreReference() + "'");
- }
- }
- if (client.removeProduct(p)) {
- // printer.println("Successfully deleted product '"
- // + p.getProductName() + "'");
- return true;
- } else {
- throw new Exception("Delete product returned false");
- }
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/PushPullObjectFactory.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/PushPullObjectFactory.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/PushPullObjectFactory.java
deleted file mode 100644
index a710e1f..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/PushPullObjectFactory.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrdelete;
-
-//OODT imports
-import org.apache.oodt.cas.filemgr.ingest.Cache;
-import org.apache.oodt.cas.filemgr.ingest.CacheFactory;
-import org.apache.oodt.cas.filemgr.ingest.Ingester;
-
-//JDK imports
-import java.lang.reflect.InvocationTargetException;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class PushPullObjectFactory {
-
- private PushPullObjectFactory() throws InstantiationException {
- throw new InstantiationException("Don't construct factory classes!");
- }
-
- public static <T> T createNewInstance(Class<T> clazz) throws InstantiationException {
- try {
- return clazz.newInstance();
- } catch (Exception e) {
- throw new InstantiationException(
- "Failed to create new object : "
- + e.getMessage());
- }
- }
-
- public static Ingester createIngester(String ingesterClass,
- String cacheFactoryClass) throws InstantiationException,
- IllegalAccessException, ClassNotFoundException,
- IllegalArgumentException, SecurityException,
- InvocationTargetException, NoSuchMethodException {
- String dataTransferFactory = "org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory";
- System.out.println("TRANSFER: " + dataTransferFactory);
- if (cacheFactoryClass == null || cacheFactoryClass.equals("")) {
- return (Ingester) Class.forName(ingesterClass).getConstructor(
- dataTransferFactory.getClass()).newInstance(
- dataTransferFactory);
- } else {
- Class<CacheFactory> cacheFactory = (Class<CacheFactory>) Class
- .forName(cacheFactoryClass);
- Cache cache = cacheFactory.newInstance().createCache();
- return (Ingester) Class.forName(ingesterClass).getConstructor(
- dataTransferFactory.getClass(), cache.getClass())
- .newInstance(dataTransferFactory, cache);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/messages/messages_en_US.properties
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/messages/messages_en_US.properties b/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/messages/messages_en_US.properties
deleted file mode 100644
index ef95599..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrdelete/messages/messages_en_US.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-Demo.Shell.Title=Demo step
-Demo.FieldName.Label=Output field name
-Demo.CheckResult.ReceivingRows.OK=Step is receiving input from other steps.
-Demo.CheckResult.ReceivingRows.ERROR=No input received from other steps!
-
-FilemgrDeleteStep.Name=OODT Filemgr File Delete
-FilemgrDeleteStep.TooltipDesc=Remove a file from the file manager
-
-FilemgrDelete.FieldName.Label=Stream Field Name
-FilemgrDelete.ServerURL.Label=Filemgr URL
-FilemgrDelete.Result.Label=Result Field
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStep.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStep.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStep.java
deleted file mode 100644
index eb9cc62..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStep.java
+++ /dev/null
@@ -1,244 +0,0 @@
-package org.apache.oodt.filemgrget;
-
-import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
-import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException;
-import org.apache.oodt.cas.filemgr.structs.exceptions.DataTransferException;
-import org.pentaho.di.core.Const;
-import org.pentaho.di.core.exception.KettleException;
-import org.pentaho.di.core.row.RowMeta;
-import org.pentaho.di.trans.Trans;
-import org.pentaho.di.trans.TransMeta;
-import org.pentaho.di.trans.step.*;
-import sun.util.logging.resources.logging_de;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Map;
-
-import static org.pentaho.di.core.row.RowDataUtil.allocateRowData;
-
-/**
-* Copyright 2014 OSBI Ltd
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-public class FilemgrGetStep extends BaseStep implements StepInterface {
-
- private OODTConfig oodt = new OODTConfig();
- private OODTProcesses oodtproc = new OODTProcesses();
- private FilemgrGetStepData data;
- private FilemgrGetStepMeta meta;
- /**
- * The constructor should simply pass on its arguments to the parent class.
- *
- * @param s step description
- * @param stepDataInterface step data class
- * @param c step copy
- * @param t transformation description
- * @param dis transformation executing
- */
- public FilemgrGetStep(StepMeta s, StepDataInterface stepDataInterface, int c, TransMeta t, Trans dis) {
- super(s, stepDataInterface, c, t, dis);
- }
-
- /**
- * This method is called by PDI during transformation startup.
- *
- * It should initialize required for step execution.
- *
- * The meta and data implementations passed in can safely be cast
- * to the step's respective implementations.
- *
- * It is mandatory that super.init() is called to ensure correct behavior.
- *
- * Typical tasks executed here are establishing the connection to a database,
- * as wall as obtaining resources, like file handles.
- *
- * @param smi step meta interface implementation, containing the step settings
- * @param sdi step data interface implementation, used to store runtime information
- *
- * @return true if initialization completed successfully, false if there was an error preventing the step from working.
- *
- */
- public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
- // Casting to step-specific implementation classes is safe
- meta = (FilemgrGetStepMeta) smi;
- data = (FilemgrGetStepData) sdi;
-
-
- logDetailed("loading xmlrpcclient");
- try {
- oodt.loadXMLRpcClient(meta.getServerURLField());
- } catch (MalformedURLException e) {
- logError("Incorrect URL", e);
- } catch (ConnectionException e) {
- logError("There was a problem connecting", e);
- }
- logDetailed("finished loading xmlrpcclient");
-
-
- return super.init(meta, data);
- }
-
-
- private Object[] buildEmptyRow() {
-
- return allocateRowData(data.outputRowMeta.size());
- }
-
- /**
- * Once the transformation starts executing, the processRow() method is called repeatedly
- * by PDI for as long as it returns true. To indicate that a step has finished processing rows
- * this method must call setOutputDone() and return false;
- *
- * Steps which process incoming rows typically call getRow() to read a single row from the
- * input stream, change or add row content, call putRow() to pass the changed row on
- * and return true. If getRow() returns null, no more rows are expected to come in,
- * and the processRow() implementation calls setOutputDone() and returns false to
- * indicate that it is done too.
- *
- * Steps which generate rows typically construct a new row Object[] using a call to
- * RowDataUtil.allocateRowData(numberOfFields), add row content, and call putRow() to
- * pass the new row on. Above process may happen in a loop to generate multiple rows,
- * at the end of which processRow() would call setOutputDone() and return false;
- *
- * @param smi the step meta interface containing the step settings
- * @param sdi the step data interface that should be used to store
- *
- * @return true to indicate that the function should be called again, false if the step is done
- */
- public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException {
-
-
- if ( first ) {
- first = false;
- data.outputRowMeta = new RowMeta();
- meta.getFields( data.outputRowMeta, getStepname(), null, null, this, repository, metaStore );
- }
-
- if(meta.getProcessType() == Process.LIST){
- try {
- Map<String, Map<String, String>> products = oodtproc.getAllProducts(oodt, environmentSubstitute(meta.getProductTypeField()));
- for (Map.Entry<String, Map<String,String>> entry : products.entrySet())
- {
- Object[] row = buildEmptyRow();
-
- incrementLinesRead();
-
- row[0] = entry.getKey();
- int i = 1;
- for(Map.Entry<String,String> innerentry : entry.getValue().entrySet()){
- row[i] = innerentry.getValue();
- i++;
- }
-
- putRow(data.outputRowMeta, row);
- }
-
- } catch (Exception e) {
- logError("Could not get data", e);
- }
-
- }
- else if(meta.getProcessType() == Process.GET && meta.getSearchType() == Search.ID){
-
- try {
- String lookup = meta.getLookup();
- if(!Const.isEmpty(lookup)){
- lookup = environmentSubstitute(lookup);
- }
-
- Object[] row = buildEmptyRow();
- row[0] = oodtproc.getProductByID(oodt, lookup);
- putRow(data.outputRowMeta, row);
-
- } catch (CatalogException e) {
- logError("Catalog Exception", e);
- } catch (DataTransferException e) {
- logError("Data Transfer Exception", e);
- } catch (IOException e) {
- logError("IO Exception",e);
- }
- }
- else if(meta.getProcessType() == Process.GET && meta.getSearchType() == Search.NAME){
- try {
- String lookup = meta.getLookup();
- if(!Const.isEmpty(lookup)){
- lookup = environmentSubstitute(lookup);
- }
-
- Object[] row = buildEmptyRow();
- row[0] = oodtproc.getProductByName(oodt, lookup);
- putRow(data.outputRowMeta, row);
- } catch (CatalogException e) {
- logError("Catalog Exception", e);
- } catch (DataTransferException e) {
- logError("Data Transfer Exception", e);
- } catch (IOException e) {
- logError("IO Exception", e);
- }
- }
-
-
- // log progress if it is time to to so
- if (checkFeedback(getLinesRead())) {
- logBasic("Linenr " + getLinesRead()); // Some basic logging
- }
-
- // indicate that processRow() should be called again
- setOutputDone();
- return false;
- }
-
- /**
- * This method is called by PDI once the step is done processing.
- *
- * The dispose() method is the counterpart to init() and should release any resources
- * acquired for step execution like file handles or database connections.
- *
- * The meta and data implementations passed in can safely be cast
- * to the step's respective implementations.
- *
- * It is mandatory that super.dispose() is called to ensure correct behavior.
- *
- * @param smi step meta interface implementation, containing the step settings
- * @param sdi step data interface implementation, used to store runtime information
- */
- public void dispose(StepMetaInterface smi, StepDataInterface sdi) {
-
- // Casting to step-specific implementation classes is safe
- FilemgrGetStepMeta meta = (FilemgrGetStepMeta) smi;
- FilemgrGetStepData data = (FilemgrGetStepData) sdi;
-
- super.dispose(meta, data);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStepData.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStepData.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStepData.java
deleted file mode 100644
index ada2397..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStepData.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrget;
-
-import org.pentaho.di.core.row.RowMetaInterface;
-import org.pentaho.di.trans.step.BaseStepData;
-import org.pentaho.di.trans.step.StepDataInterface;
-
-/**
-* Copyright 2014 OSBI Ltd
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-public class FilemgrGetStepData extends BaseStepData implements StepDataInterface {
-
- public RowMetaInterface outputRowMeta;
-
- public String fieldname;
-
- public FilemgrGetStepData()
- {
- super();
- }
-}
-
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStepDialog.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStepDialog.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStepDialog.java
deleted file mode 100644
index c6aaf0b..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStepDialog.java
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrget;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.*;
-import org.pentaho.di.core.Const;
-import org.pentaho.di.i18n.BaseMessages;
-import org.pentaho.di.trans.TransMeta;
-import org.pentaho.di.trans.step.BaseStepMeta;
-import org.pentaho.di.trans.step.StepDialogInterface;
-import org.pentaho.di.ui.core.widget.TextVar;
-import org.pentaho.di.ui.trans.step.BaseStepDialog;
-
-/**
-* Copyright 2014 OSBI Ltd
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-public class FilemgrGetStepDialog extends BaseStepDialog implements StepDialogInterface {
-
- /**
- * The PKG member is used when looking up internationalized strings.
- * The properties file with localized keys is expected to reside in
- * {the package of the class specified}/messages/messages_{locale}.properties
- */
- private static Class<?> PKG = FilemgrGetStepMeta.class; // for i18n purposes
-
- // this is the object the stores the step's settings
- // the dialog reads the settings from it when opening
- // the dialog writes the settings to it when confirmed
- private FilemgrGetStepMeta meta;
-
- // text field holding the name of the field to add to the row stream
- //private Text wHelloFieldName;
-
- // text field holding the name of the field to check the filename against
- private TextVar wFilenameField;
- private Text wServerURLField;
- private TextVar wResultField;
- private Button[] radioButtons2 = new Button[2];
- private Button[] radioButtons = new Button[2];
- private Search selectedsearch;
- private Process selectedprocess;
- /**
- * The constructor should simply invoke super() and save the incoming meta
- * object to a local variable, so it can conveniently read and write settings
- * from/to it.
- *
- * @param parent the SWT shell to open the dialog in
- * @param in the meta object holding the step's settings
- * @param transMeta transformation description
- * @param sname the step name
- */
- public FilemgrGetStepDialog(Shell parent, Object in, TransMeta transMeta, String sname) {
- super(parent, (BaseStepMeta) in, transMeta, sname);
- meta = (FilemgrGetStepMeta) in;
- }
-
- /**
- * This method is called by Spoon when the user opens the settings dialog of the step.
- * It should open the dialog and return only once the dialog has been closed by the user.
- *
- * If the user confirms the dialog, the meta object (passed in the constructor) must
- * be updated to reflect the new step settings. The changed flag of the meta object must
- * reflect whether the step configuration was changed by the dialog.
- *
- * If the user cancels the dialog, the meta object must not be updated, and its changed flag
- * must remain unaltered.
- *
- * The open() method must return the name of the step after the user has confirmed the dialog,
- * or null if the user cancelled the dialog.
- */
- public String open() {
-
- // store some convenient SWT variables
- Shell parent = getParent();
- Display display = parent.getDisplay();
-
- // SWT code for preparing the dialog
- shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX);
- props.setLook(shell);
- setShellImage(shell, meta);
-
- // Save the value of the changed flag on the meta object. If the user cancels
- // the dialog, it will be restored to this saved value.
- // The "changed" variable is inherited from BaseStepDialog
- changed = meta.hasChanged();
-
- // The ModifyListener used on all controls. It will update the meta object to
- // indicate that changes are being made.
- ModifyListener lsMod = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- meta.setChanged();
- }
- };
-
- // ------------------------------------------------------- //
- // SWT code for building the actual settings dialog //
- // ------------------------------------------------------- //
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = Const.FORM_MARGIN;
- formLayout.marginHeight = Const.FORM_MARGIN;
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "FilemgrGetStep.Name"));
-
- int middle = props.getMiddlePct();
- int margin = Const.MARGIN;
-
- // Stepname line
- wlStepname = new Label(shell, SWT.RIGHT);
- wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
- props.setLook(wlStepname);
- fdlStepname = new FormData();
- fdlStepname.left = new FormAttachment(0, 0);
- fdlStepname.right = new FormAttachment(middle, -margin);
- fdlStepname.top = new FormAttachment(0, margin);
- wlStepname.setLayoutData(fdlStepname);
-
- wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- wStepname.setText(stepname);
- props.setLook(wStepname);
- wStepname.addModifyListener(lsMod);
- fdStepname = new FormData();
- fdStepname.left = new FormAttachment(middle, 0);
- fdStepname.top = new FormAttachment(0, margin);
- fdStepname.right = new FormAttachment(100, 0);
- wStepname.setLayoutData(fdStepname);
-
- // servername field value
- Label wlServerName = new Label(shell, SWT.RIGHT);
- wlServerName.setText(BaseMessages.getString(PKG, "FilemgrGet.ServerURL.Label"));
- props.setLook(wlServerName);
- FormData fdlServerName = new FormData();
- fdlServerName.left = new FormAttachment(0, 0);
- fdlServerName.right = new FormAttachment(middle, -margin);
- fdlServerName.top = new FormAttachment(wStepname, margin);
- wlServerName.setLayoutData(fdlServerName);
-
- wServerURLField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wServerURLField);
- wServerURLField.addModifyListener(lsMod);
- FormData fdServerName = new FormData();
- fdServerName.left = new FormAttachment(middle, 0);
- fdServerName.right = new FormAttachment(100, 0);
- fdServerName.top = new FormAttachment(wStepname, margin);
- wServerURLField.setLayoutData(fdServerName);
-
- // product type
- Label wlValName = new Label(shell, SWT.RIGHT);
- wlValName.setText(BaseMessages.getString(PKG, "FilemgrGet.ProductType.Label"));
- props.setLook(wlValName);
- FormData fdlValName = new FormData();
- fdlValName.left = new FormAttachment(0, 0);
- fdlValName.right = new FormAttachment(middle, -margin);
- fdlValName.top = new FormAttachment(wServerURLField, margin);
- wlValName.setLayoutData(fdlValName);
-
- wFilenameField = new TextVar(transMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wFilenameField);
- wFilenameField.addModifyListener(lsMod);
- FormData fdValName = new FormData();
- fdValName.left = new FormAttachment(middle, 0);
- fdValName.right = new FormAttachment(100, 0);
- fdValName.top = new FormAttachment(wServerURLField, margin);
- wFilenameField.setLayoutData(fdValName);
-
-
- // processtype value
- Label wlProcessTypeName = new Label(shell, SWT.RIGHT);
- wlProcessTypeName.setText(BaseMessages.getString(PKG, "FilemgrGet.ProcessType.Label"));
- props.setLook(wlProcessTypeName);
- FormData fdlProcessTypeName = new FormData();
- fdlProcessTypeName.left = new FormAttachment(0, 0);
- fdlProcessTypeName.right = new FormAttachment(middle, -margin);
- fdlProcessTypeName.top = new FormAttachment(wFilenameField, margin);
- wlProcessTypeName.setLayoutData(fdlProcessTypeName);
-
- Composite composite = new Composite(shell, SWT.NULL);
- composite.setLayout(new RowLayout());
- radioButtons2[0] = new Button(composite, SWT.RADIO);
- radioButtons2[0].setSelection(true);
- radioButtons2[0].setText("List Products");
- radioButtons2[0].pack();
- radioButtons2[1] = new Button(composite, SWT.RADIO);
- radioButtons2[1].setSelection(false);
- radioButtons2[1].setText("Get Product");
- radioButtons2[1].pack();
- props.setLook(radioButtons2[0]);
- props.setLook(radioButtons2[1]);
-
-
- //wFilenameField.addModifyListener(lsMod);
- FormData fdProcessTypeName = new FormData();
- fdProcessTypeName.left = new FormAttachment(middle, 0);
- fdProcessTypeName.right = new FormAttachment(100, 0);
- fdProcessTypeName.top = new FormAttachment(wFilenameField, margin);
- composite.setLayoutData(fdProcessTypeName);
-
-
- // search type value
- Label wlSearchName = new Label(shell, SWT.RIGHT);
- wlSearchName.setText(BaseMessages.getString(PKG, "FilemgrGet.SearchType.Label"));
- props.setLook(wlSearchName);
- FormData fdlSearchName = new FormData();
- fdlSearchName.left = new FormAttachment(0, 0);
- fdlSearchName.right = new FormAttachment(middle, -margin);
- fdlSearchName.top = new FormAttachment(composite, margin);
- wlSearchName.setLayoutData(fdlSearchName);
-
- Composite composite1 = new Composite(shell, SWT.NULL);
- composite1.setLayout(new RowLayout());
- radioButtons[0] = new Button(composite1, SWT.RADIO);
- radioButtons[0].setSelection(true);
- radioButtons[0].setText("Name");
- radioButtons[0].pack();
- radioButtons[1] = new Button(composite1, SWT.RADIO);
- radioButtons[1].setSelection(false);
- radioButtons[1].setText("ID");
- radioButtons[1].pack();
- props.setLook(radioButtons[0]);
- props.setLook(radioButtons[1]);
- radioButtons[0].addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- selectedsearch = Search.NAME;
- }
- });
- radioButtons[1].addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- selectedsearch = Search.ID;
- }
- });
-
- FormData fdSearchName = new FormData();
- fdSearchName.left = new FormAttachment(middle, 0);
- fdSearchName.right = new FormAttachment(100, 0);
- fdSearchName.top = new FormAttachment(composite, margin);
- composite1.setLayoutData(fdSearchName);
-
- if(meta.getProcessType()==Process.LIST){
- radioButtons[0].setEnabled(false);
- radioButtons[1].setEnabled(false);
- }
-
-
- // servername field value
- Label wlResultName = new Label(shell, SWT.RIGHT);
- wlResultName.setText(BaseMessages.getString(PKG, "FilemgrGet.Result.Label"));
- props.setLook(wlResultName);
- FormData fdlResultName = new FormData();
- fdlResultName.left = new FormAttachment(0, 0);
- fdlResultName.right = new FormAttachment(middle, -margin);
- fdlResultName.top = new FormAttachment(composite1, margin);
- wlResultName.setLayoutData(fdlResultName);
-
- wResultField = new TextVar(transMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- props.setLook(wResultField);
- wResultField.addModifyListener(lsMod);
- FormData fdResultName = new FormData();
- fdResultName.left = new FormAttachment(middle, 0);
- fdResultName.right = new FormAttachment(100, 0);
- fdResultName.top = new FormAttachment(composite1, margin);
- wResultField.setLayoutData(fdResultName);
- wResultField.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- wResultField.setToolTipText(transMeta.environmentSubstitute(wResultField.getText()));
- }
- });
-
- if(meta.getProcessType()==Process.LIST){
- wResultField.setEnabled(false);
- }
- // OK and cancel buttons
- wOK = new Button(shell, SWT.PUSH);
- wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
-
- BaseStepDialog.positionBottomButtons(shell, new Button[] { wOK, wCancel }, margin, wResultField);
-
- // Add listeners for cancel and OK
- lsCancel = new Listener() {
- public void handleEvent(Event e) {cancel();}
- };
- lsOK = new Listener() {
- public void handleEvent(Event e) {ok();}
- };
-
- wCancel.addListener(SWT.Selection, lsCancel);
- wOK.addListener(SWT.Selection, lsOK);
-
- /**
- * Radio button listeners
- */
- radioButtons2[0].addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- selectedprocess = Process.LIST;
- wResultField.setEnabled(false);
- radioButtons[0].setEnabled(false);
- radioButtons[1].setEnabled(false);
-
- }
- });
- radioButtons2[1].addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- selectedprocess = Process.GET;
- radioButtons[0].setEnabled(true);
- radioButtons[1].setEnabled(true);
- wResultField.setEnabled(true);
- }
- });
-
- // default listener (for hitting "enter")
- lsDef = new SelectionAdapter() {
- public void widgetDefaultSelected(SelectionEvent e) {ok();}
- };
- wStepname.addSelectionListener(lsDef);
- wFilenameField.addSelectionListener(lsDef);
- wServerURLField.addSelectionListener(lsDef);
- wResultField.addSelectionListener(lsDef);
- // Detect X or ALT-F4 or something that kills this window and cancel the dialog properly
- shell.addShellListener(new ShellAdapter() {
- public void shellClosed(ShellEvent e) {cancel();}
- });
-
- // Set/Restore the dialog size based on last position on screen
- // The setSize() method is inherited from BaseStepDialog
- setSize();
-
- // populate the dialog with the values from the meta object
- populateDialog();
-
- // restore the changed flag to original value, as the modify listeners fire during dialog population
- meta.setChanged(changed);
-
- // open dialog and enter event loop
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- // at this point the dialog has closed, so either ok() or cancel() have been executed
- // The "stepname" variable is inherited from BaseStepDialog
- return stepname;
- }
-
- /**
- * This helper method puts the step configuration stored in the meta object
- * and puts it into the dialog controls.
- */
- private void populateDialog() {
- wStepname.selectAll();
- wFilenameField.setText(meta.getProductTypeField());
- wServerURLField.setText(meta.getServerURLField());
- wResultField.setText(meta.getResultField());
- if(meta.getSearchType() == Search.NAME){
- radioButtons[0].setSelection(true);
- radioButtons[1].setSelection(false);
- selectedsearch = Search.NAME;
- }
- else{
- radioButtons[1].setSelection(true);
- radioButtons[0].setSelection(false);
- selectedsearch = Search.ID;
- }
-
- if(meta.getProcessType() == Process.LIST){
- radioButtons2[0].setSelection(true);
- radioButtons2[1].setSelection(false);
- selectedprocess= Process.LIST;
- }
- else{
- radioButtons2[1].setSelection(true);
- radioButtons2[0].setSelection(false);
- selectedprocess = Process.GET;
- }
-
- }
-
- /**
- * Called when the user cancels the dialog.
- */
- private void cancel() {
- // The "stepname" variable will be the return value for the open() method.
- // Setting to null to indicate that dialog was cancelled.
- stepname = null;
- // Restoring original "changed" flag on the met aobject
- meta.setChanged(changed);
- // close the SWT dialog window
- dispose();
- }
-
- /**
- * Called when the user confirms the dialog
- */
- private void ok() {
- stepname = wStepname.getText();
- meta.setProductName(wFilenameField.getText());
- meta.setServerURLField(wServerURLField.getText());
- meta.setResultField(wResultField.getText());
- meta.setProcessType(selectedprocess);
- meta.setSearchType(selectedsearch);
- // close the SWT dialog window
- dispose();
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStepMeta.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStepMeta.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStepMeta.java
deleted file mode 100644
index 3b295fc..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/FilemgrGetStepMeta.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrget;
-
-import org.eclipse.swt.widgets.Shell;
-import org.pentaho.di.core.CheckResult;
-import org.pentaho.di.core.CheckResultInterface;
-import org.pentaho.di.core.annotations.Step;
-import org.pentaho.di.core.database.DatabaseMeta;
-import org.pentaho.di.core.exception.KettleException;
-import org.pentaho.di.core.exception.KettleStepException;
-import org.pentaho.di.core.exception.KettleValueException;
-import org.pentaho.di.core.exception.KettleXMLException;
-import org.pentaho.di.core.row.RowMetaInterface;
-import org.pentaho.di.core.row.ValueMeta;
-import org.pentaho.di.core.row.ValueMetaInterface;
-import org.pentaho.di.core.variables.VariableSpace;
-import org.pentaho.di.core.xml.XMLHandler;
-import org.pentaho.di.i18n.BaseMessages;
-import org.pentaho.di.repository.ObjectId;
-import org.pentaho.di.repository.Repository;
-import org.pentaho.di.trans.Trans;
-import org.pentaho.di.trans.TransMeta;
-import org.pentaho.di.trans.step.*;
-import org.pentaho.metastore.api.IMetaStore;
-import org.w3c.dom.Node;
-
-import java.util.List;
-
-/**
-* Copyright 2014 OSBI Ltd
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-@Step(
- id = "FilemgrGet",
- image = "org/apache/oodt/filemgrcheck/resources/check/oodt.jpg",
- i18nPackageName="bi.meteorite.filemgrget",
- name="FilemgrGetStep.Name",
- description = "FilemgrGetStep.TooltipDesc",
- categoryDescription="i18n:org.pentaho.di.trans.step:BaseStep.Category.BigData"
-)
-public class FilemgrGetStepMeta extends BaseStepMeta implements StepMetaInterface {
-
- /**
- * The PKG member is used when looking up internationalized strings.
- * The properties file with localized keys is expected to reside in
- * {the package of the class specified}/messages/messages_{locale}.properties
- */
- private static Class<?> PKG = FilemgrGetStepMeta.class; // for i18n purposes
-
- /**
- * Stores the name of the field added to the row-stream.
- */
- private String outputField;
- private String productName;
- private String serverURLField;
- private String resultField;
- private Search searchtypeField;
- private Process processtypeField;
-
- /**
- * Constructor should call super() to make sure the base class has a chance to initialize properly.
- */
- public FilemgrGetStepMeta() {
- super();
- }
-
- /**
- * Called by Spoon to get a new instance of the SWT dialog for the step.
- * A standard implementation passing the arguments to the constructor of the step dialog is recommended.
- *
- * @param shell an SWT Shell
- * @param meta description of the step
- * @param transMeta description of the the transformation
- * @param name the name of the step
- * @return new instance of a dialog for this step
- */
- public StepDialogInterface getDialog(Shell shell, StepMetaInterface meta, TransMeta transMeta, String name) {
- return new FilemgrGetStepDialog(shell, meta, transMeta, name);
- }
-
- /**
- * Called by PDI to get a new instance of the step implementation.
- * A standard implementation passing the arguments to the constructor of the step class is recommended.
- *
-gf * @param stepMeta description of the step
- * @param stepDataInterface instance of a step data class
- * @param cnr copy number
- * @param transMeta description of the transformation
- * @param disp runtime implementation of the transformation
- * @return the new instance of a step implementation
- */
- public StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta, Trans disp) {
- return new FilemgrGetStep(stepMeta, stepDataInterface, cnr, transMeta, disp);
- }
-
- /**
- * Called by PDI to get a new instance of the step data class.
- */
- public StepDataInterface getStepData() {
- return new FilemgrGetStepData();
- }
-
- /**
- * This method is called every time a new step is created and should allocate/set the step configuration
- * to sensible defaults. The values set here will be used by Spoon when a new step is created.
- */
- public void setDefault() {
- outputField = "demo_field";
- serverURLField = "http://localhost:9000";
- resultField = "result";
- productName = "GenericFile";
- searchtypeField = Search.NAME;
- processtypeField = Process.LIST;
- }
-
- /**
- * Getter for the name of the field added by this step
- * @return the name of the field added
- */
- public String getOutputField() {
- return outputField;
- }
-
- /**
- * Setter for the name of the field added by this step
- * @param outputField the name of the field added
- */
- public void setOutputField(String outputField) {
- this.outputField = outputField;
- }
-
-
- public String getProductTypeField(){
- return productName;
- }
-
- public void setProductName(String productName){
- this.productName = productName;
- }
- /**
- * This method is used when a step is duplicated in Spoon. It needs to return a deep copy of this
- * step meta object. Be sure to create proper deep copies if the step configuration is stored in
- * modifiable objects.
- *
- * See org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta.clone() for an example on creating
- * a deep copy.
- *
- * @return a deep copy of this
- */
- public Object clone() {
- return super.clone();
- }
-
- /**
- * This method is called by Spoon when a step needs to serialize its configuration to XML. The expected
- * return value is an XML fragment consisting of one or more XML tags.
- *
- * Please use org.pentaho.di.core.xml.XMLHandler to conveniently generate the XML.
- *
- * @return a string containing the XML serialization of this step
- */
- public String getXML() throws KettleValueException {
-
- // only one field to serialize
- String xml = " ";
- xml += " " +XMLHandler.addTagValue("outputfield", outputField);
- xml += " " +XMLHandler.addTagValue("filenamefield", productName);
- xml += " " +XMLHandler.addTagValue("serverurlfield", serverURLField);
- xml += " " +XMLHandler.addTagValue("resultfield", resultField);
- xml += " " +XMLHandler.addTagValue("producttypefield", productName);
- xml += " " +XMLHandler.addTagValue("searchtypefield", searchtypeField.toString());
- xml += " " +XMLHandler.addTagValue("processtypefield", processtypeField.toString());
- return xml;
- }
-
- /**
- * This method is called by PDI when a step needs to load its configuration from XML.
- *
- * Please use org.pentaho.di.core.xml.XMLHandler to conveniently read from the
- * XML node passed in.
- *
- * @param stepnode the XML node containing the configuration
- * @param databases the databases available in the transformation
- * @param metaStore the metaStore to optionally read from
- */
- public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore) throws KettleXMLException {
-
- try {
- setOutputField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "outputfield")));
- setProductName(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "filenamefield")));
- setServerURLField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "serverurlfield")));
- setResultField(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "resultfield")));
- setProductName(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "producttypefield")));
- setSearchType(Search.valueOf(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "searchtypefield"))));
- setProcessType(Process.valueOf(XMLHandler.getNodeValue(XMLHandler.getSubNode(stepnode, "processtypefield"))));
-
- } catch (Exception e) {
- throw new KettleXMLException("Demo plugin unable to read step info from XML node", e);
- }
-
- }
- /**
- * This method is called by Spoon when a step needs to serialize its configuration to a repository.
- * The repository implementation provides the necessary methods to save the step attributes.
- *
- * @param rep the repository to save to
- * @param metaStore the metaStore to optionally write to
- * @param id_transformation the id to use for the transformation when saving
- * @param id_step the id to use for the step when saving
- */
- public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step) throws KettleException
- {
- try{
- rep.saveStepAttribute(id_transformation, id_step, "outputfield", outputField); //$NON-NLS-1$
- }
- catch(Exception e){
- throw new KettleException("Unable to save step into repository: "+id_step, e);
- }
- }
-
- /**
- * This method is called by PDI when a step needs to read its configuration from a repository.
- * The repository implementation provides the necessary methods to read the step attributes.
- *
- * @param rep the repository to read from
- * @param metaStore the metaStore to optionally read from
- * @param id_step the id of the step being read
- * @param databases the databases available in the transformation
- */
- public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases) throws KettleException {
- try{
- outputField = rep.getStepAttributeString(id_step, "outputfield"); //$NON-NLS-1$
- }
- catch(Exception e){
- throw new KettleException("Unable to load step from repository", e);
- }
- }
-
- /**
- * This method is called to determine the changes the step is making to the row-stream.
- * To that end a RowMetaInterface object is passed in, containing the row-stream structure as it is when entering
- * the step. This method must apply any changes the step makes to the row stream. Usually a step adds fields to the
- * row-stream.
- *
- * @param inputRowMeta the row structure coming in to the step
- * @param name the name of the step making the changes
- * @param info row structures of any info steps coming in
- * @param nextStep the description of a step this step is passing rows to
- * @param space the variable space for resolving variables
- * @param repository the repository instance optionally read from
- * @param metaStore the metaStore to optionally read from
- */
- public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException{
-
- /*
- * This implementation appends the outputField to the row-stream
- */
- if(getProcessType() == Process.LIST){
- // a value meta object contains the meta data for a field
- ValueMetaInterface v = new ValueMeta("id", ValueMeta.TYPE_STRING);
-
- // setting trim type to "both"
- v.setTrimType(ValueMeta.TRIM_TYPE_BOTH);
-
- // the name of the step that adds this field
- v.setOrigin(name);
-
- // modify the row structure and add the field this step generates
- inputRowMeta.addValueMeta(v);
-
- ValueMetaInterface v2 = new ValueMeta("type", ValueMeta.TYPE_STRING);
- v2.setTrimType(ValueMeta.TRIM_TYPE_BOTH);
- v2.setOrigin(name);
- inputRowMeta.addValueMeta(v2);
-
- ValueMetaInterface v3 = new ValueMeta("name", ValueMeta.TYPE_STRING);
- v3.setTrimType(ValueMeta.TRIM_TYPE_BOTH);
- v3.setOrigin(name);
- inputRowMeta.addValueMeta(v3);
-
- ValueMetaInterface v4 = new ValueMeta("structure", ValueMeta.TYPE_STRING);
- v4.setTrimType(ValueMeta.TRIM_TYPE_BOTH);
- v4.setOrigin(name);
- inputRowMeta.addValueMeta(v4);
-
- ValueMetaInterface v5 = new ValueMeta("transferstatus", ValueMeta.TYPE_STRING);
- v5.setTrimType(ValueMeta.TRIM_TYPE_BOTH);
- v5.setOrigin(name);
- inputRowMeta.addValueMeta(v5);
-
- ValueMetaInterface v6 = new ValueMeta("metadata", ValueMeta.TYPE_STRING);
- v6.setTrimType(ValueMeta.TRIM_TYPE_BOTH);
- v6.setOrigin(name);
- inputRowMeta.addValueMeta(v6);
- }
- else{
- ValueMetaInterface v6 = new ValueMeta("export", ValueMeta.TYPE_STRING);
- v6.setTrimType(ValueMeta.TRIM_TYPE_BOTH);
- v6.setOrigin(name);
- inputRowMeta.addValueMeta(v6);
- }
- }
-
- /**
- * This method is called when the user selects the "Verify Transformation" option in Spoon.
- * A list of remarks is passed in that this method should add to. Each remark is a comment, warning, error, or ok.
- * The method should perform as many checks as necessary to catch design-time errors.
- *
- * Typical checks include:
- * - verify that all mandatory configuration is given
- * - verify that the step receives any input, unless it's a row generating step
- * - verify that the step does not receive any input if it does not take them into account
- * - verify that the step finds fields it relies on in the row-stream
- *
- * @param remarks the list of remarks to append to
- * @param transMeta the description of the transformation
- * @param stepMeta the description of the step
- * @param prev the structure of the incoming row-stream
- * @param input names of steps sending input to the step
- * @param output names of steps this step is sending output to
- * @param info fields coming in from info steps
- * @param metaStore metaStore to optionally read from
- */
- public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String input[], String output[], RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
-
- CheckResult cr;
-
- // See if there are input streams leading to this step!
- if (input.length > 0) {
- cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "Demo.CheckResult.ReceivingRows.OK"), stepMeta);
- remarks.add(cr);
- } else {
- cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "Demo.CheckResult.ReceivingRows.ERROR"), stepMeta);
- remarks.add(cr);
- }
-
- }
-
-
- public void setServerURLField(String serverURLField) {
- this.serverURLField = serverURLField;
- }
-
- public String getServerURLField() {
- return serverURLField;
- }
-
-
- public void setResultField(String resultField) {
- this.resultField = resultField;
- }
-
- public String getResultField() {
- return resultField;
- }
-
-
- public Process getProcessType() {
-
- return processtypeField;
- }
-
- public void setProcessType(Process processtypeField){
- this.processtypeField = processtypeField;
- }
-
- public Search getSearchType() {
- return searchtypeField;
- }
-
- public void setSearchType(Search searchType){
- this.searchtypeField = searchType;
- }
-
- public String getLookup() {
- return resultField;
- }
-
- public void setLookup(String lookup){
- this.resultField = lookup;
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrget/OODTConfig.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/OODTConfig.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrget/OODTConfig.java
deleted file mode 100644
index dc295f9..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/OODTConfig.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrget;
-
-import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
-* Copyright 2014 OSBI Ltd
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-public class OODTConfig {
-
- private static final Logger LOG = Logger.getLogger(OODTConfig.class.getName());
-
- private static XmlRpcFileManagerClient client = null;
-
- public boolean loadXMLRpcClient(String fmUrlStr) throws MalformedURLException, ConnectionException {
-
- client = new XmlRpcFileManagerClient(new URL(fmUrlStr), true);
-
- return true;
- }
-
- public XmlRpcFileManagerClient getXMLRpcClient(){
- return client;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrget/OODTProcesses.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/OODTProcesses.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrget/OODTProcesses.java
deleted file mode 100644
index 4da706f..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/OODTProcesses.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrget;
-
-import com.google.gson.Gson;
-import org.apache.oodt.cas.filemgr.datatransfer.DataTransfer;
-import org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory;
-import org.apache.oodt.cas.filemgr.structs.Product;
-import org.apache.oodt.cas.filemgr.structs.ProductPage;
-import org.apache.oodt.cas.filemgr.structs.ProductType;
-import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
-import org.apache.oodt.cas.filemgr.structs.exceptions.DataTransferException;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
-import org.apache.oodt.cas.metadata.Metadata;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-
-/**
- * Copyright 2014 OSBI Ltd
- * <p/>
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-public class OODTProcesses {
-
-
- public Map<String, Map<String, String>> getAllProducts(OODTConfig config, String productTypeName) throws Exception {
- XmlRpcFileManagerClient client = config.getXMLRpcClient();
- ProductType type = client.getProductTypeByName(productTypeName);
- if (type == null) {
- throw new Exception("FileManager returned null ProductType");
- }
- ProductPage firstPage = client.getFirstPage(type);
- if (firstPage == null) {
- throw new Exception("FileManager returned null product page");
- }
-
- Map<String, Map<String, String>> o = new ConcurrentHashMap<String, Map<String, String>>();
-
- for (int pid = 0; pid < firstPage.getTotalPages(); pid++) {
- if (pid > 0) {
- firstPage = client.getNextPage(type, firstPage);
- }
- for (Product p : firstPage.getPageProducts()) {
- Metadata met = client.getMetadata(p);
-
- Map<String, String> h = new ConcurrentHashMap<String, String>();
- h.put("name", p.getProductName());
- h.put("type", p.getProductType().getName());
- h.put("structure", p.getProductStructure());
- h.put("transferstatus", p.getTransferStatus());
- Gson g = new Gson();
- String json = g.toJson(met.getHashtable());
- h.put("metadata", json);
- o.put(p.getProductId(), h);
-
- }
-
- }
- return o;
-
- }
-
-
- public String getProductByID(OODTConfig config, String id) throws CatalogException, IOException, DataTransferException {
- Product product = config.getXMLRpcClient().getProductById(id);
- product.setProductReferences(config.getXMLRpcClient().getProductReferences(product));
- LocalDataTransferFactory ldtf = new LocalDataTransferFactory();
- DataTransfer dt = ldtf.createDataTransfer();
- String rand = UUID.randomUUID().toString();
- File theDir = new File("/tmp/oodt/" + rand);
- boolean mkdir = false;
- if (!theDir.exists()) {
- mkdir = theDir.mkdir();
- }
- if (mkdir) {
- dt.retrieveProduct(product, new File("/tmp/oodt/" + rand));
- return "/tmp/oodt/" + rand + "/" + product.getProductName();
- } else {
- return null;
- }
- }
-
- public String getProductByName(OODTConfig config, String name) throws CatalogException, IOException, DataTransferException {
- Product product = config.getXMLRpcClient().getProductByName(name);
- product.setProductReferences(config.getXMLRpcClient().getProductReferences(product));
- LocalDataTransferFactory ldtf = new LocalDataTransferFactory();
- DataTransfer dt = ldtf.createDataTransfer();
- String rand = UUID.randomUUID().toString();
- File theDir = new File("/tmp/oodt/" + rand);
- boolean mkdir = false;
- if (!theDir.exists()) {
- mkdir = theDir.mkdir();
- }
- if (mkdir) {
- dt.retrieveProduct(product, new File("/tmp/oodt/" + rand));
- return "/tmp/oodt/" + rand + "/" + product.getProductName();
- } else {
- return null;
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrget/Process.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/Process.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrget/Process.java
deleted file mode 100644
index a780e0f..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/Process.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrget;
-
-/**
-* Copyright 2014 OSBI Ltd
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-public enum Process {
- LIST,GET
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrget/Search.java
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/Search.java b/tools/pdi_plugin/src/org/apache/oodt/filemgrget/Search.java
deleted file mode 100644
index d3cd5ad..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/Search.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.oodt.filemgrget;
-
-/**
-* Copyright 2014 OSBI Ltd
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-public enum Search {
- NAME,ID
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrget/messages/messages_en_US.properties
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/messages/messages_en_US.properties b/tools/pdi_plugin/src/org/apache/oodt/filemgrget/messages/messages_en_US.properties
deleted file mode 100644
index f40155a..0000000
--- a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/messages/messages_en_US.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-FilemgrGetStep.Name=OODT Filemgr File Get
-FilemgrGetStep.TooltipDesc=Get the file from the repository
-
-FilemgrGet.ProductType.Label=Product Type Field
-FilemgrGet.ProcessType.Label=Process Type
-FilemgrGet.SearchType.Label=Search Type
-FilemgrGet.FieldName.Label=Product Type
-FilemgrGet.ServerURL.Label=Filemgr URL
-FilemgrGet.Result.Label=Product Name/ID
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrget/resources/get/oodt.jpg
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/resources/get/oodt.jpg b/tools/pdi_plugin/src/org/apache/oodt/filemgrget/resources/get/oodt.jpg
deleted file mode 100644
index 5810409..0000000
Binary files a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/resources/get/oodt.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/src/org/apache/oodt/filemgrget/resources/get/oodt.png
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/src/org/apache/oodt/filemgrget/resources/get/oodt.png b/tools/pdi_plugin/src/org/apache/oodt/filemgrget/resources/get/oodt.png
deleted file mode 100644
index e69de29..0000000
[5/5] oodt git commit: OODT-837: cleanup.
Posted by ma...@apache.org.
OODT-837: cleanup.
Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/2fc7bced
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/2fc7bced
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/2fc7bced
Branch: refs/heads/master
Commit: 2fc7bced96dc8296bf1ea62e08f16a86ac90254a
Parents: 508c856
Author: Chris Mattmann <ma...@apache.org>
Authored: Sun Jul 16 13:58:20 2017 -0700
Committer: Chris Mattmann <ma...@apache.org>
Committed: Sun Jul 16 13:58:20 2017 -0700
----------------------------------------------------------------------
tools/pdi_plugin/build-res/subfloor-pkg.xml | 367 ----
tools/pdi_plugin/build-res/subfloor.xml | 2026 ------------------
tools/pdi_plugin/build.properties | 13 -
tools/pdi_plugin/build.xml | 68 -
tools/pdi_plugin/build/build.properties | 3 -
tools/pdi_plugin/build/build.xml | 83 -
tools/pdi_plugin/ivy.xml | 37 -
tools/pdi_plugin/ivysettings.xml | 32 -
tools/pdi_plugin/package-ivy.xml | 15 -
tools/pdi_plugin/plugins | Bin 592575 -> 0 bytes
.../oodt/filemgrcheck/FilemgrCheckStep.java | 199 --
.../oodt/filemgrcheck/FilemgrCheckStepData.java | 55 -
.../filemgrcheck/FilemgrCheckStepDialog.java | 307 ---
.../oodt/filemgrcheck/FilemgrCheckStepMeta.java | 345 ---
.../apache/oodt/filemgrcheck/OODTConfig.java | 98 -
.../apache/oodt/filemgrcheck/OODTProcesses.java | 36 -
.../filemgrcheck/PushPullObjectFactory.java | 74 -
.../messages/messages_en_US.properties | 6 -
.../oodt/filemgrcheck/resources/check/oodt.jpg | Bin 25487 -> 0 bytes
.../oodt/filemgrcheck/resources/check/oodt.png | 0
.../oodt/filemgrdelete/FilemgrDeleteStep.java | 195 --
.../filemgrdelete/FilemgrDeleteStepData.java | 56 -
.../filemgrdelete/FilemgrDeleteStepDialog.java | 309 ---
.../filemgrdelete/FilemgrDeleteStepMeta.java | 349 ---
.../apache/oodt/filemgrdelete/OODTConfig.java | 57 -
.../oodt/filemgrdelete/OODTProcesses.java | 57 -
.../filemgrdelete/PushPullObjectFactory.java | 74 -
.../messages/messages_en_US.properties | 11 -
.../apache/oodt/filemgrget/FilemgrGetStep.java | 244 ---
.../oodt/filemgrget/FilemgrGetStepData.java | 50 -
.../oodt/filemgrget/FilemgrGetStepDialog.java | 438 ----
.../oodt/filemgrget/FilemgrGetStepMeta.java | 410 ----
.../org/apache/oodt/filemgrget/OODTConfig.java | 60 -
.../apache/oodt/filemgrget/OODTProcesses.java | 130 --
.../src/org/apache/oodt/filemgrget/Process.java | 37 -
.../src/org/apache/oodt/filemgrget/Search.java | 37 -
.../messages/messages_en_US.properties | 9 -
.../oodt/filemgrget/resources/get/oodt.jpg | Bin 25487 -> 0 bytes
.../oodt/filemgrget/resources/get/oodt.png | 0
.../oodt/filemgringest/FilemgrIngestStep.java | 216 --
.../filemgringest/FilemgrIngestStepData.java | 56 -
.../filemgringest/FilemgrIngestStepDialog.java | 388 ----
.../filemgringest/FilemgrIngestStepMeta.java | 358 ----
.../apache/oodt/filemgringest/OODTConfig.java | 98 -
.../oodt/filemgringest/OODTProcesses.java | 86 -
.../filemgringest/PushPullObjectFactory.java | 75 -
.../messages/messages_en_US.properties | 9 -
.../oodt/filemgringest/resources/oodt.jpg | Bin 25487 -> 0 bytes
.../oodt/filemgringest/resources/oodt.png | 0
49 files changed, 7573 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/build-res/subfloor-pkg.xml
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/build-res/subfloor-pkg.xml b/tools/pdi_plugin/build-res/subfloor-pkg.xml
deleted file mode 100644
index c82f9ba..0000000
--- a/tools/pdi_plugin/build-res/subfloor-pkg.xml
+++ /dev/null
@@ -1,367 +0,0 @@
-<!--===========================================================================
-Copyright (c) 2009, Pentaho Engineering Team
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Pentaho Corporation nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY Pentaho Engineering Team ''AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-============================================================================-->
-<!--===========================================================================
- == SUBFLOOR-PKG ==
- $Rev: 100 $
- $Date: 2009-12-09 11:43:26 -0500 (Wed, 09 Dec 2009) $
- Project Home: http://code.google.com/p/subfloor/
- Provides default targets for creating application archives such as zip and tar.gzip
- files.
- ============================================================================-->
-
-<project name="subfloor-pkg" basedir="." default="default" xmlns:ivy="antlib:org.apache.ivy.ant">
-
- <!-- Define the default location of the common build file -->
- <property name="subfloor.file"
- value="./subfloor.xml"
- description="This is the location of the standardized subfloor.xml file" />
-
- <!-- Import the common_build.xml file which contains all the default tasks -->
- <import file="${subfloor.file}" />
-
- <property name="stage.dir" value="${bin.dir}/stage" description="Package staging" />
- <property name="package.root.dir"
- value="${ivy.artifact.id}"
- description="Root directory of final zip or tar package" />
- <property name="approot.stage.dir"
- value="${stage.dir}/${package.root.dir}"
- description="Stage application root dir" />
- <property name="package.id" value="${ivy.artifact.id}" />
- <property name="package.basename" value="${package.id}-${project.revision}" />
- <property name="package.resdir" value="${basedir}/package-res" />
- <property name="package.artifact.ivyfile"
- value="package-ivy.xml"
- description="The ivy file defining dependencies of the package" />
- <property name="package.artifact.pomfile"
- value="package-pom.xml"
- description="The Maven pom file defining dependencies of the package" />
-
- <target name="dist" depends="jar,package" description="Builds and packages the application" />
-
- <target name="clean-dist">
- <delete dir="${dist.dir}" />
- <delete dir="${stage.dir}" />
- </target>
-
- <!-- override of jar target.. this definitely should be moved into common build -->
- <target name="jar"
- depends="compile,set-build.id,create-version-file"
- description="Jars up the bin directory after a compile">
- <jar destfile="${dist.dir}/${ivy.artifact.id}-${project.revision}.jar">
- <manifest>
- <attribute name="Implementation-Title" value="${impl.title}" />
- <attribute name="Implementation-Version" value="${project.revision}.${build.id}" />
- <attribute name="Implementation-Vendor" value="${impl.vendor}" />
- <attribute name="Implementation-ProductID" value="${impl.productID}" />
- </manifest>
- <fileset dir="${classes.dir}" />
- </jar>
- </target>
-
- <target name="create-version-file">
- <propertyfile file="${classes.dir}/version.properties" comment="${impl.title} build information">
- <entry key="version" value="${project.revision}.${build.id}" />
- <entry key="builddate" type="date" value="now" />
- </propertyfile>
- </target>
-
- <target name="assemble.init">
- <mkdir dir="${approot.stage.dir}" />
- </target>
-
- <target name="assemble" depends="assemble.init,assemble.copy-libs">
- <copy todir="${approot.stage.dir}" overwrite="true">
- <fileset dir="${package.resdir}" />
- </copy>
- <chmod perm="a+x" dir="${stage.dir}" includes="**/*.sh" />
- </target>
-
- <target name="assemble.copy-libs">
- <copy todir="${approot.stage.dir}/lib">
- <fileset dir="${lib.dir}" />
- <fileset file="${dist.dir}/${ivy.artifact.id}-${project.revision}.jar" />
- </copy>
- </target>
-
- <target name="package"
- depends="assemble,package-zip"
- description="Creates packaged distributable artifacts" />
-
- <target name="package-zip">
- <zip destfile="${dist.dir}/${package.basename}.zip">
- <zipfileset dir="${stage.dir}" filemode="755">
- <include name="**/*.sh" />
- <include name="**/JavaApplicationStub" />
- <include name="**/*.command" />
- </zipfileset>
- <zipfileset dir="${stage.dir}">
- <exclude name="**/*.sh" />
- <exclude name="**/JavaApplicationStub" />
- <exclude name="**/*.command" />
- </zipfileset>
- </zip>
- </target>
-
-
-
- <!-- ============================================linuxPackage===================================================== -->
-
- <property name="linuxPackage.name" value="pentaho-${package.id}" />
-
- <property name="linuxPackage.longName" value="${impl.title}" />
- <property name="linuxPackage.description" value="${impl.title}" />
- <property name="linuxPackage.release" value="1" />
- <property name="linuxPackage.initd.startCommandDelegatee" value="start.pentaho.sh"
- description="init.d script will delegate to this script located in /opt/pentaho/${linuxPackage.name}" />
-
- <property name="linuxPackage.initd.stopCommandDelegatee" value="stop.pentaho.sh"
- description="init.d script will delegate to this script located in /opt/pentaho/${linuxPackage.name}" />
-
- <property name="linuxPackage.initd.processName" value="catalina"
- description="string that must be present to prove pid is not stale; see init.d script" />
- <property name="linuxPackage.res.dir" value="linux-res" description="Directory with Linux package resources." />
- <filterset begintoken="[[[" endtoken="]]]" id="linuxPackage.filterset">
- <filter token="linuxPackage.initd.startCommandDelegatee" value="${linuxPackage.initd.startCommandDelegatee}" />
- <filter token="linuxPackage.initd.stopCommandDelegatee" value="${linuxPackage.initd.stopCommandDelegatee}" />
- <filter token="linuxPackage.initd.processName" value="${linuxPackage.initd.processName}" />
- <filter token="linuxPackage.name" value="${linuxPackage.name}" />
- <filter token="linuxPackage.longName" value="${linuxPackage.longName}" />
- </filterset>
- <!-- prepares Debian control file and scripts shared by DEB and RPM -->
- <target name="linuxPackage-prepare-control">
- <copy todir="${linuxPackage.stage.dir}/control" overwrite="true">
- <fileset dir="${linuxPackage.res.dir}/control" />
- <filterset refid="linuxPackage.filterset" />
- <filterset refid="${linuxPackage.extraFilterset}" />
- </copy>
- </target>
- <!-- prepares actual files to be installed shared by DEB and RPM -->
- <target name="linuxPackage-prepare-data">
- <mkdir dir="${linuxPackage.stage.dir}/data/opt/pentaho/${linuxPackage.name}" />
-
- <antcall target="linuxPackage-copy-files">
- <param name="linuxPackage.dataDir" value="${linuxPackage.stage.dir}/data" />
- <param name="linuxPackage.packageFormat" value="${linuxPackage.packageFormat}" />
- </antcall>
- <copy todir="${linuxPackage.stage.dir}/data" overwrite="true">
- <fileset dir="${linuxPackage.res.dir}/data" />
- <filterset refid="linuxPackage.filterset" />
- <filterset refid="${linuxPackage.extraFilterset}" />
- </copy>
- <!-- if any files named __package.name__, rename them-->
-
- <if>
- <available file="${linuxPackage.stage.dir}/data/etc/init.d/__package.name__" type="file" />
- <then>
- <move file="${linuxPackage.stage.dir}/data/etc/init.d/__package.name__" tofile="${linuxPackage.stage.dir}/data/etc/init.d/${linuxPackage.name}" />
- </then>
- </if>
- <if>
- <available file="${linuxPackage.stage.dir}/data/opt/pentaho/__package.name__" type="dir" />
- <then>
- <move file="${linuxPackage.stage.dir}/data/opt/pentaho/__package.name__" tofile="${linuxPackage.stage.dir}/data/opt/pentaho/${linuxPackage.name}" />
- </then>
- </if>
- </target>
-
- <!-- override if necessary -->
- <target name="linuxPackage-copy-files">
- <echo>Copying files for Linux package format: ${linuxPackage.packageFormat}</echo>
- <copy todir="${linuxPackage.dataDir}/opt/pentaho/${linuxPackage.name}">
- <fileset dir="${stage.dir}/${package.id}" />
- </copy>
- </target>
- <!-- ============================================deb============================================================== -->
-
- <property name="deb.longName" value="${linuxPackage.longName}" />
-
- <property name="deb.name" value="${linuxPackage.name}" />
- <property name="deb.arch"
- value="all"
- description="One of i386, amd64, or all." />
-
- <property name="deb.maintainer" value="buildguy <buildguy@pentaho.com>" />
- <property name="deb.desc" value="${linuxPackage.description}" />
- <property name="deb.release" value="${linuxPackage.release}" />
- <property name="deb.stage.dir"
- value="${bin.dir}/deb-stage"
- description="Staging directory for Debian package creation." />
-
- <property name="deb.res.dir"
- value="${linuxPackage.res.dir}"
- description="Debian package resources." />
- <filterset begintoken="[[[" endtoken="]]]" id="deb.filterset">
- <filter token="deb.name" value="${deb.name}" />
- <filter token="deb.version" value="${project.revision}-${deb.release}" />
- <filter token="deb.longName" value="${deb.longName}" />
- <filter token="deb.arch" value="${deb.arch}" />
- <filter token="deb.desc" value="${deb.desc}" />
- <filter token="deb.maintainer" value="${deb.maintainer}" />
- </filterset>
- <!-- jdeb is cross-platform Debian package tool -->
- <target name="install-jdeb" depends="install-ivy">
- <taskdef-with-ivy task-name="jdeb" classname="org.vafer.jdeb.ant.DebAntTask" organisation="org.vafer" module="jdeb"
- revision="0.8" />
- </target>
-
- <target name="package-deb" depends="install-jdeb" description="Creates Debian package.">
-
- <antcall target="linuxPackage-prepare-control">
- <param name="linuxPackage.stage.dir" value="${deb.stage.dir}" />
- <param name="linuxPackage.res.dir" value="${deb.res.dir}" />
- <param name="linuxPackage.extraFilterset" value="deb.filterset" />
- </antcall>
- <antcall target="linuxPackage-prepare-data">
- <param name="linuxPackage.stage.dir" value="${deb.stage.dir}" />
- <param name="linuxPackage.res.dir" value="${deb.res.dir}" />
- <param name="linuxPackage.extraFilterset" value="deb.filterset" />
- <param name="linuxPackage.packageFormat" value="deb" />
- </antcall>
- <!-- tar for the sole purpose of creating execute bit -->
- <tar destfile="${deb.stage.dir}/data.tar.gz" longfile="gnu" compression="gzip">
- <tarfileset dir="${deb.stage.dir}/data" mode="755">
- <include name="**/*.sh" />
- </tarfileset>
- <tarfileset dir="${deb.stage.dir}/data">
- <exclude name="**/*.sh" />
- </tarfileset>
- </tar>
- <!-- do not change this package name; it is consistent with Debian package naming conventions -->
- <!-- the 1 below is the Debian revision number, which may change if only the control files are changed -->
- <!-- http://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.html -->
- <jdeb destfile="${dist.dir}/${deb.name}_${project.revision}-${deb.release}_${deb.arch}.deb"
- control="${deb.stage.dir}/control">
- <data src="${deb.stage.dir}/data.tar.gz" type="archive" />
- </jdeb>
- </target>
- <!-- ================================================rpm========================================================== -->
-
- <property name="rpm.name" value="${linuxPackage.name}" />
- <property name="rpm.arch"
- value="NOARCH"
- description="One of I386, X86_64, or NOARCH. Case matters." />
- <property name="rpm.group" value="System Environment/Daemons" description="Group for RPM spec file." />
- <property name="rpm.summary" value="${linuxPackage.description}" description="Summary for RPM spec file." />
-
- <property name="rpm.stage.dir"
- value="${bin.dir}/rpm-stage"
- description="Staging directory for RPM package creation." />
-
- <property name="rpm.res.dir"
- value="${linuxPackage.res.dir}"
- description="RPM package resources." />
- <filterset begintoken="[[[" endtoken="]]]" id="rpm.filterset">
- </filterset>
- <!-- redline is cross-platform RPM package tool -->
- <target name="install-redline" depends="install-ivy">
- <taskdef-with-ivy task-name="redline" classname="org.freecompany.redline.ant.RedlineTask" organisation="org.redline-rpm" module="redline"
- revision="1.1.9" />
- </target>
- <target name="package-rpm" depends="install-redline">
- <antcall target="linuxPackage-prepare-control">
- <param name="linuxPackage.stage.dir" value="${rpm.stage.dir}" />
- <param name="linuxPackage.res.dir" value="${rpm.res.dir}" />
- <param name="linuxPackage.extraFilterset" value="rpm.filterset" />
- </antcall>
- <antcall target="linuxPackage-prepare-data">
- <param name="linuxPackage.stage.dir" value="${rpm.stage.dir}" />
- <param name="linuxPackage.res.dir" value="${rpm.res.dir}" />
- <param name="linuxPackage.extraFilterset" value="rpm.filterset" />
- <param name="linuxPackage.packageFormat" value="rpm" />
- </antcall>
- <!-- to adhere to naming conventions, version number cannot contain dash -->
- <!-- http://www.rpm.org/max-rpm/ch-rpm-file-format.html -->
- <propertyregex property="rpm.version" input="${project.revision}" regexp="-" replace="_" />
- <property name="rpm.release" value="${linuxPackage.release}" />
- <antcall target="create-rpm"></antcall>
- </target>
-
- <target name="create-rpm">
- <!-- these tarfilesets can be overridden -->
- <!-- you can't just include everything in ${rpm.stage.dir}/data without a prefix; rpm will complain that the path
- already exists; the prefixes here are paths that are expected to already exist and thus should not be created
- by this package -->
- <tarfileset erroronmissingdir="false" prefix="/etc/init.d" dir="${rpm.stage.dir}/data/etc/init.d" id="rpm.tarfileset1" />
- <tarfileset erroronmissingdir="false" prefix="/opt" dir="${rpm.stage.dir}/data/opt" id="rpm.tarfileset2" />
- <tarfileset erroronmissingdir="false" prefix="/var/run" dir="${rpm.stage.dir}/data/var/run" id="rpm.tarfileset3" />
- <tarfileset erroronmissingdir="false" dir="${rpm.stage.dir}/data" includes="doesnotexist" id="rpm.tarfileset4" />
- <tarfileset erroronmissingdir="false" dir="${rpm.stage.dir}/data" includes="doesnotexist" id="rpm.tarfileset5" />
- <redline architecture="${rpm.arch}" group="${rpm.group}" name="${rpm.name}" version="${rpm.version}"
- postInstallScript="${rpm.stage.dir}/control/postinst" preUninstallScript="${rpm.stage.dir}/control/prerm"
- destination="${dist.dir}" summary="${rpm.summary}" release="${rpm.release}">
- <tarfileset refid="rpm.tarfileset1" />
- <tarfileset refid="rpm.tarfileset2" />
- <tarfileset refid="rpm.tarfileset3" />
- <tarfileset refid="rpm.tarfileset4" />
- <tarfileset refid="rpm.tarfileset5" />
- </redline>
- </target>
- <!-- =========================================================================================================== -->
-
- <!--=======================================================================
- create-pom (override)
- Creates the POM files for publishing the jar and gwt zip package to the Maven repository
- ====================================================================-->
- <target name="create-pom"
- depends="install-ivy,subfloor.create-pom,create-package-pom"
- description="Creates a POM file based on the ivy dependencies" />
-
- <!--=======================================================================
- create-package-pom
- Creates a POM file for the package
- ====================================================================-->
- <target name="create-package-pom"
- depends="install-ivy"
- description="Creates a POM file based on the ivy dependencies for a separate package">
- <ivy:makepom ivyfile="${package.artifact.ivyfile}" pomfile="${package.artifact.pomfile}" />
- <replace file="${package.artifact.pomfile}" token="jar" value="zip" />
- </target>
-
- <!--=======================================================================
- publish-nojar (override)
- Publishes the jar and zip package to the Maven repository
- ====================================================================-->
- <target name="publish-nojar" depends="install-antcontrib,create-pom,ivy.deliver,subfloor.publish-nojar">
-
- <antcall target="maven-publish-artifact">
- <param name="publish.pomFile" value="${package.artifact.pomfile}" />
- <param name="publish.file" value="${dist.dir}/${package.basename}.zip" />
- </antcall>
- </target>
-
- <!--=======================================================================
- publish-local-nojar (override)
- Publishes jar and zip package locally
- ====================================================================-->
- <target name="publish-local-nojar" depends="install-ivy,subfloor.publish-local-nojar">
- <ivy:resolve file="${package.artifact.ivyfile}" />
- <ivy:publish resolver="local" pubrevision="${project.revision}" overwrite="true" forcedeliver="true">
- <artifacts pattern="${dist.dir}/[artifact]-[revision].[ext]" />
- </ivy:publish>
- </target>
-
-</project>
\ No newline at end of file
[4/5] oodt git commit: OODT-837: cleanup.
Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/build-res/subfloor.xml
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/build-res/subfloor.xml b/tools/pdi_plugin/build-res/subfloor.xml
deleted file mode 100644
index fa76887..0000000
--- a/tools/pdi_plugin/build-res/subfloor.xml
+++ /dev/null
@@ -1,2026 +0,0 @@
-<!--===========================================================================
-Copyright (c) 2008-2009, Pentaho Engineering Team
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Pentaho Corporation nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY Pentaho Engineering Team ''AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-============================================================================-->
-<!--===========================================================================
- == SUBFLOOR ==
-
- $Date: Wed Nov 6 16:13:57 UTC 2013 $
- Project Home: https://github.com/pentaho/subfloor/
-
- This file contains the default implementation of the ant tasks to
- perform a build. This file should be included by the build.xml file
- for your particular project. That build file should redefine any task
- that is defined in subfloor.xml IF AND ONLY IF the function of the
- task needs to be customized.
-
- FORMATTING:
- ALIGNMENT: indent=2 spaces and wrap lines longer than 120 chars
- NAMING: targets intended for execution by a user are named single-word
- or hyphenated. Internal targets use '.' notation.
-
- TO GET STARTED with your project, you will need this file in
- your project's root directory along with three additional files:
- 1. build.xml
- 2. build.properties
- 3. ivy_settings.xml
- 4. ivy.xml
-
- Below are some templates:
-
- === build.xml
- <project name="MyProject" basedir="." default="jar" xmlns:ivy="antlib:org.apache.ivy.ant" >
- <description>
- This build file is used to create the MyProject project and works with the subfloor.xml file.
- </description>
-
- <import file="subfloor.xml"/>
- </project>
-
- === build.properties
- project.revision=1.0-SNAPSHOT #the version of your project. This will appear in jar META-INF, dist artifact filenames and IVY revision metadata.
- ivy.artifact.id=my-project #IVY metadata describing the name of the artifact
- impl.title=My Project #English language version of your project name
-
-============================================================================-->
-
-
-<project name="subfloor" basedir="." default="default" xmlns:ivy="antlib:org.apache.ivy.ant">
- <description>
--------------------------------------------------------------------------------
- subfloor.xml provides tasks needed to perform a project build.
- It is typically not used directly but imported by each project's build.xml
- file. The build.xml file can override tasks when customization is required.
-
-MAIN TARGETS
-============
- * clean / clean-all :
- remove all artifacts of the build, clean-all adds the removal
- of any library or jar dependencies downloaded as part of the build
-
- * resolve :
- download/refresh library or jar dependencies needed for the build (uses Apache IVY)
-
- * compile :
- run javac on the project's source
-
- * jar :
- creates a jar file
-
- * dist :
- creates all project distributables
-
- * test :
- runs JUnit tests from your project's test source
-
-SPECIAL TARGETS
-============
- * publish-local :
- builds a jar for your project and registers it with the local artifact repository isolated
- to your machine at $HOME/.ivy2/local. Further executions of the the resolve target by this
- or other projects will find your published jar.
-
- * ivy-clean* :
- this family of targets helps reset your IVY environment in the event that you are having
- difficulty resolving dependencies
-
-TYPICAL TARGET SEQUENCE
-============
- * clean-all resolve dist :
- a good start to build all project distributables from scratch. Note that jar dependencies
- will not be downloaded unless you explicitly run the resolve target. We made the resolution
- and retrieval completely discretionary since there are many situations in which
- you will not want to get or refresh dependencies, e.g. if you are offline with no Internet
- access. In such case, you could just run "dist" if the set of jars you already have are
- sufficient.
-
- </description>
-
- <!-- Load the properties files in the proper order -->
- <property file="override.properties"
- description="Properties customized for your development environment belong in this file. This file will never be checked into the SCM." />
- <property file="build.properties"
- description="Properties customized for your particular project belong in this file." />
-
- <!-- =================================================================================
- Property Defaults
- Any of these properties can be overridden in either build.properties or override.properties
- =================================================================================-->
-
- <!-- Project meta properties -->
- <property name="impl.vendor" value="Pentaho Corporation" description="Jar file metadata describing the jar's vendor" />
- <property name="impl.productID"
- value=""
- description="Jar file metadata indicating the product ID (this is not the revision)" />
-
- <!-- Compile properties -->
- <property name="src.dir" value="${basedir}/src" description="Project source code directory" />
- <property name="bin.dir" value="${basedir}/bin" description="Base directory for all non-dist build output" />
- <property name="classes.dir"
- value="${bin.dir}/classes"
- description="Classes compiled from project source code are placed here" />
- <property name="lib.dir"
- value="${basedir}/lib"
- description="Directory that hosts Jar files required to compile project source. (IVY will populate this directory with required jars)" />
- <property name="devlib.dir"
- value="${basedir}/dev-lib"
- description="Directory for developer to place development Jar files (not affected by clean targets)" />
-
- <!-- Compiler properties (passed directly to javac ant target) -->
- <property name="javac.debug"
- value="true"
- description="Indicates whether source should be compiled with debug information (passed to javac ant task)." />
- <property name="javac.deprecation"
- value="true"
- description="Indicates whether source should be compiled with deprecation information" />
- <property name="javac.source" value="6" description="Provide source compatibility with specified release" />
- <property name="javac.target" value="6" description="Generate class files for specific VM version" />
- <property name="javac.maxmemory" value="256M" description="Max memory alloted to java compile" />
- <property name="javac.xlint" value="-Xlint:all" />
-
- <!-- Third party Ant tasks and tools properties -->
- <property name="subfloor.resources.dir"
- value="${user.home}/.subfloor"
- description="Base dir for runtime jars that are required exclusively by the build process" />
- <property name="subfloor.tmp.dir"
- value="${subfloor.resources.dir}/tmp"
- description="Temporary space where files are prepared for installation" />
- <property name="antcontrib.build.cache.dir"
- value="${subfloor.resources.dir}/ant-contrib"
- description="Directory where the Ant-Contrib jar (and dependencies) is placed after it is auto-downloaded by the build" />
- <property name="svnant.use-javahl"
- value="false"
- description="Prefer JNI JavaHL binding over the command line client for native svn support" />
- <property name="svnant.use-svnkit"
- value="true"
- description="Prefer SVNKit binding over the command line client for native svn support (defaults to true)" />
- <property name="ivy.url"
- value="http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar"
- description="The URL to the current release of Apache IVY" />
-
- <!-- Enunciate properties -->
- <property name="enunciate.home" value="${basedir}/enunciate" />
- <property name="enunciate.bin.dir" value="${bin.dir}/enunciate" />
-
-
- <!-- Test properties -->
- <property name="junit.base.dir" value="${basedir}" description="Directory in which the junit test VM will be invoked" />
- <property name="testsrc.dir" value="${basedir}/test-src" description="Directory that hosts the test source files" />
- <property name="testlib.dir"
- value="${basedir}/test-lib"
- description="Directory for jar files needed during unit testing" />
- <property name="testbin.dir"
- value="${bin.dir}/test"
- description="Base directory for all compiler generated test output" />
- <property name="testclasses.dir"
- value="${testbin.dir}/classes"
- description="Classes compiled from project test code are placed here" />
- <property name="testreports.dir"
- value="${bin.dir}/reports/test"
- description="Base directory that holds all unit test report files" />
- <property name="testreports.xml.dir"
- value="${testreports.dir}/xml"
- description="Unit test xml reports are placed here" />
- <property name="testreports.html.dir"
- value="${testreports.dir}/html"
- description="Unit test html reports are placed here" />
- <property name="junit.haltonfailure" value="no" description="Fail the build if a test fails" />
- <property name="junit.haltonerror" value="no" description="Fail the build if a error occurs" />
- <property name="junit.maxmemory" value="256M" description="Heap size when Junit is run in fork mode" />
- <property name="junit.forkmode"
- value="perTest"
- description="Defines whether JUnit forks a new JVM for each test. Use 'once' for faster test runs, and 'perTest' for complete tests."/>
- <property name="headless.unittest" value="true" description="Runs the unit tests in headless mode" />
-
- <!-- Code Coverage properties -->
- <property name="instrumented.classes.dir"
- value="${testbin.dir}/instrumented-classes"
- description="Directory where instrumented project classes are placed for use by code coverage utility" />
- <property name="cobertura.version"
- value="1.9.4.1"
- description="The version of cobertura to use for code coverage" />
- <property name="cobertura.data.dir"
- value="${testbin.dir}/cobertura-bin"
- description="Temporary data directory used by Cobertura" />
- <property name="coberturareports.dir"
- value="${bin.dir}/reports/cobertura"
- description="Base directory for all generated Cobertura code coverage reports" />
- <property name="coberturareports.xml.dir"
- value="${coberturareports.dir}/xml"
- description="Cobertura xml reports are placed here" />
- <property name="coberturareports.html.dir"
- value="${coberturareports.dir}/html"
- description="Cobertura html reports are placed here" />
-
- <!-- Javadoc properties -->
- <property name="javadoc.dir"
- value="${bin.dir}/javadoc"
- description="Directory where generated javadoc will be placed" />
- <property name="javadoc.packagenames"
- value="org.mypackagename.*"
- description="This property is passed to the packagenames property of the javadoc ant task. You should customize this for your project." />
- <property name="javadoc.zip.filename" value="${ivy.artifact.id}-${project.revision}-javadoc.zip" />
- <property name="javadoc.tar.filename" value="${ivy.artifact.id}-${project.revision}-javadoc.tar.gz" />
-
- <!-- Distribution and Assembly properties -->
- <property name="dist.dir"
- value="${basedir}/dist"
- description="Base directory for all project artifacts (jar, zip, tar.gz, etc...)" />
- <property name="license.dir"
- value="${basedir}"
- description="Base directory where this project's license files reside" />
- <property name="res.dir"
- value="${basedir}/res"
- description="Directory that holds resources not included in the source tree" />
- <property name="source.zip.filename" value="${ivy.artifact.id}-${project.revision}-sources.zip" />
- <property name="source.tar.filename" value="${ivy.artifact.id}-${project.revision}-sources.tar.gz" />
- <property name="source.publish" value="true" />
-
- <!-- Ivy properties -->
- <property name="ivy.settingsurl"
- value="file:${basedir}/ivysettings.xml"
- description="URL to the (common) ivysettings.xml. This file is required by the build to configure IVY. Note you must escape the ':' if this property exists in a .properties file" />
- <property name="ivyfile"
- value="ivy.xml"
- description="The name of the IVY xml file defining your project's dependencies" />
- <property name="ivy.artifact.group"
- value="mycompanyname"
- description="IVY metadata describing the originating company or organization" />
- <property name="ivy.artifact.pomfile"
- value="${dist.dir}/pom.xml"
- description="The path to the Maven pom file to deploy with the artifact" />
- <property name="ivy.artifact.ivyfilename"
- value="ivy.xml"
- description="The name of the IVY xml file to deploy with the artifact" />
- <property name="ivy.artifact.ivypathname"
- value="${dist.dir}/ivy.xml"
- description="The full path to the IVY xml file to deploy with the artifact" />
- <property name="ivy.reports.dir"
- value="${bin.dir}/reports/ivy"
- description="Base directory that holds all IVY dependency report files" />
- <property name="ivy.configs" value="*" description="Set of configs used for IVY reporting and checking operations" />
- <property name="ivy.use.symlinks" value="true" description="Flag indicating if Ivy should create symlinks when retrieving artifacts."/>
-
- <!-- Tattletale properties -->
- <property name="tattletale.url"
- value="http://repo.pentaho.org/artifactory/repo/jboss/tattletale/1.1.2.Final/tattletale-1.1.2.Final.zip"
- description="The URL from which to download tattletale" />
- <property name="tattletale.classname"
- value="org.jboss.tattletale.ant.ReportTask"
- description="The name of the class which will run the tattletale reports" />
- <property name="tattletale.reports.dir"
- value="${bin.dir}/reports/tattletale"
- description="Base directory that holds the output of the tattletale reports" />
- <property name="tattletale.configfile"
- value=""
- description="The configuration file for the tattletale report" />
-
- <!-- Sonar properties -->
- <property name="sonar.url"
- value="http://repo1.maven.org/maven2/org/codehaus/sonar-plugins/sonar-ant-task/1.2/sonar-ant-task-1.2.jar"/>
- <property name="sonar.classname"
- value="org.sonar.ant.SonarTask"/>
-
- <!-- Load the manifest file (if any) as a properties file -->
- <property name="dist.manifest.file"
- value="${dist.dir}/MANIFEST.MF"
- description="The manifest file that will be generated as part of the build" />
- <property name="manifest.file"
- value="${res.dir}/META-INF/MANIFEST.MF"
- description="The location of the MANIFEST.MF file for this application." />
- <property file="${manifest.file}"
- description="Loads the manifest information from the manifest file as a properties file." />
-
- <!-- Set the project revision number to the value in the manifest file (if it has not
- been specified in the properties file -->
- <property name="project.revision"
- value="${Implementation-Version}"
- description="Sets the version number of the project based on the Implementation-Version found in the manifest file (if one is supplied and nothing is specified in the build.properties)" />
- <fail message="A project revision number has not been determined!">
- <condition>
- <matches string="${project.revision}" pattern="\$\{.*\}" />
- </condition>
- </fail>
-
- <!-- Set the project title to the value in the manifest file (if it has not
- been specified in the properties file -->
- <property name="impl.title"
- value="${Implementation-Title}"
- description="Sets the title of the project based on the Implementation-Title found in the manifest file (if one is supplied and nothing is specified in the build.properties)" />
- <fail message="A project title has not been determined!">
- <condition>
- <matches string="${impl.title}" pattern="\$\{.*\}" />
- </condition>
- </fail>
-
- <!-- Build Mode properties -->
- <property name="release" value="false" description="Set this to true if you want to generate a release artifact" />
-
- <!-- Ivy should only use symlinks if we're not in release mode -->
- <condition property="ivy.use.symlinks.internal">
- <and>
- <isfalse value="${release}"/>
- <istrue value="${ivy.use.symlinks}"/>
- </and>
- </condition>
-
- <!-- Set the os property -->
- <condition property="isLinux">
- <os family="unix" />
- </condition>
- <condition property="isWindows">
- <os family="windows" />
- </condition>
- <condition property="isMac">
- <os family="mac" />
- </condition>
-
- <condition property="os.classifier" value="win">
- <os family="windows" />
- </condition>
- <condition property="os.classifier" value="mac">
- <os family="mac" />
- </condition>
- <condition property="os.classifier" value="linux">
- <os family="unix" />
- </condition>
- <property name="os.classifier" value="unsupported" />
-
- <!-- Setup the compile classpath -->
- <path id="classpath">
- <fileset dir="${devlib.dir}">
- <include name="**/*.jar" />
- </fileset>
- <fileset dir="${lib.dir}">
- <include name="**/*.jar" />
- </fileset>
- </path>
-
- <!-- Setup the classpath used for testing -->
- <path id="test.classpath">
- <pathelement path="${testclasses.dir}" />
- <pathelement path="${classes.dir}" />
- <fileset dir="${devlib.dir}">
- <include name="**/*.jar" />
- </fileset>
- <fileset dir="${testlib.dir}">
- <include name="**/*.jar" />
- </fileset>
- <fileset dir="${lib.dir}">
- <include name="**/*.jar" />
- </fileset>
- </path>
-
-
- <!--=======================================================================
- default
-
- The target that is run if no target is given
- ====================================================================-->
- <target name="default" depends="build" />
-
-
- <!--=======================================================================
- build
-
- Runs a typical build process to create the project locally
- ====================================================================-->
- <target name="build" depends="clean-all,resolve,cobertura,dist-source,dist" />
-
-
- <!--=======================================================================
- build-testless
-
- Runs a typical build process to create the project locally (no testing)
- ====================================================================-->
- <target name="build-testless" depends="clean-all,resolve,dist-source,dist" />
-
-
- <!--=======================================================================
- continuous
-
- Runs a typical continuous integration build including project dist,
- test, and coverage artifacts
- ====================================================================-->
- <target name="continuous" depends="build,publish" />
-
-
- <!--=======================================================================
- continuous-testless
-
- Runs a typical continuous integration build including project dist,
- and coverage artifacts
- ====================================================================-->
- <target name="continuous-testless" depends="build-testless,publish" />
-
-
- <!--=======================================================================
- install-antcontrib
-
- (Fetches and) installs ant-contrib tasks.
- ====================================================================-->
- <target name="install-antcontrib" depends="antcontrib.download-check">
- <taskdef resource="net/sf/antcontrib/antlib.xml">
- <classpath>
- <fileset dir="${antcontrib.build.cache.dir}">
- <include name="*.jar" />
- </fileset>
- </classpath>
- </taskdef>
- </target>
-
-
- <!--=======================================================================
- antcontrib.download-check
-
- Fetches ant-contrib from sourceforge if it is not already present
- ====================================================================-->
- <target name="antcontrib.download-check">
- <condition property="antcontrib.available">
- <and>
- <available file="${antcontrib.build.cache.dir}" />
- <available classname="net.sf.antcontrib.logic.IfTask">
- <classpath>
- <fileset dir="${antcontrib.build.cache.dir}">
- <include name="*.jar" />
- </fileset>
- </classpath>
- </available>
- </and>
- </condition>
- <antcall target="antcontrib.download" />
- </target>
-
-
- <!--=======================================================================
- antcontrib.download
-
- Fetches ant-contrib from sourceforge
- ====================================================================-->
- <target name="antcontrib.download" unless="antcontrib.available">
- <mkdir dir="${subfloor.tmp.dir}" />
- <get src="http://downloads.sourceforge.net/ant-contrib/ant-contrib-1.0b3-bin.zip"
- dest="${subfloor.tmp.dir}/antcontrib.zip"
- usetimestamp="true" />
- <unzip src="${subfloor.tmp.dir}/antcontrib.zip" dest="${subfloor.tmp.dir}">
- <patternset>
- <include name="**/*.jar" />
- </patternset>
- </unzip>
- <copy todir="${antcontrib.build.cache.dir}">
- <fileset dir="${subfloor.tmp.dir}/ant-contrib">
- <include name="**/*.jar" />
- </fileset>
- </copy>
- </target>
-
-
- <!--=======================================================================
- init
-
- Ensures that all the required directories exist before processing
- a build.
- ====================================================================-->
- <target name="init">
- <mkdir dir="${classes.dir}" />
- <mkdir dir="${dist.dir}" />
- <mkdir dir="${lib.dir}" />
- <mkdir dir="${devlib.dir}" />
- <mkdir dir="${testlib.dir}" />
- </target>
-
-
- <!--=======================================================================
- install-svnant
-
- (Fetches and) installs the SVN ANT for use by this ant script
- ====================================================================-->
- <target name="install-svnant" depends="install-ivy">
- <if>
- <istrue value="${svnant.isinstalled}" />
- <then>
- <echo message="Skipping SVN ANT install. SVN ANT has already been configured by the build" />
- </then>
- <else>
- <taskdef-with-ivy organisation="tigris"
- module="svnant"
- revision="1.3.0"
- resource="org/tigris/subversion/svnant/svnantlib.xml"
- classname="org.tigris.subversion.svnant.SvnTask" />
- <property name="svnant.isinstalled" value="true" />
- </else>
- </if>
- </target>
-
-
- <!--=======================================================================
- test-svnant
-
- Tests SVN by printing out the repository
- ====================================================================-->
- <target name="test-svnant" depends="install-svnant">
- <svn javahl="${svnant.use-javahl}" svnkit="${svnant.use-svnkit}">
- <wcVersion path="." />
- </svn>
- <echo message="Subversion repository url: ${repository.url}" />
- </target>
-
-
- <!--=======================================================================
- svn-revision
-
- Prints and sets the SVN revision for the repository at the current dir (if svn.revision is not set)
- ====================================================================-->
- <target name="svn-revision" depends="install-svnant">
-
- <svn javahl="${svnant.use-javahl}" svnkit="${svnant.use-svnkit}">
- <status path="." revisionProperty="svn.revision" />
- </svn>
- <echo message="Subversion repository revision: ${svn.revision}" />
- </target>
-
-
- <!--=======================================================================
- set-build.id
-
- Sets a property build.id to the either "development" or the svn revision
- if in release mode
- ====================================================================-->
- <target name="set-build.id" unless="build.id" depends="install-antcontrib">
- <if>
- <istrue value="${release}" />
- <then>
- <antcallback target="svn-revision" return="svn.revision" />
- <property name="build.id" value="${svn.revision}" />
- </then>
- <else>
- <property name="build.id" value="development" />
- </else>
- </if>
- </target>
-
- <!--=================================================================================
- version-properties: common Ant driven version file generation. Projects that produce
- a package or packages should run this target. Projects that produce
- jars only should NOT.
- ===================================================================================-->
- <target name="version-properties" depends="set-build.id">
- <tstamp>
- <format property="build.time" pattern="yyyy/MM/dd hh:mm aa" />
- </tstamp>
- <propertyfile file="version.properties" comment="Release Build version info">
- <entry key="release.major.number" value="${release.major.number}" />
- <entry key="release.minor.number" value="${release.minor.number}" />
- <entry key="release.milestone.number" value="${release.milestone.number}" />
- <entry key="release.candidate.token" value="${release.candidate.token}" />
- <entry key="impl.vendor" value="${impl.vendor}" />
- <entry key="impl.version"
- value="${release.major.number}.${release.minor.number}.${release.milestone.number}.${build.id}" />
- <entry key="impl.title" value="${impl.title}" />
- <entry key="buildDate" value="${build.time}" />
- <entry key="svn.revision" value="${build.id}" />
- <entry key="release.build.number" default="0" type="int" operation="+" value="1" pattern="0000" />
- </propertyfile>
- <property file="${basedir}/version.properties" />
- </target>
-
-
- <!--=======================================================================
- install-ivy
-
- Fetches and installs IVY ant tasks if not already installed
- ====================================================================-->
- <target name="install-ivy" depends="install-antcontrib">
- <if>
- <istrue value="${ivy.isinstalled}" />
- <then>
- <echo message="Skipping IVY install. IVY has already been configured by the build" />
- </then>
- <else>
- <download-antlib name="ivy" url="${ivy.url}" classname="org.apache.ivy.ant.IvyTask" extension="jar" />
- <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant">
- <classpath>
- <fileset dir="${subfloor.resources.dir}/ivy">
- <include name="*.jar" />
- </fileset>
- </classpath>
- </taskdef>
- <ivy:settings url="${ivy.settingsurl}" />
- <property name="ivy.isinstalled" value="true" />
- </else>
- </if>
- </target>
-
-
- <!--=======================================================================
- ivy.check-releasable
-
- Verifies that there are no SNAPSHOT dependencies defined in the ivy xml.
- If there are SNAPSHOTS, fail the release build.
- ====================================================================-->
- <target name="ivy.check-releasable" depends="install-ivy, install-antcontrib">
- <if>
- <istrue value="${release}" />
- <then>
- <sequential>
- <ivy:artifactproperty conf="${ivy.configs}" name="dep.[module]/[artifact]-[revision]" value="[revision]" />
-
- <propertyselector property="violators" match="dep\..*SNAPSHOT.*" select="\0" casesensitive="false" />
-
- <fail if="violators"
- message="Release not possible, you have dependencies on non-released artifacts: ${violators}" />
- </sequential>
- </then>
- </if>
- </target>
-
-
- <!--=======================================================================
- resolve
-
- Using ivy and the dependencies for the project (defined in the ivy.xml
- file), this task will retrieve the needed files and place them into
- the defined directories.
- ====================================================================-->
- <target name="resolve"
- depends="resolve-default, resolve-test, ivy.check-releasable"
- description="Retrieves all the dependent libraries" />
-
- <target name="resolve-init" unless="resolve-init.skip" depends="install-ivy">
- <!-- If this is the 1st time through resolve-init, then we need to clean up the jars
--->
- <antcall target="clean-jars" />
- <property name="resolve-init.skip" value="" />
- </target>
-
- <target name="resolve-default" depends="resolve-default.default,resolve-default.composite"/>
-
- <!--
- This target resolves the default IVY configuration as a composite of child configurations.
- You should set ivy.default.sub-configs in your build.properties only if you want your default
- configuration to be treated as a composite of two or more child configurations.
- To turn this on, set ivy.default.sub-configs property in your build.properties, e.g.
- ivy.default.sub-configs=external,internal
- Note: the parent config "default" proper will not be resolved
- -->
- <target name="resolve-default.composite" depends="install-antcontrib,resolve-init" if="ivy.default.sub-configs">
- <for list="${ivy.default.sub-configs}" param="conf">
- <sequential>
- <ivy:resolve file="${ivyfile}" conf="default_@{conf}" />
- <ivy:retrieve conf="default_@{conf}" pattern="${lib.dir}/@{conf}/[module]-[revision](-[classifier]).[ext]" symlink="${ivy.use.symlinks.internal}" />
- </sequential>
- </for>
- </target>
-
- <target name="resolve-default.default" depends="resolve-init" unless="ivy.default.sub-configs">
- <ivy:resolve file="${ivyfile}" conf="default" />
- <ivy:retrieve conf="default" pattern="${lib.dir}/[module]-[revision](-[classifier]).[ext]" symlink="${ivy.use.symlinks.internal}" />
- </target>
-
- <target name="resolve-test" depends="resolve-init">
- <ivy:resolve file="${ivyfile}" conf="test" />
- <ivy:retrieve conf="test" pattern="${testlib.dir}/[module]-[revision](-[classifier]).[ext]" symlink="${ivy.use.symlinks.internal}" />
- </target>
-
- <target name="resolve-enunciate" depends="resolve-init">
- <ivy:resolve file="${ivyfile}" conf="enunciate" />
- <ivy:retrieve conf="enunciate" pattern="${basedir}/enunciate/lib/[module]-[revision](-[classifier]).[ext]" />
- </target>
-
- <target name="resolve-codegen" depends="resolve-init">
- <ivy:resolve file="${ivyfile}" conf="codegen" />
- <ivy:retrieve conf="codegen" pattern="${lib.dir}/[module]-[revision](-[classifier]).[ext]" symlink="${ivy.use.symlinks.internal}" />
- </target>
-
- <target name="resolve-runtime" depends="resolve-init">
- <ivy:resolve file="${ivyfile}" conf="runtime" />
- <ivy:retrieve conf="runtime" pattern="${lib.dir}/[module]-[revision](-[classifier]).[ext]" symlink="${ivy.use.symlinks.internal}" />
- </target>
-
-
- <!--=======================================================================
- ivy-clean-cache
-
- Cleans the IVY cache. You are erasing IVY's memory. Run this if you
- want to force IVY to go fetch all your project dependencies from scratch.
- WARNING: this will affect all IVY projects, not just the current workspace
- ====================================================================-->
- <target name="ivy-clean-cache" depends="install-ivy">
- <ivy:cleancache />
- </target>
-
-
- <!--=======================================================================
- ivy-clean-local
-
- Completely cleans your local repository of any files published locally
- by way of publish-local.
- WARNING: this is a global action and will affect other IVY projects
- currently referencing a locally published dependency
- ====================================================================-->
- <target name="ivy-clean-local" depends="install-ivy">
- <delete dir="${ivy.local.default.root}/" />
- </target>
-
-
- <!--=======================================================================
- ivy-clean-by-name
-
- Cleans your IVY cache and local repository of specific files.
- WARNING: this is a global action and will affect other IVY projects
- currently referencing a locally published dependency
- ====================================================================-->
- <target name="ivy-clean-pentaho" depends="install-ivy">
- <mkdir dir="${ivy.local.default.root}" />
- <!-- just in case it doesn't exist -->
- <for param="dir">
- <path>
- <dirset dir="${ivy.local.default.root}" includes="*${ivy.clean.pattern}*" />
- <dirset dir="${ivy.default.ivy.user.dir}/cache" includes="*${ivy.clean.pattern}*" />
- </path>
- <sequential>
- <delete dir="@{dir}" includeemptydirs="true" />
- </sequential>
- </for>
- <for param="file">
- <path>
- <fileset dir="${ivy.local.default.root}" includes="*${ivy.clean.pattern}*" />
- <fileset dir="${ivy.default.ivy.user.dir}/cache" includes="*${ivy.clean.pattern}*" />
- </path>
- <sequential>
- <delete file="@{file}" />
- </sequential>
- </for>
- </target>
-
-
- <!--=======================================================================
- ivy-report
-
- Generates an IVY dependency report for this project.
- ====================================================================-->
- <target name="ivy-report" depends="install-ivy">
- <ivy:resolve file="${ivyfile}" conf="${ivy.configs}" />
- <ivy:report xml="true" todir="${ivy.reports.dir}" />
- </target>
-
-
- <!--=======================================================================
- publish-local-nojar
-
- Publishes the jar file for this project to the user's local repository
- for download by other projects currently being executed on the user's
- system.
- ====================================================================-->
- <target name="publish-local-nojar" depends="install-ivy,publish-local-nojar.internal">
- <if>
- <equals arg1="${tests.publish}" arg2="true" />
- <then>
- <antcall target="publish-local-nojar.internal">
- <param name="ivy.artifact.id" value="${ivy.artifact.id}-test"/>
- </antcall>
- </then>
- </if>
- <antcall target="publish-local-nojar.post"/>
- </target>
-
- <!--=======================================================================
- publish-local-nojar.post this target is invoked after the normal set of publish-local-nojar
- is completed, override this to perform additional publishing in extensions of subfloor, etc
- ====================================================================-->
- <target name="publish-local-nojar.post">
- </target>
-
- <target name="publish-local-nojar.internal" depends="install-ivy">
- <ivy:resolve file="${ivy.artifact.ivyfilename}" />
- <ivy:publish resolver="local" pubrevision="${project.revision}" overwrite="true" forcedeliver="true" warnonmissing="yes" haltonmissing="no">
- <artifacts pattern="${dist.dir}/[artifact]-[revision](-[classifier]).[ext]" />
- </ivy:publish>
- </target>
-
- <!--=======================================================================
- publish-local
-
- Builds and publishes the jar file for this project to the user's
- local repository for download by other projects currently being
- executed on the user's system.
- ====================================================================-->
- <target name="publish-local"
- depends="dist, dist-source, publish-local-nojar"
- description="Builds and publishes the jar file to the local repository" />
-
-
- <!--=======================================================================
- publish
-
- Creates and publishes the jar file for this project to a Maven2
- repository.
- ====================================================================-->
- <target name="publish" depends="dist, dist-source, publish-nojar">
- </target>
-
-
- <!--=======================================================================
- publish-nojar
-
- Publishes the jar file for this project to a Maven2 repository.
- ====================================================================-->
- <target name="publish-nojar" depends="install-antcontrib,create-pom,ivy.deliver,publish-nojar.internal">
- <if>
- <equals arg1="${tests.publish}" arg2="true" />
- <then>
- <antcall target="publish-nojar.internal">
- <param name="ivy.artifact.id" value="${ivy.artifact.id}-test"/>
- </antcall>
- </then>
- </if>
- </target>
-
- <target name="publish-nojar.internal" depends="install-antcontrib,create-pom,ivy.deliver">
- <antcall target="maven-publish-dependencies">
- <param name="publish.groupId" value="${ivy.artifact.group}" />
- <param name="publish.artifactId" value="${ivy.artifact.id}" />
- <param name="publish.version" value="${project.revision}" />
- <param name="publish.file" value="${ivy.artifact.ivypathname}" />
- </antcall>
-
- <if>
- <equals arg1="${source.publish}" arg2="true" />
- <then>
- <antcall target="maven-publish-sources">
- <param name="publish.groupId" value="${ivy.artifact.group}" />
- <param name="publish.artifactId" value="${ivy.artifact.id}" />
- <param name="publish.version" value="${project.revision}" />
- <param name="publish.file" value="${dist.dir}/${ivy.artifact.id}-${project.revision}-sources.jar" />
- </antcall>
- </then>
- </if>
-
- <antcall target="maven-publish-artifact">
- <param name="publish.pomFile" value="${ivy.artifact.pomfile}" />
- <param name="publish.file" value="${dist.dir}/${ivy.artifact.id}-${project.revision}.jar" />
- </antcall>
-
- <antcall target="maven-publish.post"/>
-
- </target>
-
- <!-- Override this if anything is needed to be done after the standard parts of publish are completed -->
- <!-- Such as: publishing non-standard/extended artifacts, etc -->
- <target name="maven-publish.post"/>
-
- <!--=======================================================================
- ivy.deliver
-
- Creates a publishable version of the ivy dependencies file, ivy.xml
- ====================================================================-->
- <target name="ivy.deliver" depends="resolve">
- <ivy:deliver conf="*(public)" deliverpattern="${dist.dir}/ivy.xml" />
- </target>
-
-
- <!--=======================================================================
- maven-publish-dependencies
-
- A function that deploys an ivy.xml file to a maven repository
- ====================================================================-->
- <target name="maven-publish-dependencies" depends="install-antcontrib">
- <sequential>
- <fail message="No file found at: ${publish.file}">
- <condition>
- <not>
- <available file="${publish.file}" />
- </not>
- </condition>
- </fail>
- <echo message="Publishing ${publish.file} to ${ivy.repository.publish}..." />
- <if>
- <isset property="isWindows" />
- <then>
- <exec executable="cmd" failonerror="true">
- <arg value="/c" />
- <arg value="mvn.bat" />
- <arg value="deploy:deploy-file" />
- <arg value="-DrepositoryId=${ivy.repository.id}" />
- <arg value="-Durl=${ivy.repository.publish}" />
- <arg value="-DgroupId=${publish.groupId}" />
- <arg value="-DartifactId=${publish.artifactId}" />
- <arg value="-Dversion=${publish.version}" />
- <arg value="-Dpackaging=ivy.xml" />
- <arg value="-Dfile=${publish.file}" />
- </exec>
- </then>
- <else>
- <exec executable="mvn" failonerror="true">
- <arg value="deploy:deploy-file" />
- <arg value="-DrepositoryId=${ivy.repository.id}" />
- <arg value="-Durl=${ivy.repository.publish}" />
- <arg value="-DgroupId=${publish.groupId}" />
- <arg value="-DartifactId=${publish.artifactId}" />
- <arg value="-Dversion=${publish.version}" />
- <arg value="-Dpackaging=ivy.xml" />
- <arg value="-Dfile=${publish.file}" />
- <arg value="-e" />
- </exec>
- </else>
- </if>
- </sequential>
- </target>
-
-
- <!--=======================================================================
- maven-publish-artifact
-
- A function that deploys an artifact to a maven repository
- ====================================================================-->
- <target name="maven-publish-artifact" depends="install-antcontrib">
- <sequential>
- <fail message="No file found at: ${publish.file}">
- <condition>
- <not>
- <available file="${publish.file}" />
- </not>
- </condition>
- </fail>
- <echo message="Publishing ${publish.file} to ${ivy.repository.publish}..." />
- <if>
- <isset property="isWindows" />
- <then>
- <exec executable="cmd" failonerror="true">
- <arg value="/c" />
- <arg value="mvn.bat" />
- <arg value="deploy:deploy-file" />
- <arg value="-DrepositoryId=${ivy.repository.id}" />
- <arg value="-Durl=${ivy.repository.publish}" />
- <arg value="-DpomFile=${publish.pomFile}" />
- <arg value="-Dfile=${publish.file}" />
- </exec>
- </then>
- <else>
- <exec executable="mvn" failonerror="true">
- <arg value="deploy:deploy-file" />
- <arg value="-DrepositoryId=${ivy.repository.id}" />
- <arg value="-Durl=${ivy.repository.publish}" />
- <arg value="-DpomFile=${publish.pomFile}" />
- <arg value="-Dfile=${publish.file}" />
- </exec>
- </else>
- </if>
- </sequential>
- </target>
-
-
- <!--=======================================================================
- maven-publish-sources
-
- A function that deploys a java-sources artifact to a maven repository
- ====================================================================-->
- <target name="maven-publish-sources" depends="install-antcontrib">
- <sequential>
- <fail message="No file found at: ${publish.file}">
- <condition>
- <not>
- <available file="${publish.file}" />
- </not>
- </condition>
- </fail>
- <echo message="Publishing ${publish.file} to ${ivy.repository.publish}..." />
- <if>
- <isset property="isWindows" />
- <then>
- <exec executable="cmd" failonerror="true">
- <arg value="/c" />
- <arg value="mvn.bat" />
- <arg value="deploy:deploy-file" />
- <arg value="-DrepositoryId=${ivy.repository.id}" />
- <arg value="-Durl=${ivy.repository.publish}" />
- <arg value="-DgroupId=${publish.groupId}" />
- <arg value="-DartifactId=${publish.artifactId}" />
- <arg value="-Dversion=${publish.version}" />
- <arg value="-DgeneratePom=true" />
- <arg value="-Dpackaging=java-source" />
- <arg value="-Dfile=${publish.file}" />
- </exec>
- </then>
- <else>
- <exec executable="mvn" failonerror="true">
- <arg value="deploy:deploy-file" />
- <arg value="-DrepositoryId=${ivy.repository.id}" />
- <arg value="-Durl=${ivy.repository.publish}" />
- <arg value="-DgroupId=${publish.groupId}" />
- <arg value="-DartifactId=${publish.artifactId}" />
- <arg value="-Dversion=${publish.version}" />
- <arg value="-DgeneratePom=true" />
- <arg value="-Dpackaging=java-source" />
- <arg value="-Dfile=${publish.file}" />
- </exec>
- </else>
- </if>
- </sequential>
- </target>
-
-
- <!--=======================================================================
- create-pom
-
- Creates the POM file for publishing the jar file to a Maven2 repository.
- ====================================================================-->
- <target name="create-pom" depends="install-ivy">
- <ivy:makepom ivyfile="${ivyfile}" pomfile="${dist.dir}/pom.xml">
- <mapping conf="default" scope="compile" />
- <mapping conf="runtime" scope="runtime" />
- </ivy:makepom>
- </target>
-
-
- <!--=======================================================================
- clean-jars
-
- Removes all the libraries that have been downloaded for this project
- using the ivy dependencies.
- ====================================================================-->
- <target name="clean-jars">
- <delete dir="${lib.dir}" />
- <delete dir="${testlib.dir}" />
- </target>
-
-
- <!--=======================================================================
- clean
-
- Removes all the files generated from the build process.
- ====================================================================-->
- <target name="clean"
- description="Cleans all the files generated from a build with the exception of IVY-downloaded jars (see clean-all)"
- depends="clean-tests, clean-cobertura, clean-sonar, clean-javadoc, clean-dist">
- <delete dir="${classes.dir}" />
- <delete dir="${bin.dir}" />
- </target>
-
-
- <!--=======================================================================
- clean-dist
-
- Removes all dist artifacts
- ====================================================================-->
- <target name="clean-dist">
- <delete dir="${dist.dir}" />
- </target>
-
-
- <!--=======================================================================
- clean-all
-
- Removes all the libraries that have been downloaded for this project
- in the workspace's lib dirs as well as all the files
- generated from the build process.
- ====================================================================-->
- <target name="clean-all" depends="clean,clean-jars" description="Cleans all the generated and dependency files" />
-
-
- <!--=======================================================================
- copy-license-lgpl
-
- Copies the LGPL license file into the binary directory.
- ====================================================================-->
- <target name="copy-license-lgpl" if="lgpl-license-avail">
- <copy todir="${classes.dir}/META-INF">
- <fileset dir="${license.dir}" includes="lgpl-2.1.txt" />
- </copy>
- </target>
-
-
- <!--=======================================================================
- copy-license-gpl-parent
-
- Copies the GPL license file from the parent directory into the
- binary directory.
- ====================================================================-->
- <target name="copy-license-gpl" if="gpl-license-avail">
- <copy todir="${classes.dir}/META-INF">
- <fileset dir="${license.dir}" includes="gpl-2.0.txt" />
- </copy>
- </target>
-
-
- <!--=======================================================================
- compile
-
- Compiles the source code (using the specified options) into the
- binary directory.
-
- NOTE: This contains multiple sub-tasks which will occur in the
- following order (this is provided for easier overriding by
- the build.xml which will include this file)...
- - compile.pre : anything needed to prep for compile
- - compile.compile : the actual compilation step
- - compile.src_copy : copying the source into the bin directory
- - compile.res_copy : copying the resources into the bin directory
- - compile.lic_copy : copying the license information into the bin directory
- - compile.post : anything needed after the compile is done
- ====================================================================-->
- <target name="compile"
- depends="init, compile.pre, compile.compile, compile.src_copy, compile.res_copy, compile.lic_copy, compile.post"
- description="Performs all the steps to prepare the bin directory with a complete compilation" />
-
-
- <!--=======================================================================
- compile.pre
-
- Prepares to perform the compile.
- ====================================================================-->
- <target name="compile.pre" />
-
-
- <!--=======================================================================
- compile.compile
-
- Performs the actual compile
- ====================================================================-->
- <target name="compile.compile" depends="init">
- <javac destdir="${classes.dir}"
- debug="${javac.debug}"
- deprecation="${javac.deprecation}"
- fork="true"
- memorymaximumsize="${javac.maxmemory}"
- source="${javac.source}"
- target="${javac.target}">
- <classpath>
- <path refid="classpath" />
- </classpath>
- <src path="${src.dir}" />
- <compilerarg value="${javac.xlint}" />
- </javac>
- </target>
-
-
- <!--=======================================================================
- compile.res_copy
-
- Copies any needed resources into the classes directory. Will not
- duplicate copying of resources from src tree (handled by compile.src_copy
- if jar.include.source is set.
- ====================================================================-->
- <target name="compile.res_copy" depends="install-antcontrib">
- <if>
- <available file="${res.dir}" />
- <then>
- <copy todir="${classes.dir}">
- <fileset dir="${res.dir}" />
- </copy>
- </then>
- </if>
-
- <if>
- <not>
- <isset property="jar.include.source" />
- </not>
- <then>
- <copy todir="${classes.dir}" flatten="false">
- <fileset dir="${src.dir}" excludes="**/*.java" />
- </copy>
- </then>
- </if>
- </target>
-
-
- <!--=======================================================================
- compile.src_copy
-
- Copies the source files to the bin directory
- NOTE: if the dont.copy.source variable exists, this step will be
- skipped!
- ====================================================================-->
- <target name="compile.src_copy" depends="init" if="jar.include.source">
- <copy todir="${classes.dir}" flatten="false">
- <fileset dir="${src.dir}" />
- </copy>
- </target>
-
-
- <!--=======================================================================
- compile.lic_copy
-
- Copies the license file(s) into the bin directory
- ====================================================================-->
- <target name="compile.lic_copy" depends="init">
- <condition property="lgpl-license-avail">
- <available file="${license.dir}/lgpl-2.1.txt" />
- </condition>
- <antcall target="copy-license-lgpl" />
- <condition property="gpl-license-avail">
- <available file="${license.dir}/gpl-2.0.txt" />
- </condition>
- <antcall target="copy-license-gpl" />
- </target>
-
-
- <!--=======================================================================
- compile.post
-
- Performs any needed post-compile tasks
- ====================================================================-->
- <target name="compile.post" />
-
-
- <!--=======================================================================
- jar
-
- Creates a jar file from the bin directory
- ====================================================================-->
- <target name="jar"
- depends="jar.main,jar.test"
- description="Jars up the bin directory after a compile">
- </target>
-
- <!-- jar the tests ONLY IF tests.publish it true -->
- <!-- if the compile-tests target is in the dependency list for this target, -->
- <!-- it will get executed no matter what the value of tests.publish is -->
- <target name="jar.test"
- if="tests.publish">
- <antcall target="compile-tests" />
- <jar destfile="${dist.dir}/${ivy.artifact.id}-test-${project.revision}.jar" manifest="${dist.manifest.file}">
- <fileset dir="${testclasses.dir}"/>
- </jar>
- </target>
-
- <target name="jar.main"
- depends="compile,set-build.id,generate.manifest">
- <jar destfile="${dist.dir}/${ivy.artifact.id}-${project.revision}.jar" manifest="${dist.manifest.file}">
- <fileset dir="${classes.dir}" />
- </jar>
- </target>
-
- <!--=======================================================================
- generate.manifest
-
- Creates a new manifest file if one is not specified, or updates
- an existing manifest file if one is specified.
- ====================================================================-->
- <target name="generate.manifest" depends="init,set-build.id">
- <delete file="${dist.manifest.file}" />
- <touch file="${dist.manifest.file}" />
- <copy file="${manifest.file}" tofile="${dist.manifest.file}" overwrite="true" failonerror="false" />
-
- <manifest file="${dist.manifest.file}" mode="update">
- <attribute name="Implementation-Title" value="${impl.title}" />
- <attribute name="Implementation-Version" value="${project.revision}.${build.id}" />
- <attribute name="Implementation-Vendor" value="${impl.vendor}" />
- <attribute name="Implementation-ProductID" value="${impl.productID}" />
- </manifest>
- </target>
-
-
- <!--=======================================================================
- dist-source
-
- Generates zip and targz distributions of the javadoc
- ====================================================================-->
- <target name="dist-source" depends="source.jar, source.zip, source.targz" />
-
-
- <!--=======================================================================
- source.jar
-
- Creates a jar of the project source for distribution
- ====================================================================-->
- <target name="source.jar" depends="init,install-antcontrib">
- <jar jarfile="${dist.dir}/${ivy.artifact.id}-${project.revision}-sources.jar" basedir="${src.dir}" />
- <if>
- <equals arg1="${tests.publish}" arg2="true" />
- <then>
- <jar jarfile="${dist.dir}/${ivy.artifact.id}-test-${project.revision}-sources.jar" basedir="${src.dir}" />
- </then>
- </if>
- </target>
-
- <!--=======================================================================
- source.zip
-
- Creates a zip of the project source for distribution
- ====================================================================-->
- <target name="source.zip" depends="init">
- <jar jarfile="${dist.dir}/${source.zip.filename}" basedir="${src.dir}" />
- </target>
-
- <!--=======================================================================
- source.targz
-
- Creates a gzipped tar of the project source for distribution
- ====================================================================-->
- <target name="source.targz" depends="init">
- <tar compression="gzip" destfile="${dist.dir}/${source.tar.filename}" basedir="${src.dir}" />
- </target>
-
-
- <!--=======================================================================
- clean-tests
-
- Removes all files related to tests
- ====================================================================-->
- <target name="clean-tests">
- <delete dir="${testbin.dir}" />
- </target>
-
-
- <!--=======================================================================
- init-tests
-
- Compiles project test source
- ====================================================================-->
- <target name="init-tests" depends="clean-tests">
- <mkdir dir="${testclasses.dir}" />
- <mkdir dir="${testsrc.dir}" />
- </target>
-
-
- <!--=======================================================================
- compile-tests
-
- Compiles project test source
- ====================================================================-->
- <target name="compile-tests" depends="init-tests">
- <javac destdir="${testclasses.dir}"
- debug="true"
- optimize="false"
- source="${javac.source}"
- target="${javac.target}"
- fork="true">
- <src path="${testsrc.dir}" />
- <classpath refid="test.classpath" />
- </javac>
-
- <!-- Copy the non-java files from the source directory to the test classes directory
--->
- <copy todir="${testclasses.dir}">
- <fileset dir="${testsrc.dir}">
- <exclude name="**/*.java" />
- </fileset>
- </copy>
- </target>
-
-
- <!--=======================================================================
- test
-
- Compiles and runs all the tests for the project
- ====================================================================-->
- <target name="test" depends="compile,compile-tests, init-test-reports" description="Compiles and runs unit tests">
- <junit maxmemory="${junit.maxmemory}"
- dir="${junit.base.dir}"
- fork="yes"
- forkmode="${junit.forkmode}"
- failureProperty="test.failed"
- haltonfailure="${junit.haltonfailure}"
- haltonerror="${junit.haltonerror}"
- printsummary="yes">
- <sysproperty key="java.awt.headless" value="${headless.unittest}" />
-
- <syspropertyset>
- <propertyref prefix="junit.sysprop." />
- <mapper type="glob" from="junit.sysprop.*" to="*"/>
- </syspropertyset>
-
- <classpath refid="test.classpath" />
- <formatter type="xml" />
- <test name="${testcase}" todir="${testreports.xml.dir}" if="testcase" />
- <batchtest fork="yes" todir="${testreports.xml.dir}" unless="testcase">
- <fileset dir="${testsrc.dir}" casesensitive="yes">
- <include name="**/*Test.java" />
- </fileset>
- </batchtest>
- </junit>
-
- <junitreport todir="${testreports.html.dir}">
- <fileset dir="${testreports.xml.dir}">
- <include name="TEST-*.xml" />
- </fileset>
- <report format="frames" todir="${testreports.html.dir}" />
- </junitreport>
- </target>
-
-
- <!--=======================================================================
- clean-test-reports
-
- Remove all xml and html JUnit test reports
- ====================================================================-->
- <target name="clean-test-reports">
- <delete dir="${testreports.xml.dir}" />
- <delete dir="${testreports.html.dir}" />
- </target>
-
-
- <!--=======================================================================
- init-test-reports
-
- Prepare directories for JUnit test reports
- ====================================================================-->
- <target name="init-test-reports" depends="clean-test-reports">
- <mkdir dir="${testreports.xml.dir}" />
- <mkdir dir="${testreports.html.dir}" />
- </target>
-
- <!--=======================================================================
- dist
-
- Creates a distribution of this project
- ====================================================================-->
- <target name="dist" depends="jar" description="Creates a distribution" />
-
-
- <!--=======================================================================
- dist-full
-
- Creates a distribution of this project including all sources needed
- to build as well as the resultant jar
- ====================================================================-->
- <target name="dist-full" depends="jar"
- description="Creates all the distributable items for this project">
- <!-- Create the required zip distribution which contains the entire project -->
- <zip destfile="${dist.dir}/${ivy.artifact.id}-${project.revision}.zip">
- <fileset dir="${basedir}">
- <exclude name="bin/"/>
- <exclude name="dist/"/>
- <exclude name="eclipse-bin/"/>
- </fileset>
- <zipfileset dir="${dist.dir}" includes="**/*.jar"/>
- </zip>
- </target>
-
-
- <!--=======================================================================
- javadoc
-
- Generates javadoc source documentation for this project
- ====================================================================-->
- <target name="javadoc" depends="javadoc.init, compile">
- <javadoc destdir="${javadoc.dir}/docs/api"
- access="public"
- source="6"
- use="true"
- notree="false"
- nonavbar="false"
- noindex="false"
- splitindex="true"
- author="true"
- version="true"
- maxmemory="256M"
- nodeprecatedlist="false"
- nodeprecated="false"
- packagenames="${javadoc.packagenames}"
- sourcepath="${src.dir}"
- doctitle="${impl.title} documentation">
- <link href="http://docs.oracle.com/javase/6/docs/api/" />
- <classpath refid="classpath" />
- </javadoc>
- </target>
-
-
- <!--=======================================================================
- enunciate
-
- Generates enunciate documentation for the resoruce
- classes comprising the BIServer REST api
- ====================================================================-->
- <target name="enunciate" depends="resolve-enunciate">
- <path id="enunciate.classpath">
- <fileset dir="${lib.dir}">
- <include name="*.jar" />
- <exclude name="saxon*.jar" />
- </fileset>
- <dirset dir="${classes.dir}" />
- <fileset dir="${dist.dir}">
- <include name="*.jar" />
- </fileset>
- <fileset dir="${enunciate.home}/lib">
- <include name="*.jar" />
- </fileset>
- </path>
-
- <taskdef name="enunciate" classname="org.codehaus.enunciate.main.EnunciateTask">
- <classpath refid="enunciate.classpath" />
- </taskdef>
-
- <enunciate dir="${basedir}/src"
- configFile="${basedir}/enunciate.xml"
- generateDir="${enunciate.bin.dir}/generate"
- compileDir="${enunciate.bin.dir}/compile"
- buildDir="${enunciate.bin.dir}/build"
- packageDir="${enunciate.bin.dir}/package"
- verbose="true">
- <include name="**/*.java" />
- <!-- have to exclude class that contains jersey multipart endpoint until http://jira.codehaus.org/browse/ENUNCIATE-537 is fixed -->
-
- <classpath refid="enunciate.classpath" />
- <export artifactId="docs" destination="${dist.dir}/${enunciate.packagename}.zip" />
- </enunciate>
- </target>
-
- <!--=======================================================================
- dist-javadoc
-
- Generates zip and targz distributions of the javadoc
- ====================================================================-->
- <target name="dist-javadoc" depends="javadoc.zip, javadoc.targz" />
-
-
- <!--=======================================================================
- clean-javadoc
-
- Removes generated javadoc files (note, this does not remove javadoc distributions.
- Use clean-dist to remove artifacts from the dist.dir.
- ====================================================================-->
- <target name="clean-javadoc">
- <delete dir="${javadoc.dir}" />
- </target>
-
-
- <!--=======================================================================
- javadoc.init
-
- Creates directories for javadoc process
- ====================================================================-->
- <target name="javadoc.init" depends="clean-javadoc">
- <mkdir dir="${javadoc.dir}" />
- </target>
-
-
- <!--=======================================================================
- javadoc.zip
-
- Creates a zip of the javadoc for distribution
- ====================================================================-->
- <target name="javadoc.zip" depends="javadoc">
- <jar jarfile="${dist.dir}/${javadoc.zip.filename}"
- basedir="${javadoc.dir}"
- includes="**/*"
- excludes="**/Thumbs.db" />
- </target>
-
-
- <!--=======================================================================
- javadoc.targz
-
- Creates a gzipped tar of the javadoc for distribution
- ====================================================================-->
- <target name="javadoc.targz" depends="javadoc">
- <tar compression="gzip"
- destfile="${dist.dir}/${javadoc.tar.filename}"
- basedir="${javadoc.dir}"
- includes="**/*"
- excludes="**/Thumbs.db" />
- </target>
-
-
- <!--=======================================================================
- cobertura
-
- Runs tests in an instrumented environment and produces Cobertura test coverage reports
- ====================================================================-->
- <target name="cobertura"
- description="Runs tests in an instrumented environment and produces Cobertura test coverage reports"
- depends="clean-cobertura,install-cobertura,compile,compile-tests,cobertura.instrument-classes,cobertura.test-instrumented,cobertura.xml-report,cobertura.html-report" />
-
-
- <!--=======================================================================
- cobertura.instrument-classes
-
- Instruments the application classes used by Cobertura during cobertura.test-instrumented
- ====================================================================-->
- <target name="cobertura.instrument-classes" depends="cobertura.clean-instrumented-classes,install-cobertura,compile">
- <cobertura-instrument todir="${instrumented.classes.dir}" datafile="${cobertura.data.dir}/cobertura.ser">
- <ignore regex="org.apache.log4j.*" />
- <fileset dir="${classes.dir}">
- <!--
- Instrument all the application classes, but
- don't instrument the test classes.
- -->
- <include name="**/*.class" />
- <exclude name="**/*Test.class" />
- </fileset>
-
- </cobertura-instrument>
- </target>
-
-
-
- <!--=======================================================================
- install-cobertura
-
- Downloads and installs Cobertura ant tasks
- ====================================================================-->
- <target name="install-cobertura" depends="install-ivy">
- <taskdef-with-ivy organisation="net.sourceforge.cobertura" module="cobertura" revision="${cobertura.version}" resource="tasks.properties" classname="net.sourceforge.cobertura.ant.InstrumentTask"/>
- </target>
-
-
- <!--=======================================================================
- clean-cobertura
-
- Removes all files created by Cobertura code coverage utility
- ====================================================================-->
- <target name="clean-cobertura" depends="cobertura.clean-instrumented-classes,cobertura.clean-coverage-reports">
- <delete dir="${cobertura.data.dir}" />
- </target>
-
- <!--=======================================================================
- clean-sonar
-
- Removes the temporary file location for sonar files
- ====================================================================-->
- <target name="clean-sonar">
- <delete dir="${basedir}/.sonar" />
- </target>
-
-
- <!--=======================================================================
- cobertura.clean-instrumented-classes
-
- Remove the instrumented classes used by Cobertura
- ====================================================================-->
- <target name="cobertura.clean-instrumented-classes">
- <delete dir="${instrumented.classes.dir}" />
- </target>
-
-
- <!--=======================================================================
- cobertura.clean-coverage-reports
-
- Remove all xml and html Cobertura coverage reports
- ====================================================================-->
- <target name="cobertura.clean-coverage-reports">
- <delete dir="${coberturareports.xml.dir}" />
- <delete dir="${coberturareports.html.dir}" />
- <delete dir="${coberturareports.dir}" />
- </target>
-
-
- <!--=======================================================================
- cobertura.test-instrumented
-
- Runs tests against instrumented classes and generates xml and html JUnit test reports
- ====================================================================-->
- <target name="cobertura.test-instrumented"
- depends="init-test-reports,install-cobertura,compile,compile-tests,cobertura.instrument-classes">
- <mkdir dir="${instrumented.classes.dir}" />
- <path id="cobertura.classpath">
- <fileset dir="${subfloor.resources.dir}/cobertura-${cobertura.version}">
- <include name="*.jar" />
- </fileset>
- </path>
- <junit fork="yes"
- forkmode="${junit.forkmode}"
- dir="${junit.base.dir}"
- maxmemory="${junit.maxmemory}"
- failureProperty="test.failed"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}">
- <sysproperty key="java.awt.headless" value="${headless.unittest}" />
-
- <!-- Specify the name of the coverage data file to use. -->
- <sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.data.dir}/cobertura.ser" />
-
- <syspropertyset>
- <propertyref prefix="junit.sysprop." />
- <mapper type="glob" from="junit.sysprop.*" to="*"/>
- </syspropertyset>
-
- <!--
- Note the classpath order: instrumented classes are before the
- original (uninstrumented) classes. This is important.
- -->
- <classpath location="${instrumented.classes.dir}" />
- <classpath refid="test.classpath" />
- <classpath refid="cobertura.classpath" />
-
- <formatter type="xml" />
- <test name="${testcase}" todir="${testreports.xml.dir}" if="testcase" />
- <batchtest todir="${testreports.xml.dir}" unless="testcase">
- <fileset dir="${testsrc.dir}" casesensitive="yes">
- <include name="**/*Test.java" />
- </fileset>
- </batchtest>
- </junit>
-
- <junitreport todir="${testreports.html.dir}">
- <fileset dir="${testreports.xml.dir}">
- <include name="TEST-*.xml" />
- </fileset>
- <report format="frames" todir="${testreports.html.dir}" />
- </junitreport>
- </target>
-
-
- <!--=======================================================================
- cobertura.xml-report
-
- Produces machine-readable xml Cobertura coverage report from results of instrumented tests
- ====================================================================-->
- <target name="cobertura.xml-report" depends="cobertura.test-instrumented">
- <cobertura-report destdir="${coberturareports.xml.dir}" datafile="${cobertura.data.dir}/cobertura.ser" format="xml">
- <fileset dir="${src.dir}">
- <include name="**/*.java" />
- </fileset>
- </cobertura-report>
- </target>
-
-
- <!--=======================================================================
- cobertura.html-report
-
- Produces human-readable html Cobertura coverage report from results of instrumented tests
- ====================================================================-->
- <target name="cobertura.html-report" depends="cobertura.test-instrumented">
- <cobertura-report destdir="${coberturareports.html.dir}"
- datafile="${cobertura.data.dir}/cobertura.ser"
- format="html">
- <fileset dir="${src.dir}">
- <include name="**/*.java" />
- </fileset>
- </cobertura-report>
- </target>
-
- <!--=======================================================================
- install-pentaho-ant-tasks
-
- Fetches and installs Pentaho Ant tasks
- ====================================================================-->
- <target name="install-pentaho-ant-tasks" depends="install-ivy">
- <taskdef-with-ivy task-name="dot-classpath" classname="org.pentaho.anttasks.DotClasspath" organisation="pentaho" module="pentaho-ant-tasks" revision="1.1" />
- </target>
-
- <!--=======================================================================
- create-dot-classpath
-
- Creates the Eclipse .classpath file from the resolved
- classpath from Ant.
- ====================================================================-->
- <target name="create-dot-classpath" depends="install-pentaho-ant-tasks,init">
- <dot-classpath>
- <!-- Include all lib dirs -->
- <classpath>
- <fileset dir="${devlib.dir}">
- <include name="*.jar" />
- </fileset>
- <fileset dir="${testlib.dir}">
- <include name="*.jar" />
- </fileset>
- <fileset dir="${lib.dir}">
- <include name="*.jar" />
- </fileset>
- </classpath>
- </dot-classpath>
- </target>
-
-
- <!--=======================================================================
- MACRO: taskdef-with-ivy
- Downloads (using IVY) and defines new Ant tasks
-
- NOTE: any task using this macro must depend on "install-antcontrib"
-
- parameters:
- task-name - Name to give the new Ant task (only used if resource is not set)
- organisation - Artifact organization (for artifact resolution with IVY)
- module - Artifact module (for artifact resolution with IVY)
- revision - Artifact revision (for artifact resolution with IVY)
- classname - Classname for the Ant task. Used during taskdef and to check
- if we already have the libraries
- resource - (optional) Resource defining the Ant task. Used during taskdef
- ====================================================================-->
- <macrodef name="taskdef-with-ivy">
- <attribute name="task-name"
- description="Name to give the new Ant task (only used if resource is not set)"
- default="unset" />
- <attribute name="organisation" description="Artifact organization" />
- <attribute name="module" description="Artifact module" />
- <attribute name="revision" description="Artifact revision" />
- <attribute name="classname"
- description="Classname for the Ant task. Used during taskdef and to check if we already have the libraries." />
- <attribute name="resource"
- description="(optional) Resource defining the Ant task. Used during taskdef"
- default="unset" />
- <sequential>
- <mkdir dir="${subfloor.resources.dir}/@{module}-@{revision}/" />
- <!-- if the library does not exist, we must download it -->
- <if>
- <not>
- <and>
- <available file="${subfloor.resources.dir}/@{module}-@{revision}" />
- <available classname="@{classname}">
- <classpath>
- <fileset dir="${subfloor.resources.dir}/@{module}-@{revision}">
- <include name="*.jar" />
- </fileset>
- </classpath>
- </available>
- </and>
- </not>
- <then>
- <ivy:retrieve inline="true"
- conf="default"
- organisation="@{organisation}"
- module="@{module}"
- revision="@{revision}"
- pattern="${subfloor.resources.dir}/@{module}-@{revision}/[module]-__-[revision](-[classifier]).[ext]" />
- <!-- in case the artifact pulls in an ant jar, remove it. they cause runtime conflicts -->
- <delete>
- <fileset dir="${subfloor.resources.dir}/@{module}-@{revision}">
- <include name="ant-__-*.jar" />
- <include name="ant-launcher-__-*.jar" />
- </fileset>
- </delete>
- </then>
- </if>
- <path id="taskdef.classpath">
- <fileset dir="${subfloor.resources.dir}/@{module}-@{revision}">
- <include name="*.jar" />
- </fileset>
- </path>
- <if>
- <equals arg1="@{resource}" arg2="unset" />
- <then>
- <taskdef classpathref="taskdef.classpath" name="@{task-name}" classname="@{classname}" />
- </then>
- <else>
- <taskdef classpathref="taskdef.classpath" resource="@{resource}" />
- </else>
- </if>
- </sequential>
- </macrodef>
-
-
- <!--=======================================================================
- Macro which will download the specified library.
-
- NOTE: any task using this macro must depend on "install-antcontrib"
-
- parameters:
- name - The name of the library (the filename w/o extension)
- url - The URL from which the library will be downloaded
- resource - The name of the resource which should be loaded
- as a task definition
- classname - A class file name which can be used to detect if the
- property library exists
- extension - The extension of the library being downloaded
- (defaults to zip)
- ====================================================================-->
- <macrodef name="download-antlib">
- <attribute name="name" />
- <attribute name="url" />
- <attribute name="classname" />
- <attribute name="extension" default="zip" />
- <sequential>
- <mkdir dir="${subfloor.resources.dir}/@{name}/" />
- <!-- if the library does not exist, we must download it -->
- <if>
- <not>
- <and>
- <available file="${subfloor.resources.dir}/@{name}" />
- <available classname="@{classname}">
- <classpath>
- <fileset dir="${subfloor.resources.dir}/@{name}">
- <include name="**/*.jar" />
- </fileset>
- </classpath>
- </available>
- </and>
- </not>
- <then>
- <!-- if it is a zip file, unzip it ... otherwise if a jar, just download it -->
- <if>
- <equals arg1="zip" arg2="@{extension}" />
- <then>
- <!-- download the source file to a temp directory -->
- <echo message="downloading library @{name} [@{name}.@{extension} from @{url}]" />
- <mkdir dir="${subfloor.tmp.dir}" />
- <get src="@{url}" dest="${subfloor.tmp.dir}/@{name}.@{extension}" usetimestamp="true" />
- <unzip src="${subfloor.tmp.dir}/@{name}.@{extension}"
- dest="${subfloor.resources.dir}/@{name}"
- overwrite="true" />
- </then>
- <else>
- <get src="@{url}" dest="${subfloor.resources.dir}/@{name}/@{name}.@{extension}" usetimestamp="true" />
- </else>
- </if>
- </then>
- </if>
- </sequential>
- </macrodef>
-
- <!--=======================================================================
- install-tattletale
-
- (Fetches and) installs TATTLETALE for use by this ant script
- ====================================================================-->
- <target name="install-tattletale" depends="install-antcontrib">
- <if>
- <istrue value="${tattletale.isinstalled}" />
- <then>
- <echo message="Skipping TATTLETALE install. TATTLETALE has already been configured by the build" />
- </then>
- <else>
- <download-antlib name="tattletale"
- url="${tattletale.url}"
- classname="${tattletale.classname}"
- extension="zip"/>
-
- <taskdef name="tattletale.report" classname="${tattletale.classname}">
- <classpath>
- <fileset dir="${subfloor.resources.dir}/tattletale">
- <include name="*.jar" />
- </fileset>
- </classpath>
- </taskdef>
-
- <property name="tattletale.isinstalled" value="true" />
- </else>
- </if>
- </target>
-
- <!--=======================================================================
- tattletale-report
-
- Generates a tattletale report for this project
- ====================================================================-->
- <target name="tattletale-report" depends="install-tattletale,jar">
- <tattletale.report source="${basedir}" destination="${tattletale.reports.dir}"/>
- </target>
-
-<!--=======================================================================
- install-sonar
-
- (Fetches and) installs SONAR ant plugin for use by this ant script
- ====================================================================-->
- <target name="install-sonar" depends="install-antcontrib">
- <if>
- <istrue value="${sonar.isinstalled}" />
- <then>
- <echo message="Skipping SONAR install. SONAR has already been configured by the build" />
- </then>
- <else>
- <download-antlib name="sonar"
- url="${sonar.url}"
- classname="${sonar.classname}"
- extension="jar"/>
-
- <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
- <classpath>
- <fileset dir="${subfloor.resources.dir}/sonar">
- <include name="*.jar" />
- </fileset>
- </classpath>
- </taskdef>
-
- <property name="sonar.isinstalled" value="true" />
- </else>
- </if>
- </target>
-
- <!--=======================================================================
- sonar
-
- Execute the sonar analysis and publish to a sonar server specified by:
- sonar.jdbc.url
- sonar.jdbc.driverClassName
- sonar.jdbc.username
- sonar.jdbc.password
- sonar.host.url
- ====================================================================-->
- <target name="sonar" depends="install-sonar, compile, test, cobertura">
- <property name="sonar.sources" value="${src.dir}" />
- <property name="sonar.binaries" value="${classes.dir}" />
- <property name="sonar.tests" value="${testsrc.dir}" />
- <property name="sonar.libraries" value="${lib.dir}" />
-
- <property name="sonar.dynamicAnalysis" value="reuseReports" />
- <property name="sonar.cobertura.reportPath" value="${coberturareports.xml.dir}/coverage.xml" />
- <property name="sonar.surefire.reportsPath" value="${testreports.xml.dir}" />
-
- <sonar:sonar key="${ivy.artifact.group}:${ivy.artifact.id}" version="${project.revision}" xmlns:sonar="antlib:org.sonar.ant"/>
- </target>
-
-</project>
http://git-wip-us.apache.org/repos/asf/oodt/blob/2fc7bced/tools/pdi_plugin/build.properties
----------------------------------------------------------------------
diff --git a/tools/pdi_plugin/build.properties b/tools/pdi_plugin/build.properties
deleted file mode 100644
index 27fa591..0000000
--- a/tools/pdi_plugin/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-impl.title=Apache OODT filemgr file get
-impl.productID=OODT_FILEMGR_GET
-impl.vendor=Apache Foundation
-
-ivy.artifact.group=oodt-filemgr
-ivy.artifact.id=filemgr-fileget-plugin
-
-project.revision=TRUNK-SNAPSHOT
-dependency.pentaho-metadata.revision=TRUNK-SNAPSHOT
-src.dir=${basedir}/src
-testsrc.dir=${basedir}/test-src
-project.use-full-dist=true
-javadoc.packagenames=org.apache.oodt.*