This past week I was implementing an "evolving" solution for a client that uses BDC and SPQuery and ran into some difficulty using SPQuery against a document library containing folders. Ika-line: assign "recursive" sa view na katangian ng mga query.
Aking mga sitwasyong:
- Sa Monday, I-upload ang dokumento at matustusan ang ilang mga meta data.
- Ang mga sumusunod na linggo, I upload a new document. Much of this new document’s meta data is based on the document I uploaded on Monday (which we call the "master document").
- Lumikha kami ng isang web façade na serbisyo na nagbibigay ng isang BDC-friendly interface sa listahan upang ang mga user ay maaaring madaling mahanap na Lunes dokumento sa pamamagitan ng isang paghahanap pamagat.
- A BDC data column provides a friendly user interface. (Ito ay bahagi ng aking mga pagtatangka sa paggamit ng BDC para sa isang mas friendly na hanay ng Paghahanap).
Ang huling BDC façade serbisyo ay gumagamit ng isang query tulad nito upang gawin ang paghahanap:
// Ginamit U2U tool upang makatulong sa pagbuo ng mga ito CAML query. oQuery.Query = "<Saan>"; kung (titleFilter.Length > 0) oQuery.Query = " <At>"; oQuery.Query = " <At>" + " <Geq>" + " <FieldRef Name=\"DocumentId\" />" + " <Value Type=\"Text\">" + MinID + "</Halaga>" + " </Geq>" + " <Leq>" + " <FieldRef Name=\"DocumentId\" />" + " <Value Type=\"Text\">" + maxId + "</Halaga>" + " </Leq>" + " </At>"; kung (titleFilter.Length > 0) oQuery.Query = " <Naglalaman ng>" + " <FieldRef Name=\"Title\" />" + " <Value Type=\"Text\">" + titleFilter + "</Halaga>" + " </Naglalaman ng>" + " </At>"; oQuery.Query = "</Saan>";
Sa panahon ng unang yugto ng pag-unlad, this worked great. Gayunman, ipinakilala namin ang mga folder sa direktoryo upang malutas ang ilang mga problema at bigla, my BDC picker wouldn’t return any results. I tracked this down to the fact that the SPQuery would never return any results. We used folders primarily to allow multiple files with the same name to be uploaded but with different meta data. When the file is uploaded, lumikha kami ng isang folder batay sa mga ID ng mga item sa listahan at pagkatapos ay ilipat ang mga file doon (Ko sinulat ni tungkol sa na dito; mayroon kaming halo-halong mga resulta may diskarteng ito ngunit sa kabuuan, ito ay mahusay na gumagana). The user don’t care about folders and in fact, don’t really understand that there are any folders. We have configured all the views on the library to show items without regard to folders.
I hit this problem twice as the technical implementation evolved and solved it differently each time. The first time, I wasn’t using the CONTAINS operator in the query. Without a CONTAINS operator, I was able to solve the problem by specifying the view on the SPQuery’s contructor. Instead of using the default constructor:
SPList oList = web.Lists["Documents"];
SPQuery oQuery = bago SPQuery();
Ko sa halip ay gumamit ng isang constructor na tinukoy ng tanawin:
SPList oList = web.Lists["Documents"];
SPQuery oQuery = bago SPQuery(oList.Views["All Documents"]);
Na malulutas ang problema ko at sinimulan upang makakuha ng aking mga resulta.
I then added the CONTAINS operator into the mix and it broke again. It turns out that the CONTAINS operator, sa ngayon bilang ang maaari kong sabihin, ay hindi gumagana sa view ng ang parehong paraan tulad ng isang mas simpleng GEQ / LEQ operators. I did some searching and learned that the query’s ViewAttributes should be set to "Recursive", tulad ng sa:
oQuery.ViewAttributes = "Scope=\"Recursive\"";
That solved the problem for CONTAINS. Sa katunayan, ito rin malutas sa aking orihinal na problema sa paghahanap at kung ako ay tinukoy ang recursive katangian sa unang pagkakataon, Hindi ko nais na tumakbo sa mga isyu muli.
Ang katotohanan na ang isang pagtingin na batay sa SPQuery gumagana para sa ilang mga operator (GEQ/LEQ) at hindi ang iba (NAGLALAMAN), isinama sa ang katunayan na ang KPI hindi mukhang gumana sa lahat ng mga may-folder na naglalaman ng mga library dokumento humantong sa akin upang maniwala na SPQuery ay may ilang mga isyu orthogonality.
Espesyal na Salamat:
- Ang mabuting tao sa U2U at ang kanilang mga query tool.
- Michael Hoffer ni dakilang "pag-aaral sa pamamagitan ng paggawa" blog post, mga komento at mga tugon.
</dulo>
http://www.batteryfast.co.uk/asus/w3v.htm Asus w3v baterya,
http://www.batteryfast.co.uk/asus/w3000a.htm asus w3000a battery,
http://www.batteryfast.co.uk/asus/w3000.htm Asus w3000 baterya,
http://www.batteryfast.co.uk/asus/w3000v.htm Asus w3000v baterya,
http://www.batteryfast.co.uk/asus/a31-s5.htm Asus a31-s5 baterya,
http://www.batteryfast.co.uk/asus/a32-s5.htm Asus a32-s5 baterya,
http://www.batteryfast.co.uk/asus/s52n.htm Asus s52n baterya,
http://www.batteryfast.co.uk/asus/s5000.htm Asus s5000 baterya,
http://www.batteryfast.co.uk/asus/s5200n.htm Asus s5200n baterya,
http://www.batteryfast.co.uk/asus/s5n.htm Asus s5n baterya,
http://www.batteryfast.co.uk/asus/90-naa1b1000.htm Asus 90-naa1b1000 baterya,
http://www.batteryfast.co.uk/asus/s2691061.htm Asus s2691061 baterya,
http://www.batteryfast.co.uk/asus/a42-v6.htm Asus a42-V6 baterya,
http://www.batteryfast.co.uk/asus/a32-u5.htm Asus a32-u5 baterya,
http://www.batteryfast.co.uk/asus/u5f.htm Asus u5f baterya,
http://www.batteryfast.co.uk/asus/u5a.htm Asus baterya U5A,
http://www.batteryfast.co.uk/asus/u5f.htm Asus u5f baterya,
http://www.batteryfast.co.uk/asus/u5.htm Asus U5 baterya,
http://www.batteryfast.co.uk/compaq/nw8000.htm Compaq nw8000 baterya,
http://www.batteryfast.co.uk/compaq/nc8000.htm Compaq nc8000 baterya,
http://www.batteryfast.co.uk/compaq/v1000.htm Compaq v1000 baterya,
http://www.batteryfast.co.uk/compaq/nc6000.htm Compaq nc6000 baterya,
http://www.batteryfast.co.uk/compaq/nx5000.htm Compaq nx5000 baterya,
http://www.batteryfast.co.uk/compaq/n600.htm Compaq n600 baterya,
http://www.batteryfast.co.uk/compaq/n600c.htm Compaq n600c baterya,
http://www.batteryfast.co.uk/compaq/n610c.htm Compaq n610c baterya,
http://www.batteryfast.co.uk/compaq/n610v.htm Compaq n610v baterya,
http://www.batteryfast.co.uk/compaq/n620c.htm Compaq n620c baterya,
http://www.batteryfast.co.uk/compaq/e500.htm Compaq e500 baterya,
http://www.batteryfast.co.uk/compaq/e500s.htm Compaq e500s baterya,
http://www.batteryfast.co.uk/compaq/v300.htm Compaq v300 baterya,
http://www.batteryfast.co.uk/compaq/v500.htm Compaq v500 baterya,
http://www.batteryfast.co.uk/compaq/pp2060.htm Compaq pp2060 baterya,
http://www.batteryfast.co.uk/compaq/nx9000.htm Compaq nx9000 baterya,
http://www.batteryfast.co.uk/compaq/nx9005.htm Compaq nx9005 baterya,
http://www.batteryfast.co.uk/compaq/nx9010.htm Compaq nx9010 baterya,
http://www.batteryfast.co.uk/compaq/nx9020.htm Compaq nx9020 baterya,
http://www.batteryfast.co.uk/compaq/n110.htm Compaq n110 baterya,
http://www.batteryfast.co.uk/compaq/n110s.htm Compaq n110s baterya,
http://www.batteryfast.co.uk/compaq/pp2101x.htm Compaq pp2101x baterya,
http://www.batteryfast.co.uk/compaq/presario-2100.htm Compaq presario 2100 baterya,
http://www.batteryfast.co.uk/compaq/ze4000.htm Compaq ze4000 baterya,
http://www.batteryfast.co.uk/compaq/f4809a.htm Compaq f4809a baterya,
http://www.batteryfast.co.uk/compaq/f4812a.htm Compaq f4812a baterya,
http://www.batteryfast.co.uk/dell/inspiron-700m.htm labak na may gubat inspiron 700m baterya,
http://www.batteryfast.co.uk/dell/inspiron-710m.htm labak na may gubat inspiron 710m baterya,
http://www.batteryfast.co.uk/dell/latitude-x200.htm labak na may gubat latitude x200 baterya,
http://www.batteryfast.co.uk/dell/8u443.htm labak na may gubat baterya 8u443,
http://www.batteryfast.co.uk/dell/312-0058.htm labak na may gubat 312-0058 baterya,
Mo alam na StringBuilder ay pinakamahusay na kasanayan para sa paglikha ng mahabang string, karapatan?