[ 
https://issues.apache.org/jira/browse/CONNECTORS-787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13796635#comment-13796635
 ] 

Karl Wright commented on CONNECTORS-787:
----------------------------------------

So I found a code example that is supposed to do what we want:

{code}
SPQuery query = new SPQuery();
query.ViewAttributes = "Scope='Recursive'";
SPListItemCollection messages = list.GetItems(query);
foreach (SPListItem message3 in messages3)
{
    // message.DisplayName is discussion title !
    // message["TrimmedBody"] is message body
}
{code}

This is from stackexchange:

http://sharepoint.stackexchange.com/questions/20216/iterate-through-discussion-list

It's very similar to what we currently do, except for rather simple changes.  
Here's our current code:

{code}
                        SPQuery listQuery = new SPQuery();
                        listQuery.Query = "<OrderBy Override=\"TRUE\"><FieldRef 
Name=\"FileRef\" /></OrderBy>";
                        listQuery.QueryThrottleMode = 
SPQueryThrottleOption.Override;
                        listQuery.ViewAttributes = "Scope=\"Recursive\"";
                        listQuery.ViewFields = "<FieldRef Name='FileRef' />";
                        listQuery.RowLimit = 1000;
{code}

The nagging possibility here is that there is no "FileRef" field for these list 
items, which is why they are not found.  If that is the case, though, then 
there is no way to locate the discussion messages via a URL in any case.

Some experimentation will therefore be required with the code snippet above to 
figure out (a) whether it really works, and (b) how *our* expression fails.


> SharePoint 2010 plugin: getListItems does not get all discussion board items
> ----------------------------------------------------------------------------
>
>                 Key: CONNECTORS-787
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-787
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: SharePoint 2010 MCPermissions extension
>    Affects Versions: ManifoldCF 1.4
>            Reporter: Karl Wright
>            Assignee: Karl Wright
>             Fix For: ManifoldCF 1.4
>
>
> Only one row is being returned from our MCPermissions plugin when trying to 
> enumerate a Discussion Board list.  This link describes the problem:
> http://social.msdn.microsoft.com/Forums/sharepoint/en-US/afe07483-6aec-424a-9434-c8e8b963e55c/how-to-get-all-the-items-from-a-discussion-board?forum=sharepointdevelopmentlegacy
> The solution (using the Items member) is not viable in our case because it 
> does not page the results.  And yet there is no CAML example that would show 
> how to get the missing rows.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to