5 Replies Latest reply on Nov 24, 2010 10:42 AM by backroom boy

    Question about  getSpaceContents and XSLT.

    backroom boy Level 1

      Hello everybody. Have some problems with understanding of working with getSpaceContents. I Have some *.xmls in ContentSpace and need put each of them into varaiable (to work with it in loop). How should I do it correct? The point of loop is :I have some xmls with one xsd into ContentSpace, i must to produce set of xmls (with another xsd) using xslt.First xsd looks like : Supplier, Good(unbounded) , second like : Good , Supplier(unbounded).I.e. each xmls with 1st xsd have 1 of all suppliers and list of goods, the 2nd have one of all goods and list of suppliers,corresponding to it.Could anyone give an idea , how to do it the best way? The problem is , that the information to make one of output xmls  contained in each of  input xmls.

       

      Thx in advance.

        • 1. Re: Question about  getSpaceContents and XSLT.
          backroom boy Level 1

          upd:

          The problem of working with getSpaceContents : i made a variable doclist ( list<CRCResult> ). After getSpaceContents operation doclist looks like that :

          <list>
            <com.adobe.livecycle.contentservices.client.impl.CRCResultImpl>
              <attributeMap>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}creator</string>
                  <string>usersystemcontext/DefaultDom</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}browse-link</string>
                  <string>http://81.5.113.36:8080/contentspace/wcs/api/node/content/workspace/SpacesStore/42dbbb75-abfa-43e1-96cd-b3454477d541/ID_1_Урожай.xml</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/system/1.0}store-protocol</string>
                  <string>workspace</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}content</string>
                  <string>contentUrl=store://2010/11/17/18/54/d143cd65-1dfc-460e-88cb-1f08975ecfea.bin|mimetype=text/xml|size=3968|encoding=UTF-8|locale=en_</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/system/1.0}node-uuid</string>
                  <string>42dbbb75-abfa-43e1-96cd-b3454477d541</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}modifier</string>
                  <string>usersystemcontext/DefaultDom</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}name</string>
                  <string>ID_1_Урожай.xml</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}qualified-path</string>
                  <string>/app:company_home/cm:RetailerSupplierInteraction/cm:Proposal/cm:ID_1_Урожай.xml</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}modified</string>
                  <date>2010-11-17 18:54:32.622 MSK</date>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}node-type</string>
                  <string>{http://www.alfresco.org/model/content/1.0}content</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}folder-path</string>
                  <string>/Company Home/RetailerSupplierInteraction/Proposal</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}created</string>
                  <date>2010-08-26 12:45:12.512 MSD</date>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/system/1.0}store-identifier</string>
                  <string>SpacesStore</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}resolved-path</string>
                  <string>/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1.0}RetailerSupplierInteraction/{http://www.alfresco.org/model/content/1.0}Proposal/{http://www.alfresco.org/model/content/1.0}ID_1_Урожай.xml</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/system/1.0}node-dbid</string>
                  <long>629</long>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}content-type</string>
                  <string>text/xml</string>
                </entry>
              </attributeMap>
              <document serialization="custom">
                <com.adobe.idp.Document>
                  <int>3</int>
                  <boolean>false</boolean>
                  <boolean>false</boolean>
                  <null/>
                  <string>81.5.113.36/127.0.0.1</string>
                  <null/>
                  <null/>
                  <null/>
                  <string>IOR:000000000000002849444C3A636F6D2F61646F62652F6964702F49446F63756D656E7443616C6C6261636B3A312E30000000000200000000000000EC000102000000000C38312E352E3131332E3336000DC8000000000015353834393831363137302F01163C37231524460635000000000000050000000000000008000000004A414300000000010000001C000000000501000100000001050100010001010900000001050100010000002100000060000000000000000100000000000000240000001E0000007E00000000000000010000000C38312E352E3131332E3336000DC9004000000000000000000000001004010008060667810201010100000000000000000000000000000000000000000000002000000004000000000000001F0000000400000003000000010000002000000000000000020000002000000004000000000000001F0000000400000003</string>
                  <int>82</int>
                  <string>text/xml</string>
                  <null/>
                  <map>
                    <entry>
                      <string>basename</string>
                      <string>ID_1_Урожай.xml</string>
                    </entry>
                    <entry>
                      <string>file</string>
                      <string>ID_1_Урожай.xml</string>
                    </entry>
                    <entry>
                      <string>wsfilename</string>
                      <string>ID_1_Урожай.xml</string>
                    </entry>
                  </map>
                  <string>adobe/idp/DocumentPullServant/adobejb_null</string>
                  <long>-1</long>
                </com.adobe.idp.Document>
              </document>
            </com.adobe.livecycle.contentservices.client.impl.CRCResultImpl>
            <com.adobe.livecycle.contentservices.client.impl.CRCResultImpl>
              <attributeMap>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}creator</string>
                  <string>usersystemcontext/DefaultDom</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}browse-link</string>
                  <string>http://81.5.113.36:8080/contentspace/wcs/api/node/content/workspace/SpacesStore/0ac06777-e5ae-48ef-99d8-1ed029253987/ID_2_Три топора.xml</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/system/1.0}store-protocol</string>
                  <string>workspace</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}content</string>
                  <string>contentUrl=store://2010/11/17/18/55/3ad2fac7-2b6e-4dae-a87a-382ca0f35fd4.bin|mimetype=text/xml|size=3979|encoding=UTF-8|locale=en_</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/system/1.0}node-uuid</string>
                  <string>0ac06777-e5ae-48ef-99d8-1ed029253987</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}modifier</string>
                  <string>usersystemcontext/DefaultDom</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}name</string>
                  <string>ID_2_Три топора.xml</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}qualified-path</string>
                  <string>/app:company_home/cm:RetailerSupplierInteraction/cm:Proposal/cm:ID_2_Три_x0020_топора.xml</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}modified</string>
                  <date>2010-11-17 18:55:26.206 MSK</date>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}node-type</string>
                  <string>{http://www.alfresco.org/model/content/1.0}content</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}folder-path</string>
                  <string>/Company Home/RetailerSupplierInteraction/Proposal</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}created</string>
                  <date>2010-08-26 12:49:54.431 MSD</date>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/system/1.0}store-identifier</string>
                  <string>SpacesStore</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}resolved-path</string>
                  <string>/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1.0}RetailerSupplierInteraction/{http://www.alfresco.org/model/content/1.0}Proposal/{http://www.alfresco.org/model/content/1.0}ID_2_Три_x0020_топора.xml</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/system/1.0}node-dbid</string>
                  <long>630</long>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}content-type</string>
                  <string>text/xml</string>
                </entry>
              </attributeMap>
              <document serialization="custom">
                <com.adobe.idp.Document>
                  <int>3</int>
                  <boolean>false</boolean>
                  <boolean>false</boolean>
                  <null/>
                  <string>81.5.113.36/127.0.0.1</string>
                  <null/>
                  <null/>
                  <null/>
                  <string>IOR:000000000000002849444C3A636F6D2F61646F62652F6964702F49446F63756D656E7443616C6C6261636B3A312E30000000000200000000000000EC000102000000000C38312E352E3131332E3336000DC8000000000015353834393831363137302F01163C37231524460635000000000000050000000000000008000000004A414300000000010000001C000000000501000100000001050100010001010900000001050100010000002100000060000000000000000100000000000000240000001E0000007E00000000000000010000000C38312E352E3131332E3336000DC9004000000000000000000000001004010008060667810201010100000000000000000000000000000000000000000000002000000004000000000000001F0000000400000003000000010000002000000000000000020000002000000004000000000000001F0000000400000003</string>
                  <int>83</int>
                  <string>text/xml</string>
                  <null/>
                  <map>
                    <entry>
                      <string>basename</string>
                      <string>ID_2_Три топора.xml</string>
                    </entry>
                    <entry>
                      <string>file</string>
                      <string>ID_2_Три топора.xml</string>
                    </entry>
                    <entry>
                      <string>wsfilename</string>
                      <string>ID_2_Три топора.xml</string>
                    </entry>
                  </map>
                  <string>adobe/idp/DocumentPullServant/adobejb_null</string>
                  <long>-1</long>
                </com.adobe.idp.Document>
              </document>
            </com.adobe.livecycle.contentservices.client.impl.CRCResultImpl>
            <com.adobe.livecycle.contentservices.client.impl.CRCResultImpl>
              <attributeMap>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}creator</string>
                  <string>usersystemcontext/DefaultDom</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}browse-link</string>
                  <string>http://81.5.113.36:8080/contentspace/wcs/api/node/content/workspace/SpacesStore/c793f4b8-0f42-462c-a75b-d104f286f66f/ID_3_Теремок.xml</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/system/1.0}store-protocol</string>
                  <string>workspace</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}content</string>
                  <string>contentUrl=store://2010/11/17/18/56/b57edc81-c288-4258-9710-18632ad86a66.bin|mimetype=text/xml|size=3974|encoding=UTF-8|locale=en_</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/system/1.0}node-uuid</string>
                  <string>c793f4b8-0f42-462c-a75b-d104f286f66f</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}modifier</string>
                  <string>usersystemcontext/DefaultDom</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}name</string>
                  <string>ID_3_Теремок.xml</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}qualified-path</string>
                  <string>/app:company_home/cm:RetailerSupplierInteraction/cm:Proposal/cm:ID_3_Теремок.xml</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}modified</string>
                  <date>2010-11-17 18:56:05.332 MSK</date>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}node-type</string>
                  <string>{http://www.alfresco.org/model/content/1.0}content</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}folder-path</string>
                  <string>/Company Home/RetailerSupplierInteraction/Proposal</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}created</string>
                  <date>2010-08-26 12:51:10.671 MSD</date>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/system/1.0}store-identifier</string>
                  <string>SpacesStore</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}resolved-path</string>
                  <string>/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1.0}RetailerSupplierInteraction/{http://www.alfresco.org/model/content/1.0}Proposal/{http://www.alfresco.org/model/content/1.0}ID_3_Теремок.xml</string>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/system/1.0}node-dbid</string>
                  <long>631</long>
                </entry>
                <entry>
                  <string>{http://www.alfresco.org/model/content/1.0}content-type</string>
                  <string>text/xml</string>
                </entry>
              </attributeMap>
              <document serialization="custom">
                <com.adobe.idp.Document>
                  <int>3</int>
                  <boolean>false</boolean>
                  <boolean>false</boolean>
                  <null/>
                  <string>81.5.113.36/127.0.0.1</string>
                  <null/>
                  <null/>
                  <null/>
                  <string>IOR:000000000000002849444C3A636F6D2F61646F62652F6964702F49446F63756D656E7443616C6C6261636B3A312E30000000000200000000000000EC000102000000000C38312E352E3131332E3336000DC8000000000015353834393831363137302F01163C37231524460635000000000000050000000000000008000000004A414300000000010000001C000000000501000100000001050100010001010900000001050100010000002100000060000000000000000100000000000000240000001E0000007E00000000000000010000000C38312E352E3131332E3336000DC9004000000000000000000000001004010008060667810201010100000000000000000000000000000000000000000000002000000004000000000000001F0000000400000003000000010000002000000000000000020000002000000004000000000000001F0000000400000003</string>
                  <int>84</int>
                  <string>text/xml</string>
                  <null/>
                  <map>
                    <entry>
                      <string>basename</string>
                      <string>ID_3_Теремок.xml</string>
                    </entry>
                    <entry>
                      <string>file</string>
                      <string>ID_3_Теремок.xml</string>
                    </entry>
                    <entry>
                      <string>wsfilename</string>
                      <string>ID_3_Теремок.xml</string>
                    </entry>
                  </map>
                  <string>adobe/idp/DocumentPullServant/adobejb_null</string>
                  <long>-1</long>
                </com.adobe.idp.Document>
              </document>
            </com.adobe.livecycle.contentservices.client.impl.CRCResultImpl>
          </list>

          I read Help about CRCResult variable, it is said there ,that we can receive the information like document, link , etc. from it. I can't figure out how to do it.So the question : what function should we apply or how can we get access to what we need? For example, i want to get document from the doclist.

          Thanks in advance.

          • 2. Re: Question about  getSpaceContents and XSLT.
            Jasmin Charbonneau Level 4

            From the list you can get the folder path and the node name for each document. You can use the following

            xPaths:

             

            /process_data/CRCResult/object/@folderPath

            /process_data/CRCResult/object/@nodeName.

             

            Then you need to call the GetContent operation with the node id. The node id should be /process_data/CRCResult/object/@folderPath + "/" + /process_data/CRCResult/object/@nodeName .

             

            The document itself is not part of the list. You need to make another call to get the document.

             

            Jasmin

            1 person found this helpful
            • 3. Re: Question about  getSpaceContents and XSLT.
              backroom boy Level 1

              Jasmin, thank you for reply. But i still can't make this thing to work correct.

              Step by step: i have variable xmlList (list<CRCResult>).I use it as output in getContentsSpace .Once it is a list , the first CRCResult  should be accessed xmlList[1] .Am I right? The error occurred ,while i am trying to do it.Next, you said , that we can obtain path and name through xpath. I tried to do it, like you described , didn't work. Could you please explain the xpath request to Data items of CRCResult . Why we are using /object/ in path to item?(Is it obligatory to all complex data types). http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/help.htm?content=003077.html

              - here it is said that there are a much more data items , we can access to. (There is a document item also). So, can we actually  access to other document using  /CRCResult/object/@document ?  I'm sorry for stupid questions, but i am totally confused.

              Thanks in advance.

              • 4. Re: Question about  getSpaceContents and XSLT.
                Jasmin Charbonneau Level 4

                Once it is a list , the first CRCResult  should be accessed xmlList[1] .Am I right?


                I don't think so. At this point you don't have an XMLList. You have a list of CRCResult. The xml you see (from the post above) is just a representation of that structure.

                 

                Next, you said , that we can obtain path and name through xpath. I tried to do it, like you described , didn't work.

                 

                I'm using that xPath expression from within Workbench. What I'm doing is I create my own XML structure that extracts the CRCResult properties that I need  and I make that xml variable my output varibale. I consume that with a Flex application later on.

                 

                Why we are using /object/ in path to item?(Is it obligatory to all complex data types)?

                 

                You get that when you use xPath within Workbench.

                 

                here it is said that there are a much more data items , we can access to. (There is a document item also)

                 

                This is what I get in my content node (again from Workbench):

                contentUrl=store://2010/11/16/14/48/61d82cf6-9171-4cc5-9b3b-6e95beeb4f14.bin|mimetype=appl ication/pdf|size=41079|encoding=UTF-8|locale=en_US_

                 

                Jasmin

                • 5. Re: Question about  getSpaceContents and XSLT.
                  backroom boy Level 1

                  Jasmin, thank you for reply.

                  Once it is a list , the first CRCResult  should be accessed xmlList[1] .Am I right?


                  I  don't think so. At this point you don't have an XMLList. You have a  list of CRCResult. The xml you see (from the post above) is just a  representation of that structure.

                   

                  Then how we suppose to select each of CRCResult from the list , i.e. how will we select @parametr from particular CRCResult if we don't mention from which ?(there are several files, so we recieve list of several CRCResults . How do we know , what file's paramentr we obtain?)

                   

                  I'm using that xPath expression from within Workbench. What I'm doing is  I create my own XML structure that extracts the CRCResult properties  that I need  and I make that xml variable my output varibale. I consume  that with a Flex application later on.

                   

                  I don't know why, but while i try to receive path and node name , through the same xpaths  you mentioned, to the string variable , for example, it is not working.

                  Could you please send me the *.lca of simple working proccess : getSpaceContents and setValue (with all these xpaths ).I will be grateful.

                   

                  Thanks in advance.