Monthly Archives: Febrúar 2008

Minniháttar opinberri tilkynningu: Windows Live Security Settings og Samband Space Eigendur

I receive a handful of messages from individuals via the built-in "send a message" virka Microsoft veitir með lifandi rými (sem hýsir einnig bloggið mitt) í hverjum mánuði.

Um þriðjungur af tíma, those users have secured their live spaces account such that I cannot reply. This is some kind of anti-spam feature I assume.

</enda>

Einföld útskýring: “Gildi falli ekki innan áætlaðs fjölda.”

UPDATE: An anonymous poster left a great comment about internal names. Be sure to read it.

Þegar unnið er með móttakara atburði og önnur númer sem tilvísanir SharePoint listi atriði í gegnum the mótmæla líkan, Ég gera oft mistök að búa til þessa villu á afturkreistingur:

Villa hleðsla og gangi móttakari Conchango.xyzzyEventReceiver í xyzzy, Útgáfa = 1.0.0.0, Menning = hlutlaus, 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. Hins, one simple explanation is that I’m referencing a field incorrectly. If the name of the field is "Due Date", Ég þarf tilvísun það svona í atburði móttakara:

properties.ListItem["Due Date"]

Þegar ég stafa vitlaust eða nota rangt mál þegar vísa á sviði, SharePoint generates the above mentioned runtime error. Til dæmis, Þetta er rangt:

properties.ListItem["due Date"]

</enda>

Gerast áskrifandi að bloggið mitt.

Technorati Tags:

Endir Notandi Fljótur Þjórfé: Raða Skoðað í Document Library, Listi, o.fl..

Við getum, ætti og bý margar skoðanir í SharePoint listi (skjal bókasöfn, Raða listum, o.fl.). 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 (og ég er ekki viss um að það getur), það er langt til tæknileg fyrir dæmigerður endir notandi þitt.

Ef þú vilt stjórna í hvaða röð SharePoint listi í boði skoðanir, einfaldlega prepend númer eða bréf til að skoða nafn, eins og í:

1 – Eftir tegundum Material
2 – Öll skjöl
3 – Skiladagur

-eða-

A – Eftir tegundum Material
B – Öll skjöl
C – Skiladagur

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

Z_KPI_[lýsing]

That causes my "KPI" sjónarmið að birtast neðst á listanum.

</enda>

Gerast áskrifandi að bloggið mitt.

Sunnudagur Fyndið: “Þegar ég var lítill drengur”

Sem foreldri, somewhere along the line I discovered the "When I was a little boy" trick.

Sonur minn, sennilega fjögur eða fimm á þeim tíma, var að spila blöðru og eins og flestum litlum strákum að spila með blöðrur, he popped it. He was very upset. The world had come to an end. I said to him, "when I was little boy, Ég hafði blöðru og það smella og að lokum, 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. Í þetta sinn, svar hans var, "Now I feel bad about two things!" I shied away from using the "when I was a little boy" tækni til huggunar eftir að.

Áður en dauður hundur atvik, þó, 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", o.fl..

Þetta var of mjög vel um stund, but he started to increasingly rebel against the tyranny of my childhood. One event, einkum, 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, sem var STUPID!".

</enda>

Gerast áskrifandi að bloggið mitt.

Technorati Tags:

Skoðanir og dálka á listum og skjal bókasöfn ekki verða tryggða

UPDATE (02/29/08): Þessi nýja Codeplex verkefni virðist té aðferð til að tryggja einstökum dálkum: http://www.codeplex.com/SPListDisplaySetting. If you have any experience working with it, vinsamlegast eftir athugasemd.

Forum veggspjöldum spyrja oft spurningu eins og þessa: "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?"

Þeir einnig oft spyrja tengdum spurningu: "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 og Moss:

  • SharePoint veitir ekki út-af-the-kassi stuðningur til að tryggja útsýni.
  • SharePoint veitir ekki út-af-the-kassi stuðningur fyrir dálka öryggi.

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" views. These are easy enough to set up. Hins, due to their "personal" eðli, these need to be configured for each user. Use standard security configuration to prevent anyone else from creating a personal view.
  • Notaðu gögn útsýni vefur hluti og framkvæma einhvers konar AJAXy öryggi snyrtingu lausn.
  • Rúlla eigin lista sýna virkni og fella öryggi snyrtingu á dálki stigi.
  • Breyta færslunni gögn eyðublöð og nota JavaScript í tengslum við öryggi líkan að innleiða dálki-stigi öryggi snyrtingu.
  • Use an InfoPath form for data entry. Implement column-level security trimming via web service calls to SharePoint and conditionally hide fields as needed.
  • Rúlla eigin ASP.NET þinn gögn innganga virka sem útfærir dálki stigi öryggi snyrtingu.

Ekkert af þeim valkostum eru í raun að mikill, en það er að minnsta kosti leið til að fylgja ef þú þarft að, jafnvel ef það er erfitt.

ATHUGIÐ: Ef þú ferð niður eitthvað af þessum leiðum, 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" og ósigur öryggi kerfi þitt.

Ef þú ert með aðrar hugmyndir fyrir eða reynslu með sem tryggja dálka eða skoðanir, vinsamlegast email mig eða leyfi a athugasemd og ég mun uppfæra þetta efni sem við.

</enda>

Gerast áskrifandi að bloggið mitt.

Technorati Tags:

Quick Ábending: BDC radíóáttavita Útgáfa Numbers Are Friend

Ef þú ert hönd-kóðun ADF skrá og gera a einhver fjöldi af kóða / innflutningur / próf hringrás, use the version number to make your life easier.

Ég hata að viðurkenna það, en þangað til í þessari viku, 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".

Dæmi:

<LobSystem
xmlns:Xsi="HTTP://www.w3.org/2001/XMLSchema-instance" Xsi:schemaLocation="HTTP://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" Tegund="VefÃ" Útgáfa="1.2.0.0" Nafn="xyzzyDocumentReview" xmlns="HTTP://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

Breyting þessi útgáfa og aftur innflutningur og núverandi fyrirtæki gögn dálki notar uppfærða útgáfu sjálfkrafa með engin frekari stillingar þarf.

</enda>

Gerast áskrifandi að bloggið mitt.

Technorati Tags:

Lausn: BDC Picker sýnir aðeins einn dálk úrslit

Í á-fara tilraunir mínar á að veita meira gagni útlit dálki með 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".

Þú aðgang að tínslumaður með því að smella á opnum bók helgimynd af gögnum fyrirtækis dálki eins og sýnt:

mynd

The above image shows a business data column called "Master Document Id". That column is connected, gegnum 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" virka. Users select a "master" skjal og þegar þeir spara, Móttökutæki atburður afrit meta gögn sviðum frá heitinu skipstjóra.

Sjálfgefið, the BDC picker looks like this when I search for a document whose ID = "38":

clip_image002

Það er gagnlegt, 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. Titill) en vilja ekki sýna raunverulegan lista yfir titla sem það finnast, bara DocId þeirra er eins og sýnt er hér:

clip_image002[1]

(The skjár skot er ekki svo mikill vegna þess að ég hafði ekki tekið leit sem skilar öllum gildar niðurstöður, en þú getur séð það ef það hefði fundið nokkrar niðurstöður, það myndi aðeins hafa sýnt er DocId, ekki titlar).

I searched high and low for the answer to this and failed. Samstarfsmaður minn, venerable Jonathan Bradshaw, had faced and solved this issue. When I reached out to him for help, Hann benti mér í rétta átt.

Configure the picker to show multiple columns via the "ShowInPicker" eign í ADF:

<Eign Nafn="ShowInPicker" Tegund="System.Boolean">satt</Eign>

Nánar:

  <!-- Titill -->
  <TypeDescriptor TypeName="System.String" Nafn="Titill" >
    <LocalizedDisplayNames>
      <LocalizedDisplayName LCID="1033">Titill</LocalizedDisplayName>
    </LocalizedDisplayNames>
    <Eiginleikar>
      <Eign Nafn="DisplayByDefault" Tegund="System.Boolean">satt</Eign>
      <Eign Nafn="ShowInPicker" Tegund="System.Boolean">satt</Eign>
    </Eiginleikar>
  </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. Í mínu tilfelli, BDC picker showed DocId by default. Hins, once I added "ShowInPicker" Titill, DocId no longer displayed. I solved that by explicitly setting the ShowInPicker property for Doc ID.

Hér er niðurstaðan:

mynd

(I’ll explain the odd-looking "168 – CamlSchema.xsd" construction in a future blog post. In short, það er Concatenated band thatà leyfa fyrir betri notandi upplifir Nokkuð).

Auðvitað, Skrifað Having þessi bloggfærslu, I just did a search for "ShowInPicker" og númeruð smellir finna, includingï þetta: http://msdn2.microsoft.com/en-us/library/ms583986.aspx. It explains the meaning of that property along with some other good BDC stuff.

</enda>

Gerast áskrifandi að bloggið mitt!

Technorati Tags:

Quick & Easy: Búa til möppu og tengja gerð efnis (Eða, Hafa KPIs og borða þá of)

Í því skyni að vinna í kringum KPI vandamál Ég skrifaði um hér, 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) the endir notandi veit ekki betur og 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, sem er ekki the endir af the heiminum.

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. Þar af leiðandi, það er a stykki af köku til að halda foreldri mappa er 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").Undirmöppur;
  SPFolder við möppu = srcFolders.Add(properties.ListItem.ID.ToString());
  SPContentTypeId kpiCT =  SPContentTypeId("0x0120002A666CAA9176DC4AA8CBAA9DC6B4039F");
  addedFolder.Item["Content Type ID"] = kpiCT;
  addedFolder.Item.Update();

Til að finna raunverulegt innihald Auðkenni, Ég nálgast þessi efni gerð í gegnum stillingar á síðuna og afrita / líma það frá vefslóð eins og sýnt:

mynd

</enda>

Gerast áskrifandi að bloggið mitt!

Technorati Tags: ,

Fljótur og Þægilegur: Fáðu SPFolder af SPListItem í Event Receiver

Ég hata að viðurkenna það, 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:

einkaaðila ógilt UpdateParentFolder(SPItemEventProperties eignir)
{

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


} // UpdateParentFolder

Í þessu tilviki, Ég er að vinna með skjal bókasafn og eignir eru að koma frá ItemAdded atburði.

The bragð er að þú getur ekki fengið SPFolder hlutarins beint frá hlutnum sjálfum (i.e. properties.ListItem.Folder er null). Staðinn, fara tengslum skrá á lista yfir atriði og fá möppu Skráin er.

</enda>

Gerast áskrifandi að bloggið mitt!

Technorati Tags:

Enn ein Receiver Event Debug Bragð

I’m sure I’m not the first person to come up with this. Hins, I haven’t noticed anyone publish a trick like this since I started paying close attention to the community last July. Svo, Ég hélt ég myndi eftir það þetta fljótleg og auðveld kemba þjórfé.

I’m working on an event receiver that started to generate this error in the 12 Hive:

Villa hleðsla og gangi móttakari Conchango.xyzzyEventReceiver í xyzzy, Útgáfa = 1.0.0.0, Menning = hlutlaus, PublicKeyToken=blahbalhbalh. Additional information is below. : Object tilvísun ekki sett til dæmis á hlut.

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.

I tried this solution to get my pdb in there with hopes that SharePoint’s 12 hive would show the stack trace, but no luck. I don’t know if it’s possible and if someone does, please let me know 🙂

I know it’s possible to write your own log messages to the 12 Hive. Frankly, I wanted something a little less scary and quicker to implement.

It occurred to me that I could at least get some basic trace information by catching and re-throwing generic exceptions like this:

  reyna {
    UpdateEditionDate(eignir);
  }
  veiða (Undantekning e)
  {
    kasta  Undantekning("Dispatcher, UpdateEditionDate(): Undantekning: [" + e.ToString() + "].");
  }

This showed up in the 12 hive thusly:

Villa hleðsla og gangi móttakari Conchango.xyzzyEventReceiver í xyzzy, Útgáfa = 1.0.0.0, Menning = hlutlaus, PublicKeyToken=blahblahblah. Additional information is below. : Dispatcher, UpdateEditionDate(): Undantekning: [System.NullReferenceException: Object tilvísun ekki sett til dæmis á hlut. at Conchango.xyzzyManagementEventReceiver.UpdateEditionDate(SPItemEventProperties eignir) at Conchango.xyzzyManagementEventReceiver.Dispatcher(SPItemEventProperties eignir, String eventDescription)].

That gave me all the detail I needed to track down that particular problem and I expect to use it a lot going forward.

</enda>

Gerast áskrifandi að bloggið mitt!