manifoldcf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luis Cabaceira (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CONNECTORS-1462) Add support for rootPath attribute in File System Connector repository
Date Fri, 29 Sep 2017 19:21:01 GMT

     [ https://issues.apache.org/jira/browse/CONNECTORS-1462?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Luis Cabaceira updated CONNECTORS-1462:
---------------------------------------
    Description: 
In recent conversations about specific needs of the new output connectors (in this case for
the Alfresco BFSI Output connector) a new construct was added in RepositoryDocument to support
having a rootPath attribute under the document object. This new construct exists currently
only in CONNECTORS-1356-2.7.1 branch.

This issue addresses the changes necessary to the File System Connector to support the new
construct and inject the rootPath locations into RepositoryDocument.

------------
Changes 
------------
org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector.java 

  // Extract rootPath from the specification

{code:java}
    ArrayList<String> rootPath = new ArrayList<String>();
    for (int i = 0; i < spec.getChildCount(); i++)
    {
      SpecificationNode sn = spec.getChild(i);
      if (sn.getType().equals("startpoint"))
      {
        String path = sn.getAttributeValue("path").replaceAll("\\\\","/");
        if (path.length() > 0)
        {
          if (!path.endsWith("/")) path += "/";
          rootPath.add(path);
          break;
        }
      }
    }
{code}


...
{code:java}
        RepositoryDocument data = new RepositoryDocument();
        data.setFileName(fileName);
        data.setMimeType(mimeType);
        data.setModifiedDate(modifiedDate);
        data.setRootPath(rootPath); // Adding the rootPath to RepositoryDocument
{code}


  was:
In recent conversations about specific needs of the new output connectors (in this case for
the Alfresco BFSI Output connector) a new construct was added in RepositoryDocument to support
having a rootPath attribute under the document object. This new construct exists currently
only in CONNECTORS-1356-2.7.1 branch.

This issue addresses the changes necessary to the File System Connector to support the new
construct and inject the rootPath locations into RepositoryDocument.

------------
Changes 
------------
org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector.java 

  // Extract rootPath from the specification

{code:java}
    ArrayList<String> rootPath = new ArrayList<String>();
    for (int i = 0; i < spec.getChildCount(); i++)
    {
      SpecificationNode sn = spec.getChild(i);
      if (sn.getType().equals("startpoint"))
      {
        String path = sn.getAttributeValue("path").replaceAll("\\\\","/");
        if (path.length() > 0)
        {
          if (!path.endsWith("/")) path += "/";
          rootPath.add(path);
          break;
        }
      }
    }
{code}


...

        RepositoryDocument data = new RepositoryDocument();
        data.setFileName(fileName);
        data.setMimeType(mimeType);
        data.setModifiedDate(modifiedDate);
        data.setRootPath(rootPath); // Adding the rootPath to RepositoryDocument




> Add support for rootPath attribute in File System Connector repository
> ----------------------------------------------------------------------
>
>                 Key: CONNECTORS-1462
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-1462
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: Alfresco BFSI Output Connector, File system connector
>    Affects Versions: ManifoldCF 2.9
>            Reporter: Luis Cabaceira
>            Assignee: Piergiorgio Lucidi
>              Labels: patch
>             Fix For: ManifoldCF next
>
>         Attachments: FileConnector.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> In recent conversations about specific needs of the new output connectors (in this case
for the Alfresco BFSI Output connector) a new construct was added in RepositoryDocument to
support having a rootPath attribute under the document object. This new construct exists currently
only in CONNECTORS-1356-2.7.1 branch.
> This issue addresses the changes necessary to the File System Connector to support the
new construct and inject the rootPath locations into RepositoryDocument.
> ------------
> Changes 
> ------------
> org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector.java 
>   // Extract rootPath from the specification
> {code:java}
>     ArrayList<String> rootPath = new ArrayList<String>();
>     for (int i = 0; i < spec.getChildCount(); i++)
>     {
>       SpecificationNode sn = spec.getChild(i);
>       if (sn.getType().equals("startpoint"))
>       {
>         String path = sn.getAttributeValue("path").replaceAll("\\\\","/");
>         if (path.length() > 0)
>         {
>           if (!path.endsWith("/")) path += "/";
>           rootPath.add(path);
>           break;
>         }
>       }
>     }
> {code}
> ...
> {code:java}
>         RepositoryDocument data = new RepositoryDocument();
>         data.setFileName(fileName);
>         data.setMimeType(mimeType);
>         data.setModifiedDate(modifiedDate);
>         data.setRootPath(rootPath); // Adding the rootPath to RepositoryDocument
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message