Index: src/Actions/MoleculeAction/LoadAction.cpp
===================================================================
--- src/Actions/MoleculeAction/LoadAction.cpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
+++ src/Actions/MoleculeAction/LoadAction.cpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -0,0 +1,97 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * LoadAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "Parser/FormatParserStorage.hpp"
+#include "molecule.hpp"
+#include "World.hpp"
+
+#include <iostream>
+
+#include <boost/filesystem/fstream.hpp>
+
+using namespace std;
+
+#include "LoadAction.hpp"
+
+// and construct the stuff
+#include "LoadAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr MoleculeLoadAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
+
+  // parsing file if present
+  if (!boost::filesystem::exists(params.filename)) {
+    DoLog(1) && (Log() << Verbose(1) << "Specified input file " << params.filename << " not found." << endl);
+    // DONT FAIL: it's just empty and we use the name. // return Action::failure;
+  } else {
+    DoLog(1) && (Log() << Verbose(1) << "Specified input file found, parsing ... ");
+
+    // extract suffix
+    std::string FilenameSuffix;
+    std::string FilenamePrefix;
+    if (params.filename.has_filename()) {
+      // get suffix
+      FilenameSuffix = params.filename.extension().substr(1); // remove the prefixed "."
+      FilenamePrefix = params.filename.stem();
+    } else {
+      DoeLog(1) && (eLog() << Verbose(1) << "Input file does not have a suffix, cannot recognize format." << endl);
+      return Action::failure;
+    }
+
+    // parse the file
+    boost::filesystem::ifstream input;
+    input.open(params.filename);
+    FormatParserStorage::getInstance().get(input, FilenameSuffix);
+    input.close();
+
+    // set file name of last molecule
+    MoleculeList::const_reverse_iterator iter = World::getInstance().getMolecules()->ListOfMolecules.rbegin();
+    (*iter)->SetNameFromFilename(FilenamePrefix.c_str());
+  }
+  return Action::success;
+}
+
+Action::state_ptr MoleculeLoadAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr MoleculeLoadAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool MoleculeLoadAction::canUndo() {
+  return false;
+}
+
+bool MoleculeLoadAction::shouldUndo() {
+  return false;
+}
+/** =========== end of function ====================== */
Index: src/Actions/MoleculeAction/LoadAction.def
===================================================================
--- src/Actions/MoleculeAction/LoadAction.def	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
+++ src/Actions/MoleculeAction/LoadAction.def	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -0,0 +1,33 @@
+/*
+ * LoadAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value
+#define paramtypes (boost::filesystem::path)
+#define paramtokens ("load")
+#define paramdescriptions ("name of molecule file")
+#undef paramdefaults
+#define paramreferences (filename)
+
+#undef statetypes
+#undef statereferences
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Molecule
+#define MENUNAME "molecule"
+#define MENUPOSITION 1
+#define ACTIONNAME Load
+#define TOKEN "load"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "parse file with molecule into World"
+#define SHORTFORM "l"
Index: src/Actions/MoleculeAction/LoadAction.hpp
===================================================================
--- src/Actions/MoleculeAction/LoadAction.hpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
+++ src/Actions/MoleculeAction/LoadAction.hpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -0,0 +1,16 @@
+/*
+ * LoadXyzAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef LOADXYZACTION_HPP_
+#define LOADXYZACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+#include "LoadAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* LOADXYZACTION_HPP_ */
Index: src/Actions/MoleculeAction/SaveAction.cpp
===================================================================
--- src/Actions/MoleculeAction/SaveAction.cpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
+++ src/Actions/MoleculeAction/SaveAction.cpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -0,0 +1,94 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * SaveAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "Parser/FormatParserStorage.hpp"
+
+#include <iostream>
+#include <string>
+
+#include <boost/filesystem/fstream.hpp>
+
+using namespace std;
+
+#include "SaveAction.hpp"
+
+// and construct the stuff
+#include "SaveAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr MoleculeSaveAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
+
+  DoLog(1) && (Log() << Verbose(1) << "Storing world to file " << params.filename << "." << endl);
+
+  // extract suffix
+  std::string FilenameSuffix;
+  std::string FilenamePrefix;
+  if (params.filename.has_filename()) {
+    // get suffix
+    FilenameSuffix = params.filename.extension().substr(1); // remove the prefixed "."
+    FilenamePrefix = params.filename.stem();
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "Output file does not have a suffix, cannot recognize format." << endl);
+    return Action::failure;
+  }
+
+  // store file
+  // parse the file
+  boost::filesystem::ofstream output;
+  output.open(params.filename);
+  if (!output.fail()) {
+    FormatParserStorage::getInstance().put(output, FilenameSuffix);
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "Could not open file " << params.filename << "." << endl);
+  }
+  output.close();
+
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeSaveAction::performUndo(Action::state_ptr _state) {
+//  ParserSaveXyzState *state = assert_cast<ParserSaveXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserSaveXyzState(state->mol,newName));
+}
+
+Action::state_ptr MoleculeSaveAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+//  // Undo and redo have to do the same for this action
+//  return performUndo(_state);
+}
+
+bool MoleculeSaveAction::canUndo() {
+  return false;
+}
+
+bool MoleculeSaveAction::shouldUndo() {
+  return false;
+}
+/** =========== end of function ====================== */
Index: src/Actions/MoleculeAction/SaveAction.def
===================================================================
--- src/Actions/MoleculeAction/SaveAction.def	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
+++ src/Actions/MoleculeAction/SaveAction.def	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -0,0 +1,33 @@
+/*
+ * SaveAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value
+#define paramtypes (boost::filesystem::path)
+#define paramtokens ("save")
+#define paramdescriptions ("file name of file")
+#undef paramdefaults
+#define paramreferences (filename)
+
+#undef statetypes
+#undef statereferences
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Molecule
+#define MENUNAME "molecule"
+#define MENUPOSITION 2
+#define ACTIONNAME Save
+#define TOKEN "save"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "save world as file of certain type"
+#define SHORTFORM "s"
Index: src/Actions/MoleculeAction/SaveAction.hpp
===================================================================
--- src/Actions/MoleculeAction/SaveAction.hpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
+++ src/Actions/MoleculeAction/SaveAction.hpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -0,0 +1,16 @@
+/*
+ * SaveXyzAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef SAVEXYZACTION_HPP_
+#define SAVEXYZACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+#include "SaveAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* SAVEXYZACTION_HPP_ */
