~ubuntu-branches/ubuntu/vivid/mediatomb/vivid

« back to all changes in this revision

Viewing changes to src/web/edit_load.cc

  • Committer: Bazaar Package Importer
  • Author(s): Andres Mejia
  • Date: 2008-03-02 13:09:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080302130916-zlljdze3kt7vuq4b
Tags: 0.11.0-1
* New upstream release.
* Include message about which inotify headers will be used when enabling
  inotify runtime support.
* Fixed error with use of INTERFACE in init script. Also removed use of -m
  option.
* Including new config.xml options.
* Added more build dependencies for new upstream release.
* Removed build dependency of libid3-dev, taglib is now preferred.
* mediatomb.xpm and manpage.xml is now included in orig tarball.
* inotify patch is not needed anymore.
* md5 patch has been committed upstream and is no longer needed. Also removed
  README.Debian.
* TwinHelix PNG fix is now used. Removed from TODO.
* Adding dependency of iceweasel for mediatomb package.
* Updated copyright file.
* Updated watch file.
* Updated rules file for proper configure options.

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-2007 Gena Batyan <bgeradz@mediatomb.cc>,
 
10
    Copyright (C) 2006-2008 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 1314 2007-05-27 15:22:26Z lww $
 
27
    $Id: edit_load.cc 1709 2008-03-01 15:35:51Z lww $
28
28
*/
29
29
 
30
30
/// \file edit_load.cc
73
73
    
74
74
    Ref<Element> title (new Element(_("title")));
75
75
    title->setText(obj->getTitle());
76
 
    title->addAttribute(_("editable"), obj->isVirtual() || objectID == CDS_ID_FS_ROOT ? _("1") : _("0"));
77
 
    item->appendChild(title);
 
76
    title->setAttribute(_("editable"), obj->isVirtual() || objectID == CDS_ID_FS_ROOT ? _("1") : _("0"));
 
77
    item->appendElementChild(title);
78
78
    
79
79
    Ref<Element> classEl (new Element(_("class")));
80
80
    classEl->setText(obj->getClass());
81
 
    classEl->addAttribute(_("editable"), _("1"));
82
 
    item->appendChild(classEl);
 
81
    classEl->setAttribute(_("editable"), _("1"));
 
82
    item->appendElementChild(classEl);
83
83
    
84
84
    int objectType = obj->getObjectType();
85
85
    item->appendTextChild(_("objType"), String::from(objectType));
90
90
        
91
91
        Ref<Element> description (new Element(_("description")));
92
92
        description->setText(objItem->getMetadata(_("dc:description")));
93
 
        description->addAttribute(_("editable"), _("1"));
94
 
        item->appendChild(description);
 
93
        description->setAttribute(_("editable"), _("1"));
 
94
        item->appendElementChild(description);
95
95
        
96
96
        Ref<Element> location (new Element(_("location")));
97
97
        location->setText(objItem->getLocation());
98
98
        if (IS_CDS_PURE_ITEM(objectType) || ! objItem->isVirtual())
99
 
            location->addAttribute(_("editable"),_("0"));
 
99
            location->setAttribute(_("editable"),_("0"));
100
100
        else
101
 
            location->addAttribute(_("editable"),_("1"));
102
 
        item->appendChild(location);
 
101
            location->setAttribute(_("editable"),_("1"));
 
102
        item->appendElementChild(location);
103
103
        
104
104
        Ref<Element> mimeType (new Element(_("mime-type")));
105
105
        mimeType->setText(objItem->getMimeType());
106
 
        mimeType->addAttribute(_("editable"), _("1"));
107
 
        item->appendChild(mimeType);
 
106
        mimeType->setAttribute(_("editable"), _("1"));
 
107
        item->appendElementChild(mimeType);
108
108
        
109
109
        if (IS_CDS_ITEM_EXTERNAL_URL(objectType))
110
110
        {
111
111
            Ref<Element> protocol (new Element(_("protocol")));
112
112
            protocol->setText(getProtocol(objItem->getResource(0)->getAttribute(_("protocolInfo"))));
113
 
            protocol->addAttribute(_("editable"), _("1"));
114
 
            item->appendChild(protocol);
 
113
            protocol->setAttribute(_("editable"), _("1"));
 
114
            item->appendElementChild(protocol);
115
115
        }
116
116
        else if (IS_CDS_ACTIVE_ITEM(objectType))
117
117
        {
119
119
            
120
120
            Ref<Element> action (new Element(_("action")));
121
121
            action->setText(objActiveItem->getAction());
122
 
            action->addAttribute(_("editable"), _("1"));
123
 
            item->appendChild(action);
 
122
            action->setAttribute(_("editable"), _("1"));
 
123
            item->appendElementChild(action);
124
124
            
125
125
            Ref<Element> state (new Element(_("state")));
126
126
            state->setText(objActiveItem->getState());
127
 
            state->addAttribute(_("editable"), _("1"));
128
 
            item->appendChild(state);
 
127
            state->setAttribute(_("editable"), _("1"));
 
128
            item->appendElementChild(state);
129
129
        }
130
130
    }
131
131
    
132
 
    root->appendChild(item);
 
132
    root->appendElementChild(item);
133
133
    //log_debug("serving XML: \n%s\n",  root->print().c_str());
134
134
}