From 2767d87ea7b9858a285f0c106262891d834422de Mon Sep 17 00:00:00 2001 From: Date: Tue, 30 Jun 2015 17:14:02 +0200 Subject: poi-manager-client under test, create/remove category OK --- api/.gitignore | 1 + .../navigation/poiservice/POIServiceTypes.fidl | 18 +- .../navigation/poiservice/POIServiceTypes.cpp | 166 ---------- .../genivi/navigation/poiservice/POIServiceTypes.h | 98 +----- api/poi-service/CMakeLists.txt | 1 + .../genivi-poiservice-contentmanager.xml | 368 +++++++++++++++++++++ 6 files changed, 373 insertions(+), 279 deletions(-) create mode 100644 api/poi-service/genivi-poiservice-contentmanager.xml (limited to 'api') diff --git a/api/.gitignore b/api/.gitignore index 9d6e68e..65a2c4a 100644 --- a/api/.gitignore +++ b/api/.gitignore @@ -1,5 +1,6 @@ #folder used for downloading external APIs .project +.classpath CMakeCache.txt cmake_install.cmake Makefile diff --git a/api/franca/navigation/poiservice/POIServiceTypes.fidl b/api/franca/navigation/poiservice/POIServiceTypes.fidl index fdcf3a4..46a297f 100755 --- a/api/franca/navigation/poiservice/POIServiceTypes.fidl +++ b/api/franca/navigation/poiservice/POIServiceTypes.fidl @@ -78,21 +78,7 @@ typeCollection POIServiceTypes { String stringValue Boolean boolValue } - - struct AttributeValueStruct polymorphic {} - - struct AttributeValueStructInt32 extends AttributeValueStruct { - Int32 intValue - } - - struct AttributeValueStructString extends AttributeValueStruct { - String stringValue - } - - struct AttributeValueStructBoolean extends AttributeValueStruct { - Boolean boolValue - } - + <** @description:**> struct Details { <** @description : list of parent categories unique id.**> @@ -333,7 +319,7 @@ typeCollection POIServiceTypes { String name <** @description:POI location.**> Coordinate3D location - <** @description: array[struct(name,type,value)].**> + <** @description: array[struct(id,type,value)].**> PoiAttribute[] attributes } diff --git a/api/franca/navigation/src-gen/org/genivi/navigation/poiservice/POIServiceTypes.cpp b/api/franca/navigation/src-gen/org/genivi/navigation/poiservice/POIServiceTypes.cpp index 3c7bc3c..021a56e 100644 --- a/api/franca/navigation/src-gen/org/genivi/navigation/poiservice/POIServiceTypes.cpp +++ b/api/franca/navigation/src-gen/org/genivi/navigation/poiservice/POIServiceTypes.cpp @@ -28,172 +28,6 @@ namespace POIServiceTypes { - -AttributeValueStruct* AttributeValueStruct::createInstance(const uint32_t& serialId) { - if (serialId == SERIAL_ID) - return new AttributeValueStruct; - - const std::function createDerivedInstanceFuncs[] = { - [&]() { return AttributeValueStructInt32::createInstance(serialId); }, - [&]() { return AttributeValueStructString::createInstance(serialId); }, - [&]() { return AttributeValueStructBoolean::createInstance(serialId); } - }; - - for (auto& createDerivedInstanceFunc : createDerivedInstanceFuncs) { - AttributeValueStruct* derivedInstance = createDerivedInstanceFunc(); - if (derivedInstance != NULL) - return derivedInstance; - } - - return NULL; -} - -uint32_t AttributeValueStruct::getSerialId() const { - return SERIAL_ID; -} - -void AttributeValueStruct::createTypeSignature(CommonAPI::TypeOutputStream& typeOutputStream) const { - AttributeValueStruct::writeToTypeOutputStream(typeOutputStream); -} - -bool operator==(const AttributeValueStruct& lhs, const AttributeValueStruct& rhs) { - if (&lhs == &rhs) - return true; - - return - true - ; -} - -void AttributeValueStruct::readFromInputStream(CommonAPI::InputStream& inputStream) { -} - -void AttributeValueStruct::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { -} - -AttributeValueStructInt32::AttributeValueStructInt32(const int32_t& intValueValue): - AttributeValueStruct(), - intValue(intValueValue) -{ -} - -AttributeValueStructInt32* AttributeValueStructInt32::createInstance(const uint32_t& serialId) { - if (serialId == SERIAL_ID) - return new AttributeValueStructInt32; - - return NULL; -} - -uint32_t AttributeValueStructInt32::getSerialId() const { - return SERIAL_ID; -} - -void AttributeValueStructInt32::createTypeSignature(CommonAPI::TypeOutputStream& typeOutputStream) const { - AttributeValueStructInt32::writeToTypeOutputStream(typeOutputStream); -} - -bool operator==(const AttributeValueStructInt32& lhs, const AttributeValueStructInt32& rhs) { - if (&lhs == &rhs) - return true; - - return - static_cast(lhs) == static_cast(rhs) && - lhs.intValue == rhs.intValue - ; -} - -void AttributeValueStructInt32::readFromInputStream(CommonAPI::InputStream& inputStream) { - AttributeValueStruct::readFromInputStream(inputStream); - inputStream >> intValue; -} - -void AttributeValueStructInt32::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { - AttributeValueStruct::writeToOutputStream(outputStream); - outputStream << intValue; -} - -AttributeValueStructString::AttributeValueStructString(const std::string& stringValueValue): - AttributeValueStruct(), - stringValue(stringValueValue) -{ -} - -AttributeValueStructString* AttributeValueStructString::createInstance(const uint32_t& serialId) { - if (serialId == SERIAL_ID) - return new AttributeValueStructString; - - return NULL; -} - -uint32_t AttributeValueStructString::getSerialId() const { - return SERIAL_ID; -} - -void AttributeValueStructString::createTypeSignature(CommonAPI::TypeOutputStream& typeOutputStream) const { - AttributeValueStructString::writeToTypeOutputStream(typeOutputStream); -} - -bool operator==(const AttributeValueStructString& lhs, const AttributeValueStructString& rhs) { - if (&lhs == &rhs) - return true; - - return - static_cast(lhs) == static_cast(rhs) && - lhs.stringValue == rhs.stringValue - ; -} - -void AttributeValueStructString::readFromInputStream(CommonAPI::InputStream& inputStream) { - AttributeValueStruct::readFromInputStream(inputStream); - inputStream >> stringValue; -} - -void AttributeValueStructString::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { - AttributeValueStruct::writeToOutputStream(outputStream); - outputStream << stringValue; -} - -AttributeValueStructBoolean::AttributeValueStructBoolean(const bool& boolValueValue): - AttributeValueStruct(), - boolValue(boolValueValue) -{ -} - -AttributeValueStructBoolean* AttributeValueStructBoolean::createInstance(const uint32_t& serialId) { - if (serialId == SERIAL_ID) - return new AttributeValueStructBoolean; - - return NULL; -} - -uint32_t AttributeValueStructBoolean::getSerialId() const { - return SERIAL_ID; -} - -void AttributeValueStructBoolean::createTypeSignature(CommonAPI::TypeOutputStream& typeOutputStream) const { - AttributeValueStructBoolean::writeToTypeOutputStream(typeOutputStream); -} - -bool operator==(const AttributeValueStructBoolean& lhs, const AttributeValueStructBoolean& rhs) { - if (&lhs == &rhs) - return true; - - return - static_cast(lhs) == static_cast(rhs) && - lhs.boolValue == rhs.boolValue - ; -} - -void AttributeValueStructBoolean::readFromInputStream(CommonAPI::InputStream& inputStream) { - AttributeValueStruct::readFromInputStream(inputStream); - inputStream >> boolValue; -} - -void AttributeValueStructBoolean::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { - AttributeValueStruct::writeToOutputStream(outputStream); - outputStream << boolValue; -} - Details::Details(const std::vector& parentsIdValue, const Icon& iconsValue, const std::string& nameValue, const std::string& shortDescValue, const Media& mediaValue): parentsId(parentsIdValue), icons(iconsValue), diff --git a/api/franca/navigation/src-gen/org/genivi/navigation/poiservice/POIServiceTypes.h b/api/franca/navigation/src-gen/org/genivi/navigation/poiservice/POIServiceTypes.h index 479e6c7..f658ba7 100644 --- a/api/franca/navigation/src-gen/org/genivi/navigation/poiservice/POIServiceTypes.h +++ b/api/franca/navigation/src-gen/org/genivi/navigation/poiservice/POIServiceTypes.h @@ -125,86 +125,6 @@ namespace POIServiceTypes { * values for attribute. */ typedef CommonAPI::Variant AttributeValue; - struct AttributeValueStruct: CommonAPI::SerializablePolymorphicStruct { - - AttributeValueStruct() = default; - - enum: uint32_t { SERIAL_ID = 0x1d47fc57 }; - - static AttributeValueStruct* createInstance(const uint32_t& serialId); - - virtual uint32_t getSerialId() const; - virtual void createTypeSignature(CommonAPI::TypeOutputStream& typeOutputStream) const; - - virtual void readFromInputStream(CommonAPI::InputStream& inputStream); - virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; - - static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { - } - }; - struct AttributeValueStructInt32: AttributeValueStruct { - int32_t intValue; - - AttributeValueStructInt32() = default; - AttributeValueStructInt32(const int32_t& intValue); - - enum: uint32_t { SERIAL_ID = 0xebabbc39 }; - - static AttributeValueStructInt32* createInstance(const uint32_t& serialId); - - virtual uint32_t getSerialId() const; - virtual void createTypeSignature(CommonAPI::TypeOutputStream& typeOutputStream) const; - - virtual void readFromInputStream(CommonAPI::InputStream& inputStream); - virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; - - static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { - AttributeValueStruct::writeToTypeOutputStream(typeOutputStream); - typeOutputStream.writeInt32Type(); - } - }; - struct AttributeValueStructString: AttributeValueStruct { - std::string stringValue; - - AttributeValueStructString() = default; - AttributeValueStructString(const std::string& stringValue); - - enum: uint32_t { SERIAL_ID = 0x84441672 }; - - static AttributeValueStructString* createInstance(const uint32_t& serialId); - - virtual uint32_t getSerialId() const; - virtual void createTypeSignature(CommonAPI::TypeOutputStream& typeOutputStream) const; - - virtual void readFromInputStream(CommonAPI::InputStream& inputStream); - virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; - - static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { - AttributeValueStruct::writeToTypeOutputStream(typeOutputStream); - typeOutputStream.writeStringType(); - } - }; - struct AttributeValueStructBoolean: AttributeValueStruct { - bool boolValue; - - AttributeValueStructBoolean() = default; - AttributeValueStructBoolean(const bool& boolValue); - - enum: uint32_t { SERIAL_ID = 0xa6ee8ff6 }; - - static AttributeValueStructBoolean* createInstance(const uint32_t& serialId); - - virtual uint32_t getSerialId() const; - virtual void createTypeSignature(CommonAPI::TypeOutputStream& typeOutputStream) const; - - virtual void readFromInputStream(CommonAPI::InputStream& inputStream); - virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; - - static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { - AttributeValueStruct::writeToTypeOutputStream(typeOutputStream); - typeOutputStream.writeBoolType(); - } - }; /** * */ @@ -977,7 +897,7 @@ namespace POIServiceTypes { */ NavigationTypes::Coordinate3D location; /** - * array[struct(name,type,value)]. + * array[struct(id,type,value)]. */ std::vector attributes; @@ -1085,22 +1005,6 @@ struct UpdateReasonComparator { } }; -bool operator==(const AttributeValueStruct& lhs, const AttributeValueStruct& rhs); -inline bool operator!=(const AttributeValueStruct& lhs, const AttributeValueStruct& rhs) { - return !(lhs == rhs); -} -bool operator==(const AttributeValueStructInt32& lhs, const AttributeValueStructInt32& rhs); -inline bool operator!=(const AttributeValueStructInt32& lhs, const AttributeValueStructInt32& rhs) { - return !(lhs == rhs); -} -bool operator==(const AttributeValueStructString& lhs, const AttributeValueStructString& rhs); -inline bool operator!=(const AttributeValueStructString& lhs, const AttributeValueStructString& rhs) { - return !(lhs == rhs); -} -bool operator==(const AttributeValueStructBoolean& lhs, const AttributeValueStructBoolean& rhs); -inline bool operator!=(const AttributeValueStructBoolean& lhs, const AttributeValueStructBoolean& rhs) { - return !(lhs == rhs); -} bool operator==(const Details& lhs, const Details& rhs); inline bool operator!=(const Details& lhs, const Details& rhs) { return !(lhs == rhs); diff --git a/api/poi-service/CMakeLists.txt b/api/poi-service/CMakeLists.txt index 12c93e8..af9e7f0 100644 --- a/api/poi-service/CMakeLists.txt +++ b/api/poi-service/CMakeLists.txt @@ -25,6 +25,7 @@ find_program(DBUSXML2CPP dbusxx-xml2cpp REQUIRED) file (GLOB XML_TO_DBUS ${CMAKE_CURRENT_SOURCE_DIR}/genivi-poiservice-contentaccessmodule.xml + ${CMAKE_CURRENT_SOURCE_DIR}/genivi-poiservice-contentmanager.xml ${CMAKE_CURRENT_SOURCE_DIR}/genivi-poiservice-poicontentaccess.xml ${CMAKE_CURRENT_SOURCE_DIR}/genivi-poiservice-poisearch.xml ${CMAKE_CURRENT_SOURCE_DIR}/genivi-poiservice-configuration.xml diff --git a/api/poi-service/genivi-poiservice-contentmanager.xml b/api/poi-service/genivi-poiservice-contentmanager.xml new file mode 100644 index 0000000..1fbda33 --- /dev/null +++ b/api/poi-service/genivi-poiservice-contentmanager.xml @@ -0,0 +1,368 @@ + + + + + 1.0 + + + getVersion = This method returns the API version implemented by the content access module. + + + + version (of type Version) = . + Version struct[versionMajor, versionMinor, versionMicro, date] = version. + Version.versionMajor ('q') = when the major changes, then backward compatibility with previous releases is not granted. + Version.versionMinor ('q') = when the minor changes, then backward compatibility with previous releases is granted, but something changed in the implementation of the API (e.g. new methods may have been added). + Version.versionMicro ('q') = when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications). + Version.date ('s') = release date (e.g. 21-06-2011). + + + + + + setLocale = Set the current language set for the search by poi provider module. + The language defines the poi and categories name and details language. If the language is not supported, the default details will be returned in the native language. + + + + languageCode = the language to be used. ISO 639‐3 language code (lower case) + + + + + countryCode = the country specific variant for the language to be used. ISO 3166‐1 alpha 3 country code (upper case) + + + + + scriptCode = the script specific variant for the language to be used. ISO 15924 alpha 4 script code (upper case) + + + + + + getLocale = Get the current language set for the search by poi provider module. + + + + languageCode = the language used. ISO 639‐3 language code (lower case) + + + + + countryCode = the country specific variant for the language used. ISO 3166‐1 alpha 3 country code (upper case) + + + + + scriptCode = the script specific variant for the language used. ISO 15924 alpha 4 script code (upper case) + + + + + + getSupportedLocales = Get the supported set of locales for the search by poi provider module. + + + + localeList = array[struct(languageCode,countryCode,scriptCode)] + + + + + + getAvailableCategories = This method retrieves the list od POI categories available (pre-defined and custom). + + + + categories (of type CategoryAndName) = List of categories (id, name and top_level). + CategoryAndName struct[uniqueId, name, topLevel] = pair of category and name + CategoryAndName.uniqueId ('?') = Category unique id. + CategoryAndName.name ('s') = name. + CategoryAndName.topLevel ('b') = true if the category is a pre-defined one (top level), false for customized categories created by plug-in. + + + + + + getRootCategory = Get the root category id. That would be ALL_CATEGORIES. + + + + category (of type CategoryID) = The root category is a top level one by design. + lineComment to be defined + + + + + + getChildrenCategories = Get the children categories id and type (top level) from the a parent unique id. + + + + category (of type CategoryID) = unique category id. + lineComment to be defined + + + + + categories (of type CategoryAndLevel) = List of categories (id and top_level). + CategoryAndLevel struct[uniqueId, topLevel] = Pair of catgory and description of level + CategoryAndLevel.uniqueId ('?') = Category unique id. + CategoryAndLevel.topLevel ('b') = true if the category is a pre-defined one (top level), false for customized categories created by plug-in. + + + + + + getParentCategories = Get the parent categories id and type (top level) from the a unique id. + + + + category (of type CategoryID) = unique category id. + lineComment to be defined + + + + + categories (of type CategoryAndLevel) = List of categories (id and top_level). + CategoryAndLevel struct[uniqueId, topLevel] = Pair of catgory and description of level + CategoryAndLevel.uniqueId ('?') = Category unique id. + CategoryAndLevel.topLevel ('b') = true if the category is a pre-defined one (top level), false for customized categories created by plug-in. + + + + + + createCategory = Creates a category by name and return an unique id. + + + + category (of type CAMCategory) = List of details for the category to create. + CAMCategory struct[details, attributes, sortOptions] = + CAMCategory.details ('?') = struct(list of parents_id, icons, name, short_desc, media). + CAMCategory.attributes ('?') = array[struct(name, type, array[struct(operator_id, operator_name)])]. + CAMCategory.sortOptions ('?') = array[struct(id, name)]. + + + + + unique_id (of type CategoryID) = Category unique id. + lineComment to be defined + + + + + + removeCategories = Removes a list of categories. Because of required time to remove it from the database, a signal is emitted when the deletion is done. + + + + categories (of type CategoryID) = List of categories to be removed. + lineComment to be defined + + + + + + addPOIs = Adds a list of POIs to a category. Because of required time to add it to the database, a signal is emitted when the update is done, that gives the id of the elements added + + + + unique_id (of type CategoryID) = Category unique id. + lineComment to be defined + + + + + poiList (of type PoiAddedDetails) = List of POIs and all their content. Note that there's no id sent, because it's up to the component to give it + PoiAddedDetails struct[name, location, attributes] = + PoiAddedDetails.name ('s') = POI name + PoiAddedDetails.location ('?') = POI location. + PoiAddedDetails.attributes ('?') = array[struct(id,type,value)]. + + + + + + removePOIs = Removes a list of POIs to a category. Because of required time to remove it from the database, a signal is emitted when the update is done. + + + + ids (of type POI_ID) = List of unique ids of POIs to remove. + lineComment to be defined + + + + + + poiSearchStarted = This method is sent by the POI service component to inform all the CAM that a new POI search was started. + It provides all the relevant search parameters. Of course the CAM will only be aware of the search if it registers one of the search categories. + + + + poiSearchHandle = poi search unique handle. It must be used by the CAM to send the list of results to the component. + + + + + maxSize = max size of the results list. + + + + + location = struct(lat,lon,alt). + + + + + poiCategories (of type CategoryAndRadius) = array[struct(id,radius)]. + CategoryAndRadius struct[id, radius] = + CategoryAndRadius.id ('?') = enum(INVALID,ALL_CATEGORIES,AIRPORT,RESTAURANT,HOTEL,GAZ_STATION,CAR_PARK, ...). Note: A POI category is a unique ID. It could be a predefined category or a custom one defined by a POI plug-in + CategoryAndRadius.radius ('u') = activation or search radius around the position (in 10 meters) for the category. If value is 0 (zero), the default radius (defined for a category) is applied. + + + + + poiAttributes (of type AttributeDetails) = array[struct(name, poiCategory, type, value, operator, mandatory)]. + AttributeDetails struct[id, categoryId, type, value, oper, mandatory] = used in setAttrbutes and CAM startPOISearch + AttributeDetails.id ('?') = id of attribute . + AttributeDetails.categoryId ('?') = enum(INVALID,ALL_CATEGORIES,AIRPORT,RESTAURANT,HOTEL,GAZ_STATION,CAR_PARK, ...). Note: A POI category is a unique ID. It could be a predefined category or a custom one defined by a POI plug-in + AttributeDetails.type ('?') = enum(INVALID,STRING,INTEGER,COORDINATES ...). + AttributeDetails.value ('?') = value or partial value. The value depends on the attribute specifications and type. + AttributeDetails.oper ('?') = enum(INVALID,MORE_THAN,LESS_THAN,EQUAL, ....). + AttributeDetails.mandatory ('b') = true if the attribute is mandatory for the search and false for optional. + + + + + inputString = contains the name of the poi that is searched. It could be a partial name or an empty string. + + + + + sortOption = enum(SORT_DEFAULT,SORT_BY_DISTANCE,SORT_BY_TIME,ATTRIBUTE_CUSTOM, ... ) + If more than one category was defined for this search, the sort criteria should be compliant with all categories. + + + + + + poiSearchCanceled = This method cancels the search for the current id. + + + + poiSearchHandle = poi search unique handle. + + + + + + resultListRequested = This method provides the poi results list found by the CAM. + As the POI unique id is managed by the POI component, the CAM only provides the POI name, the category and coordinates as well as all the relevant detailed information. + + + + camId = Content access module unique id as known by the POI service component. + + + + + poiSearchHandle = poi search unique handle. + + + + + attributes = List of attributes id to retrieve. This is optional and the list could be empty. + + + + + statusValue (of type SearchStatusState) = enum(INVALID,NOT_STARTED,SEARCHING,FINISHED, ... ). + enum[INVALID (null), NOT_STARTED (null), SEARCHING (null), FINISHED (null)] + + + + + resultListSize = Number of items of the results list. + + + + + resultList (of type PoiCAMDetails) = array[struct(source_id, name, category, location, distance, attributes)]. + PoiCAMDetails struct[sourceId, name, category, location, distance, attributes] = + PoiCAMDetails.sourceId ('?') = POI unique id as known by the content access module. This id will be used by POI service to request POI details. + PoiCAMDetails.name ('s') = POI name. + PoiCAMDetails.category ('?') = POI category unique id. + PoiCAMDetails.location ('?') = POI location. + PoiCAMDetails.distance ('q') = distance in meters to poi from center of the search. + PoiCAMDetails.attributes ('?') = List of attributes requested. It could be empty. + + + + + + poiDetailsRequested = This method retrieves the details associated to one or more POI. + It contains the name, the parent categories, the list of attributes, the icons, ... . + + + + source_id (of type POI_ID) = array[unique_poi_id]. + lineComment to be defined + + + + + results (of type SearchResultDetails) = array[(details, categories, attributes)] . + SearchResultDetails struct[details, categories, attributes] = + SearchResultDetails.details ('?') = struct(id,name,latitude,longitude,altitude). + SearchResultDetails.categories ('?') = array[unique_id]. + SearchResultDetails.attributes ('?') = array[struct(name,type,value)]. + + + + + + ConfigurationChanged = guidanceStatusChanged = This signal is sent to the clients when one or more configuration settings changes. + + + + changedSettings = changedSettings array[setting]. + + + + + + CategoriesRemoved = CategoriesRemoved = This signal is emitted when a list of categories and associated content has been removed from the database. + + + + categories (of type CategoryID) = List of categories removed. + lineComment to be defined + + + + + + POIAdded = POIAdded = This signal is emitted when a list of POIs and associated content has been added to the database. It returns the ids. + + + + pois (of type POI_ID) = List of unique ids of POIs added. The order is the same as the order in the AddPOIs method. + lineComment to be defined + + + + + + POIRemoved = POIRemoved = This signal is emitted when a list of POIs and associated content has been removed from the database. + + + + pois (of type POI_ID) = List of unique ids of POIs removed. + lineComment to be defined + + + + + -- cgit v1.2.1