Txheej txheem cej luam:
(HLOOV TSHIAB 12/04/07: Ntxiv ib qho chaw nthuav linking rau lwm cov blog uas no ntawm cov qhov Web site nthuav heev kawg)
No nkag teb chaws blog piav li cas los ua tau ib lub teeb bar hauv SharePoint. No xwb nyob rau hauv WSS thiab NTXHUAB tej kev kawm thaum uas nws tsuas nyob li tej ntaub ntawv saib web ib sab.
Lub zuag qhia tag nrho mus kom ze yog raws li nram no:
- Tsim ib daim ntawv los yog qiv ntaub ntawv uas muaj cov ntaub ntawv koj xav teeb.
- Qhov chaw lub tsev qiv ntawv hauv kab ntawv / kev cai sau mus rau ib sab thiab hloov kom muaj tej ntaub ntawv saib Web site qhov (DVWP).
- Hloov cov DVWP XSL Meskas HTML uas pom tias yog raws li ib lub teeb.
Lag luam Scenario / Teeb:
Kuv tau tsim ib daim ntawv teev kev cai uas muaj qhov Title txheem kem thiab qhia kiag ib tug ntxiv, "Leej twg". Cov qauv no (simplistically heev) ib qho "tso rau nqi" scenario nruab nrab qhov twg lub npe yog peb tes num thiab cov txheej xwm muaj nqis los ntawm cov:
- Npaj siab
- Nyob rau hauv cov txheej txheem
- Stalled
Lub hom phiaj yog tsim kom muaj kev sib tham sib kab rov tav bar teeb uas muaj cov lis dej num uas tsis yog leej twg.
Kuv muaj populated lub npe thiab nws zoo li no:
Ua kom muaj tej ntaub ntawv saib Web site qhov:
Tsim tau lub DVWP los muab cov kev cai teev rau ib sab (qhov chaw nyob sab hauv kuv tsev neeg) thiab ua raws li cov lus qhia ntawm no (http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!395.entry).
Ntxiv rau qhov tsuas tsim lub DVWP, Peb kuj yuav teev cov cuab yeej paging qhia tag nrho cov muaj natwm. Rau kuv, qhov no zoo li tej yam zoo li no:
Thaum no tus taw tes, Kuv ib txwm nyob SPD thiab qhov browser. Kuv mam li rov qhib rau sab siv qhov browser. Qhov no txhob ntawd mucking txog cov Web site qhov layout nyob rau sab.
Hloov cov XSLT:
Tam sim no lub sij hawm los hloov tus XSLT.
Kuv siv siv qhov muag saib lub studio rau qhov no. (Saib ntawm no kev ceeb toom tseem ceeb txog tus intellisense uas yuav pab tau koj heev).
Kuv tsim ib qhov project khoob ntxiv plaub ntaub ntawv tshiab (hloov lo lus "tseem cia nrog" thiab "New" tsim nyog li):
- Original.xslt
- New.xslt
- Yuavtsum Params.xml
- Params.xml tshiab
Hauv kuv tsev neeg, nws zoo li no:
Hloov hauv cov qhov web thiab luam cov params thiab cov XSL los tseem cia "nrog" Version hauv Studio nrig txog kev pom.
Lub hom phiaj ntawm no yog ua mob rau lub XSL txia qhov txheeb xyuas tau peb mus rov qab los rau cov lus nug DVWP HTML renders li ib lub teeb.
Rau qhov tus kawg, yuav xub xyuas seb cov HTML yuav zoo ua ntej peb ntxov siab insanity uas yog hu ua "XSL". (Yuav tsis ntshiab, cov nram no yog ib tsab ib qho piv txwv; tsis txhob ntaus los yog daim ntawv/muab tshuaj rau studio siv qhov muag saib. Kuv muab ib daim ntawv qhia txog tshuab pib taw tes rau qhov uas rau lub write-up). Cov qauv teeb nram qab no mas nws as per cov HTML tam sim no:
Coj HTML:
<html> <lub cev> <chaw> <table dav = 80%> <tr><Td><chaw>Horizontal Bar teeb</Td></tr> <tr> <Td dlhos = "center"> <rooj ciam teb = "1" dav = 80%> <tr> <Td dav = 10%>Qhib</Td> <Td><rooj cellpadding ="0" cellspacing ="0" ciam teb = 0 dav = 50%><tr bgcolor = liab><Td> </Td></tr></cov lus></Td> </tr> <tr> <Td dav = 10%>Kaw</Td> <Td><rooj cellpadding ="0" cellspacing ="0" ciam teb = 0 dav = 25%><tr bgcolor = liab><Td> </Td></tr></cov lus></Td> </tr> <tr> <Td dav = 10%>Stalled</Td> <Td><rooj cellpadding ="0" cellspacing ="0" ciam teb = 0 dav = 25%><tr bgcolor = liab><Td> </Td></tr></cov lus></Td> </tr> </cov lus> </Td> </tr> </cov lus> </lub cev> </html> |
Kuv siv ib tug tuag yooj yim mus kom ze rau txoj kev Kuv tuav kom tau teem xim tom qab ntawm kom "liab".
Tus take-away no yog qhov no: Thaum kawg, txhua yam peb ua yog tsim HTML natwm thiab txhua.
XSLT Template:
Kuv twb tau theej rau XSLT generates tus kab rov tav bar teeb. Nws tseem zoo haum commented ces kuv yuav tsis ntxiv npaum li cas ntawm no tsuas yog cov sau ntawv:
- Kuv pib nrog lub neej ntawd XSL SharePoint Designer muab kuv thaum uas kuv xub tsim cov DVWP.
- Kuv twb tau txiav no los ntawm tus SPD 657 kab rau 166 kab.
- Kuv ho tsis mess nrog rau cov ntaub ntawv tsis XML (Nws yog ib qho ntawm cov XSL thiab koj mam li paub tias kuv txhais li cas thaum koj mus hloov lub DVWP xwb; muaj cov ntaub ntawv ob tug uas koj yuav tau hloov). Txawm li cas los, yuav kom piv rau nws, Kuv puas tau tshem yuav luag tag nrho rau ntawm tus XSL. Qhov no txhais tau tias yog koj xav siv cov tsis, koj nyuam qhuav tau ntxiv rau lawv kuj tsis paub meej txhais cov ntsiab lus rov qab rau lub XSL. Uas yuav yooj yim vim tias koj yuav ua tau tus thawj XSL kuj tsis paub meej txhais cov ntsiab lus nyob hauv koj qhov project studio siv qhov muag saib.
- Koj mam mus yuav tau luam thiab no paste rau hauv koj qhov project studio siv qhov muag saib. Ces, tshem kuv hu thiab ntxig rau koj tus kheej hu rau "ShowBar".
- Laum rau nram tej hauj lwm tsim ib <ib tug href> li no: http://server/List?FilterField1=fieldname&FilterValue1=actualFilterValue. Txheej txheem no tej zaum yuav nqi rau lwm contexts. Thaum xub thawj, Kuv xav tias kuv yuav tau yoog mus rau ib hom ntawv ntau: http://server/List/AllItems.aspx?View={guid}&FilterField1=blah&FilterValue1=blah, tab sis, nyob hauv kuv ib puag ncig uas yog tsis tsim nyog. Daim ntawv sau URL kis rau peb ntawm SharePoint ces yog qhov no yooj yim heev rau generalize.
Nws tseem nyob ntawm no:
<xsl:stylesheet Version="1.0" exclude-no-ua kawg="Reye z o s ddwrt dt msxsl" |
Soj ntsuam:
XSL cov saum toj ntawm no generates no cov teeb:
Tho tau mus ua cov ntaub ntawv uas lwm los txhaj rau cov kev cai raws li txoj cai:
Concluding xav:
Ua qhov no ua Generalized?
Kuv nyiam no cov tswvyim graphing, tab sis, kuv ntxub cov Disease fact uas kuv yuav tsum mus ua heev tes-coding. Thiab kuv twb tau qhia me ntsis xav mus seb nws yuav tsum generalized kuv optimistic, tab sis kuv kuj hais tias yuav muaj cib ntsa qhov chaw raws li txoj kev uas yuav tsis muaj ib yam hauj lwm-nyob ib ncig ntawm fearful me ntsis. Yog leej twg muaj ib co tswv yim zoo rau hauv no, thov koj ua ib cov lus los yog email rau kuv.
Nstuas ntsug:
Qhov no nws yog ib tug kab rov tav bar teeb. Yeej tau los ua ib ntsug teeb. Yog peb yuav hloov cov HTML. Kuv yuav pib tau ib yam nkaus: Ua kom muaj ib tug sawv cev HTML rau ib ntsug bar teeb thiab mam li xyuas seb tau li cas tias ntawm XSL. Yog leej twg xav tias, Kuv yuav tsum tau persuaded sim kom paub thiab ua tau hauj lwm ua tus kinks. Yog hais tias ib tug neeg muaj twb ua tas lawm, please let me know and I’ll gladly link to your blog 🙂
Kuv xav tias kev sib tw nrog ib ntsug kev teeb yog tias tus ntawv rau lub teeb yuav tsis yooj yim uas tswj tus, tiam sis yeej ua tsis yeej.
Teb lub npe Gotcha tus:
Muaj ntau yam uas tsawg kawg yog ob tug mus nrhiav kom paub cov npe teb.
Ua ntej, Vaj teb nrog rau ib qhov chaw muaj los yuav dim hauv hauv lub XSL. Qhov no tej zaum yuav yog ib qhov teeb meem no:
<xsl:kuj sib txawv thiab lub npe="totalProposed"
xaiv="suav(/dsQueryResponse/natwm/leej[normalize-chaw(@Status) = 'Qhov'])" />
Yog rau koj "lawv" Kem no yeej hu ua "raws li txoj cai Code" ces koj yuav tau reference li "Status_x0020_Code":
<xsl:kuj sib txawv thiab lub npe="totalProposed"
xaiv="suav(/dsQueryResponse/natwm/leej[normalize-chaw(@Status_x0020_Code) = 'Qhov'])" />Thib ob, thiab kuv fuzzy me ntsis ntawm no, koj kuj yuav tsum muab khaws cia rau hauv alert rau teb lub npe hloov. Yog koj teb "raws li txoj cai Code npe koj" thiab tom qab ces nyob, rename los "Leej twg AFE", cov "lub npe" tsis hloov. Lub npe nrog nws tseem yuav "raws li txoj cai Code" thiab yuav tsum tau hais los ua "Status_x0020_Code". Qhov "lwm yam kev pab" kev mus yuav pab tshawb nrhiav thiab kho qhov teeb meem no seb.
Hais txog ntawd xim:
Kuv khaws cov "liab" vim nws yog pleasing rau kuv rau lub caij. Nws yuav tsis tau ib big deal qhia txawv xim sij muab ntau tshaj yog kev piav qhia txog ib tug xov tooj, tab sis, kuj muaj ib pab KPI. Piv txwv, Yog hais tias qhov feem pua ntawm cov "stalled" Yog tus AFE > 10% mam li pom nws liab liab, txwv tsis pub ua hauv dub. Siv <xsl:xaiv> yuav ua kom tiav no.
Lwm yam kev pab:
- Seb lub npe nrog (thiab lwm tus zoo info) rau cov ntaub ntawv nyob rau hauv ib daim ntawv teev: http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!134.entry
- Qhia tag nrho cov ntaub ntawv los ntawm SharePoint (cov nqaij nyoos XML): http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!190.entry
- Tau XPATH qhia txog ib tug ncej tag ib: http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!155.entry
- Lwm mus kom ze siv OWA(?). Kuv muaj tsis khawb rau nws, tab sis tig pheej, tshwj xeeb tshaj yog rau cov ncuav qab zib kab kos: http://www.waka.dk/Blog/PermaLink,guid,e2532e71-d774-4ac9-8f25-883964b830f4.aspx
Zoo siab transforming!
<kawg />