#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130314.1]"
+#define OSP_INSTALLER_VERSION "version=[20130318.1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
,__pFeatureList(null)
,__pLaunchConditionList(null)
,__pNotificationMap(null)
+,__pMetadataMap(null)
,__feature(0)
,__isSubMode(false)
,__legacyAppControls(false)
__pNotificationMap->RemoveAll();
delete __pNotificationMap;
}
+
+ if (__pMetadataMap)
+ {
+ __pMetadataMap->RemoveAll();
+ delete __pMetadataMap;
+ }
}
InstallerError
r = __pNotificationMap->Construct();
TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pNotificationMap->Construct() failed.");
+ __pMetadataMap = new (std::nothrow) HashMap(SingleObjectDeleter);
+ TryReturn(__pMetadataMap, INSTALLER_ERROR_OUT_OF_MEMORY, "__pMetadataMap is null.");
+ r = __pMetadataMap->Construct();
+ TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pMetadataMap->Construct() failed.");
+
return INSTALLER_ERROR_NONE;
}
Tizen::Base::Collection::HashMap* __pFeatureList;
Tizen::Base::Collection::HashMap* __pLaunchConditionList;
Tizen::Base::Collection::HashMap* __pNotificationMap;
+ Tizen::Base::Collection::HashMap* __pMetadataMap;
int __feature;
if (dirPath.Contains(L"shared/data") == true)
{
- label.Append("_shareddata");
+ label = L"*";
+ //label.Append("_shareddata");
}
else if (dirPath.Contains(L"shared/res") == true)
{
- label.Append("_sharedres");
+ label = L"*";
+ //label.Append("_sharedres");
}
else if (dirPath.Contains(L"shared/trusted") == true)
{
__pWriter->EndElement();
}
+ HashMap* pMetadataMap = pAppData->__pMetadataMap;
+ if (pMetadataMap->GetCount() > 0)
+ {
+ WriteMetadata(pMetadataMap);
+ }
+
WriteCategory(index);
#if 0
delete pMapEnum;
return true;
}
+
+bool
+ManifestGenerator::WriteMetadata(HashMap* pMetadataMap)
+{
+ std::unique_ptr< IMapEnumerator > pEnum(pMetadataMap->GetMapEnumeratorN());
+ TryReturn(pEnum, false, "GetMapEnumeratorN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ String* pKey = static_cast< String* > (pEnum->GetKey());
+ TryReturn(pEnum, false, "GetKey() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ String* pValue = static_cast< String* > (pEnum->GetValue());
+ TryReturn(pEnum, false, "GetValue() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ __pWriter->StartElement("metadata");
+ __pWriter->WriteAttribute("name", *pKey);
+ __pWriter->WriteAttribute("value", *pValue);
+ __pWriter->EndElement();
+ }
+
+ return true;
+}
bool WriteAppControl(int index, bool subMode = false);
bool WriteAccounts(int index);
bool WriteNotifications(int index);
+ bool WriteMetadata(Tizen::Base::Collection::HashMap* pMetadataMap);
private:
InstallationContext* __pContext;
{
status = OnContentStartElement();
}
- else if (strcasecmp(pName, "Liveboxes") == 0)
+ else if ((strcasecmp(pName, "Liveboxes") == 0) || strcasecmp(pName, "AppWidgets") == 0)
{
status = OnLiveboxesStartElement(pName);
}
TryReturn(__pParser, false, "__pParser is null");
__pParser->OnEndElement(pName);
- if (strcasecmp(pName, "Liveboxes") == 0)
+ if ((strcasecmp(pName, "Liveboxes") == 0) || strcasecmp(pName, "AppWidgets") == 0)
{
status = OnLiveboxesEndElement();
}
{
status = OnCategoryValue(pCharacters);
}
+ else if (strcasecmp(pName, "Metadata") == 0)
+ {
+ status = OnMetadataValue(pCharacters);
+ }
if (!status)
{
}
bool
+ManifestHandler::OnMetadataValue(const char* pCharacters)
+{
+ TryReturn(__pAppData, false, "__pAppData is null");
+
+ XmlAttribute* pAttr = null;
+ char* pKey = null;
+
+ pAttr = GetAttribute();
+ TryReturn(pAttr, true, "pAttr is null.");
+
+ pKey = pAttr->Find("Key");
+ TryReturn(pKey, true, "pKey is null.");
+
+ __pAppData->__pMetadataMap->Add(*(new (std::nothrow) String(pKey)), *(new (std::nothrow) String(pCharacters)));
+
+ AppLog("<Metadata Key=\"%s\">%s</Metadata>", pKey, pCharacters);
+
+ return true;
+}
+
+bool
ManifestHandler::FindElement(const char *pName)
{
bool res = false;
bool OnSizeValue(const char *pCharacters);
bool OnInstallationLocationValue(const char *pCharacters);
bool OnCategoryValue(const char *pCharacters);
+ bool OnMetadataValue(const char* pCharacters);
bool OnMimeTypeValue(const char* pCharacters);
bool OnUriValue(const char* pCharacters);
bool status = true;
- if (strcasecmp(pName, "Liveboxes") == 0)
+ if ((strcasecmp(pName, "Liveboxes") == 0) || (strcasecmp(pName, "AppWidgets") == 0))
{
status = OnLiveboxesStartElement();
}
- else if (strcasecmp(pName, "Livebox") == 0)
+ else if ((strcasecmp(pName, "Livebox") == 0) || (strcasecmp(pName, "AppWidget") == 0))
{
status = OnLiveboxStartElement();
}
bool status = true;
- if (strcasecmp(pName, "Liveboxes") == 0)
+ if ((strcasecmp(pName, "Liveboxes") == 0) || (strcasecmp(pName, "AppWidgets") == 0))
{
status = OnLiveboxesEndElement();
}
- else if (strcasecmp(pName, "Livebox") == 0)
+ else if ((strcasecmp(pName, "Livebox") == 0) || (strcasecmp(pName, "AppWidget") == 0))
{
status = OnLiveboxEndElement();
}
__pLiveboxDataList = new (std::nothrow) ArrayList;
TryReturn(__pLiveboxDataList, false, "__pLiveboxDataList is null");
- AppLog(" <Liveboxes>");
+ AppLog(" <AppWidgets>");
return true;
}
pAttr = pHandler->GetAttribute();
TryReturn(pAttr, true, "pAttr is null");
- AppLog(" <Livebox>");
+ AppLog(" <AppWidget>");
char *pProviderName = pAttr->Find("ProviderName");
if (pProviderName)
AppLog(" - UpdatePeriod=%lld", updatePeriod);
}
- char *pLiveboxPopupEnabled = pAttr->Find("LiveboxPopupEnabled");
+ char* pLiveboxPopupEnabled = pAttr->Find("LiveboxPopupEnabled");
if (pLiveboxPopupEnabled)
{
__pLiveboxData->SetPopupEnabled(pLiveboxPopupEnabled);
AppLog(" - LiveboxPopupEnabled=%s", pLiveboxPopupEnabled);
}
+ else
+ {
+ char* pAppWidgetPopupEnabled = pAttr->Find("AppWidgetPopupEnabled");
+ if (pAppWidgetPopupEnabled)
+ {
+ __pLiveboxData->SetPopupEnabled(pAppWidgetPopupEnabled);
+ AppLog(" - AppWidgetPopupEnabled=%s", pAppWidgetPopupEnabled);
+ }
+ }
char* pDefault = pAttr->Find("Default");
if (pDefault == null)
{
__pContext->SetLiveboxDataList(__pLiveboxDataList);
__pLiveboxDataList = null;
- AppLog(" </Liveboxes>");
+ AppLog(" </AppWidgets>");
return true;
}
{
__pLiveboxDataList->Add(*__pLiveboxData);
__pLiveboxData = null;
- AppLog(" </Livebox>");
+ AppLog(" </AppWidget>");
return true;
}