manifoldcf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Wright <daddy...@gmail.com>
Subject Re: List item url incorrect
Date Tue, 27 May 2014 00:56:17 GMT
Hi Will,

I was planning on starting the release process for MCF 1.6.1 within the
next day, so I'd like to know where things stand here.

The code in question on the Java side is actually in SharePointRepository,
around line 2274:

>>>>>>
    public void addFile(String relPath, String displayURL)
      throws ManifoldCFException
    {
      // First, convert the relative path to a full path
      if ( !relPath.startsWith("/") )
      {
        relPath = rootPath + sitePath + "/" + relPath;
      }

      String fullPath = relPath;

      // Now, strip away what we don't want - namely, the root path.  This
makes the path relative to the root.
      if ( relPath.startsWith(rootPath) )
      {
        relPath = relPath.substring(rootPath.length());

        if (relPath.startsWith(sitePath))
        {
          relPath = relPath.substring(sitePath.length());

          // Now, strip "Lists" from relPath.  If it doesn't start with
/Lists/, ignore it.
          if (relPath.startsWith("/Lists/"))
          {
            relPath = sitePath + relPath.substring("/Lists".length());
...
<<<<<<

The parameters "relPath" and "displayURL" come directly from the response
from the plugin.  Later on:

>>>>>>
                if (displayURL != null)
                  dataValues[4] = new String[]{displayURL};
                else
                  dataValues[4] = new String[]{fullPath};
<<<<<<

... which basically means that the displayURL coming from the plugin is
used in completely unaltered form at this level.  Later, though, it is
modified, at line 1466:

>>>>>>
                // Generate the URL we are going to use
                String itemUrl = fileBaseUrl + relURL;  //fileBaseUrl +
encodedItemPath;
<<<<<<

The member variable fileBaseUrl is set at line 230:

>>>>>>
      fileBaseUrl = serverUrl + encodedServerLocation;
<<<<<<

... which consists of the server url and the path to the root site.

So, with the 1.6 code at least, the *only* way doubling can occur is within
the plugin itself.  At line 135 in MCPermissions.cs, this is how it comes
up with the url:

>>>>>>
                                    urlAttribute.Value =
string.Format("{0}?ID={1}",
oListItem.ParentList.Forms[PAGETYPE.PAGE_DISPLAYFORM].ServerRelativeUrl,
oListItem.ID);
<<<<<<

So it doesn't look like any opportunity to double anything in the current
codebase.

If you are sure your plugin and MCF are current, and you still see
doubling, I suggest adding System.out.println statements after line 2274 to
see what is actually coming back from the plugin.

Thanks,
Karl



On Mon, May 26, 2014 at 3:16 AM, Karl Wright <daddywri@gmail.com> wrote:

> Hi Will,
> The URL is assembled in part by the plugin, and in part by
> SPSProxyHelper.java.
>
> First, please make sure you are using an up to date plugin version.  If
> you still have the problem I will review the code and make a recommendation.
>
> it is also essential to know what part of the URL is getting duplicated.
>
> Thanks,
>
> Karl
>
> Sent from my Windows Phone
> ------------------------------
> From: Will Parkinson
> Sent: 5/26/2014 12:56 AM
> To: user@manifoldcf.apache.org
> Subject: List item url incorrect
>
> Hello
>
> A little while ago i posted an issue with the ManifoldCF sharepoint
> connector crawling a lot of list items suffixed with the extension ".000".
> This issue seems to have been resolved in version 1.4 I believe.
>
> These items now seem to be returning the correct file name and extension,
> but it looks like the file URL path itself is incorrect
>
> An example incorrect URL is in the log segment below
>
> DEBUG 2014-05-26 14:37:28,716 (Worker thread '8') - SharePoint: Processing
> list item '/ocs/lsu/Tasks///1391_.000'; url: '
> https://sharepoint.local/divisions/resacom/divisions/resacom/ocs/lsu/Lists/Tasks/DispForm.aspx?ID=1391
> '
>
> You can see in the example above that the site is doubled in the URL
>
> /divisions/resacom/divisions/resacom/
>
> (it should be /divisions/resacom/)
>
> Any ideas where this issue might be coming from?  I'm happy to fix it up
> and submit it back if somebody can point me in the right direction.
>
> Cheers,
>
> Will
>

Mime
View raw message