API LayoutRegionMediaDelete not work

Asked by Enrico

hello i meke 2 script for testing API i'm running xibo 1.6.4 servero on linux

1 Script

#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Script to upload a Video to the Xibo CMS and replace
# an old copy of it in a region

# Imports
import os
from xml.dom import minidom
import XiboAPI

api = XiboAPI.XiboAPI()

# Call the LayoutList Method
response, status, code, message, content = api.callMethod('LayoutList')

# Parse the response XML
doc = minidom.parseString(content)

params = [('layoutId', '4'),
          ('regionId', '47ff29524ce1b'),
          ('mediaiId', '2fd03b0503316a593dcbdb67c8999e59')]

# Call the RegionList Method
response, status, code, message, content = api.callMethod('LayoutRegionMediaDelete', params)
duration=100
params = [('layoutid', '6'),
          ('regionid', '54c00c67e199c'),
        ('type', 'webpage'),
          ('xlf', '<media type="webpage" duration="' + str(duration) + """" schemaVersion="1">
                        <options>
                              <uri>http%3A%2F%2Flocalhost</uri>
                              <scaling>100</scaling>
                              <transparency>0</transparency>
                              <offsetLeft>0</offsetLeft>
                              <offsetTop>0</offsetTop>
                        </options>
                   <raw></raw>
                   </media>""",)]

# Call the RegionList Method
response, status, code, message, content = api.callMethod('LayoutRegionMediaAdd', params)

this script work correctly this is my log output.

-- Cut Log --
13065 2015-01-22 09:50:16 RestXml Respond <?xml version="1.0"?>
<rsp status="ok">
<media id="f26e40590e18fd3cf56b99120554b7a1"/>
</rsp>
13064 2015-01-22 09:50:16 Finished Updating Region
13063 2015-01-22 09:50:16 Layout SetValid OUT
13062 2015-01-22 09:50:16 module SetMediaInformation Existing Assigned Media XML is: \n <?xml version="1.0"?>
<root><media type="webpage" duration="100" schemaVersion="1" id="fe4e5cc1a76f023e60fb23decd4d1042" userId="3">
<options>
<uri>http%3A%2F%2Flocalhost</uri>
<scaling>100</scaling>
<transparency>0</transparency>
<offsetLeft>0</offsetLeft>
<offsetTop>0</offsetTop>
</options>
<raw/>
</media></root>
13061 2015-01-22 09:50:16 Layout GetLayoutXml OUT
13060 2015-01-22 09:50:16 Layout GetLayoutXml IN
13059 2015-01-22 09:50:16 Module created with MediaID: fe4e5cc1a76f023e60fb23decd4d1042 LayoutID: 6 and RegionID: 54c00c67e199c
13058 2015-01-22 09:50:16 Layout GetLayoutXml OUT
13057 2015-01-22 09:50:16 Layout GetLayoutXml IN
13056 2015-01-22 09:50:16 layout IsValid Assessing Region: 54c00c67e199c
13055 2015-01-22 09:50:16 layout GetRegionList [OUT]
13054 2015-01-22 09:50:16 layout GetRegionList [IN] Loaded XML into DOM
13053 2015-01-22 09:50:16 layout SetDomXML Loaded LayoutXml into the DOM
13052 2015-01-22 09:50:16 layout SetDomXML Loading LayoutXml into the DOM
13051 2015-01-22 09:50:16 Layout GetLayoutXml OUT
13050 2015-01-22 09:50:16 Layout GetLayoutXml IN
13049 2015-01-22 09:50:16 layout IsValid Reassesment Required
13048 2015-01-22 09:50:16 layout IsValid [IN]
13047 2015-01-22 09:50:16 Layout SetValid IN
13046 2015-01-22 09:50:16 Layout SetLayoutXml OUT
13045 2015-01-22 09:50:16 display NotifyDisplays Checking for Displays to refresh on Layout 3
13044 2015-01-22 09:50:16 Layout SetLayoutXml IN
13043 2015-01-22 09:50:16 LayoutMediaGroupSecurity Link OUT
13042 2015-01-22 09:50:16 LayoutMediaGroupSecurity Link IN
13041 2015-01-22 09:50:16 region AddMedia <media type="webpage" duration="100" schemaVersion="1" id="f26e40590e18fd3cf56b99120554b7a1" userId="3">
<options>
<uri>http%3A%2F%2Flocalhost</uri>
<scaling>100</scaling>
<transparency>0</transparency>
<offsetLeft>0</offsetLeft>
<offsetTop>0</offsetTop>
</options>
<raw/>
</media>
13040 2015-01-22 09:50:16 Layout GetLayoutXml OUT
13039 2015-01-22 09:50:16 Layout GetLayoutXml IN
13038 2015-01-22 09:50:16 Updating Region
13037 2015-01-22 09:50:16 module ValidateMediaXml A new media entry
13036 2015-01-22 09:50:16 module ValidateMediaXml Validating provided XLF
13035 2015-01-22 09:50:16 module SetMediaXml Provided XML Loaded
13034 2015-01-22 09:50:16 module SetMediaXml Setting the media XML for this item directly
13033 2015-01-22 09:50:16 Module created with MediaID: LayoutID: 6 and RegionID: 54c00c67e199c
13032 2015-01-22 09:50:16 Layout GetLayoutXml OUT
13031 2015-01-22 09:50:16 Layout GetLayoutXml IN
13030 2015-01-22 09:50:16 Services Authenticated API call for [LayoutRegionMediaAdd] with a [xml] response. Issued by UserId: 3

After I make an second script to delete the new media

2 Script

#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Script to upload a Video to the Xibo CMS and replace
# an old copy of it in a region

# Imports
import os
from xml.dom import minidom
import XiboAPI

api = XiboAPI.XiboAPI()

params = [('layoutId', '6'),
          ('regionId', '54c00c67e199c'),
          ('mediaId', 'fe4e5cc1a76f023e60fb23decd4d1042')]

# Call the RegionList Method
response, status, code, message, content = api.callMethod('LayoutRegionMediaDelete', params)

this script not delete the media end send me this error

-- Cut Log --
13069 2015-01-22 09:57:36 <errormsg>No results returned</errormsg>
                                                                        <errornum>1024</errornum>
                                                                        <errortype>User Notice</errortype>
                                                                        <scriptname>/var/www/xibo/lib/service/rest.class.php</scriptname>
                                                                        <scriptlinenum>1036</scriptlinenum>
13068 2015-01-22 09:57:36 Layout GetLayoutXml OUT
13067 2015-01-22 09:57:36 Layout GetLayoutXml IN
13066 2015-01-22 09:57:36 Services Authenticated API call for [LayoutRegionMediaDelete] with a [xml] response. Issued by UserId: 3

please help me

Question information

Language:
English Edit question
Status:
Answered
For:
Xibo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dan Garner (dangarner) said :
#1

I've answered you on Github.
Thanks,
Dan

Can you help with this problem?

Provide an answer of your own, or ask Enrico for more information if necessary.

To post a message you must log in.