سؤال

أنا أعمل مع SharePoint و ProjectServer 2007 عبر PSI مع Python.

لا يمكنني العثور على أي وثائق حول كيفية فئة المرشح (microsoft.office.project.server.library) الأشياء تعمل داخليًا لمحاكاة سلوكها في بيثون.

أيه أفكار؟

هل كانت مفيدة؟

المحلول

ألق نظرة على منشور مدونة كولبي إفريقيا. ايضا، مستندات MSDN هنا.

يحرر

المرشح الذي تم إنشاؤه هو مجرد XML. فيما يلي مرشح يرجع البيانات من جدول "Lookuptables" (قائمة بجميع جداول البحث):

<?xml version="1.0" encoding="utf-16"?>
<Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" filterTableName="LookupTables" xmlns="http://microsoft.com/ProjectServer/FilterSchema.xsd">
  <Fields>
    <Field tableName="" fieldName="LT_UID" />
    <Field tableName="" fieldName="LT_NAME" />
    <Field tableName="" fieldName="LT_SORT_ORDER_ENUM" />
    <Field tableName="" fieldName="LT_PRIMARY_LCID" />
    <Field tableName="" fieldName="LT_FILL_ALL_LEVELS" />
    <Field tableName="" fieldName="LT_CHECKOUTBY" />
    <Field tableName="" fieldName="LT_CHECKOUTDATE" />
    <Field tableName="" fieldName="MOD_DATE" />
  </Fields>
  <Criteria />
</Filter>

فيما يلي مثال آخر على المرشحات المطلوبة للحصول على جميع البيانات لجدول واحد ...

الخطوة 1: احصل على الصف لـ The Lookuptable (معلومات الجدول العام)

<?xml version="1.0" encoding="utf-16"?>
<Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" filterTableName="LookupTables" xmlns="http://microsoft.com/ProjectServer/FilterSchema.xsd">
  <Fields>
    <Field tableName="" fieldName="LT_UID" />
    <Field tableName="" fieldName="LT_NAME" />
    <Field tableName="" fieldName="LT_SORT_ORDER_ENUM" />
    <Field tableName="" fieldName="LT_PRIMARY_LCID" />
    <Field tableName="" fieldName="LT_FILL_ALL_LEVELS" />
    <Field tableName="" fieldName="LT_CHECKOUTBY" />
    <Field tableName="" fieldName="LT_CHECKOUTDATE" />
    <Field tableName="" fieldName="MOD_DATE" />
  </Fields>
  <Criteria>
    <FieldOperator fieldOperationType="Equal">
      <Field fieldName="LT_UID" />
      <Operand xmlns:q1="http://microsoft.com/wsdl/types/" xsi:type="q1:guid">20870732-12b6-48e2-acf4-94d934dfc27a</Operand>
    </FieldOperator>
  </Criteria>
</Filter>

الخطوة 2: احصل على جميع البيانات من جدول Lookuptablestructures (معلومات التسلسل الهرمي)

<?xml version="1.0" encoding="utf-16"?>
<Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" filterTableName="LookupTableStructures" xmlns="http://microsoft.com/ProjectServer/FilterSchema.xsd">
  <Fields>
    <Field tableName="" fieldName="LT_STRUCT_UID" />
    <Field tableName="" fieldName="LT_UID" />
    <Field tableName="" fieldName="LT_PARENT_STRUCT_UID" />
    <Field tableName="" fieldName="LT_STRUCT_COOKIE" />
  </Fields>
  <Criteria>
    <FieldOperator fieldOperationType="Equal">
      <Field fieldName="LT_UID" />
      <Operand xmlns:q1="http://microsoft.com/wsdl/types/" xsi:type="q1:guid">20870732-12b6-48e2-acf4-94d934dfc27a</Operand>
    </FieldOperator>
  </Criteria>
</Filter>

الخطوة 3: احصل على كل القيم في جدول البحث هذا

<?xml version="1.0" encoding="utf-16"?>
<Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" filterTableName="LookupTableValues" xmlns="http://microsoft.com/ProjectServer/FilterSchema.xsd">
  <Fields>
    <Field tableName="" fieldName="LT_STRUCT_UID" />
    <Field tableName="" fieldName="LCID" />
    <Field tableName="" fieldName="LT_UID" />
    <Field tableName="" fieldName="LT_VALUE_DUR" />
    <Field tableName="" fieldName="LT_VALUE_NUM" />
    <Field tableName="" fieldName="LT_VALUE_DUR_FMT" />
    <Field tableName="" fieldName="LT_VALUE_DATE" />
    <Field tableName="" fieldName="LT_VALUE_TEXT" />
    <Field tableName="" fieldName="LT_VALUE_PHONETIC" />
    <Field tableName="" fieldName="LT_VALUE_FULL" />
    <Field tableName="" fieldName="LT_VALUE_DESC" />
    <Field tableName="" fieldName="LT_VALUE_SORT_INDEX" />
    <Field tableName="" fieldName="LT_VALUE_LOCALIZED_COOKIE" />
  </Fields>
  <Criteria>
    <FieldOperator fieldOperationType="Equal">
      <Field fieldName="LT_UID" />
      <Operand xmlns:q1="http://microsoft.com/wsdl/types/" xsi:type="q1:guid">20870732-12b6-48e2-acf4-94d934dfc27a</Operand>
    </FieldOperator>
  </Criteria>
</Filter>

يتطلب ثلاثة مرشحات منفصلة للحصول على كل هذه البيانات لأنها يتم تقسيمها عبر ثلاثة جداول منفصلة. في C#، أنا أتصل ReadLookupTablesMultiLang وظيفة مع كل من هذه المرشحات ثم دمج Datatables التي تم إرجاعها.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top