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:

Comhtháthaigh sreabhadh oibre Dearthóir SharePoint le Seirbhísí Gréasáin

Tá mé ag imirt ar fud le gníomhartha saincheaptha do SharePoint Dearthóir ar feadh tamaill (féach anseo ar roinnt rudaí mionsonraithe, má a leasanna tú).

I mo tionscadal reatha, we need to do some fairly heavy lifting and we want to use declarative SPD workflow to manage the associated business process.

Fada scéal gearr, this is entirely possible. I extended my Codeplex project to invoke a "helper service" and now we can invoke a web service directly from an SPD workflow.

Seo an síniú:

 poiblí teaghrán Dispatcher(
        Guid WebID, // Passed ag an timpeallacht runtime
        Guid SiteID, // Passed ag an timpeallacht runtime
        teaghrán ListID, // Passed ag an RTÉ (níl a fhios cén fáth go bhfuil sé seo ar shraith, Ní GUID)
        int ListItemID, // Passed ag an RTÉ.
        teaghrán XmlMessage) // Passed ag an úsáideoir, mar a dearbhaíodh i SPD.

Ghiaráil sé seo ar an bhfíric gur féidir linn a fháil ar fhaisnéis sreabhadh oibre tábhachtach, cosúil leis an suíomh, ID liosta, etc. This is well documented in several places for those of you interested in creating your own custom actions. The idea is to extract the XML string as provided by the user to dispatch an appropriate procedure. Fun stuff!

Faraor, seo Is léir go bhfuil aon-bhealach ticéad síos go dtí "Loosey Goosey" talamh frith-patrún, but it’s better than hitting a brick wall 🙂

An bhfuil sé frith-patrún má dhéanann tú é cé a fhios agat go bhfuil sé frith-patrún?

I hope to wrap this inside Codeplex in the near future. If you’re interested in me doing so, a thabhairt dom poke (r-phost nó fág tagairt) and I’ll be that more enthusiastic about doing it 🙂

</deireadh>

Liostáil le mo bhlag.

Clibeanna Technorati: ,

Dé Domhnaigh greannmhar: “N'fheadar má tá do phasfhocal …”

Cheannaigh mé le déanaí lón do mo dheartháir (mar is gnách) and we ended up talking about funny things that we did at our respective colleges. At my alma mater, Lafayette Coláiste, the academic support IT department had a very inclusive way about it. We were given a LOT of rope and I took advantage of that at times.

Baineann dhá mo chuid cuimhní cinn is fearr leat le mo chara maith, Gabe. He had made the terrible mistake of telling people his freshman year that "I’m a freshman, ach tá mé seasamh Sophomore" mar gheall ar na ranganna socrúcháin chun cinn éagsúla a bhí déanta aige, etc. Many of us were similarly situated but we didn’t talk about it so much. His senior year, nuair a tugadh isteach againn air le daoine, we’d say "This is Gabe. He’s a Senior, but he has Sophomore standing".

The college had some Sun workstation/servers running X-Window. They had gigantic monitors and the engineers used them for CAD and other boring engineer stuff. We CS people used them to learn programming and, ar ndóigh, a imirt cluichí.

Ní raibh muid cosúil leis an innealtóirí ríomhaire-helpless chun an méid sin a bheadh ​​ar cheann de na ár n-rudaí is fearr leat a dhéanamh a telnet chun an bosca a bhí siad ar agus a reáchtáil X-eye on them. This would pop up a pair of eyes that followed the mouse around on the screen. You could pop up even more and have literally a dozen or more of the X-eye applications running. Try not to laugh out loud when a hapless engineer is trying to close X-eye after X-eye and muttering under his breath about it 🙂

We also played X-trek on those boxes. Chun é sin a dhéanamh, bhí tú a íoslódáil an fhoinse, get various dependencies wherever you could find them and build it. I wasn’t a sophisticated C programmer, but I could read header files. I was looking through these and found directives like "#DEFINE MAX_TORPEDO_DISTANCE 10". I played around with that increase range and power for phases and torpedoes, ath-tógadh é agus ansin a scrios Gabe an chéad uair eile a bhí againn.

Bhí Gabe chomh maith le lucht leanúna mór de seó teilifíse ar a dtugtar Blake 7. I had never seen it, ach ní raibh cosc ​​a chur orm ó insisting go Dr. Who is the superior show. The arguments would get heated at times 🙂

Lá amháin, it occurred to me that I could probably guess his UNIX password. I sat down next to him one day and announced in a loud tone, "I’m going to guess your password right now, Gabe." "Yeah, ceart" was his answer. I then logged in, iontráil a id úsáideora, iompú chun aghaidh a thabhairt dó, clóscríofa agus dúirt sé amach os ard, "I wonder if it’s B-L-A-K-E-7" ? Touch typing has never paid off as handsomely as it did that day.

Tseachtain seo chugainn (nó go luath): More computer room antics from college.

An bhfuil aon a roinnt? Leave a comment or email me and I’ll publish them here.

</deireadh>

Liostáil le mo bhlag.

Clibeanna Technorati:

Fógra Poiblí Minor: Windows Live Socruithe Slándála agus Teagmháil Úinéirí Spás

Gheobhaidh mé dornán de teachtaireachtaí ó dhaoine aonair tríd an-tógtha i "seol teachtaireacht" fheidhm Microsoft Soláthraíonn le spásanna beo (ina hóstach ar chomh maith mo bhlag) gach mí.

Thart ar aon trian de an t-am, those users have secured their live spaces account such that I cannot reply. This is some kind of anti-spam feature I assume.

</deireadh>

Míniú Simplí: “Ní thig faoi raon Luach measta.”

Suas chun dáta: An anonymous poster left a great comment about internal names. Be sure to read it.

Nuair a bheidh ag obair le glacadóirí ócáid ​​agus cód eile gur tagairtí míreanna liosta SharePoint tríd an tsamhail réad, Déanaim botúin go minic a ghineann an earráid seo ar runtime:

Earráid Conchango.xyzzyEventReceiver glacadóir luchtú agus a reáchtáil ócáid ​​i xyzzy, Leagan 1.0.0.0 =, Cultúr = neodrach, PublicKeyToken = 0dc50a750396c3ac. Additional information is below. : Value does not fall within the expected range.

I think this is a fairly generic error that is potentially caused many different ways. Mar sin féin, one simple explanation is that I’m referencing a field incorrectly. If the name of the field is "Due Date", Caithfidh mé tagairt dó mar seo i glacadóir ócáid:

properties.ListItem["Due Date"]

Nuair a bheidh mé misspell nó úsáid an cás mícheart nuair tagairt don réimse, SharePoint generates the above mentioned runtime error. Mar shampla, tá sé seo mícheart:

properties.ListItem["due Date"]

</deireadh>

Liostáil le mo bhlag.

Clibeanna Technorati:

Úsáideoir Deiridh Leid Thapa: Sórtáil Radhairc i Leabharlann Doiciméad, Liosta, etc.

Is féidir linn, Ba chóir agus a bhfuil go leor tuairimí a chruthú i liostaí SharePoint (leabharlanna doiciméad, liostaí saincheaptha, etc). SharePoint always lists available views in alphabetical order. We cannot change this using out of the box functionality. If it can be done via customization (agus níl mé cinnte gur féidir é a), tá sé i bhfad chun theicniúil do do úsáideoir deiridh tipiciúil.

Más mian leat chun rialú a dhéanamh an t-ord a liostaíonn SharePoint tuairimí ar fáil, ach roinnt nó litir réamhcheangal leis an ainm dearcadh, mar atá i:

1 – De réir Cineál Ábhar
2 – Gach Doiciméid
3 – Dáta Dlite

-nó-

A – De réir Cineál Ábhar
B – Gach Doiciméid
C – Dáta Dlite

I have also created views whose purpose is strictly to feed a KPI. I have been following this naming convention:

Z_KPI_[Cur síos]

That causes my "KPI" tuairimí a bheith i láthair ag bun an liosta.

</deireadh>

Liostáil le mo bhlag.

Dé Domhnaigh greannmhar: “Nuair a raibh mé Boy Little”

Mar thuismitheoir, somewhere along the line I discovered the "When I was a little boy" trick.

Mo mhac, is dócha go ceithre nó cúig ag an am, ag imirt le balún agus cosúil le buachaillí is beag a imirt le balúin, he popped it. He was very upset. The world had come to an end. I said to him, "when I was little boy, Bhí mé le balún agus popped sé agus diaidh ar ndiaidh, I got a new balloon." It seemed to help him cope with his loss and led to a fun talk about what it was like when I was a little boy.

That worked well as a consolation technique and I used it a several times over the next period of time. I did get into trouble once when his Monster Rancher 3 creature died. I talked about how my dog, Prince, had died in a car accident. An uair seo, bhí a fhreagairt, "Now I feel bad about two things!" I shied away from using the "when I was a little boy" teicníc le haghaidh sólás ina dhiaidh sin.

Roimh an eachtra madra marbh, áfach,, I had also started to use the technique to convince him to do chores. "When I was a little boy, I had to go out and get the newspaper", "clean my room", "get Mommy her coffee cup", etc.

Bhí sé seo ró-rathúil go leor ar feadh tamaill, but he started to increasingly rebel against the tyranny of my childhood. One event, go háirithe, marked the end. I told him to bring the garbage cans from curb back to the garage. He argued and I responded, "When I was a little boy, I had to take the garbage back to the garage." He responded, "Oh yeah! Well when you were a little boy, go raibh dúr!".

</deireadh>

Liostáil le mo bhlag.

Clibeanna Technorati:

Ní féidir tuairimí agus Colúin ar Liostaí agus Leabharlanna Doiciméad Bí Faighte

Suas chun dáta (02/29/08): Dealraíonn sé an tionscadal nua CodePlex a chur ar fáil modh chun a dhaingniú colúin aonair: http://www.codeplex.com/SPListDisplaySetting. If you have any experience working with it, fág tagairt le do thoil.

Iarraidh póstaeir Fóram minic ceist mar seo: "I have a manager view and and a staff view of a list. How do I secure the manager view so that staff can not use it?"

Siad freisin a iarraidh go minic ceist a bhaineann le: "I want to secure a specific metadata column so that only managers may edit that column while others may not even see it."

These answers apply to both WSS 3.0 agus CAONAIGH:

  • Ní SharePoint a chur ar fáil as-de-an bosca-tacaíocht do thuairimí a dhaingniú.
  • Ní SharePoint a chur ar fáil as-de-an bosca-tacaíocht do cholúin slándála.

There are several techniques one can follow to meet these kinds of security requirements. Here’s what I can think of:

  • Use out-of-the-box item level security. Views always honor item level security configuration. Event receivers and/or workflow can automate security assignment.
  • Use personal views for "privileged" tuairimí. These are easy enough to set up. Mar sin féin, due to their "personal" nádúr, these need to be configured for each user. Use standard security configuration to prevent anyone else from creating a personal view.
  • Bain úsáid as sonraí páirt gréasáin dearcadh agus a chur i roinnt de chineál slándála réiteach scamhadh AJAXy.
  • Roll do feidhmiúlacht taispeáint liosta féin agus a ionchorprú maidir le slándáil scamhadh ag an leibhéal colún.
  • Athraigh na foirmeacha iontrála sonraí agus JavaScript a úsáid i gcomhar leis an tsamhail slándála a colún-leibhéal slándála scamhadh i bhfeidhm.
  • Use an InfoPath form for data entry. Implement column-level security trimming via web service calls to SharePoint and conditionally hide fields as needed.
  • Roll do ASP.NET feidhm iontráil sonraí féin go gcuireann leibhéal slándála colún scamhadh.

Níl aon cheann de na roghanna atá i ndáiríre go hiontach, ach tá ar a laghad cosán a leanúint más gá duit, fiú má tá sé deacair.

NÓTA: Má théann tú síos aon cheann de na cosáin, don’t forget about "Actions -> Open with Windows Explorer". You want to be sure that you test with that feature to make sure that it doesn’t work as a "back door" agus defeat do scéim slándála.

Má tá tú smaointe eile nó taithí le colúin a áirithiú nó a tuairimí, le do thoil ríomhphost chugam nó a fhágáil a comment agus beidh mé thabhairt cothrom le dáta seo a phost mar is cuí.

</deireadh>

Liostáil le mo bhlag.

Clibeanna Technorati:

Leid Thapa: An bhfuil Uimhreacha BDC Leagan ADF Do Friend

Má tá tú lámh-códaithe comhaid ADF agus ag déanamh a lán de chód / allmhairiú / tástáil timthriallta, use the version number to make your life easier.

Is fuath liom a admháil go, ach go dtí an tseachtain seo, I was always deleting the ADF and re-importing it. This would break my business data columns and make me re-wire them. All unnecessary.

File this under "it’s obvious once you see it".

Sampla:

<LobSystem
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" Cineál="WebService" Leagan="1.2.0.0" Ainm="xyzzyDocumentReview" xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

Athraigh leagan sin agus ath-allmhairiú agus úsáideann an colún shonraí gnó atá ann cheana féin ar an leagan cothrom le dáta go huathoibríoch gan aon chumraíocht bhreise ag teastáil.

</deireadh>

Liostáil le mo bhlag.

Clibeanna Technorati:

Réiteach: Taispeáin BDC Picker ach amháin Colún As Torthaí

I mo iarrachtaí ar siúl ag soláthar colún lookup níos úsáidí ag baint úsáide as BDC, I hit a wall with the BDC picker. If you haven’t see it, the BDC picker is similar to a people picker except that it works with columns of type "business data".

Tá tú rochtain a fháil ar an roghnóir trí chliceáil ar an deilbhín leabhar a oscailt an colún shonraí gnó mar a thaispeántar:

íomhá

The above image shows a business data column called "Master Document Id". That column is connected, via BDC, to a web service. The web service returns two columns of information: Document ID and Title. The business purpose here is to provide a "this document is based on" fheidhm. Users select a "master" doiciméad agus nuair a shábháil siad, ócáid ​​glacadóir cóipeanna réimsí sonraí meta ón mháistir tagairt.

De réir réamhshocraithe, the BDC picker looks like this when I search for a document whose ID = "38":

gearrthóg_image002

Sin cabhrach, but not good enough. People don’t think in terms of IDs, they think in terms of titles and/or other meta data. The picker allows you to search on other columns (e.g. Teideal) ach ní bheidh a thaispeáint ar an liosta iarbhír na teidil go raibh sé, ach a n-DocId atá mar a thaispeántar anseo:

gearrthóg_image002[1]

(Níl an lámhaigh scáileán chomh mór toisc nach raibh mé ag piocadh cuardach go bhfilleann aon torthaí bailí, ach is féidir leat a fheiceáil más rud é go raibh fuair sé roinnt torthaí, bheadh ​​sé léirithe amháin DocId ar, Ní teidil).

I searched high and low for the answer to this and failed. Mo chomhghleacaí, an venerable Jonathan Bradshaw, had faced and solved this issue. When I reached out to him for help, Dúirt sé liom sa treo ceart.

Configure the picker to show multiple columns via the "ShowInPicker" maoin sa ADF:

<Maoin Ainm="ShowInPicker" Cineál="System.Boolean">fíor</Maoin>

I níos mine:

  <!-- Teideal -->
  <TypeDescriptor TypeName="System.String" Ainm="Teideal" >
    <LocalizedDisplayNames>
      <LocalizedDisplayName LCID="1033">Teideal</LocalizedDisplayName>
    </LocalizedDisplayNames>
    <Airíonna>
      <Maoin Ainm="DisplayByDefault" Cineál="System.Boolean">fíor</Maoin>
      <Maoin Ainm="ShowInPicker" Cineál="System.Boolean">fíor</Maoin>
    </Airíonna>
  </TypeDescriptor>

Setting this property does introduce a minor problem. As soon as you set it once, you need to set it for every column you want to show. I mo chás, BDC picker showed DocId by default. Mar sin féin, once I added "ShowInPicker" Theideal, DocId no longer displayed. I solved that by explicitly setting the ShowInPicker property for Doc ID.

Seo é an toradh:

íomhá

(I’ll explain the odd-looking "168 – CamlSchema.xsd" construction in a future blog post. I mbeagán focal, tá sé ina teaghrán concatenated a ligeann le haghaidh taithí úsáideora beagán níos fearr).

Ar ndóigh,, tar éis scríofa iontráil seo blog, I just did a search for "ShowInPicker" agus fuair amas iomadúla, lena n-áirítear an ceann seo: http://msdn2.microsoft.com/en-us/library/ms583986.aspx. It explains the meaning of that property along with some other good BDC stuff.

</deireadh>

Liostáil le mo bhlag!

Clibeanna Technorati: