PUT a reportUnit through REST fails - Tomcat error

0

Dots represent \r\n

PUT /jasperserver/rest/resource/reports/Customers/3221/Wasser1 HTTP/1.1.
Host: 10.84.6.166:8080.
Accept: */*.
Cookie: JSESSIONID=D170F2EA5110E4ADA55515C8F1B4D68F.
X-HTTP-Method-Override: PUT.
Content-Length: 1697.
.
<resourcedescriptor isnew="true" name="Wasser1" uristring="/reports/Customers/3221/Wasser1" wstype="reportUnit">
    <label>
        <!--[CDATA[test_report(test.jrxml)]]-->
    </label>
    <description>
        <!--[CDATA[Wasser1 generated by Jasper.php through REST Mon, 15 Jul 2013 09:57:56 +0200]]-->
    </description>
    <resourceproperty name="PROP_PARENT_FOLDER">
        <value>
            <!--[CDATA[/reports/Customers/3221]]-->
        </value>
    </resourceproperty>
    <resourceproperty name="PROP_HAS_DATA">
        <value>
            <!--[CDATA[false]]-->
        </value>
    </resourceproperty>
    <resourceproperty name="PROP_IS_REFERENCE">
        <value>
            <!--[CDATA[false]]-->
        </value>
    </resourceproperty>
    <resourceproperty name="PROP_RESOURCE_TYPE">
        <value>
            <!--[CDATA[com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.ReportUnit]]-->
        </value>
    </resourceproperty>
    <resourceproperty name="PROP_RU_ALWAYS_PROPMT_CONTROLS">
        <value>
            <!--[CDATA[false]]-->
        </value>
    </resourceproperty>
    <resourceproperty name="PROP_RU_CONTROLS_LAYOUT">
        <value>
            <!--[CDATA[1]]-->
        </value>
    </resourceproperty>
    <resourcedescriptor isnew="false" name="test02" uristring="/reports/Customers/3221/test02" wstype="jrxml">
        <label>
            <!--[CDATA[test02 Report]]-->
        </label>
        <description>
            <resourceproperty name="PROP_PARENT_FOLDER">
                <value>
                    <!--[CDATA[/reports/Customers/3221]]-->
                </value>
            </resourceproperty>
            <resourceproperty name="PROP_HAS_DATA">
                <value>
                    <!--[CDATA[true]]-->
                </value>
            </resourceproperty>
            <resourceproperty name="PROP_IS_REFERENCE">
                <value>
                    <!--[CDATA[false]]-->
                </value>
            </resourceproperty>
            <resourceproperty name="PROP_RESOURCE_TYPE">
                <value>
                    <!--[CDATA[com.jaspersoft.jasperserver.api.metadata.common.domain.FileResource]]-->
                </value>
            </resourceproperty>
            <resourceproperty name="PROP_SECURITY_PERMISSION_MASK">
                <value>
                    <!--[CDATA[31]]-->
                </value>
            </resourceproperty>
        </description>
    </resourcedescriptor>
</resourcedescriptor>

Response:

HTTP/1.1 400 Bad Request.
The request sent by the client was syntactically incorrect ().

What can be wrong?

d.wendler's picture
Joined: Jun 21 2013 - 7:23am
Last seen: 6 years 2 months ago

1 Answer:

0

I found out that child ResourceDescriptors are references to themselves,

so I had to add:

PROP_RU_IS_REFERENCE = true
PROP_RU_REFERENCE_URI = uriString

for it to work!

d.wendler's picture
Joined: Jun 21 2013 - 7:23am
Last seen: 6 years 2 months ago
Feedback
randomness