Mittwoch, 15. Mai 2013

New RQL Queries IF and FOR in Cleaner RQL

While seeting up the cleaner job (Excleanerbur how it is called in development), I found interesting new RQL Queries. RQLCOMMAND allows if and elseif queries as well as for loops. Richt now I'm unsure, whether this is limited to projects, language variants and project variants, or if this can be used in a general way. As soon as I find more time, I will investigate fruther. This might speed up complex RQL scripts a lot.

<?xml version="1.0" encoding="UTF-8"?>
<RQLCOMMAND type="for" name="PROJECTS">
    <LIST>
        <IODATA loginguid="[!guid_login!]">
            <ADMINISTRATION>
                <USER guid="[!guid_user!]">
                    <PROJECTS action="list" extendedinfo="1"/>
                </USER>
            </ADMINISTRATION>
        </IODATA>
    </LIST>
    <OBJECTIVES>
        <RQLCOMMAND type="if">
            <WHERE name="testproject" value="0" operator="="/>
            <OBJECTIVES>
                <RQLCOMMAND type="if">
                    <WHERE name="inhibitlevel" value="0" operator="="/>
                    <WHERE name="inhibitlevel" value="1" operator="="/>
                    <WHERE name="inhibitlevel" value="2" operator="="/>
                    <WHERE name="inhibitlevel" value="3" operator="="/>
                    <WHERE name="inhibitlevel" value="4" operator="="/>
                    <WHERE name="inhibitlevel" value="5" operator="="/>
                    <OBJECTIVES>
                        <RQLCOMMAND type="if">
                            <WHERE name="lockedbysystem" value="0" operator="="/>
                            <OBJECTIVES>
                               
                                <IODATA loginguid="[!guid_login!]">
                                    <ADMINISTRATION action="validate" guid="[!guid_login!]" useragent="script">
                                        <PROJECT guid="[!guid_project!]"/>
                                    </ADMINISTRATION>
                                </IODATA>
                                <RQLCOMMAND type="for" name="PROJECTVARIANTS">
                                    <LIST>
                                        <IODATA sessionkey="[!key!]" loginguid="[!guid_login!]">
                                            <PROJECT>
                                                <PROJECTVARIANTS action="list" />
                                            </PROJECT>
                                        </IODATA>
                                    </LIST>
                                    <OBJECTIVES>
                                        <RQLCOMMAND type="for" name="LANGUAGEVARIANTS">
                                            <LIST>
                                                <IODATA loginguid="[!guid_login!]" sessionkey="[!key!]">
                                                    <PROJECT>
                                                        <PROJECTVARIANTS action="load">
                                                            <PROJECTVARIANT guid="[!guid_projectvariant!]"/>
                                                        </PROJECTVARIANTS>
                                                    </PROJECT>
                                                </IODATA>
                                            </LIST>
                                            <OBJECTIVES>
                                                <RQLCOMMAND type="if">
                                                    <WHERE name="cleanuplive server" value="1" operator="="/>
                                                    <OBJECTIVES>
                                                        <IODATA loginguid="[!guid_login!]" sessionkey="[!key!]">
                                                            <PROJECT>
                                                                <CLEANER action="delete" projectvariantguid="[!guid_projectvariant!]" languagevariantguid="[!guid_languagevariant!]">
                                                                    <EMAIL subject="[!mail_subject!]" userguid="[!guid_recipient!]">
                                                                <![CDATA[You can insert an optional email text here.]]>
                                                                    </EMAIL>
                                                                </CLEANER>
                                                            </PROJECT>
                                                        </IODATA>
                                                    </OBJECTIVES>
                                                </RQLCOMMAND>
                                            </OBJECTIVES>
                                        </RQLCOMMAND>
                                    </OBJECTIVES>
                                </RQLCOMMAND>
                                
                            </OBJECTIVES>
                        </RQLCOMMAND>
                    </OBJECTIVES>
                </RQLCOMMAND>
            </OBJECTIVES>
        </RQLCOMMAND>
    </OBJECTIVES>
</RQLCOMMAND>

Keine Kommentare:

Kommentar veröffentlichen