Name: wrt-plugins-tizen
Summary: JavaScript plugins for WebRuntime
-Version: 0.4.30
+Version: 0.4.31
Release: 0
Group: Development/Libraries
License: Apache License, Version 2.0
throw InvalidValuesException("period can not be negative value");
}
- if (!JSValueIsNull(ctx, arguments[1])) {
- priv->setInterval(interval);
- } else {
- priv->setInterval(-1);
- }
+ priv->setInterval(interval);
}
}
int id = privateData->getId();
int err = alarm_get_scheduled_date(id, &date);
- JSValueRef result = converter.toJSValueRef(date);
+ if(err != ALARM_ERROR_NONE) {
+ return JSValueMakeNull(ctx);
+ }
+ // check wheter the alarm is expired or not
+ struct tm curr_date;
+ err = alarm_get_current_time(&curr_date);
if(err != ALARM_ERROR_NONE) {
return JSValueMakeNull(ctx);
}
- return result;
+
+ if (mktime(&date) < mktime(&curr_date)) {
+ return JSValueMakeNull(ctx);
+ }
+
+ return converter.toJSValueRef(date);
} catch (const BasePlatformException &err) {
return JSWebAPIErrorFactory::postException(ctx, exception, err);
}
ret = pkgmgrinfo_pkginfo_get_root_path(pkginfo_h, &root_path);
- if ((ret != PMINFO_R_OK) && (root_path != NULL)) {
+ if ((ret != PMINFO_R_OK) || (root_path == NULL)) {
LoggerE("Fail to get root path");
free(pkg_name);
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
if (NULL==rrule) {
LoggerW("No way! Rrule is not set!");
return;
- } else if(EventRecurrenceRule::NO_RECURRENCE==rrule->getFrequency()) {
+ }
+
+ if(EventRecurrenceRule::NO_RECURRENCE==rrule->getFrequency()) {
LoggerD("No recurrence frequency.");
} else if(EventRecurrenceRule::UNDEFINED_RECURRENCE==rrule->getFrequency()) {
LoggerD("Undefined recurrence frequency.");
if(CALENDAR_ERROR_NONE!=calendar_record_set_int(m_platformEvent, _calendar_event.freq, CALENDAR_RECURRENCE_NONE)) {
LoggerW("Failed setting frequency.");
}
+ return;
break;
case EventRecurrenceRule::DAILY_RECURRENCE:
if(CALENDAR_ERROR_NONE!=calendar_record_set_int(m_platformEvent, _calendar_event.freq, CALENDAR_RECURRENCE_DAILY)) {
// set byday
StringArrayPtr daysOfTheWeek = rrule->getDaysOfTheWeek();
+ std::string byday = "";
if( 0 != daysOfTheWeek->size() ) {
- std::string byday = "";
for(unsigned int i=0; i<daysOfTheWeek->size(); i++) {
byday.append(daysOfTheWeek->at(i));
if(i!=daysOfTheWeek->size()-1) {
byday.append(",");
}
}
-
- LoggerD("byday: "<<byday);
- if (CALENDAR_ERROR_NONE!=calendar_record_set_str(m_platformEvent, _calendar_event.byday, byday.c_str())) {
- LoggerW("Can't set byday.");
- }
+ }
+ LoggerD("byday: "<<byday);
+ if (CALENDAR_ERROR_NONE!=calendar_record_set_str(m_platformEvent, _calendar_event.byday, byday.c_str())) {
+ LoggerW("Can't set byday.");
}
// set the ocurrence count
}
// set the exceptions
- if ( !rrule->getExceptions()->empty() )
- {
+ std::string exdate = "";
+ if ( !rrule->getExceptions()->empty() ) {
LoggerD("Set the exceptions of length: "<<rrule->getExceptions()->size());
- std::string exdate = "";
- for( unsigned int i=0; i<rrule->getExceptions()->size(); i++ )
- {
+ for( unsigned int i=0; i<rrule->getExceptions()->size(); i++ ) {
std::stringstream ss;
ss<<rrule->getExceptions()->at(i);
exdate.append(ss.str());
exdate.append(",");
}
}
- LoggerD("exdate: "<<exdate);
- if (CALENDAR_ERROR_NONE!=calendar_record_set_str(m_platformEvent, _calendar_event.exdate, exdate.c_str())) {
- LoggerW("Can't save exceptions.");
- }
+ }
+ LoggerD("exdate: "<<exdate);
+ if (CALENDAR_ERROR_NONE!=calendar_record_set_str(m_platformEvent, _calendar_event.exdate, exdate.c_str())) {
+ LoggerW("Can't save exceptions.");
}
// set the setPositions
- if ( !rrule->getSetPositions()->empty() )
- {
+ std::string bysetpos = "";
+ if ( !rrule->getSetPositions()->empty() ) {
LoggerD("Set the setPositions of length: "<<rrule->getSetPositions()->size());
- std::string bysetpos = "";
- for( unsigned int i=0; i<rrule->getSetPositions()->size(); i++ )
- {
+ for( unsigned int i=0; i<rrule->getSetPositions()->size(); i++ ) {
std::stringstream ss;
ss<<rrule->getSetPositions()->at(i);
bysetpos.append(ss.str());
bysetpos.append(",");
}
}
- LoggerD("bysetpos: "<<bysetpos);
- if (CALENDAR_ERROR_NONE!=calendar_record_set_str(m_platformEvent, _calendar_event.bysetpos, bysetpos.c_str())) {
- LoggerW("Can't save setPositions.");
- }
+ }
+ LoggerD("bysetpos: "<<bysetpos);
+ if (CALENDAR_ERROR_NONE!=calendar_record_set_str(m_platformEvent, _calendar_event.bysetpos, bysetpos.c_str())) {
+ LoggerW("Can't save setPositions.");
}
// set the recurrence interval
- if (CALENDAR_ERROR_NONE != calendar_record_set_int(m_platformEvent,
- _calendar_event.interval,
- rrule->getInterval()))
- {
+ if (CALENDAR_ERROR_NONE != calendar_record_set_int(m_platformEvent, _calendar_event.interval, rrule->getInterval())) {
LoggerW("Can't set interval.");
}
//Callback.
bool MediacontentManager::mediaFolderCallback(media_folder_h folder, void *user_data)
-{
+{
if (user_data != NULL){
IEventFindFolder* event = (IEventFindFolder*)user_data;
if ( folder )
void MediacontentManager::OnRequestReceived(const IEventFindFolderPtr &eFolder)
{
- if ( MEDIA_CONTENT_ERROR_NONE !=
- media_folder_foreach_folder_from_db (NULL, mediaFolderCallback, eFolder.Get()))
- {
- LoggerE("error ( media_folder_foreach_folder_from_db ) : ");
- eFolder->setResult(false);
- }
- else
- {
- eFolder->setResult(true);
- }
+ filter_h filter = NULL;
+ //set filter
+ if ( MEDIA_CONTENT_ERROR_NONE == media_filter_create(&filter))
+ {
+ string condition="FOLDER_STORAGE_TYPE = 0 OR FOLDER_STORAGE_TYPE = 1";
+ LoggerI("condition:" + condition);
+ media_filter_set_condition(filter, condition.c_str(), MEDIA_CONTENT_COLLATE_DEFAULT ); //set condition
+ if ( MEDIA_CONTENT_ERROR_NONE !=
+ media_folder_foreach_folder_from_db (filter, mediaFolderCallback, eFolder.Get()))
+ {
+ LoggerE("A platform error occurs in media_folder_foreach_folder_from_db");
+ eFolder->setResult(false);
+ }
+ else{
+ eFolder->setResult(true);
+ }
+ if ( MEDIA_CONTENT_ERROR_NONE != media_filter_destroy(filter))
+ {
+ LoggerE("A platform error occurs in media_filter_destroy");
+ }
+ }
}
void MediacontentManager::OnRequestReceived(const IEventBrowseFolderPtr &eBrowse)
{
- MediaSearchVisitorPtr visitor(new MediaSearchVisitor());
- visitor->setQueryType(MediaSearchVisitor::QUERY_MEDIA);
- int ret = MEDIA_CONTENT_ERROR_NONE;
-
- try{
- filter_h filter = NULL;
+ MediaSearchVisitorPtr visitor(new MediaSearchVisitor());
+ visitor->setQueryType(MediaSearchVisitor::QUERY_MEDIA);
+ int ret = MEDIA_CONTENT_ERROR_NONE;
- if(eBrowse->getFilterIsSet() || eBrowse->getFolderIdIsSet() || eBrowse->getSortModesIsSet()
- || eBrowse->getLimitIsSet() ||eBrowse->getOffsetIsSet() )
- {
- //set filter
- if ( MEDIA_CONTENT_ERROR_NONE == media_filter_create(&filter))
- {
- if (eBrowse->getFilterIsSet())
- {
- string condition;
- FilterPtr jsFilter = eBrowse->getFilter();
-
- FilterValidatorPtr validator = MediaFilterValidatorFactory::getMediaFilterValidator(MediaFilterValidatorFactory::QUERY_MEDIA);
- bool success = jsFilter->validate(validator);
-
- if(!success)
- ThrowMsg(PlatformException, "Invalid attirbutes.");
-
- IFilterVisitorPtr IVisitor = DPL::StaticPointerCast<IFilterVisitor>(visitor);
-
- jsFilter->travel(IVisitor);
- condition = visitor->getResult();
+ try
+ {
+ filter_h filter = NULL;
- media_filter_set_condition(filter, condition.c_str(), MEDIA_CONTENT_COLLATE_DEFAULT ); //set condition
- }
+ //set filter
+ if ( MEDIA_CONTENT_ERROR_NONE == media_filter_create(&filter))
+ {
+ string condition = "(MEDIA_STORAGE_TYPE = 0 OR MEDIA_STORAGE_TYPE = 1)";;
+ if (eBrowse->getFilterIsSet())
+ {
+ FilterPtr jsFilter = eBrowse->getFilter();
+ FilterValidatorPtr validator = MediaFilterValidatorFactory::getMediaFilterValidator(MediaFilterValidatorFactory::QUERY_MEDIA);
+ bool success = jsFilter->validate(validator);
- if(eBrowse->getSortModesIsSet())
- {
- media_content_order_e order;
+ if(!success)
+ ThrowMsg(PlatformException, "Invalid attirbutes.");
- SortModePtr attr = eBrowse->getSortMode();
+ IFilterVisitorPtr IVisitor = DPL::StaticPointerCast<IFilterVisitor>(visitor);
+ jsFilter->travel(IVisitor);
+ condition += " AND ";
+ condition += visitor->getResult();
+ }
- if ( attr )
- {
- string attriName = attr->getAttributeName();
- attriName = visitor->getPlatformAttr(attriName);
-
- if (attriName.compare("") != 0)
- {
- if (attr->getOrder() == DeviceAPI::Tizen::ASCENDING_SORT_ORDER)
- {
- order = MEDIA_CONTENT_ORDER_ASC;
- }
- else
- {
- order = MEDIA_CONTENT_ORDER_DESC;
- }
-
- if ( MEDIA_CONTENT_ERROR_NONE !=
- media_filter_set_order(filter, order, attriName.c_str(), MEDIA_CONTENT_COLLATE_DEFAULT )) //set order
- {
- LoggerD("media_filter_set_order fail...");
- }
- }
- }
-
- }
+ LoggerI("condition:" + condition);
+ media_filter_set_condition(filter, condition.c_str(), MEDIA_CONTENT_COLLATE_DEFAULT ); //set condition
- if (eBrowse->getLimitIsSet() ||eBrowse->getOffsetIsSet() )
- {
- int count = -1;
- int offset = 0;
-
- if ( eBrowse->getLimitIsSet() )
- {
- count = eBrowse->getLimit();
- }
-
- if ( eBrowse->getOffsetIsSet() )
- {
- offset = eBrowse->getOffset();
- }
-
- if ( MEDIA_CONTENT_ERROR_NONE != media_filter_set_offset(filter, offset, count))
- {
- LoggerD("set limit or offset fail...");
- }
- }
-
- }
- else
- {
-
- LoggerE("error ( media filter create ) : ");
- eBrowse->setResult(false);
- }
- }
-
- if ( eBrowse->getFolderIdIsSet())
- {
- string folderID = eBrowse->getFolderID();
-
- if ( MEDIA_CONTENT_ERROR_NONE !=
- media_folder_foreach_media_from_db (folderID.c_str(), filter, mediaItemCallback, eBrowse.Get()))
- {
- LoggerE("error ( media_folder_foreach_folder_from_db ) : " << ret);
- eBrowse->setResult(false);
- }
- else
- {
- eBrowse->setResult(true);
- }
- }
- else
- {
- if ( MEDIA_CONTENT_ERROR_NONE !=
- media_info_foreach_media_from_db (filter, mediaItemCallback, eBrowse.Get()))
- {
- LoggerE("error ( media_folder_foreach_folder_from_db ) : " << ret);
- eBrowse->setResult(false);
- }
- else
- {
- eBrowse->setResult(true);
- }
- }
-
- //destory Filter
- if(filter)
- {
- if ( MEDIA_CONTENT_ERROR_NONE != media_filter_destroy(filter))
- {
- LoggerE("media_filter_create Error: " << ret);
- }
- }
-
- }
- catch(const Exception &ex){
- LoggerE("Exception: " << ex.DumpToString());
- eBrowse->setResult(false);
- return;
- }
+ if(eBrowse->getSortModesIsSet())
+ {
+ media_content_order_e order;
+ SortModePtr attr = eBrowse->getSortMode();
+
+ if ( attr )
+ {
+ string attriName = attr->getAttributeName();
+ attriName = visitor->getPlatformAttr(attriName);
+
+ if (attriName.compare("") != 0)
+ {
+ if (attr->getOrder() == DeviceAPI::Tizen::ASCENDING_SORT_ORDER)
+ {
+ order = MEDIA_CONTENT_ORDER_ASC;
+ }
+ else
+ {
+ order = MEDIA_CONTENT_ORDER_DESC;
+ }
+
+ if ( MEDIA_CONTENT_ERROR_NONE !=
+ media_filter_set_order(filter, order, attriName.c_str(), MEDIA_CONTENT_COLLATE_DEFAULT )) //set order
+ {
+ LoggerE("A platform error occurs in media_filter_set_order");
+ }
+ }
+ }
+
+ }
+
+ if (eBrowse->getLimitIsSet() ||eBrowse->getOffsetIsSet() )
+ {
+ int count = -1;
+ int offset = 0;
+
+ if ( eBrowse->getLimitIsSet() )
+ {
+ count = eBrowse->getLimit();
+ }
+
+ if ( eBrowse->getOffsetIsSet() )
+ {
+ offset = eBrowse->getOffset();
+ }
+
+ if ( MEDIA_CONTENT_ERROR_NONE != media_filter_set_offset(filter, offset, count))
+ {
+ LoggerE("A platform error occurs in media_filter_set_offset");
+ }
+ }
+ }
+ else
+ {
+ LoggerE("A platform error occurs in media_filter_create");
+ eBrowse->setResult(false);
+ }
+ if ( eBrowse->getFolderIdIsSet())
+ {
+ string folderID = eBrowse->getFolderID();
+ if ( MEDIA_CONTENT_ERROR_NONE !=
+ media_folder_foreach_media_from_db (folderID.c_str(), filter, mediaItemCallback, eBrowse.Get()))
+ {
+ LoggerE("A platform error occurs in media_folder_foreach_media_from_db");
+ eBrowse->setResult(false);
+ }
+ else
+ {
+ eBrowse->setResult(true);
+ }
+ }
+ else
+ {
+ if ( MEDIA_CONTENT_ERROR_NONE !=
+ media_info_foreach_media_from_db (filter, mediaItemCallback, eBrowse.Get()))
+ {
+ LoggerE("A platform error occurs in media_info_foreach_media_from_db");
+ eBrowse->setResult(false);
+ }
+ else
+ {
+ eBrowse->setResult(true);
+ }
+ }
+ //destory Filter
+ if(filter)
+ {
+ if ( MEDIA_CONTENT_ERROR_NONE != media_filter_destroy(filter))
+ {
+ LoggerE("A platform error occurs in media_filter_destroy");
+ }
+ }
+ }
+ catch(const Exception &ex)
+ {
+ LoggerE("Exception: " << ex.DumpToString());
+ eBrowse->setResult(false);
+ return;
+ }
}
bool MediacontentManager::updateMediaToDB(MediacontentMediaPtr mediaPtr)
#include <Commons/Exception.h>
#include "MsgServiceHandleMgr.h"
#include "IMessaging.h"
+#include "EmailUtils.h"
#include <email-api-mail.h>
#include <time.h>
// from
if (resultMail->full_address_from[0] != '\0')
{
- m_from = resultMail->full_address_from;
- LoggerD(m_from);
+ LoggerD("Header From " << resultMail->full_address_from);
+ m_from = EmailUtils::stripAddress(resultMail->full_address_from);
+ LoggerD("email From " << m_from);
}
// subject
if (mailData->full_address_to != NULL)
{
LoggerD("Header To " << mailData->full_address_to);
- m_to.push_back(mailData->full_address_to);
+ m_to = EmailUtils::stripAddressLine(mailData->full_address_to).getRecipients();
}
if (mailData->full_address_bcc != NULL)
{
LoggerD("Header Bcc " << mailData->full_address_bcc);
- m_bcc.push_back(mailData->full_address_bcc);
+ m_bcc = EmailUtils::stripAddressLine(mailData->full_address_bcc).getRecipients();
}
if (mailData->full_address_cc != NULL)
{
LoggerD("Header CC " << mailData->full_address_cc);
- m_cc.push_back(mailData->full_address_cc);
+ m_cc = EmailUtils::stripAddressLine(mailData->full_address_cc).getRecipients();
}
m_lastMessageId = resultMail->mail_id;
}
#if 1
- struct tm *t = NULL;
- t = localtime(&m_mail->date_time);
- struct tm timeinfo;
- memset(&timeinfo, 0, sizeof(timeinfo));
- memcpy(t, &timeinfo, sizeof(struct tm));
- setDateTime(timeinfo);
-
+ LoggerD(" " << m_mail->date_time);
+ tm* time = localtime(&m_mail->date_time);
+ if (!time) {
+ LoggerE("localtime failed");
+ Throw(WrtDeviceApis::Commons::PlatformException);
+ }
+ setDateTime(*time);
#else
if (m_mail->datetime[0] != '\0')
}
else
{
- DPL::Mutex::ScopedLock mx(&m_updateMutex);
+ DPL::Mutex::ScopedLock mx(&m_updateMutex);
EmailAccountInfo account = getEmailAccount();
m_accountId = account.getIntId(); //set account ID
LoggerE("Failed to destroy mailbox: " << error);
}
- LoggerD("m_mail->from" << m_mail->full_address_from);
+ loadDraftMessage();
+ }
- email_mail_data_t* result = NULL;
+ LOG_EXIT
+}
- error = email_get_mail_data(m_mail->mail_id, &result);
- if (EMAIL_ERROR_NONE != error) {
- ThrowMsg(WrtDeviceApis::Commons::PlatformException,
- "Couldn't find message " << m_mail->mail_id << ". [" << error << "]");
- }
+void Email::loadDraftMessage()
+{
+ LOG_ENTER
- if(result->body_download_status != 1)
- {
- LoggerD("result->body_download_status " << result->body_download_status);
- int mail_id_count = 1;
- int mail_id_array[1];
- email_mail_attribute_type attribute_type;
- email_mail_attribute_value_t attribute_value;
+ email_mail_data_t* result = NULL;
+ std::string from;
+
+ int error = email_get_mail_data(m_mail->mail_id, &result);
+ if (EMAIL_ERROR_NONE != error) {
+ ThrowMsg(WrtDeviceApis::Commons::PlatformException,
+ "Couldn't find message " << m_mail->mail_id << ". [" << error << "]");
+ }
- mail_id_array[0] = m_mail->mail_id;
- attribute_type = EMAIL_MAIL_ATTRIBUTE_BODY_DOWNLOAD_STATUS;
- attribute_value.integer_type_value = 1;
+ if(result->body_download_status != 1)
+ {
+ LoggerD("result->body_download_status " << result->body_download_status);
+ int mail_id_count = 1;
+ int mail_id_array[1];
+ email_mail_attribute_type attribute_type;
+ email_mail_attribute_value_t attribute_value;
+
+ mail_id_array[0] = result->mail_id;
+ LoggerD("result->mail_id " << result->mail_id);
+ attribute_type = EMAIL_MAIL_ATTRIBUTE_BODY_DOWNLOAD_STATUS;
+ attribute_value.integer_type_value = 1;
+
+ email_update_mail_attribute(m_accountId, mail_id_array, 1, EMAIL_MAIL_ATTRIBUTE_BODY_DOWNLOAD_STATUS, attribute_value);
+ }
- email_update_mail_attribute(m_accountId, mail_id_array, 1, EMAIL_MAIL_ATTRIBUTE_BODY_DOWNLOAD_STATUS, attribute_value);
- }
+ tm* time = localtime(&result->date_time);
+ if (!time) {
+ LoggerE("localtime failed");
+ Throw(WrtDeviceApis::Commons::PlatformException);
+ }
+ setDateTime(*time);
- readHeader();
- readInfo();
+ setReadStatus(result->flags_seen_field == 1);
- if (m_mail->file_path_plain)
- free(m_mail->file_path_plain);
- m_mail->file_path_plain = strdup(result->file_path_plain);
+ m_accountId = result->account_id;
+ setConvId(result->thread_id);
+ setPriority( EmailConverter::toMessagePriority( result->priority ) );
+ setSize(result->mail_size);
- if ( m_mail->file_path_html)
- {
- free(m_mail->file_path_html);
- }
+ if (m_mail->file_path_plain)
+ free(m_mail->file_path_plain);
+ m_mail->file_path_plain = strdup(result->file_path_plain);
- if(result->file_path_html)
- {
- m_mail->file_path_html = strdup(result->file_path_html);
- }
+ if ( m_mail->file_path_html)
+ {
+ free(m_mail->file_path_html);
+ }
- error = email_free_mail_data(&result, 1);
- if (EMAIL_ERROR_NONE != error) {
- ThrowMsg(WrtDeviceApis::Commons::PlatformException,
- "Couldn't find message " << m_mail->mail_id << ". [" << error << "]");
- }
+ if(result->file_path_html)
+ {
+ m_mail->file_path_html = strdup(result->file_path_html);
+ }
+ from = EmailUtils::stripAddress(result->full_address_from);
+ setFrom(from);
- }
+ error = email_free_mail_data(&result, 1);
+ if (EMAIL_ERROR_NONE != error) {
+ ThrowMsg(WrtDeviceApis::Commons::PlatformException,
+ "Couldn't find message " << m_mail->mail_id << ". [" << error << "]");
+ }
LOG_EXIT
}
void updateMessage();
void addMessageToDraft();
+
+ void loadDraftMessage();
void createSendMessage();
DeviceAPI::Common::UnknownException err("UnknownError in Message constructor.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
-
- return JSWebAPIErrorFactory::postException(context, exception,
- DeviceAPI::Common::UnknownException("UnknownError in Message constructor."));
}
JSValueRef JSMessage::convertToType(JSContextRef context,
DeviceAPI::Common::UnknownException err("UnknownError in Message constructor.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
-
- return JSWebAPIErrorFactory::postException(context, exception,
- DeviceAPI::Common::UnknownException("UnknownError in Message constructor."));
}
JSValueRef JSMessageAttachment::getProperty(JSContextRef context,
retClause = emfAttributeName + " ='" + valueString + "'";
break;
}else if(attrName.compare(MessageFilterValidatorFactory::ATTRIBUTE_TO)==0) {
- retClause = emfAttributeName + " ='<" + valueString + ">'";
+ retClause = emfAttributeName + " LIKE '%%<" + valueString +">%%'";
break;
}else if(attrName.compare(MessageFilterValidatorFactory::ATTRIBUTE_CC)==0) {
- retClause = emfAttributeName + " ='<" + valueString + ">'";
+ retClause = emfAttributeName + " LIKE '%%<" + valueString +">%%'";
break;
}else if(attrName.compare(MessageFilterValidatorFactory::ATTRIBUTE_BCC)==0) {
- retClause = emfAttributeName + " ='<" + valueString + ">'";
+ retClause = emfAttributeName + " LIKE '%%<" + valueString +">%%'";
break;
}
}else if(m_mode == MODE_SMS || m_mode == MODE_MMS ){
string initialValueStr;
string endValueStr;
+ time_t time_temp;
+
if(initialValue == NULL || endValue == NULL)
return;
if( initialValue->isType(DeviceAPI::Tizen::PrimitiveType_Time) ) {
LoggerD("<<<initialValue->getType()[PrimitiveType_Time]");
tm date = *initialValue->getDateTm();
- initialValueStr = toDateDbStr(date);
+ time_temp = mktime(&date);
+ LoggerD("time_temp " << time_temp);
+
+ stringstream ss;
+ ss << time_temp;
+ string ts = ss.str();
+ initialValueStr = ts;
+
LoggerD("<<<valueStr[" << initialValueStr <<"]");
}
else {
if( endValue->isType(DeviceAPI::Tizen::PrimitiveType_Time) ) {
LoggerD("<<<initialValue->getType()[PrimitiveType_Time]");
tm date = *endValue->getDateTm();
- endValueStr = toDateDbStr(date);
+
+ time_temp = mktime(&date);
+ LoggerD("time_temp " << time_temp);
+
+ stringstream ss;
+ ss << time_temp;
+ string ts = ss.str();
+ endValueStr = ts;
+
+ LoggerD("<<<valueStr[" << endValueStr <<"]");
} else {
LoggerE("endValue->getType()");
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid endValue Type");
}
}
-
- if(m_mode == MODE_EMAIL){
- tmpStringBuffer.append(emfAttributeName + " BETWEEN " + initialValueStr + " AND " + endValueStr);
- }else if(m_mode == MODE_SMS || m_mode == MODE_MMS){
- tmpStringBuffer.append(emfAttributeName + " BETWEEN " +
- createDateTimeTypeForSmsMms(initialValueStr) + " AND " +
- createDateTimeTypeForSmsMms(endValueStr));
- }
+ tmpStringBuffer.append(emfAttributeName + " BETWEEN " + initialValueStr + " AND " + endValueStr);
}
m_queryVector.push_back(tmpStringBuffer);
vector<IMessagePtr> retVal;
int tempInt;
+ int tempPreviousId = -1;
// int l_msgId = 0;
MessageType webApiMsgType;
{
ThrowMsg(WrtDeviceApis::Commons::UnknownException, "get message id fail");
}
-
- IMessagePtr msg;
- msg = MessageFactory::createMessage(webApiMsgType, tempInt);
- retVal.push_back(msg);
+ if( tempPreviousId != tempInt)
+ {
+ IMessagePtr msg;
+ msg = MessageFactory::createMessage(webApiMsgType, tempInt);
+ tempPreviousId = tempInt;
+ retVal.push_back(msg);
+ }
} //for
LoggerD(">>>");
LoggerI("Set Notification Init Dictionary");
//content
JSValueRef contentValue = JSUtil::getProperty(context, notiInitDict, NOTIFICATION_CONTENT);
- if (!JSValueIsUndefined(context, contentValue))
- {
+ if (!(JSValueIsUndefined(context, contentValue) || JSValueIsNull(context, contentValue)))
+ {
priv->setContent(JSUtil::JSValueToString(context, contentValue));
}
//Content
JSValueRef contents = JSUtil::getProperty(context, object, NOTIFICATION_CONTENT);
- priv->setContent( JSUtil::JSValueToString(context, contents));
+ if (!JSValueIsNull(context, contents))
+ {
+ priv->setContent( JSUtil::JSValueToString(context, contents));
+ }
// iconPath
JSValueRef iconPath = JSUtil::getProperty(context, object, STATUS_NOTIFICATION_ICON_PATH);
- if (!JSUtil::JSValueToString(context, iconPath).empty())
+ if ( !JSValueIsNull(context, contents) )
{
DeviceAPI::Filesystem::IPathPtr icon = DeviceAPI::Filesystem::Utils::fromVirtualPath(context, JSUtil::JSValueToString(context, iconPath));
priv->setIconPath(icon->getFullPath());
}
- else
- {
- priv->setIconPath("");
- }
+ //else
+ //{
+ // priv->setIconPath("");
+ //}
// subIconPath
JSValueRef subIconPath = JSUtil::getProperty(context, object, STATUS_NOTIFICATION_SUB_ICON_PATH);
- if (!JSUtil::JSValueToString(context, subIconPath).empty())
+ if (!JSValueIsNull(context, subIconPath))
{
DeviceAPI::Filesystem::IPathPtr subIcon = DeviceAPI::Filesystem::Utils::fromVirtualPath(context, JSUtil::JSValueToString(context, subIconPath));
priv->setSubIconPath(subIcon->getFullPath());
}
- else
- {
- priv->setSubIconPath("");
- }
+ //else
+ //{
+ // priv->setSubIconPath("");
+ //}
// number
JSValueRef number = JSUtil::getProperty(context, object, STATUS_NOTIFICATION_NUMBER);
// backgroundImagePath
JSValueRef backgroundImagePath = JSUtil::getProperty(context, object, STATUS_NOTIFICATION_BACKGROUND_IMAGE_PATH);
- if (!JSUtil::JSValueToString(context, backgroundImagePath).empty())
+ if (!JSValueIsNull(context, backgroundImagePath))
{
DeviceAPI::Filesystem::IPathPtr backgroundImage = DeviceAPI::Filesystem::Utils::fromVirtualPath(context, JSUtil::JSValueToString(context, backgroundImagePath));
priv->setBackground(backgroundImage->getFullPath());
}
- else
- {
- priv->setBackground("");
- }
+ //else
+ //{
+ // priv->setBackground("");
+ //}
// thumbnails
JSValueRef thumbnails = JSUtil::getProperty(context, object, STATUS_NOTIFICATION_THUMBNAILS);
// soundPath
JSValueRef soundPath = JSUtil::getProperty(context, object, STATUS_NOTIFICATION_SOUND_PATH);
- if (!JSUtil::JSValueToString(context, soundPath).empty())
+ if (!JSValueIsNull(context, soundPath))
{
DeviceAPI::Filesystem::IPathPtr sound = DeviceAPI::Filesystem::Utils::fromVirtualPath(context, JSUtil::JSValueToString(context, soundPath));
priv->setSoundPath(sound->getFullPath());
}
- else
- {
- priv->setSoundPath("");
- }
+ //else
+ //{
+ // priv->setSoundPath("");
+ //}
// vibration
JSValueRef vibration = JSUtil::getProperty(context, object, STATUS_NOTIFICATION_VIBRATION);