Ovaj prošli tjedan sam bio provedbi "razvija" solution for a client that uses BDC and SPQuery and ran into some difficulty using SPQuery against a document library containing folders. Bottom line: dodijeliti "rekurzivni" s pogledom na atribut upita.
Moj scenarij:
- U ponedjeljak,, Ću uploadati dokument i dostaviti neke meta podatke.
- Sljedeći tjedan, 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").
- Napravili smo fasadu web servis koji pruža BDC-friendly sučelje na popisu, tako da korisnici mogu jednostavno pronaći taj dokument ponedjeljak putem naslova pretraživanje.
- A BDC data column provides a friendly user interface. (To je dio mog pokušaja na korištenje BDC za više prijateljski Potraži stupac).
Konačna BDC fasada usluga koristi upita ovako raditi pretraživanja:
// Koristi U2U alat za pomoć u stvaranju ovog CAML upit. oQuery.Query = "<Gdje>"; ako (titleFilter.Length > 0) oQuery.Query = " <I>"; oQuery.Query = " <I>" + " <Geq>" + " <FieldRef Name=\"DocumentId\" />" + " <Value Type=\"Text\">" + minId + "</Vrijednost>" + " </Geq>" + " <Leq>" + " <FieldRef Name=\"DocumentId\" />" + " <Value Type=\"Text\">" + maxId + "</Vrijednost>" + " </Leq>" + " </I>"; ako (titleFilter.Length > 0) oQuery.Query = " <Sadrži>" + " <FieldRef Name=\"Title\" />" + " <Value Type=\"Text\">" + titleFilter + "</Vrijednost>" + " </Sadrži>" + " </I>"; oQuery.Query = "</Gdje>";
U početnoj fazi razvoja, this worked great. Međutim, uveli smo mape u mapu za rješavanje nekih problema i odjednom, 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, smo izradili mapu na temelju popisa stavke ID, a zatim premjestiti datoteku postoji (O tome sam pisao ovdje; imali smo mješovite rezultate s ovim pristupom, ali u cjelini, to je rad i). 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 = novi SPQuery();
I umjesto da se konstruktor koji navedenu pogled:
SPList oList = web.Lists["Documents"];
SPQuery oQuery = novi SPQuery(oList.Views["All Documents"]);
To je riješilo problem i počeo sam da se moje rezultate.
I then added the CONTAINS operator into the mix and it broke again. It turns out that the CONTAINS operator, koliko ja mogu reći, ne radi s pogledom na isti način kao jednostavniji geq / LEQ operators. I did some searching and learned that the query’s ViewAttributes should be set to "Recursive", kao u:
oQuery.ViewAttributes = "Scope=\"Recursive\"";
That solved the problem for CONTAINS. Zapravo, to također riješio moj izvorni pretragu problem i ako sam bio naveden rekurzivna značajke prvi put, Ne bih se izvoditi u pitanju opet.
Činjenica da je pogled na bazi SPQuery radi za neke operatere (Geq / Leq) a ne drugima (SADRŽI), zajedno s činjenicom da KPI ne čini uopće raditi s mape koje sadrže bibliotekama dokumenata vodi me da vjerujem da ima neke SPQuery ortogonalnost pitanja.
Posebne Hvala:
- Dobri ljudi u U2U i njihov upit alat.
- Michael Hoffer je super "učenje kroz rad" blog post, komentari i odgovori.
</kraj>
http://www.batteryfast.co.uk/asus/w3v.htm ASUS w3v baterije,
http://www.batteryfast.co.uk/asus/w3000a.htm ASUS w3000a baterije,
http://www.batteryfast.co.uk/asus/w3000.htm ASUS w3000 baterije,
http://www.batteryfast.co.uk/asus/w3000v.htm ASUS w3000v baterije,
http://www.batteryfast.co.uk/asus/a31-s5.htm ASUS A31-S5 baterije,
http://www.batteryfast.co.uk/asus/a32-s5.htm ASUS A32-S5 baterije,
http://www.batteryfast.co.uk/asus/s52n.htm ASUS s52n baterije,
http://www.batteryfast.co.uk/asus/s5000.htm ASUS S5000 bateriju,
http://www.batteryfast.co.uk/asus/s5200n.htm ASUS s5200n baterije,
http://www.batteryfast.co.uk/asus/s5n.htm ASUS s5n baterije,
http://www.batteryfast.co.uk/asus/90-naa1b1000.htm ASUS 90-naa1b1000 baterije,
http://www.batteryfast.co.uk/asus/s2691061.htm ASUS s2691061 baterije,
http://www.batteryfast.co.uk/asus/a42-v6.htm ASUS A42-v6 baterije,
http://www.batteryfast.co.uk/asus/a32-u5.htm ASUS A32-U5 baterije,
http://www.batteryfast.co.uk/asus/u5f.htm ASUS u5f baterije,
http://www.batteryfast.co.uk/asus/u5a.htm ASUS u5a baterije,
http://www.batteryfast.co.uk/asus/u5f.htm ASUS u5f baterije,
http://www.batteryfast.co.uk/asus/u5.htm ASUS U5 baterije,
http://www.batteryfast.co.uk/compaq/nw8000.htm Compaq nw8000 baterije,
http://www.batteryfast.co.uk/compaq/nc8000.htm Compaq nc8000 baterije,
http://www.batteryfast.co.uk/compaq/v1000.htm Compaq V1000 baterija,
http://www.batteryfast.co.uk/compaq/nc6000.htm Compaq nc6000 baterije,
http://www.batteryfast.co.uk/compaq/nx5000.htm Compaq nx5000 baterije,
http://www.batteryfast.co.uk/compaq/n600.htm Compaq N600 baterija,
http://www.batteryfast.co.uk/compaq/n600c.htm Compaq n600c baterije,
http://www.batteryfast.co.uk/compaq/n610c.htm Compaq N610C baterija,
http://www.batteryfast.co.uk/compaq/n610v.htm Compaq n610v baterije,
http://www.batteryfast.co.uk/compaq/n620c.htm Compaq n620c baterije,
http://www.batteryfast.co.uk/compaq/e500.htm Compaq E500 baterija,
http://www.batteryfast.co.uk/compaq/e500s.htm Compaq e500s baterije,
http://www.batteryfast.co.uk/compaq/v300.htm Compaq V300 baterija,
http://www.batteryfast.co.uk/compaq/v500.htm Compaq V500 baterija,
http://www.batteryfast.co.uk/compaq/pp2060.htm Compaq pp2060 baterije,
http://www.batteryfast.co.uk/compaq/nx9000.htm Compaq nx9000 baterije,
http://www.batteryfast.co.uk/compaq/nx9005.htm Compaq nx9005 baterije,
http://www.batteryfast.co.uk/compaq/nx9010.htm Compaq nx9010 baterije,
http://www.batteryfast.co.uk/compaq/nx9020.htm Compaq nx9020 baterije,
http://www.batteryfast.co.uk/compaq/n110.htm Compaq N110 baterija,
http://www.batteryfast.co.uk/compaq/n110s.htm Compaq n110s baterije,
http://www.batteryfast.co.uk/compaq/pp2101x.htm Compaq pp2101x baterije,
http://www.batteryfast.co.uk/compaq/presario-2100.htm Compaq Presario 2100 baterija,
http://www.batteryfast.co.uk/compaq/ze4000.htm Compaq ze4000 baterije,
http://www.batteryfast.co.uk/compaq/f4809a.htm Compaq F4809A bateriju,
http://www.batteryfast.co.uk/compaq/f4812a.htm Compaq f4812a baterije,
http://www.batteryfast.co.uk/dell/inspiron-700m.htm Dell Inspiron 700m Baterija,
http://www.batteryfast.co.uk/dell/inspiron-710m.htm Dell Inspiron 710m Baterija,
http://www.batteryfast.co.uk/dell/latitude-x200.htm Dell Latitude X200 baterije,
http://www.batteryfast.co.uk/dell/8u443.htm Dell 8u443 baterije,
http://www.batteryfast.co.uk/dell/312-0058.htm šumovita dolina 312-0058 baterija,
Vi znate da je StringBuilder je najbolje za stvaranje duge nizove, pravo?