Qeb Archives: SharePoint Development

Tej yam yooj yim piav: “Tus nqi tsis poob li ntawm txoj kev tsim kev khwv.”

HLOOV TSHIAB: Ib daim ntawv loj loj anonymous tshuav ib koob saib txog lub npe. Nco ntsoov nyeem nws.

Thaum ua hauj lwm nrog cov kev tshwm sim receivers thiab lwm yam cai references SharePoint daim ntawv teev khoom ntawm tus kwv qauv, Kuv yeej ua yuam kev uas ua kom muaj qhov yuam kev ntawm runtime:

Yuam kev chaw thau khoom thiab khiav cov kev tshwm sim receiver Conchango.xyzzyEventReceiver nyob xyzzy, Version = 1.0.0.0, Culture = nruab nrab, PublicKeyToken = 0dc50a750396c3ac. Xav paub ntxiv hauv qab no yog. : Tus nqi tsis poob tsis pub dhau lub expected ntau yam.

Kuv xav tias qhov no yog ib qho yuam kev lawm generic haum uas uas vim muaj ntau yam. Txawm li cas los, ib cov lus qhia yog tias kuv nyob referencing teb incorrectly. Yog hais tias lub teb lub npe yog "Hnub so", Kuv yuav tsum reference nws zoo li no nyob rau hauv ib qhov kev tshwm sim receiver:

zog.ListItem["Hnub"]

Thaum twg kuv misspell los siv rau rooj plaub no tsis ncaj ncees lawm thaum referencing lub teb, SharePoint generates cov saum no lum runtime yuam kev. Piv txwv, qhov no tsis yog lawm:

zog.ListItem["hnub"]

</kawg>

Subscribe rau kuv blog.

Ntawv cim npe Technorati:

Ceev & Yooj yim: Tsim ib tug ntawv tais ceev tseg thiab cob ib txheej yam (Los sis, Muaj koj KPIs thiab cov noj tau thiab)

Yuav kom ua num nyob ib ncig ntawm qhov teeb meem KPI Kuv thiaj sau txog no, Kuv puas tau ib co los soj ntsuam thiab sab ntawd KPI ua hauj lwm rau cov folders uas muaj ntaub ntawv meta tib hais tias lawv ua hauj lwm cov ntaub ntawv los teev. Kuv proved nws tawm los ntawm txoj kev kom cov ib yam tshiab nyob rau hauv daim nplaub tshev cov hom thiab ntxiv ob peb teb. Kuv tsim ib co indicators, As thiab proved rau kuv tus kheej tias KPIs ua hauj lwm raws li tau leej twg. Qhov no yog xov xwm txais tos. Yog tsis zoo meej, vim cov laum-down koj tau los ntawm lub KPI tiv thaiv cov folders yog tsis raws nraim koj xav li cas. Qhov no tsis yog noj ntau dhau ib drawback hauv kuv tsev neeg vim 1) rau cov neeg siv tag tsis paub lus zoo thiab 2) laum-down mus rau ib lub tais ceev tseg. Lawv nias lub nplaub tshev Npe thiab nyob rau tom qhov khoom. Nws yog ob tug clicks txhob siv ib tug, uas tsis yog rau thaum xaus rau lub ntiaj teb no.

Qhov no ntws ntawm nicely nrog cov ua hauj lwm uas kuv tau ua. Kuv yuav tsim ib tug ntawv tais ceev tseg rau txhua daim ntawv uas tau txais uploaded. Qhov no yog ua li cas rau ntawm ib qho kev tshwm sim receiver. Yog li ntawd, Nws yog ib daim ntawm ncuav mog qab zib kom txhob muaj qhov niam txiv sis meta cov ntaub ntawv nyob rau hauv cov sync uas muaj cov ntaub ntawv meta KPI-uas tau tsav ntawv xwb vim cov kais dej yog twb nyob rau hauv qhov chaw. Qhov no tso cai rau kuv muaj kuv tus KPI thiab yuav noj tau ib yam nkaus thiab 🙂

Cov kev tshwm sim receiver ntxiv lub sis thiab ces koj muab no nplaub tshev tus tshiab cov hom los kuv kev cai KPI hauv chav ntawv kawm yam hloov kuv. Chaws no me ntsis puas tau qhov ua kom yuam kev:

 SPFolderCollection srcFolders = targetWeb.GetFolder("Cov ntaub ntawv").SubFolders;
  SPFolder addedFolder = srcFolders.Add(zog.ListItem.ID.ToString());
  SPContentTypeId kpiCT = tshiab SPContentTypeId("0x0120002A666CAA9176DC4AA8CBAA9DC6B4039F");
  addedFolder.Item["Cov hom ID"] = kpiCT;
  addedFolder.Item.Update();

Los nrhiav lub txoos cov hom ID, Accessed ntawd hom kawm ntawd ntawm qhov chaw thiab luam/Document nws los ntawm qhov URL li:

duab

</kawg>

Subscribe rau kuv blog!

Ntawv cim npe Technorati: ,

Txoj kev sai thiab yooj yim: Tau qhov SPFolder ntawm kev SPListItem nyob hauv ib lub Receiver Event

Kuv yuav lees nws ntxub, tab sis kuv struggled nrog no ib txhua hnub. Kuv caij receiver kev hloov ntawm cov niam txiv sis teb. Qhov no tshuav me me qhia tau hais tias yuav ua li cas:

lwm yam khoob lug UpdateParentFolder(SPItemEventProperties khoom)
{

SPFolder thisItemFolder = zog.ListItem.File.ParentFolder;
thisItemFolder.Item["ZZ pom zoo lawv"] = "Xov zoo, sawv daws!";
thisItemFolder.Item.Update();


} // UpdateParentFolder

Qhov no, Kuv tabtom ua hauj lwm nrog rau ib daim ntawv qiv ntawv thiab cov khoom los yog ib qho kev tshwm sim hauv ItemAdded.

Qhov ua kom yuam kev yog tias tsis tau qhov SPFolder ntawm yam khoom no ntawm yam khoom no xwb (i.e. zog.Yog thov ListItem.Folder). Xwb, mus saib daim ntawv teev khoom txoj kab ntaub ntawv thiab muab cov ntaub ntawv ceev.

</kawg>

Subscribe rau kuv blog!

Ntawv cim npe Technorati:

Tsis tau lwm yam kev tshwm sim Receiver Debug ua kom yuam kev

Kuv kom kuv kuj tsis yog thawj tug neeg tuaj txog qhov nov. Txawm li cas los, Kuv tsis pom leej twg luam tawm tsab ib ua kom yuam kev li no vim kuv pib hmoog kaw rau lub zej zog lub Xya Hli Ntuj tas los no. Li ntawd, Kuv xav tias kuv yuav tswg nws no lub taub debug txoj kev sai thiab yooj yim.

Kuv tabtom ua hauj lwm rau hauv ib qho kev tshwm sim receiver uas pib Meskas no yuam kev hauv lub 12 nas muv:

Yuam kev chaw thau khoom thiab khiav cov kev tshwm sim receiver Conchango.xyzzyEventReceiver nyob xyzzy, Version = 1.0.0.0, Culture = nruab nrab, PublicKeyToken = blahbalhbalh. Xav paub ntxiv hauv qab no yog. : Kwv siv tsis tau teem rau kev lom los ntawm ib tug kwv.

Kuv tsis paub qhov twg kuv twb nkag tau no tiam sis vim kuv tau ua ntau yam hauv ib qhov ntawm kuv qhov chaws/deploy/kuaj mus.

Kuv sim cov tshuaj no tau txais kuv cov pdb nyob rau ntawd nrog hopes ntawd SharePoint 12 nas muv yuav qhia rau cov pawg ib txoj lw, tab sis tsis muaj hmoo. Kuv tsis paub tias yog tau thiab yog hais tias ib tug neeg twg, thov qhia rau kuv paub 🙂

Kuv paub tias nws puas yuav tau mus sau ntawv rau koj tus kheej mus sib cav ntawm 12 nas muv. Frankly, Kuv xav tej yam tsawg me ntsis scary thiab kom muaj kev cuam sai.

Nws pom kuv tias kuv kawg tau ib cov lus sau ib txoj lw los tuag thiab rov ntuav generic ntxiv li no:

  ua tiag {
    UpdateEditionDate(khoom);
  }
  ntes (Kos e)
  {
    pov tshiab Kos("Dispatcher, UpdateEditionDate(): Kos: [" + e.ToString() + "].");
  }

Qhov no kuj nyob hauv lub 12 hive thusly:

Yuam kev chaw thau khoom thiab khiav cov kev tshwm sim receiver Conchango.xyzzyEventReceiver nyob xyzzy, Version = 1.0.0.0, Culture = nruab nrab, PublicKeyToken = blahblahblah. Xav paub ntxiv hauv qab no yog. : Dispatcher, UpdateEditionDate(): Kos: [System.NullReferenceException: Kwv siv tsis tau teem rau kev lom los ntawm ib tug kwv. tom Conchango.xyzzyManagementEventReceiver.UpdateEditionDate(SPItemEventProperties zog) tom Conchango.xyzzyManagementEventReceiver.Dispatcher(SPItemEventProperties zog, Txoj hlua eventDescription)].

Uas tau muab kuv nthuav dav kuv tau teev cia tias xyov qhov teeb meem thiab kuv cia siab tias yuav siv heev mus rau pem hauv ntej.

</kawg>

Subscribe rau kuv blog!

Ntawv cim npe Technorati: ,

Kua: SPQuery tsis nrhiav Folders

Yav tas los lub limtiam uas kuv tau siv lub tswv yim no muaj "evolving" muab rau ib tug neeg uas siv cov BDC thiab cov SPQuery thiab khiav rau tej teeb meem siv SPQuery rau ib daim ntawv uas muaj folders. Ntxaib: cob "recursive" mus saib attribute rau cov lus nug.

Kuv scenario:

  • Hnub Monday, Upload ib daim ntawv thiab muab tej ntaub ntawv no meta.
  • Lub lim tiam li nram no, Kuv upload ib daim ntawv tshiab. Ntau yam ntawm cov ntaub ntawv meta no daim ntawv tus tshiab raws li daim ntawv kuv busy uploaded (uas peb hu tus "npaj ntaub ntawv").
  • Peb thiaj tau tsim lub Web site pab façade uas muab hauv BDC interface rau daim ntawv kom cov neeg siv tau yooj yim nrhiav ntawd hnub ib daim ntawv ntawm lub npe nrhiav.
  • Ib tug ncej tag BDC tej ntaub ntawv qhia tus neeg siv tus phooj ywg interface. (Qhov no yog ib feem ntawm kuv los kom siv BDC rau sab Lookup ntau tus phooj ywg).

Qhov kawg BDC façade kev siv ib cov lus nug li no ua rau lookup:

 // Siv U2U tuam mus pab generating qhov lus nug no CAML.
      oQuery.Query =
        "<Nyob qhov twg>";

      Yog hais tias (titleFilter.Length > 0)
        oQuery.Query  =
          "  <Thiab>";

      oQuery.Query  =
        "    <Thiab>" +
        "      <Geq>" +
        "        <FieldRef Name = yog muaj "DocumentId" />" +
        "        <Value yam = yog muaj "Text">" + minId + "</Tus nqi>" +
        "      </Geq>" +
        "      <Leq>" +
        "        <FieldRef Name = yog muaj "DocumentId" />" +
        "        <Value yam = yog muaj "Text">" + maxId + "</Tus nqi>" +
        "      </Leq>" +
        "    </Thiab>";

      Yog hais tias (titleFilter.Length > 0)
        oQuery.Query  =
          "    <Muaj>" +
          "      <FieldRef Name = yog muaj "Title" />" +
          "      <Value yam = yog muaj "Text">" + titleFilter + "</Tus nqi>" +
          "    </Muaj>" +
          "  </Thiab>";
      oQuery.Query  =
        "</Nyob qhov twg>";

Thaum pib txog theem ntawm kev loj hlob, qhov no ua haujlwm great. Txawm li cas los, peb nkag tau folders rau hauv cov directory yuav kom daws tau tej teeb meem no thiab mam li nco dheev, Kuv tus BDC picker tsis rov qab muaj ntsiab. Kuv tracked no mus ua tus Disease fact tias tus SPQuery yeej tsis rov muaj ntsiab. Peb siv folders los pub ntau yam ntaub ntawv uas muaj lub npe qub los yuav uploaded tab sis meta tej ntaub ntawv uas muaj neeg. Thaum cov ntaub ntawv yog uploaded, peb yuav tsim ib tug ntawv tais ceev tseg raws li daim ntawv teev khoom tus ID thiab mam li tsiv ntawv muaj (Kuv thiaj sau txog ntawd ntawm no; peb twb muaj mixed ntsuam cov kauj, tiam sis ntawm tus kheej, nws zoo zoo). Tus neeg siv tsis care txog folders thiab tiag, tsis tshua to taub tias muaj ntau yam folders. Peb muaj configured tag nrho cov kev views rau lub tsev qiv ntawv los qhia cov khoom s. folders.

Kuv ntaus cov teeb meem no ob zaug raws li cov kev siv evolved thiab solved nws txawv txhua sij hawm. Thawj thawj zaug, Kuv tsis yog siv tus neeg teb xov tooj CONTAINS rau cov lus nug. Tsis muaj ib tug neeg tsav tsheb CONTAINS, Kuv txawm yuav kom daws tau qhov teeb meem los ntawm specifying cov pom hauv lub SPQuery contructor. Tsis txhob siv lub neej ntawd constructor:

Splist.Update() oList = Web site.Teev["Cov ntaub ntawv"];

SPQuery oQuery = tshiab SPQuery();

Kuv txhais xwb ib constructor uas teev ib saib:

Splist.Update() oList = Web site.Teev["Cov ntaub ntawv"];

SPQuery oQuery = tshiab SPQuery(oList.Views["Cov ntawv"]);

Solved qhov teeb meem ntawd thiab yog tau txais kuv tau.

Ces kuv ntxiv hom kab mob tus neeg teb xov tooj CONTAINS ua tus ntse thiab raug dua. Nws puv tawm uas tus neeg teb xov tooj CONTAINS, thiaj li yuav paub kuv, tsis ua hauj lwm nrog rau cov saib tau ib yam nkaus li rau ib cov zauv GEQ / Tswv LEQ. Kuv tau ua ib co searching thiab kawm tias ViewAttributes cov lus nug yuav tsum muab teev cia rau cov "Recursive", raws li nyob rau hauv:

oQuery.ViewAttributes = "Tau = yog muaj"Recursive"";

Uas solved qhov teeb meem rau CONTAINS. qhov tseeb, qhov no kuj solved kuv yuavtsum nrhiav teebmeem thiab yog hais tias kuv yuav tsum teev cov recursive attribute thawj zaug, Kuv yuav tsis tau khiav mus rau hauv lub qhov teeb meem dua.

Tus fact SPQuery Saib kuas rau qee tus tswv xwb (GEQ/LEQ) thiab tsis yog lwm leej lwm tus (MUAJ), coupled nrog cov fact KPIs tsis zoo li mus ua hauj lwm txhua nrog rau nplaub tshev uas muaj ntaub ntawv qiv leads kuv ntseeg hais tias SPQuery muaj tej qhov teeb meem txog orthogonality.

Tsaug tshwj xeeb:

  • Tus zoo folks tom U2U thiab lawv cov lus nug cuab tam.
  • Michael Hoffer tus poj "kev kawm tau los ua" Blog ncej, lus thiab cov lus teb.

</kawg>

Subscribe rau kuv blog!

NTXHUAB KPI kab laum? Daim ntawv teev qhia tau rau daim ntawv qiv nrog Folders Tied

HLOOV TSHIAB 02/29/08: Kuv solved qhov teeb meem no los ntawm kev tsim ib tug ntawv tais ceev tseg thiab mam li muab ib yam txheej rau tus ceev uas muaj cov ntaub ntawv meta kuv yuav tsum tau rau cov KPIs. Kuv piav ntawd nyob me ntsis ntxiv nthuav dav ntawm no.

Peb DVR muaj kev tov uas cov neeg siv upload ntaub ntawv rau ib daim ntawv qiv. Ib qho kev tshwm sim receiver tsim ib directory thiab lawm cov ntaub ntawv ntawd directory (siv ib tug txheej txheem xws li yuav ua li cas kuv thiaj sau txog ntawm no). Peb twb ntse navigated ib ncig ntawm tej teeb meem los ntawm receivers kev tshwm sim uas rename uploaded ntaub ntawv (mas vim cov neeg siv yeej pib cov ntaub ntawv los ntawm txhaj rau "New" tab sis, tsim tus docs Senior xwb thiab mam li upload nws).

Cov ntaub ntawv meta rau cov ntaub ntawv muaj xws li ib tug yog/tsis muaj kev kawm ntawv Kem no hu ua "Urgent" thiab lwm qhov chaw sab hu ua "Txoj cai". Peb yuav tsum mus ntsib ib lub lag luam yuav tsum tau uas muaj qhov feem pua ntawm "Urgent" cov ntaub ntawv cov txheej xwm uas nws tsis tau "Tiav".

Qhov no yog qhov yooj yim mas yuav tau ua thiab kuv yuav piav ib yam dab tsi heev npaum li no nyob rau SharePoint Beagle Cov vijtsam txhaj tshuaj yog hais tias koj xav ntau ntau.

Nyob rau hauv ib lub nutshell, Kuv puas tau qab:

  • Ua kom muaj tus saib ntawm daim ntawv hu ua "Tseem tos seb" doc.
  • Configure tus saib yuav las mees nplaub tshev qauv.
  • Tsim ib daim ntawv teev KPI.
  • Tsim ib qhov kev taw qhia rau hauv daim ntawv teev cov ntsiab lus los ntawm doc lib thiab uas "tseem tos seb" saib.

Qhov no tsuas tsis ua hauj lwm. Tus KPI yuav qhia kuv cov phiaj (e.g. 5 cov ntaub ntawv ceev) tab sis nco ntsoov qhia tseeb pes tsawg tus ceev cov ntaub ntawv li xoom. Paradoxically, Yog hais tias koj mus ua kom paub meej tho, Nws pom tias cov ntaub ntawv ceev tsib nyob rau hauv daim ntawv. Kuv tsim ib scenario yooj yim heev uas muaj ntaub ntawv ob, ib lub sis thiab ib tug tsis. Ntawm no yog qho screen txhaj:

duab

Txhaj tshuaj ntsuam saum toj no kom meej meej pom tias muaj cov ntaub ntawv uas nyob hauv qhov pom tab sis "tus nqi ob" yog ib tug. "CamlSchema cov" nrog rau cov ntaub ntawv dawb paug Id hauv lub hauv paus ceev thiab tsis sib hauv ib nplaub tshev npe hu ua "84".

Nws zoo nkaus li rau kuv tias txawm koj hais ib tug saib kom meej, tus KPI no tsis tsim cov "qhia tag nrho cov khoom tsis muaj folders" qhov chaw kawm thiab xwb, nws tus kheej mus rau lub hauvpaus ceev confines.

Yog kuv tsis ncaj ncees lawm, thov xa kuv ib tug kab los yog cia ib tug saib.

</kawg>

Subscribe rau kuv blog!

Ntawv cim npe Technorati:

Kua rau teeb meem: “FileNotFoundException” Nrog kuv tus Feature Receiver.

Kuv tau ua hauj lwm rau ib tug feature zaum tag los uas yuav ntxiv tej yam kev tshwm sim receivers rau ib daim ntawv teev kev lom. (Kuv blogged txog tias receiver no los sau li no kuj nce mentsis).

Siv cov kev hais kom ua kab, Kuv yuav nruab qhov feature uas tsis muaj kev ua yuam kev (tiam sis saib hauv qab no rau thaum qhov kev ua yuam kev). Thaum kuv sim deploy feature rau ntawm qhov chaw, NTXHUAB complained "FileNotFoundException ib" yuam kev. No nkag teb chaws blog piav li cas kuv solved nws.

Qhov no yog qhov yuam kev ntawm NTXHUAB tsom kuv nyob rau hauv cov qhov web browser:

Feature ' b2cb42e3-4f0a-4380-aaba-1ef9cd526f20’ yuav tsis muab ntsia tau vim hais tias lub chaw thau khoom ntawm cov kev tshwm sim receiver los ua ke "xyzzyFeatureReceiver_0" ua tsis tau tejyam: System.IO.FileNotFoundException: Yuav tsis thauj cov ntaub ntawv los sib dhos ' xyzzyFeatureReceiver_0’ los yog ib qhov dependencies. Lawv nrhiav tsis tau cov ntaub ntawv teev.
Cov ntaub ntawv npe: ' xyzzyFeatureReceiver_0’
tom System.Reflection.Assembly.nLoad(AssemblyName fileName, Txoj hlua codeBase, Pov thawj assemblySecurity, Los ua ke locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
tom System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Pov thawj assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
tom System.Reflection.Assembly.InternalLoad(Txoj hlua assemblyString, Pov thawj assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
tom System.Reflection.Assembly.Load(Txoj hlua assemblyString)
tom Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
WRN: Muab sib dhos losis tswvyim dabtsi logging OFF.
Yuav pab kom sib dhos khi tsis logging, muab lub npe nqi [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) mus 1.
Ceeb toom: Yog ib co kev nplua nrog sib dhos khi tsis logging.
Tig no feature, tshem tau cov nqi no npe [HKLMSoftwareMicrosoftFusion!EnableLog].

Troubleshoot muaj teeb meem nrog rau cov kev pab cuam SharePoint qhov rais.

Kuv paub tias yuav ua li cas yuav txhob txwm tshaj tawm ua tau qhov yuam kev: tsis txhob nruab ib tus los ua ke hauv lub GAC. Tab sis npog, yog nyob hauv lub GAC. Kuv nquag nruab sibtham hauv lub GAC los cia rau hauv lub c dragging:\windowsassembly sis siv explorer qhov rais. Kuv yeej ib txwm tsis muaj 100% nyiam ua ntawd vim kuv pheej xav tias gacutil existed ib vim li … ces kuv sim uas. Ua tsis muaj qhov sib txawv.

Nrhiav cov Internets thiab pom no ncej: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2243677&SiteID=1

Cov daim ntawv loj loj tshwm sim uas yuav siv tib hauv paus ntsis ntawm txoj (los ntawm phau ntawv hauv WSS los ntawm daim ntawv) li ntawd, uas yog ib qho hopeful. Txawm li cas los, qhov suggestion ntawm decorating lub los ua ke rau ib qho [sib dhos: ] tswj tsis ntxim rau kuv. Kuv sim nws lawm thiab kuv yog txoj kev. Ua tsis muaj qhov sib txawv.

Ces kuv pom tias kuv chav kawm ntawv txhais tau tsis pej xeem. Kuv muab nws pej xeem thiab cov uas ua tsis muaj qhov sib txawv.

Tom ntej, Kuv mus rau qhov teeb meem ntawm enabling tus "sib dhos khi tsis cav" (tom qab tus tswv thiab raws cov lus qhia muab) thiab qhov no yog qhov twg yam pib tau nthuav. Cov cav ntawd qhia rau kuv tias lub runtime yog searching zaws ntawm tus neeg rau zaub mov rau kuv los ua ke. Txawm tias nws pom tau searching rau nws nyob rau hauv kuv txee rau tshuaj. Tab sis npog … nws yuav tsis nrhiav nws nyob hauv lub GAC.

Kuv muab tso rau hauv kuv lub tsho caij ntuj no thiab mus searching lub Internets dua thiab paub tias ib tug neeg nws tau qhov teeb meem no thiab. Kev zoo sab laj nyob ntawd xo peters tawm rau hauv tsis muaj dab tsi thiab kuv yuav tsis nrhiav kev kho.

Kuv tsiv kuv los ua ke rau hauv ib lub chaw leg ntaubntawv tus cav nws yog searching thiab kuv kom ntau me ntsis xwb. Kuv tabtom rewarded nrog tus tshiab yuam kev nyob hauv koj tus browser thaum kuv ua tiag mus qhib lub feature:

Tejyam uas tsim feature receiver kwv los sib dhos "xyzzyFeatureReceiver_0", hom "Conchango.xyzzyFeatureReceiver" rau feature b2cb42e3-4f0a-4380-aaba-1ef9cd526f20: System.ArgumentNullException: Tus nqi tsis tau thov.
Parameter npe: hom
tom System.Activator.CreateInstance(Tej yam, Boolean nonPublic)
tom System.Activator.CreateInstance(Tej yam)
tom Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

Troubleshoot muaj teeb meem nrog rau cov kev pab cuam SharePoint qhov rais.

Lub sij hawm rau ib lub xeem txawv tebchaws rau lub Internets!

Lub sij hawm no kuv paub, predictably txaus, ntawd NTXHUAB sib yuam kev no vim hais tias cov los ua ke yuav tsis nyob hauv GAC.

Kuv xav tau ib yam dab tsi zoo rau hauv no thiab ua kom muaj ntsis txaus siab rau qhov tias kuv tsim tau lub Tseem nrhiav kev MSIL sibtham, tab sis nws tsis ua hauj lwm. Kuv nyuam qhuav plain annoyed. Kuv nrhiav tau kuv tus kheej muttering "qaib los yog qe" raws li kuv ua tsis taus pa.

Thaum kawg kuv xav punt. Kuv tsim ib qhov project nkaus tshiab thiab daim ntawv/muab tshuaj qhov chaws ntawm incredible-cloaked-from-the-GAC-assembly uas tsis ua hauj lwm peb tes num dua tshiab project no. (Kuv nrhiav ib tug chij hu ua ib yam dab tsi zoo li "nraim ntawm los ua ke losis tswvyim dabtsi yog ntsia tau rau hauv cov GAC muaj" tab sis nrhiav tsis tau ib tug).

Nruab ib lub feature thiab qhib nws thiab … nws ua haujlwm! Li ntawd, tag nrho cov tom qab, Kuv tau ua yeej ' reboot’ ib qhov kuv. Qhov no yog lwm vim li cas kuv ntxub computers.

Kuv kawm tau ib yam dab tsi pab tau los ntawm no. Kuv yuav tsum tau txhim kho nta cov stsadm hais kom ua kab siv ib hnub thiab siv tau cov "-yuam" kev xaiv ntawm tus cwj pwm. Vim, Kuv puas tau txhob siv cov - quab yuam kev xaiv thaum kuv ntsia peb tes num tshiab. Lub sij hawm no, Kuv yeej tsis, hais tiag nco kom luam no ib qhov ntawv tshiab los ua ke rau hauv lub GAC. Yog li ntawd, Kuv tau txais "FielNotFoundException ntawd" yuam kev. Lub sij hawm no, Kuv yog tus txais ntawm stsadm, tsis yog thaum kuv sim mus qhib lub feature ntawm lub web browser. Li ntawd, -sib zog ua tau plays ob tug cwj pwm. Nws tso cai rau koj los rov nruab ib feature uas twb muaj lawm. Nws tseem tso cai rau koj nruab ib lub tsheb nees feature uas tsis ua hauj lwm ntawm runtime ntawm suppressing qhov yuam kev. Nws zaum hais ua ntau ntau nyob hauv kev pab qhov chaw tab sis kuv yeej tsis pom nws.

</kawg>

Ntawv cim npe Technorati: ,

Ceev & Yooj yim: Rename Uploaded tej ntaub ntawv uas siv SharePoint kwv tus qauv ntawm ib cov Receiver Event

HLOOV TSHIAB: Qhov no xwb, tiam sis yog muaj teeb meem loj uas muaj nyob rau hauv cov lus muaj. Qhov no tseem yuav pab tau rau ib co cirumstances.

HLOOV TSHIAB 2: Nyob rau hauv kuv qhov project no, cov neeg siv yuav tsum upload ntaub ntawv. Yog li ntawd, Kuv tsis tau khiav mus rau ib qho teeb meem uas MS Word khiav khiav thiab xav tias tias cov ntaub ntawv yog renamed rau. Kuv puas tau khiav mus rau ib qho teeb meem, "cov ntaub ntawv yog hloov los ntawm lwm tus" thiab solved no ntawm tus chij hom lus semaphore. Cov neeg siv yuav tsum tau hloov meta cov ntaub ntawv teb nws vim nqi tam sim no los yog lwm yam. Lub itemupdated() receiver zoo rau ib tug siv tau nqi muaj ua ntej ua tau lub rename thiab txij thaum ntawd los, Kuv tsis tau muaj tej teeb meem. Koj nqi kev mus yuav txawv.

Kuv muaj ib tug neeg yuav tsum tau hloov lub npe ntawm cov ntaub ntawv rau lub tsev qiv ntawv tej ntaub ntawv los yoog tau nrog ib tug naming convention uploaded. API tsis muab "rename ib()" txujci. Xwb, peb siv "MoveTo(…)". Ntawm no yog qhov chaw cia me ntsis ntawm txoj kev yuav ua kom tiav no:

 pej xeem override khoob lug ItemAdded(SPItemEventProperties khoom)
        {
            SPFile f = zog.ListItem.File;

            f.MoveTo(zog.ListItem.ParentList.RootFolder.Url + "/xyzzy.doc");
            f.Update();

        }

Lub ntsis xwb lo yog cov "khoom. ListItem.ParentList.RootFolder.Url". Lub MoveTo() txoj kev yuav tsum tau ib qhov URL. Uas mashed txog cov ntsiab lus txoj hlua kuv rau cov hauv paus hniav sis ntawm kuv lub tsev qiv ntawv ntawv tam sim no. Qhov no pub rau kuv kom tsis txhob muaj zog coding nyob hauv kuv tej receiver.

Qhov no yog ib pab tau ntau version ntawd puas muaj qhov tib, tab sis, tus assigns lub npe ntawm cov ntaub ntawv rau lub "Title":

 pej xeem override khoob lug ItemAdded(SPItemEventProperties khoom)
        {
            DisableEventFiring();

            // Cob lub npe ntawm cov khoom no rau lub npe ntawm cov ntaub ntawv xwb.
 // CEEB TOOM: No ntus yuav tsum xyuas ua ntej peb hloov cov ntaub ntawv xwb.
 // Hu rau cov hloov tshiab() nyob rau hauv SPFile pom lawm hais tias invalidate cov khoom nyob rau hauv
 // tej kev txiav txim zoo.  Tshiab rau "Title" ua tsis tau tejyam kom txog thaum uas hloov (thiab hloov tshiab() hu)
 // tau tsiv pem lub taub hau ntawm kev hloov rau cov ntaub ntawv npe.
            zog.ListItem["Title"] = zog.ListItem.File.Name;

            zog.ListItem.Update();

            SPFile f = zog.ListItem.File;

            // Tau ncua ntxiv ntawm cov ntaub ntawv.  Peb xav tias tom qab.
 hlua spfileExt = tshiab FileInfo(f.Name).Extension;

            // Rename ntawv los sau yam tus ID thiab siv tau ua ntaub ntawv thov ncua ntxiv kom
 // tias ib feem ntawm nws lawm.
            f.MoveTo(zog.ListItem.ParentList.RootFolder.Url +
                "/" + zog.ListItem["TUS ID"] + spfileExt);

            // Kuas cov qhov nyuas siv zug.
            f.Update();

            EnableEventFiring();
        }

Nreeb taub: Cov lus nug qhov Web Tshooj, Tus nqi sab lookup thiab cov XSL

Kuv muaj ib kem npe nyob rau hauv ib chav ntawv kawm hom hu ua "Qhov chaw av".

Cov qhia kiag tias yog yam "lookup".

Kuv tau hloov <CommonViewFields> thiab ItemStyle.xsl qhia sab.

Tus leb <xsl:tus nqi-kev xaiv =…> rov qab muaj nrog tus nqi uas muaj xws li cov ntaub ntawv thib peb txoj hauj lwm, xws li:

1;#Miami

Mus rau cov tib neeg hauv tus nqi, siv xsl substring-tom, li:

<xsl:valuxslf xaiv = "substring-tom(@Real_x005F_x0020_Estate_x005F_x0020_Location,’#’)"></xsl:tus nqi-ntawm>

Siv cov txheej txheem no thaum twg koj ua haujlwm nrog lookup qhov tseem ceeb nyob rau hauv XSL transforms thiab xav tau cov nqi no tib neeg hauv.

<kawg />

Ntawv cim npe Technorati: , ,

Txoj kev sai thiab yooj yim: Seb lub npe qhia kiag ntawm ib qhov chaw kem

HLOOV TSHIAB: Jeremy Thake muaj kev blogged txog qhov no thiab yuav muab ib co chaws rau ib daim ntawv thov console uas pom tias yog lub npe.

Kuv twb ua tau ib cov lus nug qhov web qhov mus tso saib ib hnub so ntawm kev ua hauj lwm ib thiab vim tias daim screen "Hnub", Kuv assumed uas qhia kiag lub npe siv nyob rau hauv <CommonViewFields> yog "Due_x0020_Date".

Tsis ncaj ncees lawm!

Rau lub npe tiag qhia kiag qhov no yog "DueDate".

Kuv mus nrhiav puas tau nws li cas? Kuv rov nyeem Heather Xatau-ntoos lub blog nkag rau modifying CQWP qhia ntxiv txhua cov ntaub ntawv. Nws piav txoj kev no kauj ruam #13. Nws ntseeg. Nws yeej muaj tseeb. Tsawg, yog tseeb rau kuv. Kuv yeej tsis ntseeg nws nyob rau ib sab nrog ib tug ntau ntev lub npe ua ntej.

Kuv hais tias "ntseeg nws" vim kuv yeej tsis ntseeg nws thiab tej zaum lub sij hawm nyob ze ob teev butting kuv taub hau up against ib phab ntsa. Tom qab kuv lawm "DueDate cov" lub npe, Kuv xav mus ntxiv rau lwm daim teb mus <CommonViewFields>. Siv tus txheej txheem Xatau-ntoos, Kuv tau txais ib kem lub npe zoo li cov "XYZ_x0020_Project_x0020_Due_x00".

Kuv xav hais rau kuv tus kheej, li no kom meej meej tau ib tug lub npe truncated. Kuv mus ntej thiab tsis truncated nws tsis tau zoo. Kuv thaum kawg siv lub npe seemingly truncated thiab nws ua haujlwm.

Lawm muaj ntsis: Thaum kuv tau nrug cov CQWP, Yog hais tias tus phem lub npe ntxiv kuv <CommonViewFields>, tus CQWP yuav qhia kuv tias cov lus nug yuav tsum rov qab tsis tau. Tab sis npog, Yog hais tias kuv ntxiv ib cov hom ntaub ntawv rau cov cov npe teb, nws yuav rov muaj tshwm sim. Muab cov ntaub ntawv yam ua tau masked ib qho teeb meem vim kuv yog referencing teb tsis-existent. Kuv phem muab nws, tiam sis thaum kuv sim mus tso saib nws cov nqi, Kuv puas yuav tsum tau ib VOJVOOS.

Qhov no tsis tau npog qhov yuam kev:

<CommonViewFields>Due_x0020_Date;</CommonViewfields>

Qhov no puas tau los npog qhov yuam kev:

<CommonViewFields>Due_x0020_Date,DateTime;</CommonViewfields>

</kawg>