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: ,

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

  1. Ron Scríobh:
    This doesn’t work. I have tried it multiple times. Trying to use KPIs against a task list folder.
    Mura bhfuil tú a bhaint as an cód a fháil ar an obair – nach dóigh liom go bhfuil an cumas a athrú.
    If you don’t need the code maybe you could expand on your explanation of creating the new folder content type. I’m using SharePoint 2007.
    Freagra

Leave a Reply

Ní thabharfar do sheoladh r-phoist a fhoilsiú. Réimsí riachtanacha atá marcáilte *