fixed bugs that media-data of place-image or place-review can be omitted 63/86363/3
authorchanywa <cbible.kim@samsung.com>
Wed, 31 Aug 2016 14:18:54 +0000 (23:18 +0900)
committerchanywa <cbible.kim@samsung.com>
Thu, 1 Sep 2016 04:58:27 +0000 (13:58 +0900)
Change-Id: I6fe8d890f6d606e57cd9987befc047c84ff6ae4e

19 files changed:
inc/engine/common/HereMaps_global.h
inc/engine/finder/BaseContent.h
inc/engine/routes/GeoRouteQuery.h
inc/here_place.h
lib/aarch64/libheremaps-engine.so.1
lib/aarch64/libheremaps-engine.so.1.0.6_17 [deleted file]
lib/aarch64/libheremaps-engine.so.1.0.6_18 [new file with mode: 0755]
lib/arm/libheremaps-engine.so.1
lib/arm/libheremaps-engine.so.1.0.6_17 [deleted file]
lib/arm/libheremaps-engine.so.1.0.6_18 [new file with mode: 0755]
lib/i586/libheremaps-engine.so.1
lib/i586/libheremaps-engine.so.1.0.6_17 [deleted file]
lib/i586/libheremaps-engine.so.1.0.6_18 [new file with mode: 0755]
lib/x86_64/libheremaps-engine.so.1
lib/x86_64/libheremaps-engine.so.1.0.6_17 [deleted file]
lib/x86_64/libheremaps-engine.so.1.0.6_18 [new file with mode: 0755]
maps-plugin-here.changes
packaging/maps-plugin-here.spec
src/here_place.cpp

index 3b5b6987ab76332ab78be34e2daabc52ea8d0021..cfe8530df81a830035c25fc2460eea2c17a203fa 100644 (file)
@@ -134,4 +134,7 @@ extern void Stopwatch_Show(int aIndex);
 extern void Stopwatch_Reset(int aIndex);
 HERE_MAPS_END_NAMESPACE
 
+#undef VERSION
+#define VERSION(a, b, c)       (((a) << 16) + ((b) << 8) + (c))
+
 #endif // HEREMAPS_GLOBAL_H
index 2abe7950889da6e6e629b337b56408eaf2ab99c9..d40241a46e70d6118c4bd9f43259b75d8c449047 100644 (file)
@@ -30,7 +30,7 @@ class LinkObject;
  * 
  * \ingroup finder
  */
-class BaseContent
+class EXPORT_API BaseContent
 {
 public:
 
index eb3480dbc2d1e41b02d9975bf3268d8609b95af9..6507c1e5dfc2dae400a379bc440dbc57ee011204 100644 (file)
@@ -19,6 +19,7 @@
 #define GEOROUTEQUERY_H
 
 #include <map>
+#include <time.h>
 
 #include "common/HereMaps_global.h"
 #include "common/BaseQuery.h"
@@ -371,6 +372,34 @@ public:
      * @return An integer indicating the realtime traffic status.
      */
     size_t GetRealtimeTraffic(void) const;
+
+    /**
+     * This method sets a value that indicates the departure time.
+     *
+     * @param time An value indicating the departure time.
+     */
+    void SetDepartureTime(time_t time);
+
+    /**
+     * This method retrieves a value that indicates the departure time.
+     *
+     * @return An value indicating the departure time.
+     */
+    time_t GetDepartureTime(void) const;
+
+    /**
+     * This method sets a value that indicates the arrival time.
+     *
+     * @param time An intevalueger indicating the arrival time.
+     */
+    void SetArrivalTime(time_t time);
+
+    /**
+     * This method retrieves a value that indicates the arrival time.
+     *
+     * @return An value indicating the arrival time.
+     */
+    time_t GetArrivalTime(void) const;
 #endif
 
     /**
index 76bff8a2536d7150b73cd19be9d5078cde090eeb..419e5a7e7aafd4681e086404a34693aa30081521 100644 (file)
@@ -32,6 +32,7 @@
 #include <maps_place_review_plugin.h>
 #include <maps_place_attribute_plugin.h>
 #include <maps_place_category.h>
+#include <maps_place_media_plugin.h>
 
 //map engine header
 #include <finder/DiscoveryQuery.h>
@@ -100,8 +101,11 @@ private:
        void ProcessPlaceDetails(PlaceDetails herePlace, maps_place_h mapsPlace);
        void ProcessPlaceReviews(PlaceDetails herePlace, maps_place_h mapsPlace);
        void ProcessPlaceRatings(PlaceDetails herePlace, maps_place_h mapsPlace);
-       void ProcessPlaceRated(PlaceDetails herePlace, maps_place_h mapsPlace);
+       void ProcessPlaceRelated(PlaceDetails herePlace, maps_place_h mapsPlace);
        void ProcessPlaceAttributes(PlaceDetails herePlace, maps_place_h mapsPlace);
+       void ProcessPlaceSupplier(PlaceDetails herePlace, maps_place_h mapsPlace);
+       bool ProcessPlaceMedia(BaseContent hereContent, maps_place_media_h mapsMedia);
+       bool ProcessPlaceLinkObject(LinkObject hereLinkObject, maps_place_link_object_h mapsLinkObject);
 
        void __sortList(PlaceList &list);
        void __flushReplies(int error);
index b3ec213fb8a917f32e4f5e119abeba5f602ba0da..8d230badc895fd668cc97ac3fceff60fef62bfcb 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_17
\ No newline at end of file
+libheremaps-engine.so.1.0.6_18
\ No newline at end of file
diff --git a/lib/aarch64/libheremaps-engine.so.1.0.6_17 b/lib/aarch64/libheremaps-engine.so.1.0.6_17
deleted file mode 100755 (executable)
index 5d43807..0000000
Binary files a/lib/aarch64/libheremaps-engine.so.1.0.6_17 and /dev/null differ
diff --git a/lib/aarch64/libheremaps-engine.so.1.0.6_18 b/lib/aarch64/libheremaps-engine.so.1.0.6_18
new file mode 100755 (executable)
index 0000000..3d4c363
Binary files /dev/null and b/lib/aarch64/libheremaps-engine.so.1.0.6_18 differ
index b3ec213fb8a917f32e4f5e119abeba5f602ba0da..8d230badc895fd668cc97ac3fceff60fef62bfcb 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_17
\ No newline at end of file
+libheremaps-engine.so.1.0.6_18
\ No newline at end of file
diff --git a/lib/arm/libheremaps-engine.so.1.0.6_17 b/lib/arm/libheremaps-engine.so.1.0.6_17
deleted file mode 100755 (executable)
index 84d9215..0000000
Binary files a/lib/arm/libheremaps-engine.so.1.0.6_17 and /dev/null differ
diff --git a/lib/arm/libheremaps-engine.so.1.0.6_18 b/lib/arm/libheremaps-engine.so.1.0.6_18
new file mode 100755 (executable)
index 0000000..8d26a6e
Binary files /dev/null and b/lib/arm/libheremaps-engine.so.1.0.6_18 differ
index b3ec213fb8a917f32e4f5e119abeba5f602ba0da..8d230badc895fd668cc97ac3fceff60fef62bfcb 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_17
\ No newline at end of file
+libheremaps-engine.so.1.0.6_18
\ No newline at end of file
diff --git a/lib/i586/libheremaps-engine.so.1.0.6_17 b/lib/i586/libheremaps-engine.so.1.0.6_17
deleted file mode 100755 (executable)
index a7bff41..0000000
Binary files a/lib/i586/libheremaps-engine.so.1.0.6_17 and /dev/null differ
diff --git a/lib/i586/libheremaps-engine.so.1.0.6_18 b/lib/i586/libheremaps-engine.so.1.0.6_18
new file mode 100755 (executable)
index 0000000..5d8be02
Binary files /dev/null and b/lib/i586/libheremaps-engine.so.1.0.6_18 differ
index b3ec213fb8a917f32e4f5e119abeba5f602ba0da..8d230badc895fd668cc97ac3fceff60fef62bfcb 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_17
\ No newline at end of file
+libheremaps-engine.so.1.0.6_18
\ No newline at end of file
diff --git a/lib/x86_64/libheremaps-engine.so.1.0.6_17 b/lib/x86_64/libheremaps-engine.so.1.0.6_17
deleted file mode 100755 (executable)
index e9a8145..0000000
Binary files a/lib/x86_64/libheremaps-engine.so.1.0.6_17 and /dev/null differ
diff --git a/lib/x86_64/libheremaps-engine.so.1.0.6_18 b/lib/x86_64/libheremaps-engine.so.1.0.6_18
new file mode 100755 (executable)
index 0000000..e302c29
Binary files /dev/null and b/lib/x86_64/libheremaps-engine.so.1.0.6_18 differ
index 0917ac5eedaaf18e5f5e7beae751f246bb22b016..55b2a8dd2b9d5d00a52b32e7c42936439936d0c6 100644 (file)
@@ -1,3 +1,8 @@
+[Version]   maps-plugin-here_0.3.5
+[Date]      31 Aug 2016
+[Title]     fixed bugs that media-data of place-image or place-review can be omitted
+[Developer] Seechan Kim <cbible.kim@samsung.com>
+
 [Version]   maps-plugin-here_0.3.4
 [Date]      24 Aug 2016
 [Title]     modified to flush gl buffer after rendering
index e38b1fc122a9a94f6349427a6e2543b4d26c6333..0e2b767dabb82c8005e48589a0ab9ec32c95f497 100644 (file)
@@ -1,6 +1,6 @@
 Name:       maps-plugin-here
 Summary:    Tizen HERE Maps Plug-in Library
-Version:    0.3.4
+Version:    0.3.5
 Release:    1
 Group:      Location/Libraries
 License:    Apache-2.0 and HERE
index 89e4cd467f985d3525de813ac91ff5be472b2b2d..2bca429ad8e15976049f4988010436cc50aa9414 100644 (file)
@@ -615,10 +615,12 @@ void HerePlace::OnPlaceDetailsReply(const PlaceDetailsReply &Reply)
 
                        ProcessPlaceRatings(herePlace, mapsPlace);
 
-                       ProcessPlaceRated(herePlace, mapsPlace);
+                       ProcessPlaceRelated(herePlace, mapsPlace);
 
                        ProcessPlaceAttributes(herePlace, mapsPlace);
 
+                       ProcessPlaceSupplier(herePlace, mapsPlace);
+
                        if (!isPending)
                                m_PlaceList.push_back(mapsPlace);
 
@@ -850,9 +852,9 @@ void HerePlace::ProcessPlaceImages(PlaceDetails herePlace, maps_place_h mapsPlac
        maps_item_list_h mapsImageList;
        maps_place_image_h mapsImage;
        maps_place_link_object_h mapsImageUser;
-       LinkObject hereImageUser;
+       maps_place_media_h mapsImageMedia;
        int error;
-       bool is_valid, is_valid2;
+       bool is_valid;
 
        if (hereImageList.empty()) return;
 
@@ -864,10 +866,9 @@ void HerePlace::ProcessPlaceImages(PlaceDetails herePlace, maps_place_h mapsPlac
                is_valid = false;
 
                /* here not supported
-               // maps_place_image_set_height(maps_place_image_h mapsPlace, const int height); */
-
-               /* here not supported
-               // maps_place_image_set_media(maps_place_image_h mapsPlace, maps_place_media_h media); */
+                  maps_place_image_set_height(maps_place_image_h mapsPlace, const int height);
+                  maps_place_image_set_width(maps_place_image_h mapsPlace, const int height);
+               */
 
                if (!hereImage->GetSource().empty()) {
                        error = maps_place_image_set_url(mapsImage, (char*)hereImage->GetSource().c_str());
@@ -879,41 +880,22 @@ void HerePlace::ProcessPlaceImages(PlaceDetails herePlace, maps_place_h mapsPlac
                        is_valid |= (error == MAPS_ERROR_NONE);
                }
 
-               hereImageUser = hereImage->GetUser();
                if (maps_place_link_object_create(&mapsImageUser) == MAPS_ERROR_NONE) {
-                       is_valid2 = false;
-
-                       if (!hereImageUser.GetId().empty()) {
-                               error = maps_place_link_object_set_id(mapsImageUser,
-                                               (char*)hereImageUser.GetId().c_str());
-                               is_valid2 |= (error == MAPS_ERROR_NONE);
-                       }
-
-                       if (!hereImageUser.GetTitle().empty()) {
-                               error = maps_place_link_object_set_name(mapsImageUser,
-                                               (char*)hereImageUser.GetTitle().c_str());
-                               is_valid2 |= (error == MAPS_ERROR_NONE);
-                       }
-
-                       if (!hereImageUser.GetHref().empty()) {
-                               error = maps_place_link_object_set_string(mapsImageUser,
-                                               (char*)hereImageUser.GetHref().c_str());
-                               is_valid2 |= (error == MAPS_ERROR_NONE);
-                       }
-
-                       if (!hereImageUser.GetType().empty()) {
-                               error = maps_place_link_object_set_type(mapsImageUser,
-                                               (char*)hereImageUser.GetType().c_str());
-                               is_valid2 |= (error == MAPS_ERROR_NONE);
-                       }
-
-                       if (is_valid2) {
+                       if (ProcessPlaceLinkObject(hereImage->GetUser(), mapsImageUser)) {
                                maps_place_image_set_user_link(mapsImage, mapsImageUser);
-                               is_valid |= is_valid2;
+                               is_valid = true;
                        }
                        maps_place_link_object_destroy(mapsImageUser);
                }
 
+               if (maps_place_media_create(&mapsImageMedia) == MAPS_ERROR_NONE) {
+                       if (ProcessPlaceMedia(*hereImage, mapsImageMedia)) {
+                               maps_place_image_set_media(mapsImage, mapsImageMedia);
+                               is_valid = true;
+                       }
+                       maps_place_media_destroy(mapsImageMedia);
+               }
+
                if (is_valid)
                        maps_item_list_append(mapsImageList, mapsImage, maps_place_image_clone);
 
@@ -980,8 +962,9 @@ void HerePlace::ProcessPlaceReviews(PlaceDetails herePlace, maps_place_h mapsPla
        maps_item_list_h mapsReviewList;
        LinkObject hereReviewUser;
        maps_place_link_object_h mapsReviewUser;
+       maps_place_media_h mapsReviewMedia;
        int error;
-       bool is_valid, is_valid2;
+       bool is_valid;
 
        if (hereReviewList.empty()) return;
 
@@ -1010,8 +993,6 @@ void HerePlace::ProcessPlaceReviews(PlaceDetails herePlace, maps_place_h mapsPla
                        is_valid |= (error == MAPS_ERROR_NONE);
                }
 
-               /* maps_place_review_set_media(mapsReview, maps_place_media_h media) */
-
                maps_place_review_set_rating(mapsReview, hereReview->GetRating());
 
                if (!hereReview->GetTitle().empty()) {
@@ -1020,42 +1001,22 @@ void HerePlace::ProcessPlaceReviews(PlaceDetails herePlace, maps_place_h mapsPla
                        is_valid |= (error == MAPS_ERROR_NONE);
                }
 
-               hereReviewUser = hereReview->GetUser();
                if (maps_place_link_object_create(&mapsReviewUser) == MAPS_ERROR_NONE) {
-                       is_valid2 = false;
-
-                       if (!hereReviewUser.GetId().empty()) {
-                               error = maps_place_link_object_set_id(mapsReviewUser,
-                                       (char*)hereReviewUser.GetId().c_str());
-                               is_valid2 |= (error == MAPS_ERROR_NONE);
-                       }
-
-                       if (!hereReviewUser.GetTitle().empty()) {
-                               error = maps_place_link_object_set_name(mapsReviewUser,
-                                       (char*)hereReviewUser.GetTitle().c_str());
-                               is_valid2 |= (error == MAPS_ERROR_NONE);
-                       }
-
-                       if (!hereReviewUser.GetHref().empty()) {
-                               error = maps_place_link_object_set_string(mapsReviewUser,
-                                       (char*)hereReviewUser.GetHref().c_str());
-                               is_valid2 |= (error == MAPS_ERROR_NONE);
-                       }
-
-                       if (!hereReviewUser.GetType().empty()) {
-                               error = maps_place_link_object_set_type(mapsReviewUser,
-                                       (char*)hereReviewUser.GetType().c_str());
-                               is_valid2 |= (error == MAPS_ERROR_NONE);
-                       }
-
-                       if (is_valid2) {
+                       if (ProcessPlaceLinkObject(hereReview->GetUser(), mapsReviewUser)) {
                                maps_place_review_set_user_link(mapsReview, mapsReviewUser);
-                               is_valid |= is_valid2;
+                               is_valid =  true;
                        }
-
                        maps_place_link_object_destroy(mapsReviewUser);
                }
 
+               if (maps_place_media_create(&mapsReviewMedia) == MAPS_ERROR_NONE) {
+                       if (ProcessPlaceMedia(*hereReview, mapsReviewMedia)) {
+                               maps_place_review_set_media(mapsReview, mapsReviewMedia);
+                               is_valid = true;
+                       }
+                       maps_place_media_destroy(mapsReviewMedia);
+               }
+
                if (is_valid)
                        maps_item_list_append(mapsReviewList, mapsReview, maps_place_review_clone);
 
@@ -1082,7 +1043,7 @@ void HerePlace::ProcessPlaceRatings(PlaceDetails herePlace, maps_place_h mapsPla
        maps_place_rating_destroy(mapsRating);
 }
 
-void HerePlace::ProcessPlaceRated(PlaceDetails herePlace, maps_place_h mapsPlace)
+void HerePlace::ProcessPlaceRelated(PlaceDetails herePlace, maps_place_h mapsPlace)
 {
        RelatedItem hereRelated = herePlace.GetRelatedItem();
        maps_place_link_object_h mapsRelated;
@@ -1091,8 +1052,7 @@ void HerePlace::ProcessPlaceRated(PlaceDetails herePlace, maps_place_h mapsPlace
 
        if (maps_place_link_object_create(&mapsRelated) != MAPS_ERROR_NONE) return;
 
-       //need to check if GetId() exist
-       //maps_place_link_object_set_id(mapsRelated, hereRelated.GetId());
+       maps_place_link_object_set_id(mapsRelated, "recommended");
 
        if (!hereRelated.GetTitle().empty()) {
                error = maps_place_link_object_set_name(mapsRelated,
@@ -1168,6 +1128,78 @@ void HerePlace::ProcessPlaceAttributes(PlaceDetails herePlace, maps_place_h maps
        maps_item_list_destroy(mapsAttributeList);
 }
 
+void HerePlace::ProcessPlaceSupplier(PlaceDetails herePlace, maps_place_h mapsPlace)
+{
+       maps_place_link_object_h mapsLinkObject;
+
+       if (maps_place_link_object_create(&mapsLinkObject) == MAPS_ERROR_NONE) {
+               if (ProcessPlaceLinkObject(herePlace.GetBaseContent().GetSupplier(), mapsLinkObject))
+                       maps_place_set_supplier_link(mapsPlace, mapsLinkObject);
+               maps_place_link_object_destroy(mapsLinkObject);
+       }
+}
+
+bool HerePlace::ProcessPlaceMedia(BaseContent hereContent, maps_place_media_h mapsMedia)
+{
+       int error;
+       bool is_valid = false;
+       maps_place_link_object_h mapsLinkObject;
+
+       if (!hereContent.GetAttribution().empty()) {
+               error = maps_place_media_set_attribution(mapsMedia,
+                               (char*)hereContent.GetAttribution().c_str());
+               is_valid = (error == MAPS_ERROR_NONE);
+       }
+
+       if (maps_place_link_object_create(&mapsLinkObject) == MAPS_ERROR_NONE) {
+               if (ProcessPlaceLinkObject(hereContent.GetSupplier(), mapsLinkObject)) {
+                       maps_place_media_set_supplier(mapsMedia, mapsLinkObject);
+                       is_valid =  true;
+               }
+               maps_place_link_object_destroy(mapsLinkObject);
+       }
+
+       if (maps_place_link_object_create(&mapsLinkObject) == MAPS_ERROR_NONE) {
+               if (ProcessPlaceLinkObject(hereContent.GetVia(), mapsLinkObject)) {
+                       maps_place_media_set_via(mapsMedia, mapsLinkObject);
+                       is_valid =  true;
+               }
+               maps_place_link_object_destroy(mapsLinkObject);
+       }
+       return is_valid;
+}
+
+bool HerePlace::ProcessPlaceLinkObject(LinkObject hereLinkObject, maps_place_link_object_h mapsLinkObject)
+{
+       int error;
+       bool is_valid = false;
+
+       if (!hereLinkObject.GetId().empty()) {
+               error = maps_place_link_object_set_id(mapsLinkObject,
+                               (char*)hereLinkObject.GetId().c_str());
+               is_valid |= (error == MAPS_ERROR_NONE);
+       }
+
+       if (!hereLinkObject.GetTitle().empty()) {
+               error = maps_place_link_object_set_name(mapsLinkObject,
+                               (char*)hereLinkObject.GetTitle().c_str());
+               is_valid |= (error == MAPS_ERROR_NONE);
+       }
+
+       if (!hereLinkObject.GetHref().empty()) {
+               error = maps_place_link_object_set_string(mapsLinkObject,
+                               (char*)hereLinkObject.GetHref().c_str());
+               is_valid |= (error == MAPS_ERROR_NONE);
+       }
+
+       if (!hereLinkObject.GetType().empty()) {
+               error = maps_place_link_object_set_type(mapsLinkObject,
+                               (char*)hereLinkObject.GetType().c_str());
+               is_valid |= (error == MAPS_ERROR_NONE);
+       }
+       return is_valid;
+}
+
 void HerePlace::__flushReplies(int error)
 {
        maps_place_h mapsPlace;