Cartlanna Catagóire: SharePoint Forbartha

Cúiseanna Féilire bambú Idirghníomhú le SharePoint "Tharla earráid gan choinne"

Sa lá atá inniu, I’ve been working in an environment that uses a Bamboo calendar web part for some improved collaboration. This a standard medium/small farm with two load balanced WFEs, ar "freastalaí iarratas" maidir le hinnéacsú agus InfoPath agus deireadh ar ais cnuasaithe SQL.

The client installed some disaster recovery software onto one of the WFEs and that resulted in a broken WFE for a specific site in the site collection. Whenever load balancing pointed at the affected WFE and that site, users saw a largely blank white screen with the sentence “An unexpected error occurred”. No other info showed, go díreach abairt.

They asked me to look at it. I easily reproduced the problem and then added a ?contents=1 to the end of the URL. This is how I learned they were using the Bamboo web part. I went back to the page and now, go tobann, Léirigh sé dom teachtaireacht earráide deas ordúil:

image

Níl a fhios agam cad a bhí ag tarlú nó cad a rinne mé a fháil ar an teachtaireacht earráide rialaithe a chur ar taispeáint eile seachas ceangal ar an ?contents=1 bit of the query string.

Tá sé seo is dócha go bhfuil cás imeall an-annamh, ach má fhaigheann tú teachtaireacht go, "Tharla earráid gan choinne" dul ar aghaidh agus cuir ?ábhar = 1 leis an teaghrán cheist agus a fheiceáil nuair a thoradh go.

</deireadh>

Liostáil le mo bhlag.

Lean mé ar Twitter ag http://www.twitter.com/pagalvin

Clibeanna Technorati: ,

Ag baint úsáide as reflector ar Microsoft.SharePoint.dll

Redgate .NET Reflector Michael Blumenthal has put up an article about alerts and views ("Cén tuairimí is féidir a úsáid nuair a chruthú ar Airdeall ?"), which is interesting on its own merits. Mar sin féin, I was even more interested to see how he methodically walks through the process of using Redgate’s .NET Reflector. Step by step, he shows how to use that tool track down how SharePoint determines whether a view on a list should be "subscribable" ar easpa focal níos fearr (he explains this much better than I do 🙂 ).

At this point in the SharePoint era, you’d almost have to be deaf and blind to have not heard or read about using that tool. It’s advanced stuff and my own sense is that it’s in many ways a tool of last resort. Mar sin féin, if you think you need it but don’t really know how, Michael’s write-up seems like a great tutorial on this subject.

</deireadh>

Liostáil le mo bhlag.

Lean mé ar Twitter ag http://www.twitter.com/pagalvin

Clibeanna Technorati: , ,

Sórtáil Míreanna Féilire sa View Féilire

I’m using a calendar to track panel discussions on a given day. I have two sessions: morning and afternoon. I want to create a view that shows morning sessions only listed alphabetically via a session ID. This is a little tricky to accomplish (mura rud é gur chaill mé rud éigin fíor-shoiléir).

I can easily create a filtered view showing just that day’s events. The calendar will show all those events and if they all take place on the same hour, it lists them side by side in the hour slot. That’s great. The tricky part is that, de réir réamhshocraithe, it wants to list them in ID format. Mar sin,, if I add "Session 02" and then "Session 01" an fhéilire, Léiríonn sé iad san ord sin (i.e, Seisiún 02 agus ansin Seisiún 01). To list them in Session ID order, Shíl mé chun iarracht a dhéanamh na rudaí seo:

  1. Configure the view using the web user interface. No luck. There are no options to sort items this way.

    Ós rud é nach raibh an obair, I am now hoping there’s a CAML query somewhere in there that will allow me to override the sort. CQWP lets me make that kind of change, b'fhéidir beidh féilire chomh maith le?

  2. Cuir an chuid gréasáin, look for an "export" fheidhm agus … Bzzz! I can’t export its XML. There is no export option.

    I’m still holding out hope that I can find and modify some CAML query. Since I can’t export the web part, a fhágann SharePoint Dearthóir.

  3. I add the calendar web part to a sandbox site and open that site using SharePoint Designer. I look at the markup for the web part and I find what I’m looking for. It’s encoded madness, ach tá sé ann: "<ListViewXml …. >madness ionchódaithe</ListViewXml>". Go sonrach, níl an GEM:

<Iarratas>
<I gcás>
<DateRangesOverlap>
<FieldRef Name="EventDate"/>
<FieldRef Name="EndDate"/>
<FieldRef Name="RecurrenceID"/>
<Value Type="DateTime">
<Mí />
</Luach>
</DateRangesOverlap>
</I gcás>
<Orderby><FieldRef Name="Session_x0020_ID" /></Orderby>
</Iarratas>

(Tá mé decoded an &lt;'S agus &gt agus roinneadh iad amach chun línte éagsúla ar mhaithe le soléireacht ar).

Cuir an <Orderby> giotán agus anois tá sé cineál le ID Seisiún, nach bhfuil an liosta inmheánach mír ID.

Tip gigantic nó’ an hata a Becky Isserman as a cuid tuairimí a blog post Isha Sagi ar: http://www.sharepoint-tips.com/2008/07/caml-sorting-by-file-name.html. I wouldn’t have put the <Orderby> san áit cheart gan a comment.

Tá súil agam a scríobh suas seo níos soiléire le shots scáileán go luath, ach ní i gcás mé, ar a laghad, Rinne mé seo i bhfad.

</deireadh>

Clibeanna Technorati: , , ,

Gnéithe SharePoint & Management Solutions — Ná Nábac an U i CRUD (nó an D ar an ní sin)

Táimid chaitheamh le chéile go leor ama ag smaoineamh faoi réitigh SharePoint — conas a chruthú dóibh, a uirlis a úsáid, cad a tharlaíonn nuair a theipeann orthu sin a imscaradh, poist uaineadóir, scopes, etc. We spend so much time thinking about the up-front bits that it’s easy to forget that we need to retract them as well. Retracting solutions is probably more difficult, ó thaobh dearadh coincheapa, than deploying them. Deployment is basically a cookbook affair. Typically, shuiteáil gné, b'fhéidir go bhfuil glacadóir gné luchtú cuid de na sonraí isteach i liosta, that sort of thing. Mar sin féin, Is retracting fhéadfadh a bheith níos casta.

Is féidir le réiteach a tugadh artifacts mar seo a chruthú:

  • Cineál Ábhar
  • Liosta Sainmhíniú
  • Sainmhíniú tSuímh
  • Sonraí i liosta
  • Fiú glacadóirí
  • Foirmeacha InfoPath

Téann an liosta ar.

Cé go bhfuil sé ar ndóigh tábhachtach a dhearadh ar réiteach go instantiates na artifacts i gceart, it’s just as important to consider the update and delete cases. If your solution creates a new list and populates that list with data, cad a tharlaíonn nuair a bhíonn an tuaslagán retracted? In some cases, the list should be deleted. In other cases, it should be left intact for historical purposes. Your business requirements will guide you to the right decision.

Chun cabhrú leis an, create a matrix that lists each artifact your solution deploys to SharePoint. List three columns per artifact, ceann amháin le haghaidh a chruthú, thabhairt cothrom le dáta agus a scriosadh. For each case, an toradh ceart don oibríocht a chinneadh.

This sort of analysis is obviously best done before the solution is ever deployed to a SharePoint farm. Mar sin féin, cosúil le caitheamh tobac, it’s never too late to start doing things correctly. Create that matrix and develop a plan to address the missing update/delete scenarios. It may be a hard problem to solve, ach ar a laghad go mbainfidh tú tar éis a chur i mbosca ar fud an fhadhb.

</deireadh>

Liostáil le mo bhlag.

Lean mé ar Twitter ag http://www.twitter.com/pagalvin

Clibeanna Technorati:

Fix Thapa: Seirbhísí Gréasáin go Idirghníomhaíocht le SharePoint, InvalidOperationException

A milliún bliain ó shin, I helped developed a web service that was invoked via a custom action for a SharePoint Designer workflow. An tseachtain seo, an cliant a theastaigh chun é a bhogadh go dtí an táirgeadh (ar deireadh!) mar sin rinne muid.

An gníomh saincheaptha d'oibrigh fíneáil, ach ní raibh an tseirbhís idirlín agairt sé, a thabhairt dúinn an earráid seo:

System.InvalidOperationException: Is féidir an oibríocht a dhéanamh ach amháin ar ríomhaire go bhfuil ceangailte le bhfeirm freastalaí ag úsáideoirí a bhfuil cead i SQL Server a léamh as an mbunachar sonraí cumraíochta. Chun an freastalaí ceangal leis an bhfeirm freastalaí, bain úsáid as an Táirgí agus Teicneolaíochtaí SharePoint Treoraí Cumraíochta, suite ar an roghchlár Tosaigh i Uirlisí Riaracháin.
at Microsoft.SharePoint.Administration.SPWebApplication.Lookup(Uri requestUri)

Turns out that I forgot to add the service to the SharePoint application pool in IIS. Once I did that, d'oibrigh sé fíneáil.

An fóram MSDN phost thug dom an clue is gá mé: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/2c97c004-7118-4e06-a62c-b2b0ac07ac99

</deireadh>

Liostáil le mo bhlag.

Lean mé ar twitter: http://twitter.com/pagalvin

Clibeanna Technorati:

Tapaidh agus éasca: Faigh SPFolder de SPItemList

Mé a choinneáil ag rith isteach ar an bhfadhb agus an Google is cosúil riamh a thuiscint cad ba mhaith liom a dhéanamh, mar sin figured mé ba mhaith liom a scríobh síos an.

Tá mé ag déanamh a lán de na debugging glacadóir ócáid ​​sa tseachtain seo caite nó dhó. The ER is defined against a document library. The individual items in the document library are tightly related to their parent folders. Mar sin,, I am always getting the folder of the item for various manipulations. While debugging, Is gá dom a thabhairt cothrom le dáta na meiteashonraí de fillteán le mír shonrach a bhfuil a haitheantas a fhios agam.

Seo iarratas consól beag (a ceapadh chun reáchtáil ar an bhfreastalaí sa feirme) a thógann dhá argóint: an ID mír agus luach a shannadh do réimse, "Approval Status". It hard codes a lot of stuff and has no error checking.

Breathnaíonn an cód suas láithreán códaithe crua, gets a hard coded document library and then finds the indicated item. It then finds the parent folder of that item and assigns the status value.

The key lesson here for me is that SPItem doesn’t get you access to the folder. You need to use SPListItem.File.

Má cares duine ar bith a thairiscint le léirmheas nó tuiscint ar bhealach níos fearr a fháil ar an fillteán le mír, fág tagairt le do thoil.

<Cód>
ag baint úsáide as Córas;
ag baint úsáide as System.Collections.Generic;
ag baint úsáide as System.Text;
ag baint úsáide as Microsoft.SharePoint;
ag baint úsáide as System.Collections;

ainmspás Conchango
{
    /// <achoimre>
 /// </achoimre>
 ranga ManualFolderUpdate
    {
        statach neamhní Príomh-(teaghrán[] comhbhrí leis an rogha)
        {
            teaghrán MSH = "ManualFolderUpdate (v1.0): "; // msh = "Message Header"

 Consól.WriteLine(MSH + "Starting up.  Bhí mé go deireanach ar an 08/04/08.");

            teaghrán url = http://localhost/xyzzy;

            ag baint úsáide as (SPSite oSPSite = nua SPSite(moladh))
            {

                ag baint úsáide as (SPWeb oSPWeb = oSPSite.OpenWeb())
                {
                    SPList docLib = oSPWeb.Lists["Documents"];

                    Consól.WriteLine(MSH + "Got the document library.");

                    Consól.WriteLine(MSH + "Doc lib item count: [" + docLib.ItemCount + "].");

                    int FolderID = 0;
                    teaghrán NewStatus = "xyzzy";

                    FolderID = Chóras.Tiontaigh.ToInt32(comhbhrí leis an rogha[0].ToString());
                    Consól.WriteLine("Seeking folder for item: [" + FolderID + "].");

                    SPListItem li = docLib.GetItemById(FolderID);

                    SPFolder thisItemFolder = li.File.ParentFolder;

                    Consól.WriteLine(MSH + "Got the parent folder.");

                    NewStatus = comhbhrí leis an rogha[1].ToString();
                    Consól.WriteLine("Setting status to [" + NewStatus + "].");

                    Consól.WriteLine("Press return to commit the update or CTRL-C to abort.");

                    Consól.ReadLine();

                    thisItemFolder.Item["Approval Status"] = NewStatus;
                    thisItemFolder.Item.Update();

                    Consól.WriteLine(MSH + "Finished updating the folder.  Scor.");

                } // ag baint úsáide as SPWeb

            } // ag baint úsáide as SPSite

 Consól.WriteLine(MSH + "Finished.");

        } // Príomh-

    } // rang foldersync
} // ainmspás
</Cód>

</deireadh>

Liostáil le mo bhlag.

Clibeanna Technorati:

Hiding Gníomhartha an Chustaim i SharePoint

Roinnt míonna ó shin, agus iad ag obair ar thionscadal do chliant, I created a feature. Among other things, gur gné sainithe gníomh saincheaptha (seo le feiceáil faoin suímh suíomh). The only purpose for this custom action was to demonstrate to me that the feature activation was working as expected. Go bunúsach, Úsáid mé é mar fhoirm amh de debugging.

I bhfad chun mo náire, an Déantán debugging rinne sé a bhealach ó dev go UAT agus a tháirgeadh roimh fuair duine éigin timpeall a iarraidh, "what is this xyzzy link?"

De réir anois, tá muid i dtáirgeadh agus I ndáiríre ní ag iarraidh a dhíshuiteáil an gné, fix elements.xml and then reinstall.

Todd bleaker pointed out an easy way to handle it. In his words:

"CustomActions are not copied into the database, siad a léamh go díreach ó na comhaid Elements.xml agus a chóipeáil isteach i stát-iarratas ag runtime. Mar sin,, Ní gá duit a dhíghníomhachtú, dhíshuiteáil, reinstall, agus athghníomhachtú an gné a bhaint as an CustomAction. Just a bhaint as an gcomhad Elements.xml agus an linn iarratas a athchúrsáil(s) dhéantar. Is é an gné an chéad uair eile i raon, ní bheidh ort a fheiceáil ar an CustomAction níos mó."

Lean mé ar a chuid treoracha agus, ar ndóigh, oibríonn siad.

I mo chás, this is a department level installation with just a single WFE. If you find yourself with this problem in future and with multiple WFE’s, Creidim go mbainfidh tú a dhéanamh an t-athrú i ngach.

</deireadh>

Liostáil le mo bhlag.

Clibeanna Technorati: ,

Fix Thapa: Teacht ar Láithreáin SharePoint Throws [HttpException (0x80004005): Iarratas thar am.]

One of my developer colleagues was working on a project this week and ran into a timeout problem while working on building some crazy web part. His web part was fine, ach "go tobann" suíomh neamhghaolmhara bhí an-mhall agus go minic thar am leis an earráid:

[HttpException (0x80004005): Iarratas thar am.]

I logged in and saw that several other sites were just fine. I suspected that there were some hidden web parts on the page and using an trusty ?ábhar = 1 teicníc debug, Raibh mé i ndáiríre a fháil 11 codanna gréasáin ar an leathanach, only two of which were visible. Even better (ó let's-dóchas-I-aimsiú-rud éigin-ghránna-anseo-go-I-is féidir-a shocrú thaobh), three of those closed web parts had a name of "Error".

Scriosadh mé na codanna gréasáin (a féin thóg am ionadh fada) and that solved the problem. For today 🙂

</deireadh>

Liostáil le mo bhlag.

Clibeanna Technorati:

Invoking Seirbhísí SSRS Gréasáin Ó SSU / CAONAIGH i Comhshaoil ​​FBA

Is gá dúinn a agairt an CreateSubscription "" method on an SSRS web service that is hosted in an FBA managed MOSS environment from a custom web part. We kept getting variations of:

  • 401: Nach n-údaraítear
  • Cuspóir athraíodh a ionad

An réad "ar athraíodh a ionad" teachtaireacht a bhí an chuid is mó suimiúil toisc go raibh sé ag rá go bhfuil an rud "" (ár seirbhís SSRS) Bhí "ar athraíodh a ionad" to login.aspx. This clearly meant we had some kind of authentication problem.

Thuig mé sa deireadh go raibh mé bookmarked ar iontráil bhlag by Robert Garret that described how to invoke a general purpose WSS/MOSS web service living inside an FBA environment. Note that I can’t link directly to the article (mar ar 06/09/08) because it wants to authenticate. The link I provide brings you to an "all posts" view and you can locate the specific article by searching for "Accessing MOSS Web Services using Forms Based Authentication".

Seo an cód a d'oibrigh le linn:

ReportingService2006 rs = náid; 
// Fhíordheimhniú Fíordheimhniú údarás = nua Fíordheimhniú(); 
auth.Url = "http://URL / _vti_bin / Authentication.asmx";
auth.CookieContainer =
nua CookieContainer();
LoginResult toradh = auth.Login("userid", "password");
más rud é (result.ErrorCode == LoginErrorCode.NoError) 
{
// Uimh earráid, mar sin a fháil ar an fianáin.
Fianáin CookieCollection = auth.CookieContainer.GetCookies(nua URI(auth.Url));
AuthCookie Cookie = fianáin[result.CookieName];
rs =
nua ReportingService2006();
rs.Url =
"http://server/_vti_bin/ReportServer/ReportService2006.asmx";
rs.CookieContainer =
nua CookieContainer();
rs.CookieContainer.Add(authCookie);
}
iarracht
{
  rs.CreateSubscription(tuarascáil, extSettings, desc, eventType, matchData, parameters1);
}
ghabháil (Ex Eisceacht)
{
  Console.WriteLine(ex.Message.ToString());
}

Mé a léirmhíniú rudaí a bheith ag obair mar seo:

  • Riachtanais ár gcuid gréasáin a dhiailiú suas an tseirbhís fíordheimhnithe agus a rá, "Hey, Tony, tá sé dom!".
  • Freagraí seirbhíse Fíordheimhniú ag rá, "Hey, I know you. How are the kids? Here’s a token."
  • Iarraimid suas an tseirbhís SSRS agus a rá, "Tony sent me, anseo tá an chomhartha."

</deireadh>

Liostáil le mo bhlag.

Quick agus Simplí: Soláthar a Láithreán Gréasáin Ag baint úsáide as Samhail Oibiachta SharePoint I C #

I tried searching for a little snippet code that would show how I can create a new SPWeb in a site collection. I didn’t find it as quickly or easily as I expected so I thought I’d slap together a little entry on the subject.

Cruthaíonn an cód seo ar shuíomh nua Wiki:

 SPSite siteCollection;

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

    SPWeb w = siteCollection.OpenWeb();

    w.Webs.Add("xyzzy", "xyzzy Title",
        "xyzzy description", 1033, SPWebTemplate.WebTemplateWIKI, bréagach, bréagach);

My initial searches failed because I was looking for phrases like "provision a web site using sharepoint object model" and the like.

Má tá tú cuardaigh for "Webs.Add()", go mbainfidh tú teacht ar líon na n-iontrálacha blag an-úsáideach, MSDN articles and SDK documentation that go into depth on this subject. I definitely recommend an suíomh seo.

</deireadh>

Liostáil le mo bhlag.

Clibeanna Technorati: