Domanda

Sto lavorando con SharePoint e ProjectServer 2007 via PSI con Python.

Non riesco a trovare alcuna documentazione su come Classe filtro ( Microsoft.Office.Project.Server.Library ) oggetti lavoro internamente emulare il suo comportamento in Python.

Tutte le idee?

È stato utile?

Soluzione

Date un'occhiata al post del blog di Colby Africa . Inoltre, MSDN documenti sono qui .

Modifica

Il filtro generato è solo XML. Qui è un filtro che restituisce i dati dalla tabella "lookuptables" (elenco di tutte le tabelle di ricerca):

<?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>

Ecco un altro esempio dei filtri necessari per ottenere tutti i dati per una tabella ...

Passaggio 1: Ottenere la riga per il LOOKUPTABLE (general informazioni Classifica)

<?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>

Passo 2: ottenere tutti i dati dalla tabella LookupTableStructures (info gerarchia)

<?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>

Fase 3: ottenere tutti i valori in questa tabella di ricerca

<?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>

Si richiede tre filtri separati per ottenere tutti questi dati, perché è diviso in tre tabelle separate. In C #, sto chiamando la funzione ReadLookupTablesMultiLang con ognuno di questi filtri e poi la fusione dei DataTable restituiti.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top