4 Replies Latest reply on Jan 26, 2016 10:16 AM by Olivier Renault

    unable to create a complex command !!!

    Olivier Renault

      Hi

      A web portal needs to have the list of roles of a rbacuser in only one command. I said that it is possible with a complex command.

      The complex commd should do like this script:

       

      blcli_execute RBACUser findByName $userName

      blcli_execute RBACUser getRoles

      blcli_execute Utility setTargetObject

      blcli_storeenv roleList

       

      So I created this complex command xml file with the same commands:

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE command_inventory SYSTEM "file://bladelogic.com/dtds/Command-Inventory.dtd">

      <command_inventory>

          <name_space name="RBACUser">

              <complex_command command_id="listRoles" published="yes" release="yes">

                  <name>listRoles</name>

                  <description>

                      <author>Olivier RENAULT</author>

                      <general_info>List all roles id from a username</general_info>

                      <paragraph>

                          <string_literal>This command lists all rolesid of a user.</string_literal>

                      </paragraph>

                      <return_value_info>id of the roles</return_value_info>

                  </description>

                  <argument_list>

                  <argument name="userName" desc="name of the user.">java.lang.String</argument>

                  </argument_list>

                  <commands_to_execute>

                      <command_invocation>

                          <namespace_ref>RBACUser</namespace_ref>

                          <name>findByName</name>

                          <input>$userName$</input>

                      </command_invocation>

                      <command_invocation>

                          <namespace_ref>RBACUser</namespace_ref>

                          <name>getRoles</name>

                          <input/>

                      </command_invocation>

                      <command_invocation>

                          <namespace_ref>Utility</namespace_ref>

                          <name>setTargetObject</name>

                          <input/>

                      </command_invocation>

                          <store_result>

                              <name>roleList</name>

                          </store_result>

                  </commands_to_execute>   

              </complex_command>

          </name_space>

      </command_inventory>

       

      It does not work

      in the logs I see :

      Failed to parse file : /opt/application/sgaapp/current/NSH/br/server_xml/cli/RBAC-PS_InterfaceWS_Additional_G5R0C0S0F0.xml

      Error was at line 37 and column 26

      Name space : RBACUser has no commands by name : listRoles

       

      I don't understand where is the problem.

      Can you help me ?

        • 1. Re: unable to create a complex command !!!
          Bill Robinson

          problem is at the end:

          <command_invocation>

                              <namespace_ref>Utility</namespace_ref>

                              <name>setTargetObject</name>

                              <input/>

                          </command_invocation>

                              <store_result>

                                  <name>roleList</name>

                              </store_result>

                      </commands_to_execute>   

           

          should be

           

          <command_invocation>

                              <namespace_ref>Utility</namespace_ref>

                              <name>setTargetObject</name>

                              <input/>

                              <store_result>

                                  <name>roleList</name>

                              </store_result>

                      </commands_to_execute>   

                      </command_invocation>
          • 2. Re: unable to create a complex command !!!
            Olivier Renault

            thanks Bill.

            You probably meant

                 <command_invocation>

                                <namespace_ref>Utility</namespace_ref>

                                <name>setTargetObject</name>

                                <input/>

                                <store_result>

                                    <name>roleList</name>

                                </store_result>

                  </command_invocation>

            </commands_to_execute>

             

             

            It works. I added a second complex command in my file without trouble.

            • 3. Re: unable to create a complex command !!!
              Bill Robinson

              Yeah – but you don’t need to store the result of the last command.

              • 4. Re: unable to create a complex command !!!
                Olivier Renault

                ok, thank you for all these informations.