summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/uscxml/plugins')
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp2
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp2
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h2
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp4
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp18
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp2
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h4
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp4
-rw-r--r--src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp2
-rw-r--r--src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp2
-rw-r--r--src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp8
-rw-r--r--src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp2
-rw-r--r--src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp2
13 files changed, 26 insertions, 28 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp
index 2c877b2..7f6a9e7 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp
@@ -509,7 +509,7 @@ void JSCDataModel::handleException(JSValueRef exception) {
Event exceptionEvent;
exceptionEvent.data.compound["exception"] = Data(exceptionMsg, Data::VERBATIM);
exceptionEvent.name = "error.execution";
- exceptionEvent.type = Event::PLATFORM;
+ exceptionEvent.eventType = Event::PLATFORM;
throw(exceptionEvent);
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp
index de3a93f..579012b 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp
@@ -7,7 +7,7 @@ namespace DOM {
JSClassRef JSCSCXMLEvent::Tmpl;
JSStaticValue JSCSCXMLEvent::staticValues[] = {
- { "type", typeCustomAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },
+ { "eventType", eventTypeCustomAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },
{ "name", nameAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },
{ "origin", originAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },
{ "origintype", origintypeAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h
index 306e563..8e00401 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h
+++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h
@@ -39,7 +39,7 @@ public:
JSC_DESTRUCTOR(JSCSCXMLEventPrivate);
- static JSValueRef typeCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception);
+ static JSValueRef eventTypeCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception);
static JSValueRef nameAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception);
static JSValueRef originAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception);
static JSValueRef origintypeAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception);
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp
index 1033034..0209467 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp
@@ -3,11 +3,11 @@
namespace Arabica {
namespace DOM {
-JSValueRef JSCSCXMLEvent::typeCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) {
+JSValueRef JSCSCXMLEvent::eventTypeCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) {
struct JSCSCXMLEventPrivate* privData = (struct JSCSCXMLEventPrivate*)JSObjectGetPrivate(thisObj);
JSStringRef stringRef;
- switch (privData->nativeObj->type) {
+ switch (privData->nativeObj->eventType) {
case uscxml::Event::INTERNAL:
stringRef = JSStringCreateWithUTF8CString("internal");
break;
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp
index 90abfa3..7ef2755 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp
@@ -5,24 +5,22 @@ namespace Arabica {
namespace DOM {
JSValueRef JSCXPathResult::singleNodeValueCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) {
-#if 0
- v8::Local<v8::Object> self = info.Holder();
- V8XPathResultPrivate* privData = V8DOM::toClassPtr<V8XPathResultPrivate >(self->GetInternalField(0));
+ struct JSCXPathResultPrivate* privData = (struct JSCXPathResultPrivate*)JSObjectGetPrivate(thisObj);
- Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->asNodeSet()[0]);
+ Arabica::XPath::NodeSet<std::string> nodeSet = privData->nativeObj->asNodeSet();
+ if (nodeSet.size() == 0)
+ return JSValueMakeUndefined(ctx);
- v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction();
- v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance());
+ Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(nodeSet[0]);
+ JSClassRef retClass = JSCNode::getTmpl();
- struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate();
+ struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate();
retPrivData->dom = privData->dom;
retPrivData->nativeObj = retVal;
- retObj->SetInternalField(0, V8DOM::toExternal(retPrivData));
+ JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData);
- retObj.MakeWeak(0, V8Node::jsDestructor);
return retObj;
-#endif
}
}
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
index f912455..b394171 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
@@ -558,7 +558,7 @@ void V8DataModel::throwExceptionEvent(const v8::TryCatch& tryCatch) {
assert(tryCatch.HasCaught());
Event exceptionEvent;
exceptionEvent.name = "error.execution";
- exceptionEvent.type = Event::PLATFORM;
+ exceptionEvent.eventType = Event::PLATFORM;
std::string exceptionString(*v8::String::AsciiValue(tryCatch.Exception()));
exceptionEvent.data.compound["exception"] = Data(exceptionString, Data::VERBATIM);;
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h
index 670d818..8b71ed7 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h
@@ -41,7 +41,7 @@ public:
static bool hasInstance(v8::Handle<v8::Value>);
- static v8::Handle<v8::Value> typeCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
+ static v8::Handle<v8::Value> eventTypeCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
static v8::Handle<v8::Value> nameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
static v8::Handle<v8::Value> originAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
static v8::Handle<v8::Value> origintypeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
@@ -63,7 +63,7 @@ public:
instance->SetInternalFieldCount(1);
- instance->SetAccessor(v8::String::NewSymbol("type"), V8SCXMLEvent::typeCustomAttrGetter, 0,
+ instance->SetAccessor(v8::String::NewSymbol("eventType"), V8SCXMLEvent::eventTypeCustomAttrGetter, 0,
v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None));
instance->SetAccessor(v8::String::NewSymbol("name"), V8SCXMLEvent::nameAttrGetter, 0,
v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None));
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp
index 4eecb94..d02a4cb 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp
@@ -3,11 +3,11 @@
namespace Arabica {
namespace DOM {
-v8::Handle<v8::Value> V8SCXMLEvent::typeCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) {
+v8::Handle<v8::Value> V8SCXMLEvent::eventTypeCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) {
v8::Local<v8::Object> self = info.Holder();
V8SCXMLEventPrivate* privData = V8DOM::toClassPtr<V8SCXMLEventPrivate >(self->GetInternalField(0));
- switch (privData->nativeObj->type) {
+ switch (privData->nativeObj->eventType) {
case uscxml::Event::INTERNAL:
return v8::String::New("internal");
break;
diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp
index a52af4b..4a1ce05 100644
--- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp
+++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp
@@ -202,7 +202,7 @@ void SWIDataModel::setEvent(const Event& event) {
// event.type
std::string type;
- switch (event.type) {
+ switch (event.eventType) {
case Event::PLATFORM:
type = "platform";
break;
diff --git a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp
index c38aef3..842c560 100644
--- a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp
+++ b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp
@@ -123,7 +123,7 @@ void XPathDataModel::setEvent(const Event& event) {
// -- type
Element<std::string> eventTypeElem = _doc.createElement("type");
Text<std::string> eventType;
- switch (event.type) {
+ switch (event.eventType) {
case Event::INTERNAL:
eventType = _doc.createTextNode("internal");
break;
diff --git a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp
index a70be38..de5a580 100644
--- a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp
+++ b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp
@@ -94,7 +94,7 @@ void UmundoInvoker::send(const SendRequest& req) {
event.name = _invokeId + ".reply." + req.name;
event.origin = msg.getMeta("um.channel");
event.origintype = "umundo";
- event.type = Event::EXTERNAL;
+ event.eventType = Event::EXTERNAL;
returnEvent(event);
svcIter++;
@@ -230,7 +230,7 @@ void UmundoInvoker::receive(void* object, umundo::Message* msg) {
event.invokeid = _invokeId;
event.origin = msg->getMeta("um.channel");
event.origintype = "umundo";
- event.type = Event::EXTERNAL;
+ event.eventType = Event::EXTERNAL;
// if (msg->getMeta().find("um.s11n.type") != msg->getMeta().end())
// event.compound["class"] = msg->getMeta("um.s11n.type");
@@ -268,7 +268,7 @@ void UmundoInvoker::added(umundo::ServiceDescription desc) {
addedEvent.invokeid = _invokeId;
addedEvent.origin = desc.getName();
addedEvent.origintype = "umundo";
- addedEvent.type = Event::EXTERNAL;
+ addedEvent.eventType = Event::EXTERNAL;
addedEvent.name = _invokeId + ".added";
std::map<std::string, std::string>::const_iterator propIter = desc.getProperties().begin();
@@ -294,7 +294,7 @@ void UmundoInvoker::removed(umundo::ServiceDescription desc) {
addedEvent.invokeid = _invokeId;
addedEvent.origin = desc.getName();
addedEvent.origintype = "umundo";
- addedEvent.type = Event::EXTERNAL;
+ addedEvent.eventType = Event::EXTERNAL;
addedEvent.name = _invokeId + ".removed";
std::map<std::string, std::string>::const_iterator propIter = desc.getProperties().begin();
diff --git a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp
index a612ee6..56e2523 100644
--- a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp
+++ b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp
@@ -70,7 +70,7 @@ Data BasicHTTPIOProcessor::getDataModelVariables() {
bool BasicHTTPIOProcessor::httpRecvRequest(const HTTPServer::Request& req) {
Event reqEvent = req;
- reqEvent.type = Event::EXTERNAL;
+ reqEvent.eventType = Event::EXTERNAL;
bool scxmlStructFound = false;
if (reqEvent.data.compound["header"].compound.find("Content-Type") != reqEvent.data.compound["header"].compound.end() &&
diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp
index 25e0f8c..67b518c 100644
--- a/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp
+++ b/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp
@@ -39,7 +39,7 @@ boost::shared_ptr<IOProcessorImpl> MMIHTTPIOProcessor::create(InterpreterImpl* i
bool MMIHTTPIOProcessor::httpRecvRequest(const HTTPServer::Request& req) {
Event reqEvent = req;
- reqEvent.type = Event::EXTERNAL;
+ reqEvent.eventType = Event::EXTERNAL;
bool scxmlStructFound = false;
if (reqEvent.data.compound["header"].compound.find("Content-Type") != reqEvent.data.compound["header"].compound.end() &&