Mimi nilikuwa kufanya baadhi ya utafiti kwa ajili ya mtu leo karibu huduma list.asmx mtandao zinazotolewa kama sehemu ya SharePoint 2010 (na mapema). Aliweza kupata vitu orodha katika folder mizizi (ikiwa ni pamoja na majina ya ndogo folders-), lakini hakuweza kupata vitu katika sub-folders. Sikuweza baadhi kuangalia kote juu ya internets na ni swali kushangaza kawaida. Hata hivyo, Sikuweza kupata jibu zuri kwa swali rahisi, "Kama najua folder, jinsi gani mimi kupata vitu katika folder?" Kuwa waaminifu, Mimi si kujaribu ngumu kwamba wote tangu nimekuwa alitaka kufikiri hii moja nje peke yangu kwa muda .
Kuweka hii up, Mimi umba tovuti aitwaye "Mabalozi Matukio ya" na orodha desturi aitwaye "Desturi Orodha Folders na Sub". Mimi kisha kuundwa folders aitwaye:
- Mwaka 2005
- Mwaka 2006
- Mwaka 2007
Mimi aliongeza vitu kadhaa na "Mwaka 2006" folder. Hii ni nini inaonekana kama:
Rafiki yangu si kuandika C # kanuni lakini badala ya kutumia Java, hivyo bahasha sabuni ilikuwa nini yeye kweli inahitajika. Kupata kwamba, Niliandika kidogo ya jQuery na kisha kutumika fiddler kupata halisi HTTP mazungumzo.
Hapa ni jQuery husika (Mimi kunakiliwa kanuni chini chini kama unataka nakala / kuweka):
Wao muhimu ya kwanza ni pamoja na wawili <queryOptions> na <QueryOptions> nodi. muhimu ya pili ni kwamba <Folder> nodi ni URL ambayo mteja ana upatikanaji.
Kunaweza kuwa na njia nyingine ya kupata hii, lakini hii kazi vizuri kwa ajili yangu wakati wa kutumia jQuery.
Hapa ni bahasha sabuni kwa juu:
<soapenv:Bahasha xmlns:soapenv =’http://schemas.xmlsoap.org / sabuni / bahasha /’>
<soapenv:Mwili>
<GetListItems xmlns =’http://schemas.microsoft.com / SharePoint / sabuni /’>
<Deciduous>Orodha ya desturi na Folders Sub</Deciduous>
<viewFields>
<ViewFields>
<FieldRef Jina = 'Kichwa’ />
<FieldRef Jina = 'EncodedAbsUrl’ />
</ViewFields>
</viewFields>
<queryOptions>
<QueryOptions>
<Folder>http://demoserver1/Blogging Matukio / orodha / Orodha ya Desturi na Folders Sub / Mwaka 2006</Folder>
</QueryOptions>
</queryOptions>
</GetListItems>
</soapenv:Mwili>
</soapenv:Bahasha>
mengi ya mifano na majadiliano kote hii imesababisha mimi kuamini kwamba kila nahitaji mara <QueryOptions> na kutaja jina folder. Kwa ajili yangu, Nahitaji wote wrap ndani ya <queryOptions> vilevile kutaja URL kikamilifu waliohitimu kwa <Folder> nodi.
Hapa ni jQuery AJAX kuanzisha:
$(hati).tayari(kazi() {
mara soapEnv =
"<soapenv:Bahasha xmlns:soapenv =’http://schemas.xmlsoap.org / sabuni / bahasha /’> \
<soapenv:Mwili> \
<GetListItems xmlns =’http://schemas.microsoft.com / SharePoint / sabuni /’> \
<Deciduous>Orodha ya desturi na Folders Sub</Deciduous> \
<viewFields> \
<ViewFields> \
<FieldRef Jina = 'Kichwa’ /> \
<FieldRef Jina = 'EncodedAbsUrl’ /> \
</ViewFields> \
</viewFields> \
<queryOptions> \
<QueryOptions> \
<Folder>http://demoserver1/Blogging Matukio / orodha / Orodha ya Desturi na Folders Sub / Mwaka 2006</Folder> \
</QueryOptions> \
</queryOptions> \
</GetListItems> \
</soapenv:Mwili> \
</soapenv:Bahasha>";
</mwisho>
Kufuata yangu juu ya Twitter kwa http://www.twitter.com/pagalvin
Hi
I am trying to display the documents under a specific folder using a SPD 2010 DataSource GetListItems
Once I connect to to my web service and enter the guid for the document library
I can modify the QueryOptions and enter the following piece of CAML
Compliance Training\CompanyX.
Only this does not return any results – removing the QueryOptions parameter returns all the documents in the root document library….
Am I looking at passing some sort of view parameter and include the view guid.
This is a very old post/comment so sorry for never replying. I assume you long since figured out how to proceed.
Good article! Shukrani.
You can also use the RecursiveAll option to automatically traverse down the folder structure (from the root level).
Ok, looks like it stripped out the xml… just replace the pound signs below with chevrons.
#queryOptions#
#QueryOptions#
#ViewAttributes Scope=’RecursiveAll’/#
#/QueryOptions#
#/queryOptions#
Shukrani rundo kwa post hii, Paulo. Nimekuwa kujaribu kuwaondoa GetListItems kupitia ColdFusion cfhttp, na hakuweza kupata haki bahasha. Hatimaye alimkuta post hii, na mfano wako kazi flawlessly. Shukrani tena.
BTW – unajua ya kwamba orodha sahihi ya rasilimali bahasha sabuni kila? moja kwa ajili ya Items GetList kuchapishwa kwenye microsoft.com hailingani hapa yako…