Update change log and spec for wrt-plugins-tizen_0.2.85 2.0alpha master 2.0_alpha submit/master/20120920.151155
authorDongjin Choi <milkelf.choi@samsung.com>
Sun, 16 Sep 2012 06:51:55 +0000 (15:51 +0900)
committerDongjin Choi <milkelf.choi@samsung.com>
Sun, 16 Sep 2012 07:08:27 +0000 (16:08 +0900)
Changed Modules : Messaging, MediaContent

[Version] 0.2.85
[Project] GT-I8800,Public
[Title] SEL Verification
[Team] WebAPI
[BinType] PDA
[Customer] Open

[MediaContent] Fixed MediaContent SE UnitTC Error.

[Title] Fixed setArtist, setGenres bug & Video's setGeolocation function was implemented.
[Problem] Was not able to handle the error in a setArtist & setGenres function.
          And video's setGeolocation function was missing.
[Solution] fixed bug & implemented function.
[SCMRequest] N/A

[Messaging] SE_UNIT TC bug fix

[Issue] findMessage and findConversation bug fix
[Problem] exception on limit param with true
[Cause] exception on limit param with true
[Solution] change true to 1 on limit and offset
[SCMRequest] N/A

Change-Id: Ic7877922f7753b421a4af3f773069ff72a5303b1

debian/changelog
packaging/wrt-plugins-tizen.spec
src/platform/API/Mediacontent/MediacontentVideo.cpp
src/standards/Tizen/Mediacontent/JSAudio.cpp
src/standards/Tizen/Mediacontent/JSImage.cpp
src/standards/Tizen/Mediacontent/JSVideo.cpp
src/standards/Tizen/Mediacontent/JSVideo.h
src/standards/Tizen/Messaging/JSMessagingStorage.cpp

index 3a16bc8..a7a3b2d 100644 (file)
@@ -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
index 263c9a8..1fbb308 100755 (executable)
@@ -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
index 8c60292..b7ef9ca 100755 (executable)
@@ -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()
index bb458df..7c4cc85 100755 (executable)
@@ -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;
index 3f00acf..a1813fc 100755 (executable)
 #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;
index 0e6e57a..5e6b6d8 100755 (executable)
@@ -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;
     }
index 8397d5c..5f40193 100755 (executable)
@@ -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
index 726186c..5f101f3 100755 (executable)
@@ -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());