Qeb Archives: SharePoint Development

Xyoob Calendar Interacting nrog SharePoint ua "ib qho yuam kev lawm npaj txhij txog neeg"

Hnub no, Kuv twb tau ua hauj lwm hauv ib cheeb tsam uas siv ib xyoob daim Web site tshooj rau ib co tswv yim paub. Qhov no txheem nruab nrab/choj ua teb nrog ob load balanced WFEs, neeg rau zaub ib "daim ntawv thov mov" rau indexing thiab cov InfoPath thiab ib cov clustered SQL tag rov qab.

Tus neeg ntsia tej huab cua phem rov qab software mus rau ib lub WFEs thiab uas ua rau ib WFE rau ib qhov chaw hais nyob rau hauv qhov chaw sau los lawm. Tav twg thauj ntsuas taw tes qhia nyob rau cov WFE thiab cov uas kawm ntawv, cov neeg kaw lub tshuaj lom zem ntau dawb tshuaj ntsuam nrog cov kab lus "ib qho yuam kev npaj txhij txog neeg". Tsis yog lwm pab ntxiv yog tsom, Yog tias kab lus.

Lawv kom kuv mus saib. Yooj yim tswv cuab qhov teeb meem thiab ho ntxiv ib ?txheem = 1 thiaj li yog qhov xaus ntawm qhov URL. Qhov no yog li cas kuv kawm lawv tau siv ib sab web xyoob. Kuv rov mus rau sab thiab tam sim no, dheev, nws tsom kuv lus zoo yaam yuam kev:

image

Tsis paub tias dab tsi yog zoj zis los yog li cas kuv ho tau tswj tau qhov kev ua yuam kev hais kom tso saib dua appending lwm tus ?txheem = 1 me ntsis cov lus nug txoj hlua.

Qhov no tej zaum ib rooj plaub ntug tsis tshua muaj heev tab sis yog hais tias koj tau txais cov lus ntawd, "Kev npaj txhij txog qhov kev ua yuam kev tshwmsim" koj mus koj thiab ntxiv ?txheem = 1 rau cov lus nug hlua thiab pom qhov twg uas ua.

</kawg>

Subscribe rau kuv blog.

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

Ntawv cim npe Technorati: ,

Siv Reflector rau ntawm Microsoft.SharePoint.dll

Redgate .NET Reflector Michael Blumenthal tau muab tso tus tsab xov xwm txog alerts views ("Uas views siv tau thaum uas tsim ib qho Alert ?"), Nws yog ib qho ntawm nws tus kheej yuav pab lawd tog nthuav. Txawm li cas los, Kuv twb xav xub los saib cas nws methodically mus taug kev los ntawm txoj kev siv lub Redgate .NET Reflector. Step ntawm step, nws qhia tau hais tias yuav ua li cas los siv qhov cuab tam khiav nqes cas SharePoint pom seb ib saib rau ib daim ntawv teev yuav tau "subscribable" for lack of muaj ib lo lus zoo (he explains this much better than I do 🙂 ).

Thaum no tus taw tes rau qhov SharePoint era, koj puas yuav luag tau lag ntseg thiab dig muag kom muaj tsis hnov los yog nyeem txog kev siv qhov cuab tam ntawd. Nws tau nce khoom thiab kuv cov kev txiav txim zoo yog tias yeej muaj ntau txoj kev uas ib tug uas ntawm lub xeem resort. Txawm li cas los, Yog koj xav tias koj xav tau tiam sis tsis tshua paub npaum li cas, Michael nws write-up rau nkawd xws li ib tug yawm nyeem hauv no kawm.

</kawg>

Subscribe rau kuv blog.

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

Ntawv cim npe Technorati: , ,

Sorting khoom nyob hauv daim Calendar saib

Kuv yuav siv daim calendar los teev cia cov vaj huam sib luag tham ib hnub muab. Kuv muaj ob zaug: sawv ntxov ntxov thiab tav su. Kuv xav ua kom pom uas pom tias yog thaum sawv ntxov zaug xwb alphabetically teev ntawm ib daim ID qhib. Qhov no yog lo me ntsis mus ua kom tiav (ntshe kuv yuav tu tej yam cuab kev real).

Kuv tau yooj yim yuav tsim ib tug uas saib uas qhia cia tias hnub twg cov txheej xwm. Daim ntawv thov raws qhov yuav qhia tag nrho cov txheej xwm thiab yog lawv cov noj muab rau cov teev tib, nws teev lawv tog yog tog hauv cov teev qhov. zoo heev. Lo ib sab ntawd yog, los vim, nws xav ua phem rau lawv tus ID hom ntawv sau. Li ntawd, Yog tias kuv hais ntxiv "qhib 02" thiab luag "qhib 01" rau qhov lub, nws qhia lawv tias kom (i.e, Kho 02 thiab ces sib kho 01). Sau hais sib kho ID, Kuv xav tias tej no yuav ua tiag:

  1. Configure pom qhov siv tau cov web neeg interface. Tsis muaj hmoo. Yog tsis muaj kev xaiv kom khoom li no.

    Vim tus uas tsis ua hauj lwm, Kuv yog tam sim no muaj hoping yog ib cov lus nug CAML qhov chaw nyob ntawd uas yuav, cia kuv mus override tus tsi. CQWP cia kuv ntawd tsi hloov ua, tej zaum daim yuav zoo li?

  2. Kho kom raug rau cov qhov Web site, nrhiav "export ib" nuj nqi thiab … BZZZT! Kuv tsis tau export nws cov XML. Yog tsis muaj kev xaiv export.

    Kuv tseem tuav tawm vam cia tias kuv yuav nrhiav thiab hloov tej lus nug CAML. Vim kuv tsis tau export web ib sab, SharePoint Designer yoojyim uas.

  3. Ntxiv rau daim Web site qhov rau ib qhov chaw sandbox thiab qhib uas qhov chaw siv SharePoint Designer. Kuv saib cov markup rau ib sab qhov web thiab kuv pom dab tsi kuv tab tom nrhiav. Nws muaj encoded kev chim, tiam sis nws tseem muaj: "<ListViewXml …. >encoded kev chim</ListViewXml>". Yeej, yog lub pov haum:

<Lus nug>
<Nyob qhov twg>
<DateRangesOverlap>
<FieldRef Name = "EventDate" />
<FieldRef Name = "EndDate" />
<FieldRef Name = "RecurrenceID" />
<Value yam = "DateTime">
<Hli />
</Tus nqi>
</DateRangesOverlap>
</Nyob qhov twg>
<OrderBy><FieldRef Name = "Session_x0020_ID" /></OrderBy>
</Lus nug>

(Kuv twb decoded cov &LT;tus thiab &lub gt thiab lawv hais kom cov kab ntau rau tus clarity sake phua).

Ntxiv rau <OrderBy> tshuav thiab tam sim no nws sorts los ntawm sib kho ID, tsis rau sab hauv daim ntawv teev khoom ID.

GIGANTIC taub o’ kaus mom rau Becky Isserman rau nws saib kom Isha Sagi blog ncej: http://www.sharepoint-tips.com/2008/07/caml-sorting-by-file-name.html. Kuv tsis tau muab cov <OrderBy> nyob rau hauv qhov chaw yog nws saib tsis tau.

Kuv vam tias sau ntawv no ntxiv kom meej meej screen txhaj tshuaj sai sai, tiam sis thaum kuv yeej tsis ua, ntawm kuv puas no much.

</kawg>

Ntawv cim npe Technorati: , , ,

SharePoint nta & Dlaws Management — Tsis txhob hnov qab tus U hauv CRUD (los yog cov D rau qhov teeb meem ntawd)

Peb collectively siv ib yawm deal txog sij hawm xav txog cov ntsiab SharePoint — tsim lawv yuav ua li cas, cuab tam twg yog cov uas yuav siv, ua li cas thaum lawv tsis deploy, cov hauj lwm timer, scopes, yam. Peb siv heev thaum xav txog cov khoom up-front uas nws tseem nco qab txog tias peb yuav mus nkaum lawv zoo li. Pheej rov huas pas dlaws yog zaum nyuaj, los ntawm ib tug tsim conceptual foundations, dua li cov deploying lawv. Txiag yeej yog ib tug cookbook yi. Feem ntau, install a feature, tej zaum muaj ib feature receiver thauj ib co ntaub ntawv rau ib daim ntawv teev, tshaj ntawd tsi. Txawm li cas los, pheej rov huas pas yog uas ntau txoj.

Muab tov yuav ua artifacts zoo li no:

  • Cov hom
  • Daim ntawv teev txhais
  • Chaw txhais
  • Cov ntaub ntawv nyob rau hauv ib daim ntawv teev
  • Tej receivers
  • Cov ntaub ntawv InfoPath

Daim ntawv mus.

Thaum tseem ceeb tsim muaj cov kua obviously uas instantiates cov artifacts kom raug, yog cia li xav txog cov hloov tshiab thiab rho tawm cov neeg. Yog hais tias koj muab ib qho kev ib daim ntawv tshiab thiab populates ntawd daim ntawv uas muaj ntaub ntawv, ua li cas thaum lub kua retracted? Tej zaum, daim ntawv yuav tsum tau yuav deleted. Lwm zaus, nws yuav tsum yuav laug lawm los kuj muaj keeb kwm. Koj yuav tsum ua hauj lwm yuav coj koj mus rau txoj kev txiav txim siab.

Mus pab cov no, tsim ib matrix uas teev txhua yam neeg ua koj cov tshuaj mus SharePoint deploys. Peb daim ntawv teev txhua ib yam cuav, ib qhov kev tshwmsim, hloov tshiab thiab rho tawm. Rau ib lub rooj, seb lub sij hawm yog tias lag luam.

Tsom xam no tsi yog obviously zoo ua ua ntej cov tshuaj no puas deployed rau ib tus neeg ua liaj ua teb SharePoint. Txawm li cas los, xws li pa luam yeeb, Nws tseem tsis tau lig los pib ua tej yam kom haum. Tsim ntawd matrix thiab tsim ib lub hom phiaj nyob rau qhov uas ploj lawm hloov tshiab/rho tawm scenarios. Nws yuav ua tau ib qho teeb meem nyuaj los daws kom tau, tab sis kawg mam li muaj rau ib lub thawv nyob ib ncig ntawm qhov teeb meem.

</kawg>

Subscribe rau kuv blog.

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

Ntawv cim npe Technorati:

Quick Fix: Web cov kev pab uas muaj Interact nrog SharePoint, InvalidOperationException

Lab (million) lub xyoos dhau los, Kuv pab tsim qhov Web site uas yog invoked ntawm tus kev cai txiav txim rau ib SharePoint Designer workflow. Lub lim tiam no, tus neeg ntawd xav tau tsiv los ntau lawm (Thaum kawg!) peb ua li ntawd.

Cov kev cai ua haujlwm fine, tiam sis qhov Web site rau nws invoked tsis, muab rau peb qhov yuam kev:

System.InvalidOperationException: Cov sijhawm ua haujlwm no yuav tau tsuas nyob ib lub computer txuas rau ib tug neeg rau zaub mov ua liaj ua teb los ntawm cov neeg uas muaj permissions SQL neeg rau zaub mov mus nyeem cov configuration database. Mus cuag no neeg rau zaub mov rau cov neeg rau zaub mov ua liaj ua teb, siv cov SharePoint khoom thiab yees Configuration Wizard, nyob rau hauv lub tshuab raj pib hauv Administrative cuab yeej.
tom Microsoft.SharePoint.Administration.SPWebApplication.Lookup(Pas requestUri)

Puv uas kuv tsis nco qab ntxiv rau qhov kev pab rau cov SharePoint ntawv pas hauv IIS. Thaum kuv yeej tias, nws ua haujlwm fine.

No MSDN Adminstrative posting muab kuv qhov clue kuv xav tau: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/2c97c004-7118-4e06-a62c-b2b0ac07ac99

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob twitter: http://twitter.com/pagalvin

Ntawv cim npe Technorati:

Txoj kev sai thiab yooj yim: Mus rau ntawm SPItemList SPFolder

Kuv thiaj khiav mus rau qhov teeb meem no thiab hauv Google nkawd yeej tsis to taub dab tsi uas kuv xav ua, vim li ntawd kuv figured kuv yuav sau qhov no cia.

Kuv twb tau ua ntau ntawm cov kev tshwm sim receiver debugging nyob hauv lub limtiam ntawd lub xeem los yog ob tug. Tus ER txhais rau ib daim ntawv qiv. Nruj nreem cov khoom nyob rau hauv cov tsev qiv ntawv hauv daim ntawv ntawd txog rau cov niam txiv folders. Li ntawd, Kuv yog ib txwm nrhiav kev daim nplaub tshev ntawm yam khoom no rau ntau manipulations. Thaum debugging, Kuv yuav tsum tau hloov lub metadata ntawm tus ceev rau ib yam khoom uas nws daim ID kuv paub.

Nov yog tsab ntawv teev npe me ntsis console (tsim los khiav rau neeg rau zaub mov nyob hauv lub teb) uas yuav siv ob nqe lus: tus ID ntawm ib yam khoom muaj nqis mus cob rau ib lub teb, "Pom zoo raws li txoj cai". Tsis codes khoom ntau heev thiab yeej tsis yuam kev kuaj.

Tus tig mus rau ib qhov chaw ib coded, tau ib coded ib daim ntawv thiab pom qhov khoom ntawd ces. Nws mam li pom niam txiv sis yam ntawd khoom thiab assigns tus pej xeem Mes Kas tus nqi.

Qhov tseem ceeb Tshooj nov rau kuv yog tias SPItem tsis tau koj mus thov kom tus sis. Koj yuav tau siv cov SPListItem.File.

Yog hais tias tus neeg zov mus ce ib soj ntsuas ntaub ntawv los yog kom muab ib txoj kev zoo mus rau nplaub tshev los ntawm ib yam khoom, thov cia ib saib.

<chaws>
siv Tsim;
siv System.Collections.Generic;
siv System.Text;
siv Microsoft.SharePoint;
siv System.Collections;

namespace Conchango
{
    /// <txoj kev>
 /// </txoj kev>
 hoob ManualFolderUpdate
    {
        zoo li qub khoob lug Main(hlua[] args)
        {
            hlua msh = "ManualFolderUpdate (v1.0): "; // msh = "Message Header"

 Console.WriteLine(msh + "Pib.  Kuv yog kawg hloov rau 08/04/08.");

            hlua url = http://localhost/xyzzy;

            siv (SPSite oSPSite = tshiab SPSite(url))
            {

                siv (SPWeb oSPWeb = oSPSite.OpenWeb())
                {
                    Splist.Update() docLib = oSPWeb.Lists["Cov ntaub ntawv"];

                    Console.WriteLine(msh + "Tau txais lub tsev qiv ntawv hauv daim ntawv.");

                    Console.WriteLine(msh + "Doc lib yam suav: [" + docLib.ItemCount + "].");

                    rau cov menyuam FolderID = 0;
                    hlua NewStatus = "xyzzy";

                    FolderID = System.Hloov ua lwm yam.ToInt32(args[0].ToString());
                    Console.WriteLine("Nrhiav nplaub tshev rau khoom: [" + FolderID + "].");

                    SPListItem lis = docLib.GetItemById(FolderID);

                    SPFolder thisItemFolder = lis.File.ParentFolder;

                    Console.WriteLine(msh + "Tau txais tus niam/txiv sis.");

                    NewStatus = args[1].ToString();
                    Console.WriteLine("Teev raws li txoj cai [" + NewStatus + "].");

                    Console.WriteLine("Nias rau nws kuas nyuas siv zug cov hloov tshiab lossis CTRL-C mus ho tuaj.");

                    Console.ReadLine();

                    thisItemFolder.Item["Pom zoo rau lawv"] = NewStatus;
                    thisItemFolder.Item.Update();

                    Console.WriteLine(msh + "Tas muab kho dua rau nplaub tshev.  Teebmeem.");

                } // siv SPWeb

            } // siv SPSite

 Console.WriteLine(msh + "Tas.");

        } // Main

    } // hoob kawm foldersync
} // namespace
</chaws>

</kawg>

Subscribe rau kuv blog.

Ntawv cim npe Technorati:

Nkaum rau tej yam kev cai rau hauv SharePoint

Ob peb lub hlis dhau los, thaum uas koj ua haujlwm rau ib tug yog ib qhov rau ib tug neeg, Kuv tsim ib feature. Cov yam, ntawd feature txhais ib cov kev cai txiav txim (Cov no tshwm sim nyob rau hauv qhov chaw). Lub hom phiaj tsuas rau daim ntawv kev cai no yog yuav ua rau kuv lub feature ua kom tau zoo li tuaj. Yeej, Kuv muab nws ua ib daim ntawm debugging crude.

Npaum li cas rau kuv lossis poob ntsej muag, yam cuav yuav debugging no ua nws txoj kev los ntawm cov dev UAT thiab ntau lawm ua ntej ib tug neeg tau mus mus nug, "qhov txuas no xyzzy?"

Lawm los, tag lawm nyob rau hauv ntau lawm thiab kuv yeej tsis xav los uninstall lub feature, kho elements.xml thiab ces reinstall.

Todd Bleaker taw tes qhia tawm ib qho yooj yim uas tswj tau nws. Nyob rau hauv nws cov lus:

"CustomActions yeej tsis tau theej rau lub database, lawv yog nyeem muaj ntawm tus Elements.xml tej ntaub ntawv thiab tau theej rau hauv lub xeev daim ntawv ntawm runtime. Li ntawd, koj tsis tas yuav mus deactivate, uninstall, reinstall, thiab leg ntaubntawv hauv Feature kom tshem tau cov CustomAction. Cia li tshem nws tawm hauv cov ntaub ntawv Elements.xml thiab rho tus ntawv pas(s) mob. Lub sij hawm tom qab no cov Feature yog tau, koj yuav tsis pom lub CustomAction lawm."

Kuv raws li nws cov lus qhia thiab, tau mas, lawv ua hauj lwm.

Hauv kuv tsev neeg, qhov no yog lub fai theem plahaum nrog ib WFE. Yog koj pom koj tus kheej nrog rau qhov teeb meem no rau yav tom ntej thiab muaj ntau yam WFE, Kuv ntseeg tias koj yuav tau ua cov kev hloov nyob rau hauv txhua.

</kawg>

Subscribe rau kuv blog.

Ntawv cim npe Technorati: ,

Quick Fix: Tus txheejtxheem kawm ntawv SharePoint Throws [HttpException (0x 80004005): Thov timed.]

Ib qho uas kuv tsim tawm lug txhawb cov miv twb khiav hauj lwm rau ib qhov project no lub limtiam thiab khiav mus rau ib qho teeb meem timeout thaum ua hauj lwm hauv tsev qee ib feem web vwm. Yog nws lub qhov zoo, tab sis "dheev" ib qhov chaw uas ncaj los ua yuav slow heev thiab feem ntau timed nrog rau qhov yuam kev:

[HttpException (0x 80004005): Thov timed.]

In thiaj li tso rau hauv thiab pom tias ob peb lwm qhov chaw ntawd cia li zoo. Kuv xav tias tsam tias muaj qee qhov chaw hauv web thaum nyob rau sab hab siv lub trusty ?txheem = 1 debug cov txheej txheem, Kuv puas tau qhov tseeb paub 11 qhov chaw web site nyob rau sab, xwb ob tug uas tau pom. Txawm tias nws yuav zoo dua (los ntawm ib cov foundations let's-hope-I-find-something-ugly-here-that-I-can-fix), peb ntawm cov qhov web kaw yam muaj ib lub npe "Yuam kev".

Kuv deleted ntawd cov qhov Web site (uas nws muab ib lub sij hawm ntev kuj ceeb tias) thiab solved qhov teeb meem uas. For today 🙂

</kawg>

Subscribe rau kuv blog.

Ntawv cim npe Technorati:

Invoking SSRS Web Services ntawm WSS / NTXHUAB hauv FBA ib puag ncig

Peb yuav tsum tau mus ua tsis tau muaj rau tus "CreateSubscription cov" txujci nyob ib SSRS web muab kev pab uas yog hosted hauv ib FBA tswj NTXHUAB ib puag ncig ntawm ib lub qhov web kev cai. Peb tau ceev cia variations ntawm:

  • 401: Tsis tso cai
  • Kwv tsiv

Cov "kwv tsiv" lus sam twb nthuav ntau vim nws twb hais tias "kwv cov" (peb qhov kev pab SSRS) muaj "tsiv" mus login.aspx. Qhov no qhia meej meant peb muaj tej yam teeb meem authentication.

Pom tau kuv nws thiaj li hais tias kuv muaj bookmarked ib tug nkag teb chaws blog yog Robert Garret uas piav li cas yuav ua tau rau tus muaj lub ntsiab WSS/NTXHUAB web qhov kev pab nyob hauv ib lub chaw kawm FBA. Nco ntsoov tias kuv tsis tau txuas ncaj qha rau tsab xov xwm (li ntawm 06/09/08) vim nws xav authenticate. Qhov kuv muab txuas theem koj rau ib qho "cov posts" saib thiab koj kuj nrhiav ib tsab xov xwm ntawm searching "Accessing NTXHUAB Web pab siv ntaub Based Authentication".

Ntawm no yog cov chaws uas ua haujlwm rau peb:

ReportingService2006 Reye = null; 
// Authenticate Authentication auth = tshiab Authentication(); 
auth.Url = "http://URL/_vti_bin/Authentication.asmx";
auth.CookieContainer =
tshiab CookieContainer();
Kev raug LoginResult = auth.ID nkag mus("userid", "password");
Yog hais tias (tshwm sim.ErrorCode == LoginErrorCode.NoError) 
{
// Tsis muaj kev ua yuam kev, thiaj tau lub ncuav qab zib.
CookieCollection ncuav qab zib = auth.CookieContainer.GetCookies(tshiab Pas(auth.Url));
Kua nplaum uas authCookie = ncuav qab zib[tshwm sim.CookieName];
Reye =
tshiab ReportingService2006();
Reye.Url =
"http://server/_vti_bin/ReportServer/ReportService2006.asmx";
Reye.CookieContainer =
tshiab CookieContainer();
Reye.CookieContainer.Add(authCookie);
}
ua tiag
{
  Reye.CreateSubscription(qhia txog, extSettings, desc, eventType, matchData, parameters1);
}
ntes (Kos ex)
{
  Console.WriteLine(ex.Message.ToString());
}

Kuv nkag siab yam hauj lwm zoo li no:

  • Peb cov qhov Web site yuav tsum hu mus rau qhov kev pab cuam authentication thiab hais, "Hav, Tony, Nws yog kuv!".
  • Authentication qhov replies hais, "Hav, Kuv paub koj. Cov me nyuam no li cas? Ntawm no yog ib token."
  • Peb hu tau tuaj rau qhov kev pab cuam SSRS thiab hais, "Tony xa kuv, Nov yog lub token."

</kawg>

Subscribe rau kuv blog.

Yooj yim thiab ceev thaum: Provision ib lub Web Site uas siv SharePoint kwv qauv hauv C#

Kuv sim searching rau me ntsis snippet rau chaws uas yuav ua li cas kuv yuav tsim ib SPWeb tshiab nyob rau hauv ib qhov chaw sau ntawv. Kuv tsis nrhiav nws ceev nrooj los yooj yim raws li kuv paub zoo ces kuv xav tias kuv yuav ncuav ua ke me ntsis nkag teb chaws rau cov kawm.

Cov cai no ua ib qho Wiki site:

 SPSite siteCollection;

    siteCollection = tshiab SPSite("http://conchang-o9l8qi");

    SPWeb w = siteCollection.OpenWeb();

    w.Webs.Add("xyzzy", "xyzzy Title",
        "xyzzy hauj lwm", 1033, SPWebTemplate.WebTemplateWIKI, tsis tseeb, tsis tseeb);

Kuv thawj zaug kev luag tshawb tau tejyam vim kuv twb nrhiav tau rau cov nqe lus xws li "provision ib lub web site uas siv cov qauv kwv sharepoint" thiab cov zoo li.

Yog hais tias koj nrhiav rau cov "Webs.Add()", koj mam li nrhiav ib tug xov tooj uas pab tau heev blog nkag, Cov khoom MSDN thiab SDK cov ntaub ntawv uas yuav mus rau qhov tob no kawm. Kuv twv yuav raug hu kom qhov chaw nov.

</kawg>

Subscribe rau kuv blog.

Ntawv cim npe Technorati: