Qeb Archives: SharePoint Development

HTTP 406 Yuam kev thaum uas siv cov Angular $http.get tiv thaiv SharePoint so kawg ntsiab lus

Hloov tshiab: Marc AD ndersson taw tes qhia tawm no zoo kawg thiab daim info: http://blogs.Office.com/2014/08/13/json-Light-Support-rest-sharepoint-API-Released/. Uas piav txog heev :).

Uas tej zaum yuav tau lub npe phem ntawm ib cov ncej blog puas! Anyhoo.

Kuv mas ua rau kuv prototyping rau thaj O365. Kuv tau kuv tus kheej lom kom kuv tsis muaj yuav txhawj xeeb txog koj rau leej twg. Ua tus ib cag-nco thaum peb hu kwv ncig cov cav tov virtual rau peb laptops nrog NTXHUAB – SQL neeg rau zaub mov, IIS, txiav txim siab seb vs Hyper-V. VMWare? Anyhoo...

Kuv tau tsim ib qho app Angular siv nyob rau hauv qhov chaw uas puas, cov lwm yam, qhov no:

$http.Get(serverUrl)
.zoo(muaj nuj nqi(cov ntaub ntawv, xwm txheej, headers, config) {

Var getLinksResponse = ntaub ntawv;

getLinksResponse.value.forEach(muaj nuj nqi(theResult) {

// li ntawd thiab ces froth

Qhov no yog ua hauj lwm xwb fine ob hom SharePoint nyob rau hauv tej kev kawm. Txawm li cas los, Thaum twg kuv colleague ported nws mus rau ib Cloudshare lom, nws tsis yog ib tug HTTP 406 yuam kev (uas yog thawj zaug kuv puas tau mus txog ntawd ib tug, vim li ntawd... yay, tej zaum). Peb puas muaj me ntsis kev soj ntsuam thiab pom tias header uas muaj "Txais" tus ntawd tawm. SharePoint hauv Internet yog txawm zoo siab nrog:

Txais: daim ntawv thov/json

Tab sis qhov cloudshare lom (Nws yog ib qho SP rau prem, hosted rau ib tug neeg rau zaub mov virtual) xav qhov classic "odata = verbose" ntxiv rau kom zoo:

Txais: daim ntawv thov/json;odata = verbose

Kho uas, peb ntxiv cov header zoj:

Var config = {headers: {
'Lees': ' thov/json;odata = verbose'
}
};

$http.Get(serverUrl,config)
.zoo(muaj nuj nqi(cov ntaub ntawv, xwm txheej, headers, config) {

Var getLinksResponse = ntaub ntawv;

getLinksResponse.value.forEach(muaj nuj nqi(theResult) {

// li ntawd thiab ces froth

Uas tau mus tua ntawm tus 406, tiam sis nws kuj hloov cov hom ntawv uas yuav teb. Yog xav paub ntxiv … verbose. (haha!) Muaj ntau yam hloov ntxiv yuav tsum thiab nov yog qhov tshwm sim zaum kawg:

Var config = {headers: {
'Lees': ' thov/json;odata = verbose'
}
};

$http.Get(serverUrl,config)
.zoo(muaj nuj nqi(cov ntaub ntawv, xwm txheej, headers, config) {

Var getLinksResponse = ntaub ntawv;

getLinksResponse.d.Results.forEach(muaj nuj nqi(theResult) {

// li ntawd thiab ces froth

Qhov no tsuas txia ntshis ua ib tug 30 teeb meem feeb rau peb, kom peb lucked. Hopefully ib tug neeg pom qhov no pab tau.

</kawg>

Zuj zus khiav / Mus tu JavaScript coj

Kuv colleague, Javed Ansari (http://www.bigapplesharepoint.com/team?showExpertName=Javed%20Ansari&rsource=pgblog), sau tau ib cov ncej luv xaus blog rau coj nws nyiam los kawg twb tau siv cov nrog SharePoint: http://www.bigapplesharepoint.com/pages/View-An-Insight.aspx?BlogID=53&rsource=PGBlog).

jQuery nkawd tau victor cov nyob teb, li ntawd, yuav hais lus, xyoo tam sim no, tiam sis yog lwm tus tshiab ntxiv thiab stills txog battling nws txheeb, zoo li Angular. (SPServices, tau mas, tau ib lub neej saver xyoo thiab tseem yuav raug ces kuv xav tias).

Dab tsi yog cov neeg uas siv? Yog lawv teem dua rau hauv Microsoft lub tooling (CSOM / JSOM) los yog tsiv ntxiv mus rau Angular, Knockout, Ember, yam?

Kuv muaj ib tug thuam pheej loj mus rau tej kev coj tsis yog Microsoft lub. Kuv xav tias tus MSFT khoom yog nyuab nyuab zog ua hauj lwm nrog, kheej yuav luag npaum kev nkhaus li laus-style neeg rau zaub mov ces dev.

Logged nov los dhau ntawm Loj lub kua SharePoint Yog koj xav tham txog (Kua ntau yuav tau ntxiv yuav ua rau muaj kev sib sab laj zoo).

</kawg>

Spinning SharePoint Timer hauj lwm ntawm lub Site Collection Configuration

Kuv colleague, Ashish Patel, sau tau ib cov ncej blog piav tias yooj ywm timer txoj hauj lwm architecture uas affords ib co yooj zoo txhawb ntev khiav paub tab thiab/lossis cov ntaub ntawv.  Nyob rau hauv nws cov lus:

1. Cais Checked tawm cov ntaub ntawv thiab xa nco mus rau cov tib neeg yog tus leb ntawm hnub (vim ntawv yog ntsuam xyuas kom paub) tshaj tej tus Harbor txwv

2. Tshem cov kev mus los ntawm lwm yam ntsiab lus thaum ib qho kev kawm raug tshem tawm los sis archived ntawm lub cev

3. Neeg xav saib txhua tus alerts uas nws cuv npe rau hauv tag nrho cov webs nyob rau hauv qhov chaw sau

4. Xa ib tug nco los sau phau ntawv los saib xyuas cov ntsiab lus thaum ib lub sij hawm txheeb xyuas tau teev nyob hauv cov ntsiab lus thiab uas hnub ntawd

Qhov tshij, daim ntawv no mus...

– Saib ntxiv rau: http://www.bigapplesharepoint.com/ nplooj/pom-tau-Insight.aspx?BlogID=40#sthash.7cKuiwly.dpuf

Muaj ntau zaus rau kuv yav tag los thaum twg muaj tej yam zoo li no yuav tau pab heev.

</kawg>

Yuav ua li cas: Configure tsev kuaj thiab tshuaj ntsuam cov kev pab uas muaj QUnit.js thiab Blanket.js rau ib qho chaw ua hauj lwm 365 SharePoint App

Intro

Twb tau kawm chav tsev kuaj thiab ntsuam xyuas cov kev pab tsis rau JavaScript nrog kuv ua hauj lwm hauv SharePoint app rau SharePoint hauv internet nyob rau hauv qhov chaw ua hauj lwm 365 Suite.  Cov cuab kev tshawb fawb paths coj kuv mus Qunit.js thiab txoj cai tom qab uas, mus Blanket.js.

QUnit cia kuv teeb tsev kuaj thiab koom rau hauv modules.  Ib tug module nws cia li yooj yim rau Teacher lwm yam kev kuaj. (Kuv tsis paub hais tias kuv yuav siv nws los siv yuav tsum, tab sis nws puas ua haujlwm rau kuv nyob deb thiaj nrog lub me me teeb ntawm kev ntsuam xyuas uas kuv tau deb deb li no txhais).

Blanket.js integrates nrog Qunit thiab nws yuav qhia kuv qhov tseeb kab ntawm JavaScript tau – thiab ntau ceeb tshaj – twb tsis tau tseg thaum khiav cov kev ntsuam xyuas.  Qhov no yog "los" – cov kab mob tseg yog them los ntawm txoj kev kuaj no thaum lwm tus uas tsis.

Teem mus kuaj mob zoo thiab saib cov kev pab them nqi, peb yuav txo tau qhov uas yuav ua kom cov code peb tau muab zais tsis xws luag.  Zoo sij hawm.

Qunit

Piv txwv tias yog koj muaj koj Studio uas koj siv qhov muag saib ib qhov teeb, pib los daus JavaScript pob ntawm http://qunitjs.com.  Ntxiv cov JavaScript thiab coj CSS koj cov tshuaj.  Mine looks li no:

image

Daim duab 1

Raws li koj tau pom, Kuv twb siv 1.13.0 thaum lub sij hawm uas kuv sau tau no blog tswg. Tsis txhob hnov qab ntxiv rau CSS daim download tau thiab kev pab.

Uas tawm hauv txoj kev, cov kauj ruam tom ntej yog los tsim tej yam xeem sam xauv nees thiab reference lub Qunit khoom.  Kuv yuav kuaj ib Rev muaj zog hauv ib tsab ntawv thov hu ua "QuizUtil.js" es kuv tsim ib nplooj hu ua "QuizUtil_test.html" thaum pom tias cov HTML:

image Daim duab 2

Ntawm no yog cov chaws:

<!DOCTYPE html>
<html xmlns= "http://xyoo 1999/xhtml www.w3.org/">
<lub taub hau>
    <npe>QuizUtil xeem nrog Qunit</npe>
    <txuas rel= "stylesheet" href="../CSS/qunit-1.13.0.CSS" />
    <tsab ntawv hom= "ntawv nyeem/javascript" src="QuizUtil.js" cov ntaub ntawv npog></tsab ntawv>
    <Script yam ="ntawv nyeem/javascript" src ="qunit-1.13.0.js"></tsab ntawv>
    <Script yam ="ntawv nyeem/javascript" src ="blanket.min.js"></tsab ntawv>

    <tsab ntawv>
        Module("getIDFromLookup");
        ntsuam xyuas("QuizUtil getIDFromLookupField", muaj nuj nqi () {
            Var goodValue = "1;#Paul Galvin";

            sib npaug(getIDFromLookupField(goodValue) + 1, 2), "Tus ID rau [" + goodValue + "] + 1 yuav tsum muaj rau 2";
            sib npaug(getIDFromLookupField(undefined), undefined, "Undefined input cav yuav rov raug undefined.");
            sib npaug(getIDFromLookupField(""), undefined, "Khoob input cav yuav tsum tau xa ib tus nqi uas undefined.");
            sib npaug(getIDFromLookupField("gobbledigood3-thq;dkvn ada;skfja sdjfbvubvqrubqer0873407t534piutheqw;vn"), undefined,"Yuav tsum nco ntsoov rov ib lub convertible no rau ib Integer");
            sib npaug(getIDFromLookupField("2;#ib txhia neeg"), "2", "Xyuas [2;#ib txhia neeg].");
            sib npaug(getIDFromLookupField("9834524;#tus nqi uas ntev"), "9834524", "Coob tus nqi kuaj.");
            notEqual(getIDFromLookupField("5;#leej twg los", 6), 6, "Kuaj ib notEqual (5 yog tsis sib npaug 6 rau cov qauv no: [5;#leej twg los]");

        });

        Module("htmlEscape");
        ntsuam xyuas("QuizUtil htmlEscape()", muaj nuj nqi () {
            sib npaug(htmlEscape("<"), "&LT;", "Escaping ib tug tsawg dua li tus neeg teb xov tooj ('<')");
            sib npaug(htmlEscape("<div hoob = yog muaj "someclass">Tej ntawv nyeem</div>"), "&LT;chav kawm ntawv div =&quot;someclass&quot;&gt;Tej ntawv nyeem&LT;/div&gt;", "Ntau xeem txoj hlua.");
        });

        Module("getDateAsCaml");
        ntsuam xyuas("QuizUtil getDateAsCaml()", muaj nuj nqi () {
            sib npaug(getDateAsCaml(tshiab Hnub tim("12/31/2013")), "2013-12-31T:00:00:00", "Kuaj coded ib hnub: [12/31/2013]");
            sib npaug(getDateAsCaml(tshiab Hnub tim("01/05/2014")), "2014-01-05T:00:00:00", "Kuaj coded ib hnub: [01/05/2014]");
            sib npaug(getDateAsCaml(tshiab Hnub tim("01/31/2014")), "2014-01-31T:00:00:00", "Kuaj coded ib hnub: [01/31/2014]");
            sib npaug(getTodayAsCaml(), getDateAsCaml(tshiab Hnub tim()), "getTodayAsCaml() yuav tsum siab sib npaug getDateAsCaml(Hnub tshiab())");
            sib npaug(getDateAsCaml("dev paus tus nqi"), undefined, "Sim tau hnub ntawm ib cov nqi dev paus.");
            sib npaug(getDateAsCaml(undefined), undefined, "Sim tau lub hnub lub [undefined] hnub.");
        });

        Module("getParameterByName");
        ntsuam xyuas("QuizUtil getParameterByName (los ntawm cov lus nug hlua)", muaj nuj nqi () {
            sib npaug(getParameterByName(undefined), undefined, "Sim nrhiav undefined parameter yuav tsum tau rov undefined.");
            sib npaug(getParameterByName(muaj "tsis nyob"), undefined, "Sim nrhiav parameter nqi thaum uas peb paub tias muaj tus parameter tsis nyob.");

        });

        Module("Ncuav qab zib");
        ntsuam xyuas("QuizUtil kua nplaum uas ntau zog.", muaj nuj nqi () {
            sib npaug(setCookie("sim", "1", -1), getCookieValue("sim"), "Tau ib cov kua nplaum uas kuv teem caij yuav tsum tau ua.");
            sib npaug(setCookie("anycookie", "1", -1), tseeb, "Qhov chaw kawm ib tug siv tau noj yuav tsum tau xa 'nws muaj tseeb'.");
            sib npaug(setCookie("npab kua nplaum uas lub npe !@#$%"%\^&*(()?/><.,", "1", -1), tseeb, "Qhov chaw kawm ib lub npe phem cov kua nplaum uas yuav tsum tau rov 'cuav'.");
            sib npaug(setCookie(undefined, "1", -1), undefined, "Raws li cov kua nplaum uas npe undefined.");
            sib npaug(getCookieValue(muaj "tsis nyob"), "", Muaj "kua nplaum uas tsis nyob ntawd.");
        });

    </tsab ntawv>
</lub taub hau>
<lub cev>
    <div tus ID= "qunit"></div>
    <div tus ID= "qunit-fixture"></div>

</lub cev>
</html>

Muaj ntau ntau yam zoj zis no:

  1. Referencing kuv code (QuizUtil.js)
  2. Referencing Qunity.js
  3. Defining tej modules (getIDFromLookup, Ncuav qab zib, thiab lwm tus)
  4. Muab ib <div> nws daim ID yog "qunit".

Ces, Kuv cia li rub tau cov nplooj ntawv no thiab koj mus muab tau tej yam zoo li no:

image

Daim duab 3

Yog qhov koj saib hla saum, koj tau xaiv ob peb, yog ob tug uas nthuav:

  • Hide dhau kev ntsuam xyuas: Cuab kev zoo nkauj.  Yuav pab tau koj qhov muag pom xwb lub teeb meem chaw thiab tsis muaj coob plaus.
  • Module: (hlauv): Qhov no yuav lim tau cov kev ntsuam xyuas pawg xwb cov kev ntsuam xyuas uas koj xav mus ua.

Ntawm kev tshuaj ntsuam lawv tus kheej – ob peb lus:

  • Nws yuav mus tsis tau hais tias koj tau sau koj cov cai xws tias nws yog testable ua tus xub place.  Siv cov cuab tam yuav pab tswj qhov kev qhuab qhia. Piv txwv, Kuv muaj ib tug ua haujlwm hu ua "getTodayAsCaml()”.  Qhov no tsis testable heev vim nws yuav siv sij hawm tsis sib cav uas input thiab kuaj kev koob pheej ntawm lawv, peb yuav tau lossi kho qhov chaws kuaj kom muaj kev cuam tshuam rau hnub tam sim no.  Kuv refactored ntawd los ntawm kev muab ib cov ntaub ntawv input parameter ces dua sau hnub thaum kuv xav hnub no CAML hom.
  • Qhov lub moj khaum Qunit ntaub ntawv rau qhov kev ntsuam xyuas nws tus kheej thiab no mas, robust zoo nkauj.  Nws yuav ua tau tej yam yooj yim xws li kuaj kev koob pheej ntawm lawv thiab tseem muaj nyiaj yug rau ajax style hu (ob leeg "tiag tiag" los mocked siv koj txoj kev mocker).
  • Yuav ua raws cov txheej txheem kuj forces koj xav mus txog ntug no – yuav ua cas nrog "undefined" lossis null dhau mus ua ib tug muaj nuj nqi.  Nws ua nws tuag yooj yim mus kuaj cov scenarios tawm.  Khoom zoo.

Cov kev pab uas muaj Blanket.js

Blanket.js complements Qunit los nrhiav lub txoos kab kev cai txim tuag thaum khiav koj kev ntsuam xyuas.  Nws integrates txoj cai rau hauv Qunit no, txawm ho yog ib tus tseem cais app, nws nicely plays – nws yeej zoo li nws yog ib tug seamless app.

Qhov no nws yog blanket.js rau hauv ntawv:

image Daim duab 4

image

Daim duab 5

(Koj yeej tau mus nias rau ntawm "Pab kom cov kev pab" checkbox rau saum [pom daim duab 3] kom niam no.)

Tus kab highlighted nyob hauv daim duab 5 tau tsis tau tseg los ntawm ib yam ntawm kuv qhov kev ntsuam xyuas, li ntawd, kuv yuav npaj ib txoj kev kuaj uas ua rau lawv rau txim tuag yog kuv xav tau kev pab tas nrho.

Tau ua hauj lwm los yog ua raws li cov kauj ruam nram blanket.js:

  1. Download tau nws tawm http://blanketjs.org/.
  2. Ntxiv rau koj qhov project
  3. Hloov koj nplooj ntawv kuaj sam xauv nees (QuizUtil_test.html hauv kuv tsev neeg) raws li nram no:
    1. Siv tus cai
    2. Kho koj <tsab ntawv> siv nyiam qhov no:
    <tsab ntawv hom= "ntawv nyeem/javascript" src="QuizUtil.js" cov ntaub ntawv npog></tsab ntawv>

Blanket.js picks los ntawm "cov ntaub ntawv npog" attribute thiab puas tau nws cov khawv koob.  Nws mus ua Qunit hooks, siab tus UI ntxiv qhov "Pab kom cov kev pab" option thiab voila!

Txoj kev (TL; DR)

Siv Qunit los mus sau koj cov raug kuaj.

  • Download tau nws
  • Ntxiv rau koj qhov project
  • Sau tau ib nplooj ntawv kuaj sam xauv nees
  • Ua kom muaj qhov kev ntsuam xyuas koj
    • Ib txhia ntawm koj cov cai ua testable refactor
    • Yuav muaj tswv yim!  Xav txog crazy, scenarios yeej ua thiab kuaj lawv lawm.

Siv cov blanket.js kom muaj kev pab them nqi

  • Xyuas kom tseeb tias Qunit ua hauj lwm
  • Download tau blanket.js thiab ntxiv mus rau koj qhov project
  • Ntxiv rau mus kuaj sam xauv nees phab:
    • Ntxiv ib siv mus blanket.js
    • Ntxiv "cov ntaub ntawv npog" attribute rau koj <tsab ntawv> lossis
  • Khiav koj cov kev kuaj Qunit.

Kuv yeej tsis ua yam no ua ntej thiab muaj ib co rudimentary khoom ua hauj lwm ib handful teev. 

Kev soj ntsuam zoo siab!

</kawg>

undefinedSubscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Lists.asmx, GetList thiab "tus nqi tsis raug null”

Kuv sab hnub uas cov GetList() txoj kev ua lists.asmx cov qhov Web site yog hu ua tib zoo heev lawm los sis yog nws muab pov ib mysterious kos "Tus nqi tsis tau thov" (thiab cov piv txwv uas yog tias koj tau txais yav tas los tseem heev tshaj generic yuam kev hais, "Kos yam ' Microsoft.SharePoint.SoapServer.SoapServerException’ ces muab pov twb tseg.")  Yeej, Kuv pom tias koj muab tsis tau prefix txhua yam nyob rau hauv cov txujci GetList.  Cov nram qab no jQuery snippet illustrates tus taw tes:

image

Yog hais tias ua li, qhov kev pab cov qhov web teb nrog "Tus nqi tsis tau thov" as per qhov no fiddler-yog muab HTTP transcript:

<?xml version = "1.0 Tub ntxhais" encoding = "utf-8"?>
  <xab npum:Hnab ntawv
     xmlns:xab npum ="
http://schemas.xmlsoap.org/soap/envelope/"    
     xmlns:xsi = "
http://www.w3.org/ 2001/XMLSchema-lom
     xmlns:xsd ="
http://www.w3.org/ 2001/XMLSchema">

  <xab npum:Lub cev>
    <xab npum:Txhaum>
      <faultcode>xab npum:Neeg rau zaub mov</faultcode>
      <faultstring>
        Kos yam ' Microsoft.SharePoint.SoapServer.SoapServerException’ ntawd ces muab pov tseg.
      </faultstring>
      <nthuav dav>
        <errorstring xmlns ="
http://schemas.Microsoft.com/sharepoint/soap/">
Tus nqi tsis tau thov.
        </errorstring>
      </nthuav dav>
    </xab npum:Txhaum>
  </xab npum:Lub cev>
</xab npum:Hnab ntawv>

tau mas, koj ntshe tsis ntxiv ntawd cov prefix "s0" ntawm tus kheej, tiam sis yog nws ua ib co cuab yeej (zoo li cov dab noj hnub).

Qhov no yog tag yim ruam tag / frustrating vim hais tias muaj lwm txoj kev tso ua kawg.  Piv txwv, lub GetListCollection txoj kev tsis mloog yog hais tias nws yog raug prefixed, Txawm tias yog muaj dev paus ua kawg xws li "xyzzy":

image

Qhov no "tus nqi tsis tau thov" rau nkawd MBDD ntau nrog lists.asmx hopefully li no yuav pab lwm tus neeg paub yav.

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Endlessly Nesting <div> Ntawv cim npe thiab jQuery

Qhov no xws li tej tus oddball npe nkawd, Kuv tsis paub hais tias nws yog yeej muaj nqis blogging txog, tab sis cov uas ib txwm tsis lawm ua ntej kuv, yog li no peb yuav mus Luag nyav

Kuv tabtom haujlwm rau ib qhov project uas kuv tabtom rub tau tej ntaub ntawv los ntawm ib tug mus nrhiav, packaging nws rau hauv ib cov lus XML thiab ces tus XML yog kawg transformed rau HTML ntawm XSLT.  Muaj coob heev jQuery muab kev koom tes, ib ntsis uas implements tej cov tabbing functionality.  Thaum twg koj nyem rau ntawm ib tug tab (tiag tiag, ib tug <div>), jQuery invokes .hide() thiab .show() nyob rau ntau yam divs (cov nplooj pib load downloads cov ntsiab lus txhua yam thiaj li muaj muaj tsis muaj postbacks qhov no).

Ib Rev teev dhau los, tus tab switching logic pib coj erratically thiab nws tsis qhia ib qho kuv tabs.  Kuv kawg tracked nws mus txog ntawd qhov internet explorer (tsawg) xav hais tias tus <div> cim npe nested deb deb, deb ntxaum dua intended.Tus tsim tawm toolbar yuav qhia:

-<div daim id = "Tab1Content">
  -<div>
    -<div>
      -<div daim id = "Tab2Content">
        -<div>
           …………………………
                   </div>  <— kaw thaum kawg uas qhia nws tag kev cia rau no!

Li ntawd, Yog hais tias kuv ua ib $("#Tab1Content").nkaum(), Kuv kuj xav nraim Tab2 thiab kuv yuav tsis pom Tab2 yog hais tias kuv tsis tau qhia Tab1.  Tau theej thiab Document lub chaws rau studio siv qhov muag saib thiab nws yuav tsom hauv ob sab qhov div phlu tuaj tag nrho nicely, li lawv thiab yuav tau ua, saib zoo li no:

-<div daim id = "Tab1Content">
  +<div>
  +<div>
-<div daim id = "Tab2Content">
  +<div>
  +<div>

Tuav kuv lub taub hau tiv thaiv phab ntsa ib pliag thiab pom tau tias nyob hauv lub txoos HTML code tau generating empty heev <div> cim npe, zoo li:

<lub cev>

  <div daim id = "Tab1Content">

    <div daim id = "row1" />
    <div daim id = "row2" />

  </div>

  <div daim id = "Tab2Content">

    <div daim id = "row1" />
    <div daim id = "row2" />

  </div>

</lub cev>

(Cov saum no yog waaaaaaaaaaaay oversimplified.  Qhov khoob div cim ua npe yog siv tau lig. Qee yam ntawm kuv <div> cim npe tau tag nrho cov ntsiab lus, tab sis coob tshaj ntawd twb tsis tau.  Kuv tuaj hauv realization uas kuv <xsl:rau-ib> kev tswj tau emitting lub luv-daim ntawv div tags thaum twg tus xsl:rau-ib tsis ' nrhiav tej ntaub ntawv no.  Kuv yuam ua qhov HTML saib mus rau hauv lub qhov zis, li:

image

 

Tom qab kuv puas tau tias, tag nrho cov div lub lined nicely thiab kuv tab switching pib ua hauj lwm.

Li ib txwm, Kuv vam tias qhov no yuav pab lwm tus neeg nyob hauv lub pinch.

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Ib tug ua rau "tus creator ntawm qhov kev txhaum ho tsis qhia ib vim li cas.”

Kuv twb tau ua hauj lwm SharePoint nrhiav lately thiab lawv cov KeywordQuery kawm ntau, khoom thiab txoj kev.

Yog hais tias koj xav tau tus raug tso rov qab tau above and beyond lub suspects li ib txwm (saib ntawm no), koj ntxiv nws lub SelectedProperties sau, raws li nyob rau hauv:

myKeywordQuery.SelectProperties.Add("xyzzy");

Tsaug ntau thiab ib lub kaus mom rau taub Corey Roth thiab no cov ncej tswv enormously blog (http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/02/19/how-to-use-the-moss-enterprise-search-keywordquery-class.aspx)

Hauv kuv tsev neeg, "xyzzy" tsis yog ib tug muaj managed long-term ua tau.  Thaum twg kuv ntxiv nws rau SelectedProperties lawm, SharePoint txawb kuv favorite ib puas runtime ntxiv:

"Tus creator ntawm qhov kev txhaum ho tsis qhia tias koj thiab."

Kuv pheej nyiam lub peev "R" nyob rau hauv vim li cas.  Qhov no kuv suab zoo li .NET sib npaug ntawm"Kuv muaj tsis muaj qhov ncauj, thiab kuv yuav tsum tau scream.”

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Tej kev siv ncaj: Pheej tawm ntawm kev tshawb KeywordQuery

Ua tau rau thaum koj tus tus Execute() txujci nyob ib KeywordQuery, koj muaj peev xwm tsim ib ResultTable le ResultType.RelevantResults.  No lub snippet code illustrates kuv txhais li cas:

ResultTableCollection resultsTableCollection = myKeywordQuery.Execute();

ResultTable searchResultsTable = resultsTableCollection[ResultType.RelevantResults];

Lub rooj resulting yuav muaj rau txhua cov lus nram qab no: 

WorkId
Plaws
Npe
Sau
Loj
Kab
Hauj lwm lawm
Sau ntawv
SiteName
CollapsingStatus
HitHighlightedSummary
HitHighlightedProperties
ContentClass
IsDocument
PictureThumbnailURL
ServerRedirectedURL

Kuv derived daim ntawv los ntawm ib cov SharePoint 2010 ib puag ncig, ib tsab Enterprise.  Hopefully nws yuav ua ke rau ib tug neeg yav.

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Vim li cas ib tug rau: "Tejyam extract cov ntaub cab hauv cov kua”

Tswvyim thaum uas ua hauj lwm los ntawm siv qhov muag saib lub studio Web site qhov npaj hnub no, Kuv puas tau ib tug me re-nrog rau tej ntaub ntawv yuav muab tso rau hauv lub _layouts sis ib feem ntawm txheej txheem txiag. Yeej, Kuv renamed ib .js thov los ntawm "TypeAhead.js" los "TypeAhead(laus).js"  Kuv yuav npaj ua kom tshem nws thaum nws successor "TypeAhead.js" proves puas muaj tseeb.  Nws zoo li no:

image

Qhov no tam sim ntawd vim ib qho teeb meem uas siv qhov muag saib lub studio thaum kuv sim deploy rau peb tes num:

Yuam kev tshwm sim txiag kauj ruam 'Ntxiv kua': Tejyam uas extract tsheb tav xis cov ntaub ntawv nyob rau hauv txoj kev hais haum.

Nws puv kom paub tias koj yuav tsis tso ib tug parenthesis npe rau cov ntaub ntawv.  Kuv tshem tawm cov parens thiab solved qhov teeb meem uas.

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin