~vanvugt/ubuntu/oneiric/mediatomb/fix-770964-784431

« back to all changes in this revision

Viewing changes to src/web/edit_load.cc

  • Committer: Bazaar Package Importer
  • Author(s): Andres Mejia
  • Date: 2009-04-22 21:39:19 UTC
  • mto: (4.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20090422213919-52m015y6gcpv1m1g
Tags: upstream-0.12.0~svn2018
ImportĀ upstreamĀ versionĀ 0.12.0~svn2018

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
    Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
8
                       Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
9
9
    
10
 
    Copyright (C) 2006-2008 Gena Batyan <bgeradz@mediatomb.cc>,
 
10
    Copyright (C) 2006-2009 Gena Batyan <bgeradz@mediatomb.cc>,
11
11
                            Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
12
                            Leonhard Wimmer <leo@mediatomb.cc>
13
13
    
24
24
    version 2 along with MediaTomb; if not, write to the Free Software
25
25
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
26
26
    
27
 
    $Id: edit_load.cc 1709 2008-03-01 15:35:51Z lww $
 
27
    $Id: edit_load.cc 2010 2009-01-11 19:10:43Z lww $
28
28
*/
29
29
 
30
30
/// \file edit_load.cc
69
69
    
70
70
    Ref<Element> item (new Element(_("item")));
71
71
    
72
 
    item->setAttribute(_("object_id"), objID);
 
72
    item->setAttribute(_("object_id"), objID, mxml_int_type);
73
73
    
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);
78
79
    
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);
83
85
    
84
86
    int objectType = obj->getObjectType();
85
 
    item->appendTextChild(_("objType"), String::from(objectType));
 
87
    item->appendTextChild(_("obj_type"), CdsObject::mapObjectType(objectType));
86
88
    
87
89
    if (IS_CDS_ITEM(objectType))
88
90
    {
89
91
        Ref<CdsItem> objItem = RefCast(obj, CdsItem);
90
92
        
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);
95
98
        
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);
100
104
        else
101
 
            location->setAttribute(_("editable"),_("1"));
 
105
            location->setAttribute(_("editable"),_("1"), mxml_bool_type);
102
106
        item->appendElementChild(location);
103
107
        
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);
108
113
        
109
114
        if (IS_CDS_ITEM_EXTERNAL_URL(objectType))
110
115
        {
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);
115
121
        }
116
122
        else if (IS_CDS_ACTIVE_ITEM(objectType))
118
124
            Ref<CdsActiveItem> objActiveItem = RefCast(objItem, CdsActiveItem);
119
125
            
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);
124
131
            
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);
129
137
        }
130
138
    }