diff options
-rw-r--r-- | debian/changelog | 8 | ||||
-rwxr-xr-x | packaging/wrt-plugins-tizen.spec | 2 | ||||
-rwxr-xr-x | src/platform/API/Mediacontent/MediacontentVideo.cpp | 2 | ||||
-rwxr-xr-x | src/standards/Tizen/Mediacontent/JSAudio.cpp | 49 | ||||
-rwxr-xr-x | src/standards/Tizen/Mediacontent/JSImage.cpp | 9 | ||||
-rwxr-xr-x | src/standards/Tizen/Mediacontent/JSVideo.cpp | 45 | ||||
-rwxr-xr-x | src/standards/Tizen/Mediacontent/JSVideo.h | 6 | ||||
-rwxr-xr-x | src/standards/Tizen/Messaging/JSMessagingStorage.cpp | 46 |
8 files changed, 124 insertions, 43 deletions
diff --git a/debian/changelog b/debian/changelog index 3a16bc8..a7a3b2d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +wrt-plugins-tizen (0.2.85) unstable; urgency=low + + * Bug fix on Application + * Git : framework/web/wrt-plugins-tizen + * Tag : wrt-plugins-tizen_0.2.85 + + -- DongJin Choi <milkelf.choi@samsung.com> Sun, 16 Sep 2012 15:35:42 +0900 + wrt-plugins-tizen (0.2.84) unstable; urgency=low * Bug fix on Application diff --git a/packaging/wrt-plugins-tizen.spec b/packaging/wrt-plugins-tizen.spec index 263c9a8..1fbb308 100755 --- a/packaging/wrt-plugins-tizen.spec +++ b/packaging/wrt-plugins-tizen.spec @@ -1,6 +1,6 @@ Name: wrt-plugins-tizen Summary: JavaScript plugins for WebRuntime -Version: 0.2.84 +Version: 0.2.85 Release: 0 Group: TO_BE_FILLED License: TO_BE_FILLED diff --git a/src/platform/API/Mediacontent/MediacontentVideo.cpp b/src/platform/API/Mediacontent/MediacontentVideo.cpp index 8c60292..b7ef9ca 100755 --- a/src/platform/API/Mediacontent/MediacontentVideo.cpp +++ b/src/platform/API/Mediacontent/MediacontentVideo.cpp @@ -34,7 +34,7 @@ MediacontentVideo::MediacontentVideo() m_editableAttrList.push_back("playedTime"); m_editableAttrList.push_back("playCount"); m_editableAttrList.push_back("description"); - m_editableAttrList.push_back("orientation"); + m_editableAttrList.push_back("geolocation"); } MediacontentVideo::~MediacontentVideo() diff --git a/src/standards/Tizen/Mediacontent/JSAudio.cpp b/src/standards/Tizen/Mediacontent/JSAudio.cpp index bb458df..7c4cc85 100755 --- a/src/standards/Tizen/Mediacontent/JSAudio.cpp +++ b/src/standards/Tizen/Mediacontent/JSAudio.cpp @@ -544,8 +544,9 @@ bool JSAudio::setPropertyPlayCount( { Converter converter(context); MediacontentAudioPtr audio = getAudioObject(object); - int rating = converter.toInt(value); - audio->setAudioPlayCount(rating); + int count = converter.toInt(value); + LogDebug("count : " << count); + audio->setAudioPlayCount(count); return true; } Catch(Exception) @@ -600,6 +601,8 @@ bool JSAudio::setPropertyArtist( vector<std::string> artists; if (!JSValueIsNull(context, value)) { + if (JSIsArrayValue(context, value)) + { JSObjectRef jsObject = converter.toJSObjectRef(value); for (std::size_t i = 0; i < JSGetArrayLength(context, jsObject); ++i) { @@ -607,13 +610,24 @@ bool JSAudio::setPropertyArtist( artists.push_back(converter.toString(element)); } } + else + { + TizenApis::Commons::JSTizenExceptionFactory::postException(context, exception, TizenApis::Commons::JSTizenException::TYPE_MISMATCH_ERROR); + return false; + } + } + else + { + artists.push_back(converter.toString(value)); + } + audio->setAudioArtist(artists, true); return true; } Catch(Exception) { LogWarning("trying to set incorrect value"); - TizenApis::Commons::JSTizenExceptionFactory::postException(context, exception, TizenApis::Commons::JSTizenException::TYPE_MISMATCH_ERROR); + return TizenApis::Commons::JSTizenExceptionFactory::postException(context, exception, TizenApis::Commons::JSTizenException::TYPE_MISMATCH_ERROR); } return false; @@ -634,7 +648,10 @@ bool JSAudio::setPropertyComposer( MediacontentAudioPtr audio = getAudioObject(object); vector<std::string> composers; - if (!JSValueIsNull(context, value)) { + if (!JSValueIsNull(context, value) ) + { + if (JSIsArrayValue(context, value)) + { JSObjectRef jsObject = converter.toJSObjectRef(value); for (std::size_t i = 0; i < JSGetArrayLength(context, jsObject); ++i) { @@ -642,13 +659,19 @@ bool JSAudio::setPropertyComposer( composers.push_back(converter.toString(element)); } } + } + else + { + composers.push_back(converter.toString(value)); + } + audio->setAudioComposer(composers, true); return true; } Catch(Exception) { LogWarning("trying to set incorrect value"); - TizenApis::Commons::JSTizenExceptionFactory::postException(context, exception, TizenApis::Commons::JSTizenException::TYPE_MISMATCH_ERROR); + return TizenApis::Commons::JSTizenExceptionFactory::postException(context, exception, TizenApis::Commons::JSTizenException::TYPE_MISMATCH_ERROR); } return false; @@ -668,21 +691,31 @@ bool JSAudio::setPropertyGenre( MediacontentAudioPtr audio = getAudioObject(object); vector<std::string> genres; - if (!JSValueIsNull(context, value)) { + if (!JSValueIsNull(context, value) ) + { + if (JSIsArrayValue(context, value)) + { JSObjectRef jsObject = converter.toJSObjectRef(value); for (std::size_t i = 0; i < JSGetArrayLength(context, jsObject); ++i) { JSValueRef element = JSGetArrayElement(context, jsObject, i); genres.push_back(converter.toString(element)); } + + } + } + else + { + genres.push_back(converter.toString(value)); } - audio->setAudioComposer(genres, true); + + audio->setAudioGenre(genres, true); return true; } Catch(Exception) { LogWarning("trying to set incorrect value"); - TizenApis::Commons::JSTizenExceptionFactory::postException(context, exception, TizenApis::Commons::JSTizenException::TYPE_MISMATCH_ERROR); + return TizenApis::Commons::JSTizenExceptionFactory::postException(context, exception, TizenApis::Commons::JSTizenException::TYPE_MISMATCH_ERROR); } return false; diff --git a/src/standards/Tizen/Mediacontent/JSImage.cpp b/src/standards/Tizen/Mediacontent/JSImage.cpp index 3f00acf..a1813fc 100755 --- a/src/standards/Tizen/Mediacontent/JSImage.cpp +++ b/src/standards/Tizen/Mediacontent/JSImage.cpp @@ -21,6 +21,11 @@ #include <CommonsJavaScript/JSUtils.h> #include <CommonsJavaScript/JSDOMExceptionFactory.h> #include <Tizen/Tizen/JSSimpleCoordinates.h> + +#include <Tizen/Common/JSTizenExceptionFactory.h> +#include <Tizen/Common/JSTizenException.h> +#include <Tizen/Common/SecurityExceptions.h> + #include "JSMediacontent.h" #include "JSImage.h" @@ -32,6 +37,8 @@ #define TIZEN_MEDIACONTENT_IMAGE_ORIENTATION "orientation" using namespace TizenApis::Tizen1_0::Tizen; +using namespace TizenApis::Commons; +using namespace WrtDeviceApis::Commons; namespace TizenApis { namespace Tizen1_0 { @@ -242,6 +249,7 @@ bool JSImage::setPropertyOrientation( Catch(Exception) { LogWarning("trying to get incorrect value"); + return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR); } return false; @@ -272,6 +280,7 @@ bool JSImage::setPropertyGeolocation( Catch(Exception) { LogWarning("trying to get incorrect value"); + TizenApis::Commons::JSTizenExceptionFactory::postException(context, exception, TizenApis::Commons::JSTizenException::TYPE_MISMATCH_ERROR); } return false; diff --git a/src/standards/Tizen/Mediacontent/JSVideo.cpp b/src/standards/Tizen/Mediacontent/JSVideo.cpp index 0e6e57a..5e6b6d8 100755 --- a/src/standards/Tizen/Mediacontent/JSVideo.cpp +++ b/src/standards/Tizen/Mediacontent/JSVideo.cpp @@ -39,6 +39,8 @@ #define TIZEN_MEDIACONTENT_VIDEO_HEIGHT "height" using namespace TizenApis::Tizen1_0::Tizen; +using namespace TizenApis::Commons; +using namespace WrtDeviceApis::Commons; namespace TizenApis { namespace Tizen1_0 { @@ -166,6 +168,35 @@ JSValueRef JSVideo::getPropertyGeoLocation( return JSValueMakeUndefined(context); } +bool JSVideo::setPropertyGeoLocation( + JSContextRef context, + JSObjectRef object, + JSStringRef propertyName, + JSValueRef value, + JSValueRef* exception) +{ + LogDebug("entered"); + Try + { + Converter converter(context); + MediacontentVideoPtr video = getVideoObject(object); + + TizenApis::Api::Tizen::SimpleCoordinatesPtr geoLocation = + TizenApis::Tizen1_0::Tizen::JSSimpleCoordinates::getSimpleCoordinates(context, value); + + video->setVideoLatitude(geoLocation->getLatitude()); + video->setVideoLongitude(geoLocation->getLongitude()); + + return true; + } + Catch(Exception) + { + LogWarning("trying to get incorrect value"); + return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR); + } + return JSValueMakeUndefined(context); +} + JSValueRef JSVideo::getPropertyAlbum( JSContextRef context, @@ -365,8 +396,9 @@ bool JSVideo::setPropertyPlayCount( { Converter converter(context); MediacontentVideoPtr video = getVideoObject(object); - int rating = converter.toInt(value); - video->setVideoPlayCount(rating, true); + int count = converter.toInt(value); + LogDebug("count:" << count); + video->setVideoPlayCount(count, true); return true; } Catch(Exception) @@ -394,6 +426,9 @@ bool JSVideo::setPropertyArtists( vector<std::string> artists; if (!JSValueIsNull(context, value)) { + + if (JSIsArrayValue(context, value)) + { JSObjectRef jsObject = converter.toJSObjectRef(value); for (std::size_t i = 0; i < JSGetArrayLength(context, jsObject); ++i) { @@ -401,6 +436,12 @@ bool JSVideo::setPropertyArtists( artists.push_back(converter.toString(element)); } } + else + { + TizenApis::Commons::JSTizenExceptionFactory::postException(context, exception, TizenApis::Commons::JSTizenException::TYPE_MISMATCH_ERROR); + return false; + } + } video->setVideoArtist(artists, true); return true; } diff --git a/src/standards/Tizen/Mediacontent/JSVideo.h b/src/standards/Tizen/Mediacontent/JSVideo.h index 8397d5c..5f40193 100755 --- a/src/standards/Tizen/Mediacontent/JSVideo.h +++ b/src/standards/Tizen/Mediacontent/JSVideo.h @@ -159,6 +159,12 @@ private: JSValueRef value, JSValueRef* exception); + static bool setPropertyGeoLocation( + JSContextRef context, + JSObjectRef object, + JSStringRef propertyName, + JSValueRef value, + JSValueRef* exception); //todo-dykim //static JSValueRef setPropertyPlayedTime diff --git a/src/standards/Tizen/Messaging/JSMessagingStorage.cpp b/src/standards/Tizen/Messaging/JSMessagingStorage.cpp index 726186c..5f101f3 100755 --- a/src/standards/Tizen/Messaging/JSMessagingStorage.cpp +++ b/src/standards/Tizen/Messaging/JSMessagingStorage.cpp @@ -397,7 +397,7 @@ namespace Tizen1_0 { else // NOT nullable { LogDebug("Filter type is mismatched."); - Throw(ConversionException); + Throw(ConversionException); } } if(argumentCount >= 2) // successCallback @@ -421,7 +421,7 @@ namespace Tizen1_0 { else if(!Validator(context).isNullOrUndefined(arguments[2])) //nullable { LogDebug("ErrorCallback type is mismatched."); - Throw(ConversionException); + Throw(ConversionException); } } if(argumentCount >= 4) //optional SortMode? sortMode @@ -436,32 +436,24 @@ namespace Tizen1_0 { LogDebug("SortMode type is mismatched."); Throw(ConversionException); } - } + } if(argumentCount >= 5) //optional unsigned long? limit JSValueIsUndefined(context, arguments[0]), JSValueIsNull(context, arguments[0]) { if (!Validator(context).isNullOrUndefined(arguments[4])) { - if (!JSValueIsNumber(context, arguments[4])) - { - Throw(ConversionException); - } long limit = filterConverter->toULong(arguments[4]); event->setLimit(limit); - } - } + } + } if(argumentCount >= 6) //optional unsigned long? offset JSValueIsUndefined(context, arguments[0]), JSValueIsNull(context, arguments[0]) { if (!Validator(context).isNullOrUndefined(arguments[5])) { - if (!JSValueIsNumber(context, arguments[5])) - { - Throw(ConversionException); - } long offset = filterConverter->toULong(arguments[5]); event->setOffset(offset); } - } - + } + if(callbackManager) { callbackManager->setOnSuccess(onSuccessForCbm); @@ -907,7 +899,7 @@ namespace Tizen1_0 { else // NOT nullable { LogDebug("Filter type is mismatched."); - Throw(ConversionException); + Throw(ConversionException); } } if(argumentCount >= 2) // successCallback @@ -923,7 +915,7 @@ namespace Tizen1_0 { } } if(argumentCount >= 3) //optional ErrorCallback? errorCallback - { + { if(Validator(context).isCallback(arguments[2])) { onErrorForCbm = arguments[2]; @@ -931,7 +923,7 @@ namespace Tizen1_0 { else if(!Validator(context).isNullOrUndefined(arguments[2])) //nullable { LogDebug("ErrorCallback type is mismatched."); - Throw(ConversionException); + Throw(ConversionException); } } if(argumentCount >= 4) //optional SortMode? sortMode @@ -946,29 +938,21 @@ namespace Tizen1_0 { LogDebug("SortMode type is mismatched."); Throw(ConversionException); } - } + } if(argumentCount >= 5) //optional unsigned long? limit JSValueIsUndefined(context, arguments[0]), JSValueIsNull(context, arguments[0]) { if (!Validator(context).isNullOrUndefined(arguments[4])) { - if (!JSValueIsNumber(context, arguments[4])) - { - Throw(ConversionException); - } long limit = filterConverter->toULong(arguments[4]); event->setLimit(limit); - } - } + } + } if(argumentCount >= 6) //optional unsigned long? offset JSValueIsUndefined(context, arguments[0]), JSValueIsNull(context, arguments[0]) { if (!Validator(context).isNullOrUndefined(arguments[5])) { - if (!JSValueIsNumber(context, arguments[5])) - { - Throw(ConversionException); - } long offset = filterConverter->toULong(arguments[5]); - event->setOffset(offset); + event->setOffset(offset); } } if(callbackManager) @@ -977,7 +961,7 @@ namespace Tizen1_0 { callbackManager->setOnError(onErrorForCbm); callbackManager->setObject(thisObject); } - + event->setPrivateData(DPL::StaticPointerCast<WrtDeviceApis::Commons::IEventPrivateData >(callbackManager)); event->setForAsynchronousCall(&MessagingListener::getInstance()); event->setIndex(objectPriv->getIndex()); |