27 #include "../../../../common/Exception.h" 28 #include "../../../../core/translator/Translator.h" 29 #include "../../../../dataaccess/dataset/DataSet.h" 30 #include "../../../../dataaccess/dataset/DataSetPersistence.h" 31 #include "../../../../dataaccess/dataset/DataSetTypePersistence.h" 32 #include "../../../../dataaccess/datasource/BatchExecutor.h" 33 #include "../../../../dataaccess/datasource/DataSource.h" 34 #include "../../../../dataaccess/datasource/DataSourceCatalogLoader.h" 35 #include "../../../../dataaccess/datasource/DataSourceTransactor.h" 36 #include "../../../../dataaccess/datasource/PreparedQuery.h" 37 #include "../../common/Utils.h" 46 return ::v8::Undefined();
52 return ::v8::Undefined();
58 return ::v8::Undefined();
65 if(args.Holder().IsEmpty())
66 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"In order to use the getDataSet method you must use the object notation: \"dataset = obj.getDataSet(\"mydataset-name\");\"")));
68 if(args.Length() != 1 || args[0].IsEmpty() || !args[0]->IsString())
69 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"Wrong parameters in getDataSet method!")));
74 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"Invalid data source transactor in getDataSet method!")));
78 v8::String::Utf8Value jdatasetname(args[0]->
ToString());
79 std::auto_ptr<te::da::DataSet> dataset(t->
getDataSet(*jdatasetname));
82 return hs.Close(jsdataset);
84 catch(
const std::exception& e)
86 return ::v8::ThrowException(::v8::String::New(e.what()));
90 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"Unexpected exception in getDataSet method!")));
97 return ::v8::Undefined();
102 ::v8::HandleScope hs;
103 return ::v8::Undefined();
108 return ::v8::Undefined();
113 ::v8::HandleScope hs;
114 return ::v8::Undefined();
119 ::v8::HandleScope hs;
120 return ::v8::Undefined();
125 ::v8::HandleScope hs;
126 return ::v8::Undefined();
131 ::v8::HandleScope hs;
132 return ::v8::Undefined();
137 ::v8::HandleScope hs;
138 return ::v8::Undefined();
143 ::v8::HandleScope hs;
144 return ::v8::Undefined();
149 ::v8::HandleScope hs;
150 return ::v8::Undefined();
155 ::v8::HandleScope hs;
156 return ::v8::Undefined();
165 ::v8::Local<::v8::FunctionTemplate> result = ::v8::FunctionTemplate::New();
166 ::v8::Handle<::v8::ObjectTemplate> prototype = result->PrototypeTemplate();
::v8::Local<::v8::Object > Make(T *obj, TF tfunc, const bool isOwner)
It creates a new JavaScript object from a C++ object (obj).
::v8::Handle<::v8::Value > DataSourceTransactor_Execute(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSourceTransactor_GetDataSet(const ::v8::Arguments &args)
::v8::Handle<::v8::Value > DataSourceTransactor_GetDataSetTypePersistence(const ::v8::Arguments &)
JavaScript exporting routine for the TerraLib Data Access module.
::v8::Handle<::v8::Value > DataSourceTransactor_Cancel(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSourceTransactor_GetPreparedStmt(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSourceTransactor_GetDataSetByGeom(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSourceTransactor_Begin(const ::v8::Arguments &)
static::v8::Persistent<::v8::FunctionTemplate > sds_datasourcetransactor_template
::v8::Handle<::v8::Value > DataSourceTransactor_RollBack(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSourceTransactor_GetDataSetPersistence(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSourceTransactor_Query(const ::v8::Arguments &)
A DataSourceTransactor can be viewed as a connection to the data source for reading/writing things in...
::v8::Handle<::v8::Value > DataSourceTransactor_GetDataSource(const ::v8::Arguments &)
::v8::Persistent<::v8::FunctionTemplate > & GetDataSetTemplate()
It returns a reference to the persistent template of a DataSet object.
::v8::Handle<::v8::Value > DataSourceTransactor_Commit(const ::v8::Arguments &)
virtual std::unique_ptr< DataSet > getDataSet(const std::string &name, te::common::TraverseType travType=te::common::FORWARDONLY, bool connected=false, const te::common::AccessPolicy accessPolicy=te::common::RAccess)=0
It gets the dataset identified by the given name. A dataset can be connected or disconnected. A connected dataset, after its creation through the data source transactor, continues to depend on the connection given by its associated data source. Differently, a disconnected dataset, after its creation, no more depends of the connection given by the data source, and it continues to live after the connection has been released to the data source.
::v8::Handle<::v8::Value > DataSourceTransactor_GetBatchExecutor(const ::v8::Arguments &)
::v8::Persistent<::v8::FunctionTemplate > & GetDataSourceTransactorTemplate()
It returns a reference to the persistent template of a DataSourceTransactor object.
#define TR_V8JSI(message)
It marks a string in order to get translated. This is a special mark used in the Vector Geometry modu...
::v8::Handle<::v8::Value > DataSourceTransactor_GetDataSetByEnvelope(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSourceTransactor_GetCatalogLoader(const ::v8::Arguments &)
std::string ToString(const XMLCh *const value)
It converts the XML string to a standard C++ string.