Cartlanna míosúla: Feabhra 2008

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:

Cuardaigh & Éasca: Cruthaigh Fillteán agus Cineál Ábhar Sann (Nó, Nocht do TFBeanna agus Them Eat Too)

D'fhonn a bheith ag obair ar fud an fhadhb PTF Scríobh mé faoi anseo, I did some testing and discovered that KPI’s work against folders with meta data in the same way that they work against documents or list items. I proved it out by creating a new content type based on the folder content type and then added a few fields. I created some indicators and proved to myself that KPIs work as expected. This was welcome news. It’s not perfect, because the drill-down you get from the KPI against the folders is not exactly what you want. This isn’t too much a drawback in my case because 1) ní dhéanann na húsáideoirí deiridh a fhios bith níos fearr agus 2) the drill-down goes to a folder. They click the folder name and they are at the item. It’s two clicks instead of one, nach bhfuil an deireadh an domhain.

This flowed nicely with the work I was doing. I am creating a folder for every document that gets uploaded. This is done via an event receiver. Mar thoradh air sin, tá sé ina píosa císte a choinneáil ar an fillteán tuismitheora meta data in sync with the KPI-driven meta data from the file itself since the plumbing is already in place. This allows me to have my KPI’s and eat them too 🙂

I modified the event receiver to add the folder and then set this new folder’s content type to my custom KPI-friendly content type. This bit of code did the trick:

 SPFolderCollection srcFolders = targetWeb.GetFolder("Documents").Fofhillteáin;
  SPFolder fillteán a cuireadh leis = srcFolders.Add(properties.ListItem.ID.ToString());
  SPContentTypeId kpiCT = nua SPContentTypeId("0x0120002A666CAA9176DC4AA8CBAA9DC6B4039F");
  addedFolder.Item["Content Type ID"] = kpiCT;
  addedFolder.Item.Update();

Chun teacht ar an Ábhar Cineál haitheantas iarbhír, Rochtain agam go cineál ábhar trí suímh láithreán agus cóipeáil / a ghreamú sé as an URL mar a thaispeántar:

íomhá

</deireadh>

Liostáil le mo bhlag!

Clibeanna Technorati: ,

Tapaidh agus éasca: Faigh an SPFolder de SPListItem i Glacadóir Imeacht

Is fuath liom a admháil go, but I struggled with this one all day. My event receiver needs to update a field of its parent folder. This little bit shows how to do it:

príobháideach neamhní UpdateParentFolder(SPItemEventProperties airíonna)
{

SPFolder thisItemFolder = properties.ListItem.File.ParentFolder;
thisItemFolder.Item["ZZ Approval Status"] = "Good news, gach duine!";
thisItemFolder.Item.Update();


} // UpdateParentFolder

Sa chás seo, Tá mé ag obair le leabharlann doiciméad agus na hairíonna atá ag teacht ó ócáid ​​ItemAdded.

Is é an cleas nach féidir leat a fháil ar an SPFolder na míre díreach ó na míre féin (i.e. Is properties.ListItem.Folder null). Ina áit sin, téigh go dtí an mír liosta ar Comhad a bhaineann agus a fháil ar an fillteán Comhad ar.

</deireadh>

Liostáil le mo bhlag!

Clibeanna Technorati:

Ach eile Imeacht Trick Debug Glacadóir

I’m sure I’m not the first person to come up with this. Mar sin féin, I haven’t noticed anyone publish a trick like this since I started paying close attention to the community last July. Mar sin,, Shíl mé sa phost é seo tip debug tapaidh agus éasca.

Tá mé ag obair ar glacadóir ócáid ​​a thosaigh a ghiniúint an earráid sa 12 hive:

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 = blahbalhbalh. Additional information is below. : Cuspóir tagartha nach leagtar ar shampla de rud.

I didn’t know where I had introduced this bug because I had done too many things in one of my code/deploy/test cycles.

Rinne mé an réiteach seo a fháil ar mo PDB i ann le súil go SharePoint ar 12 Bheadh ​​hive thaispeáint ar an rian chairn, but no luck. I don’t know if it’s possible and if someone does, cuir in iúl dom 🙂

Tá a fhios agam go bhfuil sé indéanta go do theachtaireachtaí logáil féin a scríobh chuig an 12 hive. Frankly, Theastaigh uaim rud éigin a bhí beagán níos lú scary agus níos tapúla a chur i bhfeidhm.

Rith sé liom go raibh mé in ann ar a laghad, a fháil ar roinnt eolais rian bhunúsach ag breith agus ath-throwing eisceachtaí cineálach mar seo:

  iarracht {
    UpdateEditionDate(airíonna);
  }
  ghabháil (Eisceacht agus)
  {
    caith nua Eisceacht("Dispatcher, UpdateEditionDate(): Eisceacht: [" + e.ToString() + "].");
  }

Léirigh sé seo suas sa 12 hive thusly:

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 = blahblahblah. Additional information is below. : Dispatcher, UpdateEditionDate(): Eisceacht: [System.NullReferenceException: Cuspóir tagartha nach leagtar ar shampla de rud. at Conchango.xyzzyManagementEventReceiver.UpdateEditionDate(Airíonna SPItemEventProperties) at Conchango.xyzzyManagementEventReceiver.Dispatcher(Airíonna SPItemEventProperties, EventDescription Teaghrán)].

Sin a thug dom go léir na sonraí is gá dom a rianú síos ar an bhfadhb ar leith agus tá mé ag súil é a úsáid go leor ag dul ar aghaidh.

</deireadh>

Liostáil le mo bhlag!