Mjesečni arhiv: Veljača 2008

Manji javno oglašavanje: Windows Live Sigurnosne postavke i Kontaktiranje Space Vlasnici

I receive a handful of messages from individuals via the built-in "send a message" funkcija Microsoft nudi živim prostora (koji je također domaćin moj blog) svaki mjesec.

Oko jedne trećine vremena, those users have secured their live spaces account such that I cannot reply. This is some kind of anti-spam feature I assume.

</kraj>

Jednostavno objašnjenje: “Vrijednost ne padne unutar očekivanog raspona.”

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

Prilikom rada s događaja prijemnika i drugi kod koji reference SharePoint popis stavki putem objektni model, Ja često čine greške koje stvaraju ovu pogrešku tijekom izvršavanja:

Pogreška pri učitavanju i trčanje događaj prijemnik Conchango.xyzzyEventReceiver u xyzzy, Verzija = 1.0.0.0, Kultura = neutralni, 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. Međutim, one simple explanation is that I’m referencing a field incorrectly. If the name of the field is "Due Date", Moram ga referencirati ovako u slučaju prijemnik:

properties.ListItem["Due Date"]

Kad sam pogrešno ili koristite pogrešnu slučaj kada pozivom na polje, SharePoint generates the above mentioned runtime error. Na primjer, to je krivo:

properties.ListItem["due Date"]

</kraj>

Pretplatite se na moj blog.

Technorati Tags:

Krajnji korisnik Quick Savjet: Sortiraj Pogledaj u biblioteci dokumenata, Popis, itd..

Možemo, treba i ne stvaraju mnoge poglede u SharePoint popisima (dokument knjižnice, prilagođeni popisi, itd.). 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 (i nisam siguran da mogu), to je daleko tehnički za svoje tipične krajnjeg korisnika.

Ako želite kontrolirati redoslijed u kojem SharePoint popise pogled, jednostavno upotrijebiti nesto broj ili slovo na more ime, kao u:

1 – Po vrsti materijala
2 – Svi dokumenti
3 – Datum dospijeća

-ili-

A – Po vrsti materijala
B – Svi dokumenti
C – Datum dospijeća

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

Z_KPI_[opis]

That causes my "KPI" prikazi da se pojavi na dnu popisa.

</kraj>

Pretplatite se na moj blog.

Nedjelja Zabavno: “Kad sam bio dječak”

Kao roditelj, somewhere along the line I discovered the "When I was a little boy" trick.

Moj sin, vjerojatno četiri ili pet u vrijeme, igrala balon i kao i većina dječaka koji igraju s balonima, he popped it. He was very upset. The world had come to an end. I said to him, "when I was little boy, I had a balloon and it popped and eventually, 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. Ovaj puta, his response was, "Now I feel bad about two things!" I shied away from using the "when I was a little boy" technique for consolation after that.

Before the dead dog incident, međutim, 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", itd..

This too was pretty successful for a while, but he started to increasingly rebel against the tyranny of my childhood. One event, posebno, 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, that was STUPID!".

</kraj>

Pretplatite se na moj blog.

Technorati Tags:

Pregledi i stupci se na popisima iu bibliotekama dokumenata ne mogu osigurati

UPDATE (02/29/08): Ovaj novi projekt codeplex čini se da pružaju metodu za osiguravanje pojedine stupce: http://www.codeplex.com/SPListDisplaySetting. If you have any experience working with it, molimo vas da ostavite komentar.

Forum plakati često postaviti pitanje ovako: "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 i mahovina:

  • 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" views. These are easy enough to set up. Međutim, 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.

NAPOMENA: 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 elektronička pošta mene or leave a comment and I’ll update this posting as appropriate.

</kraj>

Pretplatite se na moj blog.

Technorati Tags:

Quick Savjet: BDC ADF verzija brojevi su Your Friend

Ako ste ručno kodiranje ADF datoteke i radi puno koda / uvoz / ispitnih ciklusa, use the version number to make your life easier.

Mrzim to priznati, ali dok ovaj tjedan, 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".

Primjer:

<LobSystem
xmlns:Rebel="http://www.w3.org/2001/XMLSchema-instance" Rebel:schemaLocation="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" Tip="WebService" Verzija="1.2.0.0" Ime="xyzzyDocumentReview" xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

Promjena tu verziju i ponovno uvesti, a postojeći poslovni podatkovni stupac koristi ažuriranu verziju automatski, bez dodatnih konfiguracija potrebna.

</kraj>

Pretplatite se na moj blog.

Technorati Tags:

Otopina: BDC Picker Pokazuje samo jedan stupac rezultata

U mojim o ovim pokušajima pružanje više koristan pretraživanje stupac pomoću 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".

Možete pristupiti berač klikom na otvorenoj knjizi ikonu u stupcu poslovnih podataka kao što je prikazano:

slika

The above image shows a business data column called "Master Document Id". That column is connected, putem 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" funkcija. Users select a "master" dokument i kada su spasiti, nekog događaja prijamnik kopije meta podataka polja iz navedenog majstora.

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

clip_image002

To je korisno, 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. Naslov) ali neće pokazati stvarni popis naslova se nalaze, Upravo njihova DocId kao je prikazano ovdje:

clip_image002[1]

(Zaslon metak nije tako velik, jer nisam pokupiti traži da se vraća nikakve valjane rezultate, ali možete vidjeti da li je pronašao neke rezultate, to bi samo pokazala DocId je, ne naslova).

I searched high and low for the answer to this and failed. Moj kolega, časni Jonathan Bradshaw, had faced and solved this issue. When I reached out to him for help, on mi je ukazao u pravom smjeru.

Configure the picker to show multiple columns via the "ShowInPicker" Objekt u ADF:

<Svojstvo Ime="ShowInPicker" Tip="System.Boolean">pravi</Svojstvo>

U detaljnije:

  <!-- Naslov -->
  <TypeDescriptor TypeName="System.String" Ime="Naslov" >
    <LocalizedDisplayNames>
      <LocalizedDisplayName LCID="1033">Naslov</LocalizedDisplayName>
    </LocalizedDisplayNames>
    <Svojstva>
      <Svojstvo Ime="DisplayByDefault" Tip="System.Boolean">pravi</Svojstvo>
      <Svojstvo Ime="ShowInPicker" Tip="System.Boolean">pravi</Svojstvo>
    </Svojstva>
  </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. U mom slučaju, BDC picker showed DocId by default. Međutim, once I added "ShowInPicker" na Naslov, DocId no longer displayed. I solved that by explicitly setting the ShowInPicker property for Doc ID.

Ovdje je rezultat:

slika

(I’ll explain the odd-looking "168 – CamlSchema.xsd" construction in a future blog post. In short, to ulančani niz koji omogućuje za nešto bolje korisničko iskustvo).

Naravno, nakon što je napisao ovaj blog post, I just did a search for "ShowInPicker" i pronašao brojne hitove, pa i ova: http://msdn2.microsoft.com/en-us/library/ms583986.aspx. It explains the meaning of that property along with some other good BDC stuff.

</kraj>

Pretplatite se na moj blog!

Technorati Tags:

Brz & Lako: Napravite mapu i dodijeliti vrstu sadržaja (Ili, Jesu li Vaše KPI i jesti ih previše)

Kako bi zaobišli KPI problema Sam pisao o tome ovdje, 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) su krajnji korisnici ne znaju za bolje i 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, što nije kraj svijeta.

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. Kao rezultat toga, to je komad torte zadržati Roditelj mapom 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").Podmape;
  SPFolder addedFolder = srcFolders.Add(properties.ListItem.ID.ToString());
  SPContentTypeId kpiCT = novi SPContentTypeId("0x0120002A666CAA9176DC4AA8CBAA9DC6B4039F");
  addedFolder.Item["Content Type ID"] = KpiCT;
  addedFolder.Item.Update();

Da biste pronašli stvarni ID vrste sadržaja, Ja pogledana je vrsta sadržaja putem stranice postavki i copy / ga zalijepiti u URL kao što je prikazano:

slika

</kraj>

Pretplatite se na moj blog!

Technorati Tags: ,

Brzo i jednostavno: Nabavite SPFolder jednog SPListItem u Event prijemnik

Mrzim to priznati, 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:

privatni poništiti UpdateParentFolder(SPItemEventProperties Svojstva)
{

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


} // UpdateParentFolder

U tom slučaju, I’m working with a document library and the properties are coming from an ItemAdded event.

The trick is that you can’t get the SPFolder of the item directly from the item itself (i.e. properties.ListItem.Folder is null). Umjesto toga, go to the list item’s associated File and get the File’s folder.

</kraj>

Pretplatite se na moj blog!

Technorati Tags:

Još jedan događaj Debug prijemnik Trick

I’m sure I’m not the first person to come up with this. Međutim, I haven’t noticed anyone publish a trick like this since I started paying close attention to the community last July. Tako, Mislio sam da bih objaviti ga to brzo i lako ispravljanje savjet.

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

Pogreška pri učitavanju i trčanje događaj prijemnik Conchango.xyzzyEventReceiver u xyzzy, Verzija = 1.0.0.0, Kultura = neutralni, PublicKeyToken=blahbalhbalh. Additional information is below. : Objekta nije postavljena na instancu objekta.

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, javite mi 🙂

I know it’s possible to write your own log messages to the 12 košnica. 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:

  pokušati {
    UpdateEditionDate(Svojstva);
  }
  ulov (Izuzetak e)
  {
    baciti novi Izuzetak("Dispatcher, UpdateEditionDate(): Izuzetak: [" + e.ToString() + "].");
  }

This showed up in the 12 hive thusly:

Pogreška pri učitavanju i trčanje događaj prijemnik Conchango.xyzzyEventReceiver u xyzzy, Verzija = 1.0.0.0, Kultura = neutralni, PublicKeyToken=blahblahblah. Additional information is below. : Dispečer, UpdateEditionDate(): Izuzetak: [System.NullReferenceException: Objekta nije postavljena na instancu objekta. at Conchango.xyzzyManagementEventReceiver.UpdateEditionDate(SPItemEventProperties svojstva) at Conchango.xyzzyManagementEventReceiver.Dispatcher(SPItemEventProperties svojstva, 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.

</kraj>

Pretplatite se na moj blog!