Yog hais tias lub cuab tam yog koj ua khoom koj tsis to taub thiab ces nws tsis nyob hauv lub kauj ruam n ntawm ib tug lej ntawm cov kauj ruam, koj nyob nraum tuag nyob hauv tus dej…
</kawg>
Yog hais tias lub cuab tam yog koj ua khoom koj tsis to taub thiab ces nws tsis nyob hauv lub kauj ruam n ntawm ib tug lej ntawm cov kauj ruam, koj nyob nraum tuag nyob hauv tus dej…
</kawg>
Kuv muaj dua ib zaug crafting BDC ADF cov ntaub ntawv ntawm tes (kom kuv tau tsim kuv "• Get off kuv nyom!" cred) thiab ntaus no tus ntxim hlub yuam kev:
"Thov txhais ntshuam tejyam. Qhov yuam kev no tshwm sim:"
Raws li koj tau pom, yog ib qho kev ua yuam kev, tab sis npog … nws tsis yuav kom koj qhia kuv yog vim li cas nws yog.
Hauv kuv tsev neeg, qhov no muab tias kuv twb pib nrog ib ADF rau lub txawv tus peb tes num uas txuas nrog lub database thiab sau tau ib cov lus nug SQL tiv thaiv ib saib tej qhov chaw. Hauv no yog ib qhov tshiab, Kuv hu ib tug qauv ntawm qhov Web site. Kuv muaj stripped tawm tus DB hom khoom thiab ntxiv kuv qhov Web site rau khoom, tab sis tsis tau tejyam uas hloov lub <LobSystem>lub hom attribute. Kuv switched nws mus "WebService" thiab kuv kaj siab lug mus rau newer thiab ntau exciting ntshuam uas tsis, uas tau licas hauv due kiag.
Ntawm no yog tus LobSystem lawm:
<LobSystem
xmlns:xsi =http://www.w3.org/ 2001/XMLSchema-lom
xsi:schemaLocation =http://schemas.Microsoft.com/Office/2006/03/BusinessDataCatalogBDCMetadata.xsd
Yam = "Database"
Version = "1.0.0.0" Lub npe = "xyzzy"
xmlns ="http://schemas.Microsoft.com/Office/2006/03/BusinessDataCatalog">
Qhov no yeej muaj tseeb:
<LobSystem
xmlns:xsi =http://www.w3.org/ 2001/XMLSchema-lom
xsi:schemaLocation =http://schemas.Microsoft.com/Office/2006/03/BusinessDataCatalogBDCMetadata.xsd
Yam = "WebService"
Version = "1.0.0.0" Lub npe = "xyzzy"
xmlns ="http://schemas.Microsoft.com/Office/2006/03/BusinessDataCatalog">
</kawg>
HLOOV TSHIAB: No lub posting MSDN muaj ib co kev nthuav tswvyim ntawm JXJ raws li nws, mas tsis zoo, yaam puab paub mus nram no txog kev: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2623565&SiteID=1
Peb muaj ib lub lag luam scenario qhov uas peb yuav tsum txuas ob qiv ntaub ntawv ntawm ib qho "daim ntawv ID" teb.
Peb nquag siv ib sab lookup mus qiv mus li no. Muaj ntau ntau lub drawbacks los lookup txhua, peb cov uas muaj:
Backed los BDC, peb yuav siv tus "lag luam ntawv" hom qhia kiag thiab nws muab ib superior nrhiav thiab twb pub ntau txhua cov ntaub ntawv no tshwm nyob rau hauv daim ntawv teev views.
Puas muaj tej yam ua ntej zoo nrog kauj thiab npaj rau kev sau ntawv tshaj txog nws.
Yog hais tias koj twb ua hauj lwm no lub ua ntej thiab yuav tsum muaj tej lus, thov koj qhia!
</kawg>
Kuv twb tau nrog ua hauj lwm BDC hnub no, coding ADF cov ntaub ntawv yog xuas tes ntxuav thiab generating kuv tus kheej ib txhia uas tsis. Zoo li no yuam kev ib:
Thov txhais ntshuam tau tejyam. Qhov yuam kev no tshwm sim: Yuav tsis thauj tej piav los TypeDescriptor tus TypeName. Parameter npe: ces yuav yuam kev typeName yog tsum nyob los yog ua ntej kab: ' 35’ thiab ua tib: '20'.
Tso tawm kom NTXHUAB pom qhov yuam kev no thaum kuv sim import ADF XML ntawv.
Researched lub Internets thiab pom tias kuv yog referencing LOB lom lub npe (los ntawm cov <LobSystemInstance>) nyob hauv kuv <TypeDescriptor> ntawm hais kuv yuav tsum tau muaj los lub npe LOB xwb (ntawm <LobSystem>).
Tsis ncaj ncees lawm:
<TypeDescriptor TypeName="Conchango.KeyValue, LOB lom npe" Lub npe = "KeyValue">
Kho:
<TypeDescriptor TypeName="Conchango.KeyValue, LOB npe" Lub npe = "KeyValue">
Vam tias tej no yog ib yam neeg teev los yog ob lub sij hawm.
</kawg>
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>
===
Cuav xwm tus poj niam lawm:
Ob tug txiv neej mejyig tawm rooj mus noj su. Ib leeg hais sib, "Kuv cia plam ib lub ris hauv qab Freudian embarrassing lwm hmo ntuj."
"Ib Freudian tiab hauv qab? ko yog dab tsi?"
"Zoo, Thaum peb tas noj, lub waitress tuaj thiab nug seb peb nyiam peb noj mov. Kuv meant hais, ' Kuv hlub tus qaib mis’ tiam sis xwb kuv hais tias 'Kuv hlub koj ob lub mis'. Yog kuv txaj muag heev."
"Ah," tus neeg ua hauj lwm nqi teb. "Kuv muaj qhov qub tshaj plaws li rau kuv no lis xaus nrog kuv tus poj niam. Peb noj tshais kuv meant hais nws kis tau tus butter, tab sis xwb kuv screamed rau nws, ' Kuv lub neej puas koj!’"
</kawg>
HLOOV TSHIAB (04/08/08): Kuv zoo li muaj qhov teeb meem no solved. Ntawm qhov hais kom ua kab, Kuv tau khiav "c:\windowssystem32lodctr /R" as per ib qhov rooj sib tham txog InstallShield teeb meem thiab uas pom muaj solved nws rau kuv.
Kuv tau pom tias lately, Kuv desktop/neeg rau zaub mov kiv cua tsis puv. Kuv paub tias nws siv los tua. Kuv nqa ib pliag saib seb nws pom tias cov tau lub neej VMware tau khiav ib zoo ib yam 20% siv rau ib lub CPU. Kuv ntsuam xyuas cov kev tshwm sim cav thiab pom cov uas tsis nyob hauv tus ntawv cav zom dozens ntawm lub sij hawm ib feeb:
Qhov rai tsis ntsaws txee extensible DLL UGatherer, tus thawj DWORD nyob rau hauv cov ntaub ntawv seem yog lub qhov rais yuam kev cai.
Qhov rai tsis ntsaws txee extensible DLL UGTHRSVC, tus thawj DWORD nyob rau hauv cov ntaub ntawv seem yog lub qhov rais yuam kev cai.
Qhov rai tsis ntsaws txee extensible DLL MSSCNTRS, tus thawj DWORD nyob rau hauv cov ntaub ntawv seem yog lub qhov rais yuam kev cai.
Yog hais tias kuv tau tho rau hauv cov lus uas yog ib cov lus, Kuv tau txais no:
Tau qhov twg los: Perflib
Hom: Yuam kev
Qeb: All
Kev tshwm sim ID 1023
Kuv puas tau tej kev tshawb fawb thiab yog ib txhia yeej nws yuav yog ib qho teeb meem tso cai ntawd rau tus DLLs nug txog. Kuv ua si nrog cov khoom ntawd tiam sis yuav tsis muaj feem xyuam rau yam nyob rau hauv ib txoj kev zoo li no kuv muab ntawm qhov uas.
VMware muaj lawm nagging kuv hais txog qhov ua tau zoo rau ib qho kev hloov tshiab heev ib zaug, vim li ntawd kuv jotted cia tus version kuv twb ntsia (thaj "1.0.1 tuam 29996") thiab ho hloov tshiab cov. Qhov no upgraded kuv mus v1.04. Sadly, nws tsis tau kho qhov no.
Kuv yuav nres insane coob sib yuav kuv daim ntawv thov cav yog kuv sib txuas qhov hu ua "VMware tso cai pab". Qhov no tsis pub kuv siv cov VMware software, thiaj li … tsis tas li tus poj xaiv.
Lub party operating system yog qhov rais XP 64 ntsis.
Kuv tsis xav tias qhov no tau tas sim, tab sis, kuv tsis nco qab lawm xyov tej kev tshwm sim uas yuav tau coj mus rau nws.
Qhov no yog vim li cas kuv ntxub computers.
</kawg>
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(); } |
Ib tug khub, "Mark", tau pib nce ib uas nthuav newsgroup tham ntawm kev "tsim kom yav tom ntej tej SharePoint los pib" rau ib tug 35,000 neeg ib puag ncig.
Kev sab laj ntawm no yog: http://groups.google.com/group/microsoft.public.sharepoint.portalserver/browse_thread/thread/6d9a738d981af772/1c390b15c5407db6?#1c390b15c5407db6
Pop rau saud thiab pab txhawb!
</kawg>
Kuv tseem nyob tus cwj pwm uas crafting kuv feature XML ntaub ntawv yog xuas tes ntxuav vim nws tseem tshiab heev tas rau kuv. Kuv tsis xav cia ib tug front-end uas ntawd puas khoom kuv tsis to taub (Nws hais tias nws tau sau ib tug tuaj txog blog uas siv ib tug uas nws tsis to taub).
Hnub no, Kuv twb sim ntxiv ib txog kev cai los ntawm tej chaw kawm ntawv, tiam sis nws cia li tsis tshwm. Kuv yuav nruab ib lub feature thiab pom nyob rau hauv lub qhov nta, tiam sis thaum kuv tshuab txais (tsis muaj kev ua yuam kev) nws tsuas tsis tshwm rau ntawm daim ntawv qhia zaub mov nco-down.
Pom tau kuv thaum kawg hais tias kuv misspelled "SharePoint" nyob rau hauv attribute qhov chaw nyob ntawm tus <CustomAction> ntawm. Qhov no nws yog ntawv phem elements.xml:
<?xml Version="1.0" encoding="utf-8" ?> <Ntsiab xmlns="http://schemas.Microsoft.com/sharepoint/"> <CustomAction Tus ID="SiteActionsToolbar" GroupId="SiteActions" Qhov chaw="Microsoft.Sharepoint.StandardMenu" Ib theem zuj zus="100" Npe="Nyob zoo!" Hauj lwm lawm="Tshuab raj ua kev cai txiav txim ntxiv ntawm ib feature." ImageUrl="_layouts/images/menuprofile.gif"> <UrlAction Url="http://www.xyzzy.com"/> </CustomAction> </Ntsiab> |
Zoo:
<?xml Version="1.0" encoding="utf-8" ?> <Ntsiab xmlns="http://schemas.Microsoft.com/sharepoint/"> <CustomAction Tus ID="SiteActionsToolBar" GroupId="SiteActions" Qhov chaw="Microsoft.SharePoint.StandardMenu" Ib theem zuj zus="100" Npe="Nyob zoo!" Hauj lwm lawm="Tshuab raj ua kev cai txiav txim ntxiv ntawm ib feature." > <UrlAction Url="http://www.xyzzy.com"/> </CustomAction> </Ntsiab> |
That one took me a good two hours to figure out 🙂
Kuv yuav tsum solace nyob txog tias ib hnub yav tom ntej, Kuv yuav tau mus hais rau lub txim ua txhaum, "rov qab rau lub hnub, Kuv yuav tsum tau taug kev mais peb nce toj hauv cov daus (barefoot!) thiaj li deploy rau ib tug kev cai feature rau NTXHUAB. Koj cov me nyuam, koj tsis paub li cas easy koj muaj nws! • Get off kuv nyom!"
Yuav tos tsis tau.
</kawg>