70
70
Ref<Element> item (new Element(_("item")));
72
item->setAttribute(_("object_id"), objID);
72
item->setAttribute(_("object_id"), objID, mxml_int_type);
74
74
Ref<Element> title (new Element(_("title")));
75
title->setTextKey(_("value"));
75
76
title->setText(obj->getTitle());
76
title->setAttribute(_("editable"), obj->isVirtual() || objectID == CDS_ID_FS_ROOT ? _("1") : _("0"));
77
title->setAttribute(_("editable"), obj->isVirtual() || objectID == CDS_ID_FS_ROOT ? _("1") : _("0"), mxml_bool_type);
77
78
item->appendElementChild(title);
79
80
Ref<Element> classEl (new Element(_("class")));
81
classEl->setTextKey(_("value"));
80
82
classEl->setText(obj->getClass());
81
classEl->setAttribute(_("editable"), _("1"));
83
classEl->setAttribute(_("editable"), _("1"), mxml_bool_type);
82
84
item->appendElementChild(classEl);
84
86
int objectType = obj->getObjectType();
85
item->appendTextChild(_("objType"), String::from(objectType));
87
item->appendTextChild(_("obj_type"), CdsObject::mapObjectType(objectType));
87
89
if (IS_CDS_ITEM(objectType))
89
91
Ref<CdsItem> objItem = RefCast(obj, CdsItem);
91
93
Ref<Element> description (new Element(_("description")));
94
description->setTextKey(_("value"));
92
95
description->setText(objItem->getMetadata(_("dc:description")));
93
description->setAttribute(_("editable"), _("1"));
96
description->setAttribute(_("editable"), _("1"), mxml_bool_type);
94
97
item->appendElementChild(description);
96
99
Ref<Element> location (new Element(_("location")));
100
location->setTextKey(_("value"));
97
101
location->setText(objItem->getLocation());
98
102
if (IS_CDS_PURE_ITEM(objectType) || ! objItem->isVirtual())
99
location->setAttribute(_("editable"),_("0"));
103
location->setAttribute(_("editable"),_("0"), mxml_bool_type);
101
location->setAttribute(_("editable"),_("1"));
105
location->setAttribute(_("editable"),_("1"), mxml_bool_type);
102
106
item->appendElementChild(location);
104
108
Ref<Element> mimeType (new Element(_("mime-type")));
109
mimeType->setTextKey(_("value"));
105
110
mimeType->setText(objItem->getMimeType());
106
mimeType->setAttribute(_("editable"), _("1"));
111
mimeType->setAttribute(_("editable"), _("1"), mxml_bool_type);
107
112
item->appendElementChild(mimeType);
109
114
if (IS_CDS_ITEM_EXTERNAL_URL(objectType))
111
116
Ref<Element> protocol (new Element(_("protocol")));
117
protocol->setTextKey(_("value"));
112
118
protocol->setText(getProtocol(objItem->getResource(0)->getAttribute(_("protocolInfo"))));
113
protocol->setAttribute(_("editable"), _("1"));
119
protocol->setAttribute(_("editable"), _("1"), mxml_bool_type);
114
120
item->appendElementChild(protocol);
116
122
else if (IS_CDS_ACTIVE_ITEM(objectType))
118
124
Ref<CdsActiveItem> objActiveItem = RefCast(objItem, CdsActiveItem);
120
126
Ref<Element> action (new Element(_("action")));
127
action->setTextKey(_("value"));
121
128
action->setText(objActiveItem->getAction());
122
action->setAttribute(_("editable"), _("1"));
129
action->setAttribute(_("editable"), _("1"), mxml_bool_type);
123
130
item->appendElementChild(action);
125
132
Ref<Element> state (new Element(_("state")));
133
state->setTextKey(_("value"));
126
134
state->setText(objActiveItem->getState());
127
state->setAttribute(_("editable"), _("1"));
135
state->setAttribute(_("editable"), _("1"), mxml_bool_type);
128
136
item->appendElementChild(state);