throw new tizen.WebAPIException(tizen.WebAPIException.INVALID_VALUES_ERR);
var obj = new tizen.BookmarkFolder(folder[0].title);
- _edit.allow();
obj.id = folder[0].id;
obj.parent = this.getFolder(folder[0].parentId);
- _edit.disallow();
return obj;
};
obj = new tizen.BookmarkItem(item.title, item.url);
_edit.allow();
obj.id = item.id;
- obj.url = item.url;
obj.parent = this.getFolder(item.parentId);
_edit.disallow();
result.push(obj);
]);
var parent_;
var id_ = null;
- var url_;
Object.defineProperties(this, {
parent: {
return parent_;
},
set: function(new_parent) {
- if (_edit.canEdit) {
+ if (_edit.canEdit)
parent_ = new_parent;
- }
},
enumerable: true,
nullable: true
get: function() {
return args.url;
},
- set: function(new_url) {
- if (_edit.canEdit) {
- url_ = new_url;
- }
- },
enumerable: true,
nullable: false
},
id: {
get: function() {
- if (!id_)
- return 0;
return id_;
},
set: function(new_id) {
- if (_edit.canEdit) {
+ if (_edit.canEdit)
id_ = new_id;
- }
},
enumerable: false,
nullable: true
return parent_;
},
set: function(new_parent) {
- if (_edit.canEdit) {
+ if (_edit.canEdit)
parent_ = new_parent;
- }
},
enumerable: true,
nullable: true
},
id: {
get: function() {
- if (!id_)
- return 0;
return id_;
},
set: function(new_id) {
- if (_edit.canEdit) {
+ if (_edit.canEdit)
id_ = new_id;
- }
},
enumerable: false,
nullable: true
#include <web/bookmark-adaptor.h>
#include <string>
+#include "common/logger.h"
#include "common/platform_exception.h"
#include "common/converter.h"
obj[kType] = picojson::value(std::to_string(entry.bookmark_info.type));
obj[kParentId] = picojson::value(std::to_string(
entry.bookmark_info.parent));
- obj[kUrl] = picojson::value(entry.bookmark_info.url);
+ if (!entry.bookmark_info.type)
+ obj[kUrl] = picojson::value(entry.bookmark_info.url);
arr.push_back(picojson::value(obj));
}
int saved_id =-1;
bp_bookmark_info_fmt data = {0};
- data.title = const_cast<char*>(arg.get(kTitle).to_str().c_str());
+ data.title = const_cast<char*>(arg.get(kTitle).to_str().c_str());
data.parent = arg.get(kParentId).get<double>();
- data.type = arg.get(kType).get<double>();
- data.url = const_cast<char*>(arg.get(kUrl).to_str().c_str());
-
+ data.type = arg.get(kType).get<double>();
+ data.url = const_cast<char*>(arg.get(kUrl).to_str().c_str());
if (bp_bookmark_adaptor_create(&saved_id) < 0) {
ReportError(o);
return;