+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
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
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()
{
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)
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) {
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;
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) {
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;
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;
#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"
#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 {
Catch(Exception)
{
LogWarning("trying to get incorrect value");
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR);
}
return false;
Catch(Exception)
{
LogWarning("trying to get incorrect value");
+ TizenApis::Commons::JSTizenExceptionFactory::postException(context, exception, TizenApis::Commons::JSTizenException::TYPE_MISMATCH_ERROR);
}
return false;
#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 {
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,
{
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)
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) {
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;
}
JSValueRef value,
JSValueRef* exception);
+ static bool setPropertyGeoLocation(
+ JSContextRef context,
+ JSObjectRef object,
+ JSStringRef propertyName,
+ JSValueRef value,
+ JSValueRef* exception);
//todo-dykim
//static JSValueRef setPropertyPlayedTime
else // NOT nullable
{
LogDebug("Filter type is mismatched.");
- Throw(ConversionException);
+ Throw(ConversionException);
}
}
if(argumentCount >= 2) // successCallback
else if(!Validator(context).isNullOrUndefined(arguments[2])) //nullable
{
LogDebug("ErrorCallback type is mismatched.");
- Throw(ConversionException);
+ Throw(ConversionException);
}
}
if(argumentCount >= 4) //optional SortMode? sortMode
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);
else // NOT nullable
{
LogDebug("Filter type is mismatched.");
- Throw(ConversionException);
+ Throw(ConversionException);
}
}
if(argumentCount >= 2) // successCallback
}
}
if(argumentCount >= 3) //optional ErrorCallback? errorCallback
- {
+ {
if(Validator(context).isCallback(arguments[2]))
{
onErrorForCbm = arguments[2];
else if(!Validator(context).isNullOrUndefined(arguments[2])) //nullable
{
LogDebug("ErrorCallback type is mismatched.");
- Throw(ConversionException);
+ Throw(ConversionException);
}
}
if(argumentCount >= 4) //optional SortMode? sortMode
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)
callbackManager->setOnError(onErrorForCbm);
callbackManager->setObject(thisObject);
}
-
+
event->setPrivateData(DPL::StaticPointerCast<WrtDeviceApis::Commons::IEventPrivateData >(callbackManager));
event->setForAsynchronousCall(&MessagingListener::getInstance());
event->setIndex(objectPriv->getIndex());