首页 > 代码库 > [转]Getting (personal) tasks from the user profile.

[转]Getting (personal) tasks from the user profile.

 

from http://blog.amtopm.be/2013/02/22/getting-personal-tasks-from-the-user-profile/

Getting (personal) tasks from the user profile.

Introduction

On the personal site (user profile) users are able to create new tasks assigned to themselves. However when looking at the site content there is no tasklist to be found.

Turns out that the tasks in the User Profile are stored in a hidden list on the user profile site. The tasks are not even stored as a task contenttype.

Where is it stored?

The list where the user profile tasks are stored is called: ‘WmaAggregatorList_User‘. You can access it by using the default server model (have not tried client model yet)

1
2
3
4
5
6
7
8
9
10
11
12
using (SPSite site = new SPSite("http://my.wingtip.com/personal/administrator/"))
{
   using (SPWeb web = site.OpenWeb())
   {
      SPList list = web.Lists["WmaAggregatorList_User"];
 
      foreach (SPListItem item in list.Items)
      {
         Console.WriteLine(String.Format("{0} - {1}",item.ContentTypeId, item.Title));
      }
   }
}

The special contenttype

But there is more. Look at the contenttypeId of those items: ‘0x0056568DFBB054A24E9CD75205760A1195
It does not resemble the typical contenttypeId layout that we are used to. A content type always starts with ‘0x01′ (=item) from which ,normally, all other contant types inherit. It seems that this is a special one.

For you reference here is a list with the default contenttypeId prefixes

Content TypeID
 System0x
 Item0×01
 Document0×0101
 Event0×0102
 Issue0×0103
 Announcement0×0104
 Link0×0105
 Contact0×0106
 Message0×0107
 Task0×0108
 Workflow History0×0109
 Post0×0110
 Comment0×0111
 East Asia Contact0×0116
 Folder0×0120

The contenttype fields

Here is also a reference to all the fields included in this special ‘item’ contentype

Content TypeID
1d22ea11-1e32-424e-89ab-9fedbadb6ce1ID
03e45e84-1992-4d42-9116-26f756012634Content Type ID
c042a256-787d-4a6f-8a8a-cf6ab767f12dContent Type
fa564e0f-0c70-4ab9-b863-0177e6ddd247Title
28cf69c5-fa48-462a-b5cd-27b6f9d2bd5fModified
8c06beca-0777-48f7-91c7-6da68bc07b69Created
1df5e554-ec7e-46a6-901d-d85a3881cb18Created By
d31655d1-1d5b-4511-95a1-7a09e9b75bf2Modified By
26d0756c-986a-48a7-af35-bf18ab85ff4aHas Copy Destinations
6b4e226d-3d88-4a36-808d-a129bf52bccfCopy Source
d4e44a66-ee3a-4d02-88c9-4ec5ff3f4cd5owshiddenversion
f1e020bc-ba26-443f-bf2f-b68715017bbcWorkflow Version
7841bf41-43d0-4434-9f50-a673baef7631UI Version
dce8262a-3ae9-45aa-aab4-83bd75fb738aVersion
67df98f4-9dec-48ff-a553-29bece9c5bf4Attachments
fdc3b2ed-5bf2-4835-a4bc-b885f3396a61Approval Status
34ad21eb-75bd-4544-8c73-0e08330291feApprover Comments
503f1caa-358e-4918-9094-4a2cdc4bc034Edit
bc91a437-52e7-49e1-8c4e-4698904b2b6dTitle
82642ec8-ef9b-478f-acf9-31f7d45fbc31Title
5f190d91-3dbc-4489-9878-3c092caf35b6Title
b1f7969b-ea65-42e1-8b54-b588292635f2Select
50a54da4-1528-4e67-954a-e2d24f1e9efbInstance ID
ca4addac-796f-4b23-b093-d2a3f65c0774Order
ae069f25-3ac2-4256-b9c3-15dbc15da0e0GUID
de8beacf-5505-47cd-80a6-aa44e7ffe2f4Workflow Instance ID
94f89715-e097-4e8b-ba79-ea02aa8b7adbURL Path
56605df6-8fa1-47e4-a04c-5b384d59609fPath
173f76c8-aebd-446a-9bc9-769a2bd2c18fModified
998b5cff-4a35-47a7-92f3-3914aa6aa4a2Created
30bb605f-5bae-48fe-b4e3-1f81d9772af9Item Type
423874f8-c300-4bfb-b7a1-42e2159e3b19Sort Type
ba3c27ee-4791-4867-8821-ff99000bac98Effective Permissions Mask
8553196d-ec8d-4564-9861-3dbe931050c8Name
4b7403de-8d94-43e8-9f0f-137a3e298126Unique Id
6d2c4fde-3605-428e-a236-ce5f3dc2b4d4Client Id
c5c4b81c-f1d9-4b43-a6a2-090df32ebb68ProgId
dddd2420-b270-4735-93b5-92b713d0944dScopeId
39360f11-34cf-4356-9945-25c44e68dadeFile Type
4ef1b78f-fdba-48dc-b8ab-3fa06a0c9804HTML File Type
3c6303be-e21f-4366-80d7-d6d0a3b22c7aEdit Menu Table Start
1344423c-c7f9-4134-88e4-ad842e2d723cEdit Menu Table Start
2ea78cef-1bf9-4019-960a-02c41636cb47Edit Menu Table End
9d30f126-ba48-446b-b8f9-83745f322ebeName
5cc6dc79-3710-4374-b433-61cb4a686c12Name
224ba411-da77-4050-b0eb-62d422f13d3eName
081c6e4c-5c14-4f20-b23e-1a71ceb6a67cType
105f76ce-724a-4bba-aece-f81f2fce58f5Server Relative URL
7177cfc7-f399-4d4d-905d-37dd51bc90bfEncoded Absolute URL
7615464b-559e-4302-b8e2-8f440b913101File Name
687c7f94-686a-42d3-9b67-2782eac4b4f8Property Bag
43bdd51b-3c5b-4e78-90a8-fb2087f71e70Level
c101c3e7-122d-4d4d-bc34-58e94a38c816Is Current Version
b824e17e-a1b3-426e-aecf-f0184d900485Item Child Count
960ff01f-2b6d-4f1b-9c3f-e19ad8927341Folder Child Count
6bfaba20-36bf-44b5-a1b2-eb6346d49716App Created By
e08400f3-c779-4ed2-a18c-ab7f34caa318App Modified By
1edbd545-4ecf-4543-ada7-ec9b34042285TypeIdField
fe1cda57-dc9e-4957-8291-8f93f18745a3LxColor
cb99f61e-da96-4130-9b39-11225b3b3631LxIsHidden
25741724-109e-4595-8748-bd7b0e4ee403LxParentId
a53afe1f-c618-4843-9fac-9f19fda794e5LxProviderData
7b70505d-fa83-4eaa-bb2b-ff50f3f98404LxProviderKey
c8993990-8d05-4fb2-8f6b-cc785e2a77ecLxTimestampZeroTasks
c0246154-fc70-47ca-b2eb-58a517e19c3aLxUrl
b3a4ce61-0d09-4aa1-bc26-7258fdb71fe3LIxIsHidden
4683ad38-556e-4b25-8955-3fdc1ec76bddLIxParentId
12e77597-1073-47ed-8691-25770058455cLIxPersonalSyncTargetKey
f56f75b5-fe57-4c31-9bf2-eed6bc9549e0LIxPersonalSyncTargetState
24579217-f403-4152-aa9f-c820c9a36794LIxProviderData
9fc6fa68-fa54-40d2-aeda-7349799ef3a8LIxProviderKey
f2e1b70e-1a28-4bf5-b3d6-9ade5eeacbf4LIxSyncTargetKey
a90d3f97-d4b6-4855-8a28-8d55e457d260LIxSyncTargetState
5f2de15b-1479-413d-9c17-078d23d7c8a6SingletonVerificationField
4a4a519c-086a-4cfb-a59a-8600e982b631LKxSerializedLockState
0b9d78ac-1912-41e1-9c93-069d5fdb13d6PPxSerializedProperties
7d1b202f-7e3c-4afb-b2e7-29221e90abb4PCxSerializedState
ae26c81a-84cd-4667-be67-803c34f653eaPIxSerializedState
4411628d-e1e8-4010-840b-f9a95acec59aRxSerializedRefreshState
a0942467-68bf-48ec-9440-5b42b960004bSxDaysAfterCurrentDateTimelineEn
4e0ab55b-2dd2-4790-b735-1fb0ca48a377SxDaysATaskIsConsideredNewTask
4971dcb8-6a29-4d0b-8e79-6f630ef6867eSxDaysBeforeCurrentDateTimelineS
fdd6ec36-62e4-49e5-8b61-20004c129791SxImportantLocationIds
97d6ef3b-9f7d-4cf9-b873-5416b3b34c68SxImportantTasksLimit
d030a147-5699-4694-a9e6-d938dfddbb09SxInactiveMonthsBeforeLocationEx
6760bb14-50b0-4ae4-8371-760510736cb3SxLateTasksLimit
cfb6266a-257a-468e-b2e2-6d7af5f66730SxOldTasksLimit
ee2635fa-1e93-463d-a888-575f67fb8417SxUpcomingTasksLimit
4760fdc7-5fb2-429a-80f9-de45826c32f9TxCustomAttributes
4e7286fa-3147-40a6-bbc9-5ee940eaf3dbTxDescription
6dc64f63-3d14-442e-a9f8-b845f3bd9c2fTxDueDate
6171ad6f-49f4-4e99-8303-ff2873813a78TxEditUrl
2bef6b3d-2884-4f40-be51-8880c64ea5a6TxExplicitLocationGroupOrder
988f285e-2b33-4512-b2f4-6df5f9a71801TxExplicitOrder
a08ad8db-073c-41a3-b104-0a3837ed708bTxIsCompleted
d7d43ca1-cc01-46c3-a810-4a4ec9dceebfTxIsImportantForExchange
dea6d386-17f3-444f-843b-f43041aea4a4TxIsPersonalDeletedTask
26b887a2-b3a4-4920-b134-791825f10c0dTxIsReadOnly
ef49207b-c42c-4305-946a-6ec8b1c097e0TxLocationId
a5e28579-2fe8-4878-bd39-0ff1abf5ac4bTxMappedStorageFolderKey
38aa56bb-431e-4175-9019-7da3dadc4c8eTxMappedStorageKey
9c4d60b5-a1eb-43d0-bbed-34c57352bcbbTxPinnedDate
623971cd-a44e-46e3-a832-2089cc5024ddTxProviderData
cf7ec4ad-1d95-4abd-9255-5b54f3f86716TxProviderKey
a785c3e9-b034-4680-b39d-8f7c746c8bd9TxSerializedCustomDataForClient
bff09429-0f4c-4960-8d17-a7e7f88fe3f3TxServiceCreated
22249896-4a9e-403a-ade0-70fbffeeb934TxServiceLastModified
9c8a5443-5e09-4bdf-8bb9-63a4d58d6896TxStartDate
32f590a3-4b46-433a-9061-49b31d91b22aTxEffectiveCreated
f1962adb-b231-42ac-9c48-60dbe899280bTxEffectiveLastModified
74bec003-cac3-4e53-a3d8-60d6c7ddc226TxEffectiveLocationGroupOrder
150bb05a-af1e-4e06-bafd-9b3ccd2d2074TxEffectiveOrder
26eeefb6-05bc-459b-9959-65ac996a2afbTIxLocationId
09068dab-3dbf-4f89-983b-92ce4366f40dTIxProviderData
ff9bfad5-ed35-4370-b5a6-1cea68a77b0fTIxProviderKey

[转]Getting (personal) tasks from the user profile.