[MNT-12795] CMIS Javascript ROOT object is undefined Created: 03-Nov-14  Updated: 08-Nov-17  Resolved: 08-Nov-17

Status: Closed
Project: Service Packs and Hot Fixes
Component/s: CMIS
Affects Version/s: 5.0
Fix Version/s: None

Type: Bug
Reporter: Mike Farman Assignee: Closed Issues
Resolution: Won't Fix Votes: 3
Labels: 5.0.N, CommunityPainPoints, NonCustomerENH, releasenotes
Remaining Estimate: 0 minutes
Time Spent: 1 day, 1 hour, 25 minutes
Original Estimate: Not Specified

Attachments: Text File OpenCMIS Query Example.js     Zip Archive simple cmis web script (using new api).zip     Zip Archive simple-cmis.zip    
Issue Links:
is duplicated by ALF-21434 CMIS Javascript ROOT object is undefined Closed
Bug Priority:
Category 2


It looks like the cmis javascript root object has been removed. I don't think it should have gone, there are examples that used this that we still ship. It should still work on the opencmis based implemented I think.

To reproduce:
Open: http://localhost:8080/alfresco/service/cmis-browser-app/connections

Exception: org.mozilla.javascript.EcmaError - ReferenceError: "cmis" is not defined. (classpath*:alfresco/extension/templates/webscripts/org/alfresco/cmis/client/cmisbrowser/connections.get.js#2)

Comment by Brian Remmington [ 03-Nov-14 ]

Steve, does this ring any bells at all? If not, any suggestions as to who to ask next?

Comment by Kevin Roast [X] (Inactive) [ 03-Nov-14 ]

See the subversion history on this issue: ACE-2010
In particular: https://fisheye.alfresco.com/changelog/alfresco-enterprise?cs=74406

It may simply be that it was removed over-aggressively during the CMIS 0.9 removal. Alan Davis may be able to provide more info.

Comment by Brian Remmington [ 03-Nov-14 ]

Alan, see previous comment from Kev. Thoughts? Can we bring the cmis root object back?

Comment by Alan Davis [ 05-Nov-14 ]


The cmis key entry (webscripts.js.cmis.client bean) was removed from the webscripts.container bean (web-scripts-application-context.xml) on the EOL2 branch r75765 as it was using the old cmis vrsion.

Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
76300: Merged EOL2 (5.0.0.EOL2) to HEAD-BUG-FIX (5.0/Cloud)
75765: ACE-2010 - EOL Legacy CMIS - removed webscript REST APIs pertinent to Alfresco 3.4 CMIS API pt1

The implementation of the webscripts.js.cmis.client bean (CMISLocalConnectionManagerImpl) was removed from the EOL2 branch in r75774. r75802 makes the same change in the cloud overlay.

Having talked to Steve G, it appears that many of the templates did use the old cmis version. The implementation of CMISLocalConnectionManagerImpl may also use some old CMIS code, although later comments indicate that this might not have been as bad as first thought. Reimplemented in OpenCMIS however is not a trivial task and may take a couple of weeks.

Passing to Steve to add first hand information.

Comment by Gavin Cornwell [ 15-Apr-15 ]

Not sure what to do with this one to be honest.

Steven Glover [X] Steve, if you still have the fix you mention above? If so, could you possibly commit it to a DEV branch?

Having said that, Mike Farman are you sure this is still required? As far as I can see and mentioned above all the old CMIS webscripts and samples (including http://localhost:8080/alfresco/service/cmis-browser-app/connections) have been removed and are no longer available in 5.x.

Moving to Need Info to await product management decision.

Comment by Steven Glover [X] (Inactive) [ 17-Apr-15 ]

Gavin Cornwell I'm afraid I didn't get very far with this. I identified which svn revisions contained the removal of the original Javascript integration code but didn't proceed beyond that point. To re-instate this we would have to bring back the Javascript integration code and re-implement those parts of it that were using the old CMIS code in terms of OpenCMIS (a lot of it was implemented in terms of the old CMIS code which is now, of course, gone). It is non-trivial.

Comment by Mark Rogers [X] (Inactive) [ 16-Jun-15 ]

This is/was part of our documented Repository Java Script API. (e.g. http://docs.alfresco.com/5.0/references/API-JS-rootscoped.html) Either it needs to be reinstated or the docs need fixing. There is work to be done either way.

I noticed this during the Java Script Review (RA-355) Which identified that tests are missing for this API !

Also it looks like Web Quick Start uses it in a couple of places

Comment by Mark Rogers [X] (Inactive) [ 21-Aug-15 ]

If we are to re-implement the Java Script API on OpenCMIS then we would need to put back the interface for CMISConnectionManager and add an implementation based upon OpenCMIS.
That interface has 10 or so methods and also depends upon CMISConnection and CMISServer.

CMISConnection has 10 or so simple methods so shouldn't be a problem.

CMISServer was our class so we should have defined an interface anyway. It depends upon OpenCMIS Session class so that should already be present and not be a problem.

Comment by Mark Rogers [X] (Inactive) [ 25-Sep-15 ]

I'm going to attempt to fix this.

Code was tangled with surf webscript container which required a little rework.
Got a build that compiles.

But how to test?

Comment by Gavin Cornwell [ 28-Sep-15 ]

Mark Rogers [X] Do you have the code on a branch that we can review? It might be worth asking Mike Farman or Gabriele Columbro [X] whether they have any examples we could use or know of any customers/partners that have used this functionality. There must be some otherwise we wouldn't have been asked to fix it

Regardless of whether there are any examples, we should add some JavaScript based tests, I think there are several examples of these in the repo already.

Comment by Mike Farman [ 28-Sep-15 ]

simple-cmis.zip example repo Web Script attached. Deploy this to the repo tier and access it using /alfresco/s/simplecmis
Queries for content named 'Project%' so should return files from the sample site.

Comment by Mike Farman [ 29-Sep-15 ]

Also attached OpenCMIS Query Example.js which is a pure Javascript example.

Comment by Richard Esplin [X] (Inactive) [ 18-Nov-15 ]

darren hartford has been interested in this issue for some time. If we need a real-world example, he can provide one.


A permission change is preventing him from commenting on this issue (reported as JIRA-90), so if it is still needed you should reach out to him directly.

Comment by Martin Bergljung [ 18-Nov-15 ]

I think moving forward the cmis root object should be deprecated and the new endpoint alfresco-api should be used.

See my attached sample.

It might make sense to bring back the cmis root object for backwards compatibility if many customers are using it.

Comment by Martin Bergljung [ 18-Nov-15 ]

If it is a repo side web script then use the standard root objects such as search (set language to cmis-strict or cmis-alfresco), companyhome etc.

I will still include the sample for Surf Web Scripts as it is quite useful

Comment by Gavin Cornwell [ 18-Nov-15 ]

darren hartford If you have sample webscripts that make use the of cmis root object feel free to attach them to this ticket.

Comment by Richard Esplin [X] (Inactive) [ 08-Nov-17 ]

The Javascript root object for CMIS was lost as a side-effect of moving to the standard OpenCMIS implementation from Apache Chemistry and finally removing our custom CMIS implementation in the 5.0 release.

This issue was raised because internally we saw the value of this functionality. But in the two years since the removal, only one external person has requested it. We found this lack of enthusiasm surprising. We think this is the case because it is unusual to use CMIS from within the application server itself. CMIS is intended to be used as an interoperability standard.

This functionality is not part of the CMIS standard, is rarely used, the lack of this functionality is easy to work around, and adding it on top of the OpenCMIS implementation is non-trivial. As a result, we will focus our efforts on more common use cases.

Generated at Mon Mar 08 16:26:33 GMT 2021 using Jira 7.13.15#713015-sha1:7c5ddd2c3e1709974ae9c48c17df8edd3919fe2c.