You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by bf...@apache.org on 2010/12/23 03:48:37 UTC
svn commit: r1052149 [2/2] - in /oodt/branches/wengine-branch/pge: ./ src/
src/main/ src/main/assembly/ src/main/bin/ src/main/java/
src/main/java/gov/ src/main/java/gov/nasa/ src/main/java/gov/nasa/jpl/
src/main/java/gov/nasa/jpl/oodt/ src/main/java/g...
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/PgeConfigBuilder.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/PgeConfigBuilder.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/PgeConfigBuilder.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/PgeConfigBuilder.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,35 @@
+/*
+ * 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.cas.pge.config;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.metadata.ControlMetadata;
+
+/**
+ *
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Interface for building a {@link PgeConfig}
+ * </p>.
+ */
+public interface PgeConfigBuilder {
+
+ public PgeConfig build(ControlMetadata ctrlMetadata) throws Exception;
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/PgeConfigMetKeys.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/PgeConfigMetKeys.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/PgeConfigMetKeys.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/PgeConfigMetKeys.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,100 @@
+/*
+ * 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.cas.pge.config;
+
+/**
+ * @author mattmann
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Met Keys used when reading a {@link PgeConfig} XML file
+ * </p>.
+ */
+public interface PgeConfigMetKeys {
+
+ public static final String IMPORT_TAG = "import";
+
+ public static final String NAMESPACE_ATTR = "namespace";
+
+ public static final String FILE_ATTR = "file";
+
+ public static final String CUSTOM_METADATA_TAG = "customMetadata";
+
+ public static final String METADATA_TAG = "metadata";
+
+ public static final String KEYREF_ATTR = "key-ref";
+
+ public static final String KEY_GEN_ATTR = "key-gen";
+
+ public static final String KEY_ATTR = "key";
+
+ public static final String VAL_ATTR = "val";
+
+ public static final String ENV_REPLACE_ATTR = "envReplace";
+
+ public static final String ENV_REPLACE_NO_RECUR_ATTR = "envReplace-NoRecur";
+
+ public static final String SPLIT_ATTR = "split";
+
+ public static final String WORKFLOW_MET_ATTR = "workflowMet";
+
+ public static final String DYN_INPUT_FILES_TAG = "dynInputFiles";
+
+ public static final String FILE_TAG = "file";
+
+ public static final String PATH_ATTR = "path";
+
+ public static final String WRITER_CLASS_ATTR = "writerClass";
+
+ public static final String ARGS_ATTR = "args";
+
+ public static final String EXE_TAG = "exe";
+
+ public static final String DIR_ATTR = "dir";
+
+ public static final String SHELL_TYPE_ATTR = "shellType";
+
+ public static final String CMD_TAG = "cmd";
+
+ public static final String OUTPUT_TAG = "output";
+
+ public static final String DIR_TAG = "dir";
+
+ public static final String CREATE_BEFORE_EXEC_ATTR = "createBeforeExe";
+
+ public static final String FILES_TAG = "files";
+
+ public static final String REGEX_ATTR = "regExp";
+
+ public static final String NAME_ATTR = "name";
+
+ public static final String MET_FILE_WRITER_CLASS_ATTR = "metFileWriterClass";
+
+ public static final String RENAMING_CONV_TAG = "renamingConv";
+
+ public static final String NAMING_EXPR_ATTR = "namingExpr";
+
+ public static final String FILE_STAGING_TAG = "fileStaging";
+
+ public static final String STAGE_FILES_TAG = "stageFiles";
+
+ public static final String METADATA_KEY_ATTR = "metadataKey";
+
+ public static final String FORCE_ATTR = "force";
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/RegExprOutputFiles.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/RegExprOutputFiles.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/RegExprOutputFiles.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/RegExprOutputFiles.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,63 @@
+/*
+ * 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.cas.pge.config;
+
+/**
+ *
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * A regular expression class to define what OutputFiles
+ * to identify after running a PGE
+ * </p>.
+ */
+public class RegExprOutputFiles {
+
+ private String regExp;
+
+ private String converterClass;
+
+ private Object[] args;
+
+ private RenamingConv renamingConv;
+
+ public RegExprOutputFiles(String regExp, String converterClass,
+ RenamingConv renamingConv, Object[] args) {
+ this.regExp = regExp;
+ this.converterClass = converterClass;
+ this.renamingConv = renamingConv;
+ this.args = args;
+ }
+
+ public RenamingConv getRenamingConv() {
+ return this.renamingConv;
+ }
+
+ public String getRegExp() {
+ return this.regExp;
+ }
+
+ public String getConverterClass() {
+ return this.converterClass;
+ }
+
+ public Object[] getArgs() {
+ return this.args;
+ }
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/RenamingConv.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/RenamingConv.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/RenamingConv.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/RenamingConv.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,54 @@
+/*
+ * 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.cas.pge.config;
+
+//JDK imports
+import java.util.List;
+
+//OODT imports
+import org.apache.oodt.cas.metadata.Metadata;
+
+/**
+ *
+ * @author bfoster
+ * @version $Revision$
+ *
+ */
+public class RenamingConv {
+
+ private String renamingString;
+
+ private Metadata tmpReplaceMet;
+
+ public RenamingConv(String renamingString) {
+ this.renamingString = renamingString;
+ this.tmpReplaceMet = new Metadata();
+ }
+
+ public String getRenamingString() {
+ return this.renamingString;
+ }
+
+ public void addTmpReplaceMet(String key, List<String> values) {
+ this.tmpReplaceMet.replaceMetadata(key, values);
+ }
+
+ public Metadata getTmpReplaceMet() {
+ return this.tmpReplaceMet;
+ }
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/XmlFilePgeConfigBuilder.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/XmlFilePgeConfigBuilder.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/XmlFilePgeConfigBuilder.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/config/XmlFilePgeConfigBuilder.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,415 @@
+/*
+ * 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.cas.pge.config;
+
+//JDK imports
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+//OODT imports
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.metadata.SerializableMetadata;
+import org.apache.oodt.cas.metadata.util.PathUtils;
+import org.apache.oodt.cas.pge.metadata.PGETaskMetKeys;
+import org.apache.oodt.commons.xml.XMLUtils;
+
+//JPL OODT imports
+import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
+import org.apache.oodt.cas.filemgr.util.QueryUtils;
+import org.apache.oodt.cas.filemgr.util.SqlParser;
+import org.apache.oodt.cas.workflow.metadata.ControlMetadata;
+import static org.apache.oodt.cas.pge.config.PgeConfigMetKeys.*;
+
+//DOM imports
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ *
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * An implementation of the {@link PgeConfigBuilder} that reads an XML file
+ * representation of the {@link PgeConfig}
+ * </p>.
+ */
+public class XmlFilePgeConfigBuilder extends FileBasedPgeConfigBuilder {
+
+ private static Logger LOG = Logger.getLogger(XmlFilePgeConfigBuilder.class.getName());
+
+ public XmlFilePgeConfigBuilder() {
+ super();
+ }
+
+ protected PgeConfig _build(ControlMetadata ctrlMetadata) throws Exception {
+ try {
+ PgeConfig pgeConfig = new PgeConfig();
+ this.buildImports(this.fillIn(ctrlMetadata
+ .getMetadata(CONFIG_FILE_PATH),
+ ctrlMetadata.asMetadata()), null, pgeConfig, ctrlMetadata);
+ return pgeConfig;
+ } catch (Exception e) {
+ throw new Exception("Failed to build PgeConfig : "
+ + e.getMessage(), e);
+ }
+
+ }
+
+ private void buildImports(String configFile, String namespace, PgeConfig pgeConfig, ControlMetadata ctrlMetadata) throws MalformedURLException, Exception {
+
+ Element root = this.getRootElement(configFile);
+
+ // load parent files
+ NodeList nodeList = root.getElementsByTagName(IMPORT_TAG);
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ String curImportNS = this.fillIn(((Element) nodeList.item(i))
+ .getAttribute(NAMESPACE_ATTR), ctrlMetadata
+ .asMetadata());
+ String file = this.fillIn(((Element) nodeList.item(i))
+ .getAttribute(FILE_ATTR), ctrlMetadata.asMetadata());
+ if (!file.startsWith(File.separator))
+ file = new File(configFile).getParent()
+ + File.separator + file;
+ this.buildImports(file, curImportNS.equals("") ? null : curImportNS, pgeConfig, ctrlMetadata);
+ }
+
+ // load base config file
+ LOG.log(Level.INFO, "Loading PgeConfig file '" + configFile + "'");
+ this.build(root, namespace, pgeConfig, ctrlMetadata);
+
+ }
+
+ private void build(Element root, String namespace, PgeConfig pgeConfig,
+ ControlMetadata ctrlMetadata) throws MalformedURLException, Exception {
+
+ // load custom metadata
+ ControlMetadata localPgeMetadata = null;
+ if (root.getElementsByTagName(CUSTOM_METADATA_TAG).getLength() > 0) {
+ localPgeMetadata = this.getCustomMetadata((Element) root
+ .getElementsByTagName(CUSTOM_METADATA_TAG).item(0), ctrlMetadata);
+ }
+
+ // update metadata
+ ControlMetadata curPgeMetadata = new ControlMetadata();
+ curPgeMetadata.replaceControlMetadata(ctrlMetadata);
+ if (localPgeMetadata != null)
+ curPgeMetadata.replaceControlMetadata(localPgeMetadata);
+ Metadata curMetadata = curPgeMetadata.asMetadata();
+
+ // load file staging info
+ if (root.getElementsByTagName(FILE_STAGING_TAG).getLength() > 0) {
+ pgeConfig.setFileStagingInfo(this.getFileStagingInfo((Element) root
+ .getElementsByTagName(FILE_STAGING_TAG).item(0), ctrlMetadata,
+ localPgeMetadata, curMetadata));
+ }
+
+ // add local pge metadata to global pge metadata with given namespace
+ curPgeMetadata.replaceControlMetadata(ctrlMetadata);
+ if (localPgeMetadata != null)
+ curPgeMetadata.replaceControlMetadata(localPgeMetadata);
+ curMetadata = curPgeMetadata.asMetadata();
+
+ // load dynamic config file info
+ if (root.getElementsByTagName(DYN_INPUT_FILES_TAG).getLength() > 0) {
+ List<DynamicConfigFile> configFileList = this.getDynConfigFile(
+ (Element) root.getElementsByTagName(DYN_INPUT_FILES_TAG)
+ .item(0), curMetadata);
+ for (DynamicConfigFile dcf : configFileList)
+ pgeConfig.addDynamicConfigFile(dcf);
+ }
+
+ // load exe info
+ if (root.getElementsByTagName(EXE_TAG).getLength() > 0) {
+ pgeConfig.setExeDir(this.getExeDir((Element) root.getElementsByTagName(
+ EXE_TAG).item(0), curMetadata));
+ pgeConfig.setShellType(this.getShellType((Element) root
+ .getElementsByTagName(EXE_TAG).item(0), curMetadata));
+ List<String> exeCmds = pgeConfig.getExeCmds();
+ exeCmds.addAll(this.getExeCmds((Element) root.getElementsByTagName(
+ EXE_TAG).item(0), curMetadata));
+ pgeConfig.setExeCmds(exeCmds);
+ }
+
+ // load output dirs
+ if (root.getElementsByTagName(OUTPUT_TAG).getLength() > 0) {
+ List<OutputDir> outputDirs = this.getOuputDirs((Element) root
+ .getElementsByTagName(OUTPUT_TAG).item(0), curMetadata);
+ for (OutputDir outputDir : outputDirs)
+ pgeConfig.addOuputDirAndExpressions(outputDir);
+ }
+
+ // add local pge metadata to global pge metadata with given namespace
+ if (localPgeMetadata != null)
+ ctrlMetadata.replaceControlMetadata(localPgeMetadata, namespace);
+ }
+
+ private ControlMetadata getCustomMetadata(Element customMetadataElem, ControlMetadata ctrlMetadata)
+ throws MalformedURLException, Exception {
+ ControlMetadata localPgeMetadata = new ControlMetadata();
+ Metadata currentMetadata = ctrlMetadata.asMetadata();
+ if (customMetadataElem != null) {
+ NodeList customMetadataList = customMetadataElem
+ .getElementsByTagName(METADATA_TAG);
+ String key = null;
+ try {
+ for (int i = 0; i < customMetadataList.getLength(); i++) {
+ Element metadataElement = (Element) customMetadataList.item(i);
+ key = metadataElement.getAttribute(KEY_ATTR);
+ if (key.equals(""))
+ key = this.fillIn(metadataElement.getAttribute(KEY_GEN_ATTR), currentMetadata);
+ if (!metadataElement.getAttribute(KEYREF_ATTR).equals("")) {
+ String val = metadataElement.getAttribute(KEYREF_ATTR);
+ if (metadataElement.getAttribute(ENV_REPLACE_NO_RECUR_ATTR)
+ .toLowerCase().equals("true"))
+ val = this.fillIn(val, currentMetadata, false);
+ else if (!metadataElement.getAttribute(ENV_REPLACE_ATTR)
+ .toLowerCase().equals("false"))
+ val = this.fillIn(val, currentMetadata);
+ localPgeMetadata.linkKey(key, val);
+ currentMetadata.replaceMetadata(key, currentMetadata.getAllMetadata(val));
+ }else {
+ String val = metadataElement.getAttribute(VAL_ATTR);
+ if (val.equals(""))
+ val = metadataElement.getTextContent();
+ if (metadataElement.getAttribute(ENV_REPLACE_NO_RECUR_ATTR)
+ .toLowerCase().equals("true"))
+ val = this.fillIn(val, currentMetadata, false);
+ else if (!metadataElement.getAttribute(ENV_REPLACE_ATTR)
+ .toLowerCase().equals("false"))
+ val = this.fillIn(val, currentMetadata);
+ List<String> valList = new Vector<String>();
+ if (!metadataElement.getAttribute(SPLIT_ATTR)
+ .toLowerCase().equals("false"))
+ valList.addAll(Arrays.asList((val + ",").split(",")));
+ else
+ valList.add(val);
+ if (localPgeMetadata.isLink(key) && localPgeMetadata.getMetadata(key) == null) {
+ String keyref = localPgeMetadata.getReferenceKey(key);
+ if (ctrlMetadata.getMetadata(keyref) != null) {
+ ctrlMetadata.replaceLocalMetadata(keyref, valList);
+ if (ctrlMetadata.getMetadata(keyref, ControlMetadata.DYN) != null) {
+ ctrlMetadata.setAsWorkflowMetadataKey(keyref);
+ ctrlMetadata.commitWorkflowMetadataKeys(keyref);
+ }
+ }else {
+ throw new Exception("Dangling key-ref '" + key + "'");
+ }
+ for (String parentKey : localPgeMetadata.getReferenceKeyPath(key))
+ currentMetadata.replaceMetadata(parentKey, valList);
+ }else {
+ localPgeMetadata.replaceLocalMetadata(key, valList);
+ }
+ currentMetadata.replaceMetadata(key, valList);
+ }
+ if (metadataElement.getAttribute(WORKFLOW_MET_ATTR)
+ .toLowerCase().equals("true")) {
+ localPgeMetadata.setAsWorkflowMetadataKey(key);
+ localPgeMetadata.commitWorkflowMetadataKeys(key);
+ }
+// currentMetadata.replaceMetadata(key, localPgeMetadata.getAllMetadata(key));
+ }
+ }catch (Exception e) {
+ throw new Exception("Failed to load custom metadata [key='"
+ + key
+ + "',val='"
+ + (key != null ? currentMetadata.getMetadata(key)
+ : null) + "'] : " + e.getMessage(), e);
+ }
+ }
+ return localPgeMetadata;
+ }
+
+ private Element getRootElement(String xmlFilePath)
+ throws FileNotFoundException {
+ return XMLUtils.getDocumentRoot(
+ new FileInputStream(new File(xmlFilePath)))
+ .getDocumentElement();
+ }
+
+ private List<DynamicConfigFile> getDynConfigFile(
+ Element dynConfigFileElement, Metadata curMetadata)
+ throws MalformedURLException, Exception {
+ List<DynamicConfigFile> configFileList = new LinkedList<DynamicConfigFile>();
+ if (dynConfigFileElement != null) {
+ NodeList dynConfigFilesList = dynConfigFileElement
+ .getElementsByTagName(FILE_TAG);
+ for (int i = 0; i < dynConfigFilesList.getLength(); i++) {
+ Element fileElement = (Element) dynConfigFilesList.item(i);
+ configFileList.add(new DynamicConfigFile(this.fillIn(
+ fileElement.getAttribute(PATH_ATTR), curMetadata), this
+ .fillIn(fileElement.getAttribute(WRITER_CLASS_ATTR),
+ curMetadata), (Object[]) this.fillIn(
+ fileElement.getAttribute(ARGS_ATTR), curMetadata)
+ .split(",")));
+ }
+ }
+ return configFileList;
+ }
+
+ private FileStagingInfo getFileStagingInfo(Element fileStagingElement, ControlMetadata ctrlMetadata, ControlMetadata localPgeMetadata, Metadata curMetadata) throws Exception {
+ String stagingDir = this.fillIn(fileStagingElement.getAttribute(DIR_ATTR), curMetadata);
+ boolean forceStaging = Boolean.parseBoolean(this.fillIn(fileStagingElement.getAttribute(FORCE_ATTR), curMetadata));
+ FileStagingInfo fileStagingInfo = new FileStagingInfo(stagingDir, forceStaging);
+
+ if (fileStagingElement.getElementsByTagName(STAGE_FILES_TAG).getLength() > 0) {
+ NodeList stageFiles = fileStagingElement.getElementsByTagName(STAGE_FILES_TAG);
+ for (int i = 0; i < stageFiles.getLength(); i++) {
+ String fileKey = ((Element) stageFiles.item(i)).getAttribute(METADATA_KEY_ATTR);
+ List<String> files = curMetadata.getAllMetadata(fileKey);
+ fileStagingInfo.addFilePaths(files);
+ List<String> newPaths = new Vector<String>();
+ for (String file : files) {
+ File fileHandle = new File(file);
+ if (fileStagingInfo.isForceStaging() || !fileHandle.exists()) {
+ newPaths.add(fileStagingInfo.getStagingDir() + "/" + fileHandle.getName());
+ }else {
+ newPaths.add(file);
+ }
+ }
+ curMetadata.replaceMetadata(fileKey, newPaths);
+ if (localPgeMetadata != null && localPgeMetadata.getMetadata(fileKey) != null) {
+ localPgeMetadata.replaceLocalMetadata(fileKey, newPaths);
+ if (localPgeMetadata.getMetadata(fileKey, ControlMetadata.DYN) != null)
+ localPgeMetadata.commitWorkflowMetadataKeys(fileKey);
+ }
+ if (ctrlMetadata.getMetadata(fileKey = localPgeMetadata.getReferenceKey(fileKey)) != null) {
+ ctrlMetadata.replaceLocalMetadata(fileKey, newPaths);
+ if (ctrlMetadata.getMetadata(fileKey, ControlMetadata.DYN) != null)
+ ctrlMetadata.commitWorkflowMetadataKeys(fileKey);
+ }
+ }
+ }
+
+ return fileStagingInfo;
+ }
+
+ private String getExeDir(Element exeElement, Metadata curMetadata)
+ throws MalformedURLException, Exception {
+ if (exeElement != null)
+ return this.fillIn(exeElement.getAttribute(DIR_ATTR), curMetadata);
+ else
+ return null;
+ }
+
+ private String getShellType(Element exeElement, Metadata curMetadata)
+ throws MalformedURLException, Exception {
+ if (exeElement != null)
+ return this.fillIn(exeElement.getAttribute(SHELL_TYPE_ATTR),
+ curMetadata);
+ else
+ return null;
+ }
+
+ private List<String> getExeCmds(Element exeElement, Metadata curMetadata)
+ throws MalformedURLException, DOMException, Exception {
+ LinkedList<String> exeCmds = new LinkedList<String>();
+ if (exeElement != null) {
+ NodeList cmds = exeElement.getElementsByTagName(CMD_TAG);
+ for (int i = 0; i < cmds.getLength(); i++) {
+ Element cmd = (Element) cmds.item(i);
+ exeCmds.add(this.fillIn(cmd.getTextContent(), curMetadata));
+ }
+ }
+ return exeCmds;
+ }
+
+ private List<OutputDir> getOuputDirs(Element ouputDirElement,
+ Metadata curMetadata) throws MalformedURLException, Exception {
+ List<OutputDir> outputDirs = new LinkedList<OutputDir>();
+ if (ouputDirElement != null) {
+ NodeList outputDirsList = ouputDirElement
+ .getElementsByTagName(DIR_TAG);
+ for (int i = 0; i < outputDirsList.getLength(); i++) {
+ Element outputDirElement = (Element) outputDirsList.item(i);
+ String dirPath = this.fillIn(outputDirElement
+ .getAttribute(PATH_ATTR), curMetadata);
+ OutputDir outputDir = new OutputDir(dirPath, this.fillIn(
+ outputDirElement.getAttribute(CREATE_BEFORE_EXEC_ATTR),
+ curMetadata).equals("true"));
+ NodeList fileList = outputDirElement
+ .getElementsByTagName(FILES_TAG);
+ for (int j = 0; j < fileList.getLength(); j++) {
+ Element fileElement = (Element) fileList.item(j);
+ String outputFile = fileElement.getAttribute(REGEX_ATTR);
+ if (outputFile.equals(""))
+ outputFile = this.fillIn(fileElement
+ .getAttribute(NAME_ATTR), curMetadata);
+ NodeList renamingConvNodes = fileElement.getElementsByTagName(RENAMING_CONV_TAG);
+ RenamingConv renamingConv = null;
+ if (renamingConvNodes.getLength() > 0) {
+ Element renamingElement = (Element) renamingConvNodes.item(0);
+ String namingExpr = renamingElement.getAttribute(NAMING_EXPR_ATTR);
+ if (renamingElement.getAttribute(ENV_REPLACE_NO_RECUR_ATTR)
+ .toLowerCase().equals("true"))
+ namingExpr = this.fillIn(namingExpr, curMetadata, false);
+ else if (!renamingElement.getAttribute(ENV_REPLACE_ATTR)
+ .toLowerCase().equals("false"))
+ namingExpr = this.fillIn(namingExpr, curMetadata);
+ renamingConv = new RenamingConv(namingExpr);
+ NodeList metadataNodes = renamingElement.getElementsByTagName(METADATA_TAG);
+ for (int k = 0; k < metadataNodes.getLength(); k++)
+ renamingConv.addTmpReplaceMet(
+ ((Element) metadataNodes.item(k))
+ .getAttribute(KEY_ATTR), Arrays
+ .asList(((Element) metadataNodes
+ .item(k)).getAttribute(
+ VAL_ATTR).split(",")));
+ }
+ outputDir.addRegExprOutputFiles(new RegExprOutputFiles(
+ outputFile, this.fillIn(fileElement
+ .getAttribute(MET_FILE_WRITER_CLASS_ATTR),
+ curMetadata), renamingConv, (Object[]) this.fillIn(
+ fileElement.getAttribute(ARGS_ATTR),
+ curMetadata).split(",")));
+ }
+ outputDirs.add(outputDir);
+ }
+ }
+ return outputDirs;
+ }
+
+ private String fillIn(String value, Metadata inputMetadata) throws Exception {
+ return this.fillIn(value, inputMetadata, true);
+ }
+
+ private String fillIn(String value, Metadata inputMetadata, boolean envReplaceRecur)
+ throws Exception {
+ try {
+ while ((value = PathUtils.doDynamicReplacement(value, inputMetadata)).contains("[") && envReplaceRecur);
+ if (value.toUpperCase()
+ .matches("^\\s*SQL\\s*\\(.*\\)\\s*\\{.*\\}\\s*$"))
+ value = QueryUtils.getQueryResultsAsString(new XmlRpcFileManagerClient(new URL(inputMetadata
+ .getMetadata(PGETaskMetKeys.QUERY_FILE_MANAGER_URL))).complexQuery(SqlParser.parseSqlQueryMethod(value)));
+ return value;
+ }catch (Exception e) {
+ throw new Exception("Failed to parse value: " + value, e);
+ }
+ }
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/metadata/PGETaskMetKeys.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/metadata/PGETaskMetKeys.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/metadata/PGETaskMetKeys.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/metadata/PGETaskMetKeys.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,114 @@
+/*
+ * 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.cas.pge.metadata;
+
+/**
+ *
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Describe your class here
+ * </p>
+ * .
+ */
+public interface PGETaskMetKeys {
+
+ public static final String PGE_TASK_GROUP = "PGETask";
+
+ public static final String NAME = PGE_TASK_GROUP + "/Name";
+
+ public static final String PGE_CONFIG_BUILDER = PGE_TASK_GROUP + "/PgeConfigBuilder";
+
+ public static final String LOG_FILE_PATTERN = PGE_TASK_GROUP + "/LogFilePattern";
+
+ public static final String PROPERTY_ADDERS = PGE_TASK_GROUP + "/PropertyAdders";
+
+ public static final String PGE_RUNTIME = PGE_TASK_GROUP + "/Runtime";
+
+ public static final String DUMP_METADATA = PGE_TASK_GROUP + "/DumpMetadata";
+
+
+ public static final String QUERY_GROUP = PGE_TASK_GROUP + "/Query";
+
+ public static final String QUERY_FILE_MANAGER_URL = QUERY_GROUP + "/FileManagerUrl";
+
+ public static final String QUERY_CLIENT_TRANSFER_SERVICE_FACTORY = QUERY_GROUP + "/ClientTransferServiceFactory";
+
+
+ public static final String INGEST_GROUP = PGE_TASK_GROUP + "/Ingest";
+
+ public static final String INGEST_FILE_MANAGER_URL = INGEST_GROUP + "/FileManagerUrl";
+
+ public static final String INGEST_CLIENT_TRANSFER_SERVICE_FACTORY = INGEST_GROUP + "/ClientTransferServiceFactory";
+
+ public static final String CRAWLER_CRAWL_FOR_DIRS = INGEST_GROUP + "/CrawlerCrawlForDirs";
+
+ public static final String CRAWLER_RECUR = INGEST_GROUP + "/CrawlerRecur";
+
+ public static final String MET_FILE_EXT = INGEST_GROUP + "/MetFileExtension";
+
+ public static final String REQUIRED_METADATA = INGEST_GROUP + "/RequiredMetadata";
+
+ public static final String ACTION_IDS = INGEST_GROUP + "/ActionsIds";
+
+ public static final String ACTION_REPO_FILE = INGEST_GROUP + "/ActionRepoFile";
+
+ public static final String ATTEMPT_INGEST_ALL = INGEST_GROUP + "/AttemptIngestAll";
+
+
+ public static final String CONDITION_GROUP = PGE_TASK_GROUP + "/Condition";
+
+ public static final String TIMEOUT = CONDITION_GROUP + "/Timeout";
+
+ public static final String PROP_ADDERS = CONDITION_GROUP + "/PropertyAdders";
+
+ public static final String POST_PROP_ADDERS = CONDITION_GROUP + "/PostPropertyAdders";
+
+ public static final String START_DATE_TIME_KEY = CONDITION_GROUP + "/StartDateTimeKey";
+
+ public static final String END_DATE_TIME_KEY = CONDITION_GROUP + "/EndDateTimeKey";
+
+ public static final String FILTER_ALGOR = CONDITION_GROUP + "/FilterAlgorClass";
+
+ public static final String PRODUCT_TYPES = CONDITION_GROUP + "/ProductTypeNames";
+
+ public static final String EXPECTED_NUM_OF_FILES = CONDITION_GROUP + "/ExpectedNumOfFiles";
+
+ public static final String EPSILON_IN_MILLIS = CONDITION_GROUP + "/EpsilonInMillis";
+
+ public static final String VERSIONING_KEY = CONDITION_GROUP + "/VersioningKey";
+
+ public static final String SORY_BY_KEY = CONDITION_GROUP + "/SortByKey";
+
+ public static final String MIN_NUM_OF_FILES = CONDITION_GROUP + "/MinNumOfFiles";
+
+ public static final String MAX_GAP_SIZE = CONDITION_GROUP + "/MaxGap/Size";
+
+ public static final String MAX_GAP_START_DATE_TIME = CONDITION_GROUP + "/MaxGap/StartDateTime";
+
+ public static final String MAX_GAP_END_DATE_TIME = CONDITION_GROUP + "/MaxGap/EndDateTime";
+
+ public static final String VERSION_CONVERTER = CONDITION_GROUP + "/VersionConverter";
+
+ public static final String RESULT_KEY_FORMATS = CONDITION_GROUP + "/ResultKeyFormats";
+
+ public static final String SQL_QUERY_KEY = CONDITION_GROUP + "/SqlQueryKey";
+
+
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/query/conv/DateVersionConverter.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/query/conv/DateVersionConverter.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/query/conv/DateVersionConverter.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/query/conv/DateVersionConverter.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,43 @@
+/*
+ * 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.cas.pge.query.conv;
+
+//OODT imports
+import org.apache.oodt.cas.filemgr.structs.query.conv.VersionConverter;
+import org.apache.oodt.commons.date.DateUtils;
+
+//JDK imports
+import java.text.ParseException;
+import java.util.Calendar;
+
+/**
+ *
+ * @author bfoster
+ * @version $Revision$
+ *
+ */
+public class DateVersionConverter implements VersionConverter {
+
+ public double convertToPriority(String version) throws ParseException {
+ Calendar cal = DateUtils.toCalendar(version,
+ DateUtils.FormatType.UTC_FORMAT);
+ return (cal.get(Calendar.YEAR) * 10000)
+ + ((cal.get(Calendar.MONTH) + 1) * 100)
+ + (cal.get(Calendar.DAY_OF_MONTH));
+ }
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/staging/FileManagerFileStager.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/staging/FileManagerFileStager.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/staging/FileManagerFileStager.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/staging/FileManagerFileStager.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,63 @@
+/*
+ * 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.cas.pge.staging;
+
+//OODT imports
+import org.apache.oodt.cas.filemgr.datatransfer.DataTransfer;
+import org.apache.oodt.cas.filemgr.datatransfer.RemoteDataTransferFactory;
+import org.apache.oodt.cas.filemgr.structs.Product;
+import org.apache.oodt.cas.filemgr.structs.Reference;
+import org.apache.oodt.cas.filemgr.util.GenericFileManagerObjectFactory;
+import org.apache.oodt.cas.pge.metadata.PGETaskMetKeys;
+import org.apache.oodt.cas.workflow.metadata.ControlMetadata;
+
+//JDK imports
+import java.io.File;
+import java.net.URL;
+import java.util.Collections;
+import java.util.logging.Level;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public class FileManagerFileStager extends FileStager {
+
+ public void stageFile(String origPath, String destDir, ControlMetadata ctrlMetadata) throws Exception {
+ DataTransfer dataTransferer = null;
+ if (ctrlMetadata.getMetadata(PGETaskMetKeys.QUERY_CLIENT_TRANSFER_SERVICE_FACTORY) != null)
+ dataTransferer = GenericFileManagerObjectFactory.getDataTransferServiceFromFactory(ctrlMetadata.getMetadata(PGETaskMetKeys.QUERY_CLIENT_TRANSFER_SERVICE_FACTORY));
+ else
+ dataTransferer = new RemoteDataTransferFactory().createDataTransfer();
+ String filemgrUrl = ctrlMetadata.getMetadata(PGETaskMetKeys.QUERY_FILE_MANAGER_URL);
+ if (filemgrUrl != null)
+ dataTransferer.setFileManagerUrl(new URL(filemgrUrl));
+ else
+ LOG.log(Level.WARNING, "Metadata field '" + PGETaskMetKeys.QUERY_FILE_MANAGER_URL + "' was not set, if DataTranferer requires filemgr server, your transfers will fail");
+ dataTransferer.copyProduct(createDummyProduct(origPath), new File(destDir));
+ }
+
+ private Product createDummyProduct(String path) {
+ Product dummy = new Product();
+ Reference reference = new Reference();
+ reference.setDataStoreReference("file:" + new File(path).getAbsolutePath());
+ dummy.setProductReferences(Collections.singletonList(reference));
+ return dummy;
+ }
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/staging/FileStager.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/staging/FileStager.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/staging/FileStager.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/staging/FileStager.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,50 @@
+/*
+ * 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.cas.pge.staging;
+
+//JDK imports
+import java.io.File;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+//OODT imports
+import org.apache.oodt.cas.pge.config.FileStagingInfo;
+import org.apache.oodt.cas.workflow.metadata.ControlMetadata;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public abstract class FileStager {
+
+ protected static final Logger LOG = Logger.getLogger(FileStager.class.getName());
+
+ public void stageFiles(FileStagingInfo fileStagingInfo, ControlMetadata ctrlMetadata) throws Exception {
+ new File(fileStagingInfo.getStagingDir()).mkdirs();
+ for (String file : fileStagingInfo.getFilePaths()) {
+ File fileHandle = new File(file);
+ if (fileStagingInfo.isForceStaging() || !fileHandle.exists()) {
+ LOG.log(Level.INFO, "Staging file '" + file + "' to directory '" + fileStagingInfo.getStagingDir() + "'");
+ this.stageFile(file, fileStagingInfo.getStagingDir(), ctrlMetadata);
+ }
+ }
+ }
+
+ protected abstract void stageFile(String origPath, String destPath, ControlMetadata ctrlMetadata) throws Exception;
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/PcsMetFileWriter.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/PcsMetFileWriter.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/PcsMetFileWriter.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/PcsMetFileWriter.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,65 @@
+/*
+ * 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.cas.pge.writers;
+
+//OODT imports
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.metadata.ControlMetadata;
+import org.apache.oodt.cas.filemgr.metadata.CoreMetKeys;
+
+//OODT imports
+import java.io.File;
+
+/**
+ *
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Writes a PCS metadata file for the give data file
+ * </p>.
+ */
+public abstract class PcsMetFileWriter {
+
+ public static final String FILE_SIZE = "FileSize";
+
+ public Metadata getMetadataForFile(File sciPgeCreatedDataFile,
+ ControlMetadata ctrlMetadata, Object... customArgs) throws Exception {
+ try {
+ Metadata inputMetadata = ctrlMetadata.asMetadata();
+
+ inputMetadata.replaceMetadata(CoreMetKeys.FILENAME,
+ sciPgeCreatedDataFile.getName());
+ inputMetadata.replaceMetadata(CoreMetKeys.FILE_LOCATION,
+ sciPgeCreatedDataFile.getParentFile().getAbsolutePath());
+ inputMetadata.replaceMetadata(FILE_SIZE, Long.toString(new File(
+ inputMetadata.getMetadata(CoreMetKeys.FILE_LOCATION),
+ inputMetadata.getMetadata(CoreMetKeys.FILENAME)).length()));
+
+ return this.getSciPgeSpecificMetadata(
+ sciPgeCreatedDataFile, inputMetadata, customArgs);
+ } catch (Exception e) {
+ throw new Exception("Failed to create PCS metadata file for '"
+ + sciPgeCreatedDataFile + "' : " + e.getMessage(), e);
+ }
+ }
+
+ protected abstract Metadata getSciPgeSpecificMetadata(
+ File sciPgeCreatedDataFile, Metadata inputMetadata,
+ Object... customArgs) throws Exception;
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/SciPgeConfigFileWriter.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/SciPgeConfigFileWriter.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/SciPgeConfigFileWriter.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/SciPgeConfigFileWriter.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,49 @@
+/*
+ * 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.cas.pge.writers;
+
+//JDK imports
+import java.io.File;
+import java.io.IOException;
+
+//OODT imports
+import org.apache.oodt.cas.metadata.Metadata;
+
+/**
+ *
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Abstract interface for generating PGE config input files defining the input
+ * necessary to run the underlying PGE
+ * </p>.
+ */
+public interface SciPgeConfigFileWriter {
+
+ /**
+ *
+ * @param sciPgeConfigFilePath
+ * @param inputMetadata
+ * @param customArgs
+ * @return
+ * @throws IOException
+ */
+ public File createConfigFile(String sciPgeConfigFilePath,
+ Metadata inputMetadata, Object... customArgs) throws IOException;
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/metlist/MetadataListPcsMetFileWriter.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/metlist/MetadataListPcsMetFileWriter.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/metlist/MetadataListPcsMetFileWriter.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/metlist/MetadataListPcsMetFileWriter.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,87 @@
+/*
+ * 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.cas.pge.writers.metlist;
+
+//JDK imports
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Arrays;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+//OODT imports
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.metadata.util.PathUtils;
+import org.apache.oodt.cas.pge.writers.PcsMetFileWriter;
+import org.apache.oodt.commons.xml.XMLUtils;
+import static org.apache.oodt.cas.pge.config.PgeConfigMetKeys.*;
+
+
+/**
+ *
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * A {@link PcsMetFileWriter} that generates PCS met files based on a MetList
+ * XML document
+ * </p>.
+ */
+public class MetadataListPcsMetFileWriter extends PcsMetFileWriter {
+
+ @Override
+ protected Metadata getSciPgeSpecificMetadata(File sciPgeCreatedDataFile,
+ Metadata inputMetadata, Object... customArgs) throws Exception {
+ Metadata metadata = new Metadata();
+ for (Object arg : customArgs) {
+ Element root = XMLUtils.getDocumentRoot(
+ new FileInputStream(new File((String) arg)))
+ .getDocumentElement();
+ NodeList metadataNodeList = root.getElementsByTagName(METADATA_TAG);
+ for (int i = 0; i < metadataNodeList.getLength(); i++) {
+ Element metadataElement = (Element) metadataNodeList.item(i);
+ String key = metadataElement.getAttribute(KEY_ATTR);
+ if (key.equals(""))
+ key = PathUtils.doDynamicReplacement(metadataElement.getAttribute(KEY_GEN_ATTR), inputMetadata);
+ String val = metadataElement.getAttribute(VAL_ATTR);
+ if (val.equals(""))
+ val = metadataElement.getTextContent();
+ if (val != null && !val.equals("")) {
+ if (!metadataElement.getAttribute(ENV_REPLACE_ATTR).toLowerCase().equals("false"))
+ val = PathUtils.doDynamicReplacement(val, inputMetadata);
+ String[] vals = null;
+ if (metadataElement.getAttribute(SPLIT_ATTR).toLowerCase().equals("false")) {
+ vals = new String[] { val };
+ } else {
+ String delimiter = metadataElement.getAttribute("delimiter");
+ if (delimiter == null || delimiter.equals(""))
+ delimiter = ",";
+ vals = (val + delimiter).split(delimiter);
+ }
+ metadata.replaceMetadata(key, Arrays.asList(vals));
+ inputMetadata.replaceMetadata(key, Arrays.asList(vals));
+ } else if (inputMetadata.getMetadata(key) != null
+ && !inputMetadata.getMetadata(key).equals("")) {
+ metadata.replaceMetadata(key, inputMetadata
+ .getAllMetadata(key));
+ }
+ }
+ }
+ return metadata;
+ }
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/xslt/XslTransformWriter.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/xslt/XslTransformWriter.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/xslt/XslTransformWriter.java (added)
+++ oodt/branches/wengine-branch/pge/src/main/java/org/apache/oodt/cas/pge/writers/xslt/XslTransformWriter.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,77 @@
+/*
+ * 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.cas.pge.writers.xslt;
+
+//JDK imports
+import java.io.File;
+import java.io.IOException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.dom.DOMSource;
+
+//OODT imports
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.metadata.SerializableMetadata;
+import org.apache.oodt.cas.pge.writers.SciPgeConfigFileWriter;
+
+/**
+ *
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * XSL Transformation class which writes Science PGE config files based from the
+ * XML format of SerializableMetadata
+ * </p>.
+ */
+public class XslTransformWriter implements SciPgeConfigFileWriter {
+
+ public File createConfigFile(String sciPgeConfigFilePath,
+ Metadata inputMetadata, Object... customArgs) throws IOException {
+ try {
+ File sciPgeConfigFile = new File(sciPgeConfigFilePath);
+
+ String xsltFilePath = (String) customArgs[0];
+ Source xsltSource = new StreamSource(new File(xsltFilePath));
+ Result result = new StreamResult(sciPgeConfigFile);
+
+ TransformerFactory transFact = TransformerFactory.newInstance();
+ Transformer trans = transFact.newTransformer(xsltSource);
+ boolean useCDATA = customArgs.length > 1 ? ((String) customArgs[1])
+ .toLowerCase().equals("true") : false;
+ Source xmlSource = new DOMSource((new SerializableMetadata(
+ inputMetadata,
+ trans.getOutputProperty(OutputKeys.ENCODING), useCDATA))
+ .toXML());
+
+ trans.setOutputProperty(OutputKeys.INDENT, "yes");
+ trans.transform(xmlSource, result);
+
+ return sciPgeConfigFile;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new IOException("Failed to create science PGE config file '"
+ + sciPgeConfigFilePath + "' : " + e.getMessage());
+ }
+ }
+
+}
Added: oodt/branches/wengine-branch/pge/src/main/resources/REMOVE.log
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/resources/REMOVE.log?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/resources/REMOVE.log (added)
+++ oodt/branches/wengine-branch/pge/src/main/resources/REMOVE.log Thu Dec 23 02:48:35 2010
@@ -0,0 +1,2 @@
+You can remove this file. It was only included to ensure that the log directory for this
+distribution was created on assembly.
Added: oodt/branches/wengine-branch/pge/src/main/resources/examples/MetadataOutputFiles/metadata-output.xml
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/resources/examples/MetadataOutputFiles/metadata-output.xml?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/resources/examples/MetadataOutputFiles/metadata-output.xml (added)
+++ oodt/branches/wengine-branch/pge/src/main/resources/examples/MetadataOutputFiles/metadata-output.xml Thu Dec 23 02:48:35 2010
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<metadataList>
+
+ <!-- one or more of these -->
+ <metadata key="output-metadata-field-name" val="optional-value-[all-dyn-rplmnt-works-here]"/>
+
+</metadataList>
\ No newline at end of file
Propchange: oodt/branches/wengine-branch/pge/src/main/resources/examples/MetadataOutputFiles/metadata-output.xml
------------------------------------------------------------------------------
svn:executable =
Added: oodt/branches/wengine-branch/pge/src/main/resources/examples/PgeConfigFiles/pge-config.xml
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/resources/examples/PgeConfigFiles/pge-config.xml?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/resources/examples/PgeConfigFiles/pge-config.xml (added)
+++ oodt/branches/wengine-branch/pge/src/main/resources/examples/PgeConfigFiles/pge-config.xml Thu Dec 23 02:48:35 2010
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2008, California Institute of Technology.
+ ALL RIGHTS RESERVED. U.S. Government sponsorship acknowledged.
+
+ $Id$
+-->
+<pgeConfig>
+
+ <import namespace="optional-NS" file="absolute-or-relative-to-this-file-another-pgeConfig-import-file-path"/>
+
+ <!-- input file for science PGE that need to be created -->
+ <dynInputFiles>
+
+ <!-- one or more of these -->
+ <file path="path-with-name-to-create" writerClass="class-path-to-SciPgeConfigFileWriter" args="zero-or-more-args-comma-segregated"/>
+
+ </dynInputFiles>
+
+ <!-- stage input files -->
+ <fileStaging dir="base-staging-dir" force="true-or-false">
+
+ <!-- metadata key with files paths as value (values get modified if files in actually staged; i.e. doesn't already exist) -->
+ <stageFiles metadataKey="metadata-key"/>
+
+ </fileStaging>
+
+ <!-- how to run science PGE -->
+ <exe dir="set-working-dir-for-script" shellType="script-type">
+
+ <!-- one or more of these -->
+ <cmd>line-in-script-file</cmd>
+
+ </exe>
+
+ <!-- files to ingest -->
+ <output>
+
+ <!-- one or more of these -->
+ <dir path="path-to-an-output-dir" createBeforeExe="true-or-false">
+
+ <!-- one or more of these ** regExp or name can be used-->
+ <files regExp="regex-of-files-to-ingest-to-filemgr" metFileWriterClass="class-path-to-PcsMetFileWriter" args="zero-or-more-args-comma-segregated">
+
+ <!-- zero or one of these -->
+ <renamingConv namingExpr="">
+
+ <!-- zero or more of these -->
+ <metadata key="name-of-metadata-field" val="metadata-value"/>
+
+ </renamingConv>
+
+ </files>
+
+ </dir>
+
+ </output>
+
+ <!-- metadata keys you want to set -->
+ <customMetadata>
+
+ <!-- one or more of these -->
+ <metadata key="name-of-metadata-field" val="metadata-value"/>
+
+ </customMetadata>
+
+</pgeConfig>
Propchange: oodt/branches/wengine-branch/pge/src/main/resources/examples/PgeConfigFiles/pge-config.xml
------------------------------------------------------------------------------
svn:executable =
Added: oodt/branches/wengine-branch/pge/src/main/resources/examples/WorkflowMgrInput/pcs-pge-dyn-metadata.met
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/resources/examples/WorkflowMgrInput/pcs-pge-dyn-metadata.met?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/resources/examples/WorkflowMgrInput/pcs-pge-dyn-metadata.met (added)
+++ oodt/branches/wengine-branch/pge/src/main/resources/examples/WorkflowMgrInput/pcs-pge-dyn-metadata.met Thu Dec 23 02:48:35 2010
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<cas:metadata xmlns:cas="http://oodt.jpl.nasa.gov/1.0/cas">
+<!-- this dyn metadata should come from the workflow/process manager -->
+ <keyval>
+ <key>TaskId</key>
+ <val>1</val>
+ </keyval>
+ <keyval>
+ <key>JobId</key>
+ <val>1929</val>
+ </keyval>
+ <keyval>
+ <key>ProcessingNode</key>
+ <val>compute-0-13</val>
+ </keyval>
+
+ <!-- this dynamic metadata is the actual input to the task -->
+ <keyval>
+ <key>SiteName</key>
+ <val>parkfalls</val>
+ </keyval>
+ <keyval>
+ <key>InstrumentId</key>
+ <val>ifs1</val>
+ </keyval>
+ <keyval>
+ <key>LocalDay</key>
+ <val>050506</val>
+ </keyval>
+ <keyval>
+ <key>ProductType</key>
+ <val>IASI_CalSub</val>
+ </keyval>
+
+</cas:metadata>
\ No newline at end of file
Added: oodt/branches/wengine-branch/pge/src/main/resources/examples/WorkflowMgrInput/pcs-pge-task-workflow.properties
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/resources/examples/WorkflowMgrInput/pcs-pge-task-workflow.properties?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/resources/examples/WorkflowMgrInput/pcs-pge-task-workflow.properties (added)
+++ oodt/branches/wengine-branch/pge/src/main/resources/examples/WorkflowMgrInput/pcs-pge-task-workflow.properties Thu Dec 23 02:48:35 2010
@@ -0,0 +1,6 @@
+# Copyright (c) 2008 California Institute of Technology.
+# ALL RIGHTS RESERVED. U.S. Government Sponsorship acknowledged.
+#
+# $Id$
+
+foobar=foo
\ No newline at end of file
Propchange: oodt/branches/wengine-branch/pge/src/main/resources/examples/WorkflowMgrInput/pcs-pge-task-workflow.properties
------------------------------------------------------------------------------
svn:executable =
Added: oodt/branches/wengine-branch/pge/src/main/resources/examples/XsltFiles/xslt_prop_eq_val.xml
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/resources/examples/XsltFiles/xslt_prop_eq_val.xml?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/resources/examples/XsltFiles/xslt_prop_eq_val.xml (added)
+++ oodt/branches/wengine-branch/pge/src/main/resources/examples/XsltFiles/xslt_prop_eq_val.xml Thu Dec 23 02:48:35 2010
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2008, California Institute of Technology.
+ ALL RIGHTS RESERVED. U.S. Government sponsorship acknowledged.
+
+ $Id Converts cas-metadata xml output to a property equals comma segregated value pge config file$
+ -->
+<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cas="http://oodt.jpl.nasa.gov/1.0/cas">
+
+ <xsl:output method="text"/>
+
+ <xsl:variable name="delimiter"><xsl:text>,</xsl:text></xsl:variable>
+ <xsl:variable name="equalTo"><xsl:text>=</xsl:text></xsl:variable>
+ <xsl:variable name="newline"><xsl:text>
</xsl:text></xsl:variable>
+
+ <xsl:template match="/">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="metadata/keyval">
+ <xsl:value-of select="key"/>
+ <xsl:value-of select="$equalTo"/>
+ <xsl:for-each select="val">
+ <xsl:value-of select="."/>
+ <xsl:if test="not(position() = last())">
+ <xsl:value-of select="$delimiter"/>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:value-of select="$newline"/>
+ </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
Added: oodt/branches/wengine-branch/pge/src/main/resources/logging.properties
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/main/resources/logging.properties?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/main/resources/logging.properties (added)
+++ oodt/branches/wengine-branch/pge/src/main/resources/logging.properties Thu Dec 23 02:48:35 2010
@@ -0,0 +1,56 @@
+# Copyright (c) 2008 California Institute of Technology.
+# ALL RIGHTS RESERVED. U.S. Government Sponsorship acknowledged.
+#
+# $Id$
+
+
+# Specify the handlers to create in the root logger
+# (all loggers are children of the root logger)
+# The following creates two handlers
+handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
+
+# Set the default logging level for the root logger
+.level = ALL
+
+# Set the default logging level for new ConsoleHandler instances
+java.util.logging.ConsoleHandler.level = ALL
+java.util.logging.FileHandler.level = ALL
+
+# Set the default formatter for new ConsoleHandler instances
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+# default file output is in user's home directory.
+java.util.logging.FileHandler.pattern = ../logs/cas_pge%g.log
+java.util.logging.FileHandler.limit = 50000
+java.util.logging.FileHandler.count = 5
+java.util.logging.FileHandler.append = true
+java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
+
+# Set the default logging level for the subsystems
+
+# catalog subsystem
+org.apache.oodt.cas.filemgr.catalog.level = INFO
+
+# repository subsystem
+org.apache.oodt.cas.filemgr.repository.level = FINE
+
+# system subsystem
+org.apache.oodt.cas.filemgr.system.level = INFO
+
+# versioning subsystem
+org.apache.oodt.cas.filemgr.versioning.level = INFO
+
+# data transfer subsystem
+org.apache.oodt.cas.filemgr.datatransfer.level = FINE
+
+# util
+org.apache.oodt.cas.filemgr.util.level = INFO
+
+# validation
+org.apache.oodt.cas.filemgr.validation.level = INFO
+
+# control the underlying commons-httpclient transport layer for xmlrpc
+org.apache.commons.httpclient.level = INFO
+httpclient.wire.header.level = INFO
+httpclient.wire.level = INFO
+
Added: oodt/branches/wengine-branch/pge/src/site/resources/images/cas-pge.jpg
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/site/resources/images/cas-pge.jpg?rev=1052149&view=auto
==============================================================================
Binary file - no diff available.
Propchange: oodt/branches/wengine-branch/pge/src/site/resources/images/cas-pge.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: oodt/branches/wengine-branch/pge/src/site/resources/images/cas-pge.psd
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/site/resources/images/cas-pge.psd?rev=1052149&view=auto
==============================================================================
Binary file - no diff available.
Propchange: oodt/branches/wengine-branch/pge/src/site/resources/images/cas-pge.psd
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: oodt/branches/wengine-branch/pge/src/test/gov/nasa/jpl/oodt/cas/pge/util/UtilsTest.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/pge/src/test/gov/nasa/jpl/oodt/cas/pge/util/UtilsTest.java?rev=1052149&view=auto
==============================================================================
--- oodt/branches/wengine-branch/pge/src/test/gov/nasa/jpl/oodt/cas/pge/util/UtilsTest.java (added)
+++ oodt/branches/wengine-branch/pge/src/test/gov/nasa/jpl/oodt/cas/pge/util/UtilsTest.java Thu Dec 23 02:48:35 2010
@@ -0,0 +1,48 @@
+/*
+ * 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 gov.nasa.jpl.oodt.cas.pge.util;
+
+//OODT imports
+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.QueryFormulationException;
+import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManagerException;
+
+//JDK imports
+import java.net.MalformedURLException;
+
+//JUnit imports
+import junit.framework.TestCase;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public class UtilsTest extends TestCase {
+
+ protected void setUp() throws Exception {
+ }
+
+ protected void tearDown() throws Exception {
+ }
+
+ public void testEvalSQL() throws MalformedURLException, ConnectionException, CatalogException, RepositoryManagerException, QueryFormulationException {
+ //Utils.evalSQL("SQL { SELECT Filename FROM IASI_L1C WHERE DataVersion >= '23.4' AND DataVersion <= '24.4' AND DataVersion != '24.0' OR Filename != 'SomeName' }");
+ }
+
+}