Nyaraka za kila mwezi: Februari 2008

Madogo Umma Announcement: Windows Live Settings Usalama na Kuwasiliana Wamiliki Space

I receive a handful of messages from individuals via the built-in "send a message" kazi Microsoft hutoa na nafasi ya kuishi (ambayo pia ni mwenyeji wa blog yangu) kila mwezi.

Kuhusu theluthi moja ya wakati, those users have secured their live spaces account such that I cannot reply. This is some kind of anti-spam feature I assume.

</mwisho>

Maelezo rahisi: “Thamani si kuanguka ndani mbalimbali yanayotarajiwa.”

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

Wakati wa kufanya kazi na kupokea tukio na code nyingine kwamba marejeo SharePoint orodha ya vitu via mfano kitu, Mimi mara nyingi kufanya makosa ili kuzalisha hili kosa katika Runtime:

Hitilafu ya upakiaji na mbio tukio receiver Conchango.xyzzyEventReceiver katika xyzzy, Version = 1.0.0.0, Utamaduni = neutral, 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. Hata hivyo, one simple explanation is that I’m referencing a field incorrectly. If the name of the field is "Due Date", Mimi lazima akifanya marejeo ni kama hii katika receiver tukio:

properties.ListItem["Due Date"]

Wakati mimi misspell au kutumia vibaya wakati kesi referencing shamba, SharePoint generates the above mentioned runtime error. Kwa mfano, hii ni sahihi:

properties.ListItem["due Date"]

</mwisho>

Kujiunga na blog yangu.

Tags technorati:

Mtumiaji wa mwisho Quick Tip: Aina Views katika Library Document, Orodha ya, nk.

Tunaweza, lazima na wala kujenga maoni mengi katika orodha SharePoint (hati maktaba, desturi orodha, nk). 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 (na mimi nina uhakika unaweza), ni mbali ya kiufundi kwa ajili ya mtumiaji yako ya kawaida mwisho.

Kama unataka kudhibiti utaratibu ambao SharePoint orodha ya maoni inapatikana, tu prepend ya simu au barua kwa jina maoni, kama katika:

1 – Kwa Aina Material
2 – Kila Nyaraka
3 – Kutokana Tarehe

-au-

A – Kwa Aina Material
B – Kila Nyaraka
C – Kutokana Tarehe

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

Z_KPI_[maelezo]

That causes my "KPI" maoni kuonekana chini ya orodha.

</mwisho>

Kujiunga na blog yangu.

Jumapili Mapenzi: “Nilipokuwa Little Boy”

Kama mzazi, somewhere along the line I discovered the "When I was a little boy" trick.

Mwanangu, pengine minne au mitano wakati, alikuwa kucheza puto na kama wengi wavulana kidogo kwamba kucheza na balloons, he popped it. He was very upset. The world had come to an end. I said to him, "when I was little boy, Mimi nilikuwa na puto na ni popped na hatimaye, 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. Wakati huu, majibu yake ilikuwa, "Now I feel bad about two things!" I shied away from using the "when I was a little boy" mbinu kwa ajili ya faraja baada ya kuwa.

Kabla ya tukio hilo wafu mbwa, hata hivyo, 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", nk.

Hii pia ilikuwa pretty mafanikio kwa wakati, but he started to increasingly rebel against the tyranny of my childhood. One event, hasa, 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, kwamba ilikuwa ya kijinga!".

</mwisho>

Kujiunga na blog yangu.

Tags technorati:

Maoni na nguzo kwenye Orodha na Maktaba Kudhibiti Haiwezi Imelindwa

UPDATE (02/29/08): Hii mpya codeplex mradi inaonekana kutoa njia kwa ajili ya kupata nguzo ya mtu binafsi: http://www.codeplex.com/SPListDisplaySetting. If you have any experience working with it, tafadhali acha maoni.

Forum mabango ya mara kwa mara kuuliza swali kama hili: "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?"

They also frequently ask a related question: "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 na MOSS:

  • SharePoint does not provide out-of-the-box support for securing views.
  • SharePoint does not provide out-of-the-box support for security columns.

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" maoni. These are easy enough to set up. Hata hivyo, due to their "personal" nature, these need to be configured for each user. Use standard security configuration to prevent anyone else from creating a personal view.
  • Use a data view web part and implement some kind of AJAXy security trimming solution.
  • Roll your own list display functionality and incorporate security trimming at the column level.
  • Modify the data entry forms and use JavaScript in conjunction with the security model to implement column-level security trimming.
  • 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 your own ASP.NET data entry function that implements column level security trimming.

None of those options are really that great, but there is at least a path to follow if you need to, even if it’s hard.

NOTE: If you go down any of these paths, 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" and defeat your security scheme.

If you have other ideas for or experiences with securing columns or views, please email yangu or leave a comment and I’ll update this posting as appropriate.

</mwisho>

Kujiunga na blog yangu.

Tags technorati:

Haraka Tip: BDC ADF Version Hesabu Je, Rafiki yako

Kama wewe ni mkono-coding files ADF na kufanya mengi ya kanuni / kuagiza / mtihani mizunguko, use the version number to make your life easier.

I hate kukubali hilo, lakini mpaka wiki hii, 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".

Mfano:

<LobSystem
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" Aina="Webservice" Toleo="1.2.0.0" Jina="xyzzyDocumentReview" xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

Change that version and re-import and the existing business data column uses the updated version automatically with no additional configuration required.

</mwisho>

Kujiunga na blog yangu.

Tags technorati:

Ufumbuzi: BDC Picker Inaonyesha Mmoja tu Column ya Matokeo

In my on-going attempts at providing a more useful lookup column using 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".

You access the picker by clicking on the open book icon of a business data column as shown:

picha

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" kazi. Users select a "master" document and when they save, an event receiver copies meta data fields from the referenced master.

By default, the BDC picker looks like this when I search for a document whose ID = "38":

clip_image002

That’s helpful, 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. Title) but won’t show the actual list of titles it found, just their DocId’s as shown here:

clip_image002[1]

(The screen shot isn’t so great because I didn’t pick a search that returns any valid results, but you can see that if it had found some results, it would only have shown DocId’s, not titles).

I searched high and low for the answer to this and failed. Yangu mwenzake, the venerable Jonathan Bradshaw, had faced and solved this issue. When I reached out to him for help, he pointed me in the right direction.

Configure the picker to show multiple columns via the "ShowInPicker" property in the ADF:

<Mali Jina="ShowInPicker" Aina="System.Boolean">kweli</Mali>

In more detail:

  <!-- Title -->
  <TypeDescriptor TypeName="System.String" Jina="Title" >
    <LocalizedDisplayNames>
      <LocalizedDisplayName LCID="1033">Title</LocalizedDisplayName>
    </LocalizedDisplayNames>
    <Mali>
      <Mali Jina="DisplayByDefault" Aina="System.Boolean">kweli</Mali>
      <Mali Jina="ShowInPicker" Aina="System.Boolean">kweli</Mali>
    </Mali>
  </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. Katika kesi yangu, BDC picker showed DocId by default. Hata hivyo, once I added "ShowInPicker" to Title, DocId no longer displayed. I solved that by explicitly setting the ShowInPicker property for Doc ID.

Here is the result:

picha

(I’ll explain the odd-looking "168 – CamlSchema.xsd" construction in a future blog post. Kwa kifupi, it’s a concatenated string that allows for a slightly better user experience).

Bila shaka, having written this blog entry, I just did a search for "ShowInPicker" and found numerous hits, including this one: http://msdn2.microsoft.com/en-us/library/ms583986.aspx. It explains the meaning of that property along with some other good BDC stuff.

</mwisho>

Kujiunga na blog yangu!

Tags technorati:

Haraka & Rahisi: Kujenga Folder na Mpe Aina Content (Au, Kuwa KPIs yako na kula sana Them)

In order to work around a KPI problem I wrote about here, 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 end users don’t know any better and 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, which isn’t the end of the world.

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. Kama matokeo, it’s a piece of cake to keep the parent folder’s meta data in sync with the KPI-driven meta data from the file itself since the plumbing is already in place. Hii inaruhusu yangu kuwa wangu KPI na kula nao pia 🙂

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").SubFolders;
  SPFolder addedFolder = srcFolders.Add(properties.ListItem.ID.ToString());
  SPContentTypeId kpiCT = mpya SPContentTypeId("0x0120002A666CAA9176DC4AA8CBAA9DC6B4039F");
  addedFolder.Item["Content Type ID"] = kpiCT;
  addedFolder.Item.Update();

To locate the actual Content Type ID, I accessed that content type via site settings and copy/pasted it from the URL as shown:

picha

</mwisho>

Kujiunga na blog yangu!

Tags technorati: ,

Haraka na Easy: Kupata SPFolder ya SPListItem katika kupokea Tukio

I hate kukubali hilo, 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:

binafsi utupu UpdateParentFolder(SPItemEventProperties mali)
{

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


} // UpdateParentFolder

Katika kesi hiyo, Mimi nina kazi na maktaba hati na mali ni kuja kutoka tukio ItemAdded.

hila ni kwamba huwezi kupata SPFolder ya bidhaa moja kwa moja kutoka bidhaa yenyewe (i.e. properties.ListItem.Folder ni null). Badala yake, kwenda Picha bidhaa orodha ya kuhusishwa na kupata folder faili ya.

</mwisho>

Kujiunga na blog yangu!

Tags technorati:

Lakini nyingine kupokea Tukio Ondoa Hitialfu hila

I’m sure I’m not the first person to come up with this. Hata hivyo, I haven’t noticed anyone publish a trick like this since I started paying close attention to the community last July. Hivyo, Nilidhani ningependa baada ya kuwa hii haraka na rahisi Debug ncha.

Mimi nina kazi ya receiver tukio hilo kuwa ilianza kuzalisha kosa hili katika 12 mzinga:

Hitilafu ya upakiaji na mbio tukio receiver Conchango.xyzzyEventReceiver katika xyzzy, Version = 1.0.0.0, Utamaduni = neutral, PublicKeyToken = blahbalhbalh. Additional information is below. : Kitu kumbukumbu si kuweka mfano wa kitu.

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.

Nilijaribu ufumbuzi huu kupata PDB yangu katika huko pamoja na matumaini kwamba SharePoint ya 12 mzinga bila kuonyesha mpororo, but no luck. I don’t know if it’s possible and if someone does, tafadhali napenda kujua 🙂

Najua inawezekana kuandika ujumbe yako mwenyewe logi kwa 12 mzinga. Frankly, Nilitaka kitu kidogo kidogo inatisha na wepesi kutekeleza.

Ilitokea kwangu kwamba mimi naweza angalau kupata baadhi ya msingi kuwaeleza habari na kuambukizwa na re-kutupa isipokuwa generic kama hii:

  kujaribu {
    UpdateEditionDate(mali);
  }
  kukamata (Ubaguzi e)
  {
    kutupa mpya Ubaguzi("Dispatcher, UpdateEditionDate(): Ubaguzi: [" + e.ToString() + "].");
  }

Hii ilionyesha juu katika 12 mzinga thusly:

Hitilafu ya upakiaji na mbio tukio receiver Conchango.xyzzyEventReceiver katika xyzzy, Version = 1.0.0.0, Utamaduni = neutral, PublicKeyToken = blahblahblah. Additional information is below. : Dispatcher, UpdateEditionDate(): Ubaguzi: [System.NullReferenceException: Kitu kumbukumbu si kuweka mfano wa kitu. at Conchango.xyzzyManagementEventReceiver.UpdateEditionDate(SPItemEventProperties mali) at Conchango.xyzzyManagementEventReceiver.Dispatcher(SPItemEventProperties mali, Kamba eventDescription)].

Kwamba alinipa undani wote mimi zinahitajika kufuatilia kwamba tatizo fulani na mimi kutarajia matumizi yake mengi kwenda mbele.

</mwisho>

Kujiunga na blog yangu!