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

Markus Schuch edited comment on CONNECTORS-1566 at 9/18/19 8:56 AM:
--------------------------------------------------------------------

Thanks [~kwri...@metacarta.com]. This patch is exactly what i did here to get 
forward. Hope it does not break anything for older livelink versions.
Which is the minimal livelink version we want to support with this connector?

The next problem i encountered is, that {{evaluateRight(...)}} throws an NPE, 
because {{nr}} is {{null}}. (in my current case {{rights.getPublicRight()}} 
returns null for a document).

{code}
FATAL 2019-09-18T10:53:49,752 (Worker thread '14') - Error tossed: null
java.lang.NullPointerException
        at 
org.apache.manifoldcf.crawler.connectors.csws.CswsConnector.evaluateRight(CswsConnector.java:4410)
 ~[?:?]
        at 
org.apache.manifoldcf.crawler.connectors.csws.CswsConnector.lookupTokens(CswsConnector.java:4393)
 ~[?:?]
        at 
org.apache.manifoldcf.crawler.connectors.csws.CswsConnector.processDocuments(CswsConnector.java:1209)
 ~[?:?]
        at 
org.apache.manifoldcf.crawler.system.WorkerThread.run(WorkerThread.java:399) 
[mcf-pull-agent.jar:?]
{code}

My first naive patch would be to add a null check:
{code}
protected static boolean evaluateRight(final NodeRight nr) {
    if (nr == null) return false;
    final NodePermissions np = nr.getPermissions();
    return np.isSeePermission() && np.isSeeContentsPermission();
}
{code}



was (Author: schuchm):
Thanks [~kwri...@metacarta.com]. This patch is exactly what i did here to get 
forward. Hope it does not break anything for older livelink versions.
Which is the minimal livelink version we want to support with this connector?

The next problem i encountered is, that {{evaluateRight(...)}} throws an NPE, 
because {{nr}} is {{null}}. (in my current case {{rights.getPublicRight()}} 
returns null for a document).

{code}
protected static boolean evaluateRight(final NodeRight nr) {
    final NodePermissions np = nr.getPermissions();
    return np.isSeePermission() && np.isSeeContentsPermission();
}
{code}

My first naive patch would be
{code}
protected static boolean evaluateRight(final NodeRight nr) {
    if (nr == null) return false;
    final NodePermissions np = nr.getPermissions();
    return np.isSeePermission() && np.isSeeContentsPermission();
}
{code}


> Develop CSWS connector as a replacement for deprecated LiveLink LAPI connector
> ------------------------------------------------------------------------------
>
>                 Key: CONNECTORS-1566
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-1566
>             Project: ManifoldCF
>          Issue Type: Task
>          Components: LiveLink connector
>    Affects Versions: ManifoldCF 2.12
>            Reporter: Karl Wright
>            Assignee: Karl Wright
>            Priority: Major
>             Fix For: ManifoldCF 2.14
>
>         Attachments: OTCS_IIS.png, OTCS_Tomcat.png, chrome_cgfC00ujx7.png
>
>
> LAPI is being deprecated.  We need to develop a replacement for it using the 
> ContentServer Web Services API.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to