cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 5.0.x, 5.1.x, webscript 'cmis' not defined

dhartford
Champ on-the-rise
Champ on-the-rise
There seems to be an issue with webscripts that rely in CMIS binding.

ReferenceError: "cmis" is not defined

The same webscripts work in alfresco 4.2.f, so has something changed?


   var cmisConnection = cmis.getConnection();
   var cmisSession = cmisConnection.getSession();
….





other forum references:
https://forums.alfresco.com/forum/developer-discussions/web-scripts/web-script-cmis-query-12152011-0...
http://forums.alfresco.com/forum/developer-discussions/other-apis/alfresco-50-webscript-cmis-not-def...
10 REPLIES 10

dhartford
Champ on-the-rise
Champ on-the-rise
Apparently there is an open ticket around this issue, but no momentum:

https://issues.alfresco.com/jira/browse/MNT-12795

mrogers
Star Contributor
Star Contributor
Yes its still an issue that's been jammed for too long.

dhartford
Champ on-the-rise
Champ on-the-rise
I've voted for this ticket, but not able to add comments. 

We chose to build alfreso-specific dashlets, using the CMIS behind the server-side webscripts as it handled security.  This provided some convenience and performance, but was a conscious decision to lock-in to Alfresco itself.

Now, we have some concerns - would it have been preferred to create a liferay portlet or regular webapp talking over CMIS rather than embed into Alfresco with their dashlet and webscript approach (as this CMIS-no-longer-available-serverside-webscript bug has been lingering for a while)?

dhartford
Champ on-the-rise
Champ on-the-rise
Is there any feedback from Alfresco if this will be a 'not fix' kind of issue, or if there are actual plans to fix it?

created a community ticket (versus the customer MNT ticket) - https://issues.alfresco.com/jira/browse/ALF-21434

dhartford
Champ on-the-rise
Champ on-the-rise
The above community ticket was closed related to duplicate of MNT, was hoping for visibility in the 5.1.x community stream (this has been open issue since 4.2.f).

dhartford
Champ on-the-rise
Champ on-the-rise
Tested 5.1.c (201510) release of Alfresco.

Still unable to add comments to: https://issues.alfresco.com/jira/browse/MNT-12795

Using Jeff Potts example (https://forums.alfresco.com/forum/developer-discussions/web-scripts/web-script-cmis-query-12152011-0...), still get this error with 5.1.c/201510 EA release, nor the example attached directly to MNT-12795 as it also gets the same error:

ReferenceError: \"cmis\" is not defined.



This is a regression issue as this used to work with older versions of alfresco (last that worked was Alf 4.2.f).  Usecase is when you want to run CMIS queries *through* webscript (such as an alfresco dashlet).

resplin
Elite Collaborator
Elite Collaborator
Your persistence on this issue has kept visibility on it. It is one of those issues that hasn't been big enough to make a priority, but is too big to fix quickly. There was some internal conversation on the issue that I opened up in the issue tracker.

A few notes on the issue tracker:
* MNT is the project where we prioritize customer fixes that are likely to end up in a hot fix or service pack.
* Because MNT largely consists of customer raised issues, it defaults to private settings so we don't accidentally leak customer information. Unfortunately, we often forget to make things public when there is no customer info.
* The public used to be able to comment on MNT issues. I'm not sure what changed, but it was accidental. We will get it fixed.

This is unlikely to be fixed in time for the 5.1 release, but it hasn't been forgotten. Sorry about the delay.

dhartford
Champ on-the-rise
Champ on-the-rise
Here is some key api calls that I'm using:

var cmisConnection = cmis.getConnection();
var cmisSession = cmisConnection.getSession();
cmisSession.getTypeDefinition(…).getPropertyDefinitions()
var quickOperationContext = cmisSession.createOperationContext();
   quickOperationContext.setMaxItemsPerPage(100);
   quickOperationContext.setIncludeAllowableActions(false);
var results = cmisSession.query(selectQuery , false, quickOperationContext).skipTo(nextIndex).getPage(model.pageSize).iterator();

They are all standard / traditional chemistry API calls using the old CMIS integration approach.  Would hate to have to rewrite them all into something that isn't as portable (i.e. I just change 'var' with the actual object when using codesnippet/logic to/from systems other than Alfresco's webscripts, making it really easy to go back and forth and reuse the same skillset…minus the authentication management that is built in to webscripts). 

EDIT: as an additional option, if there is a good example of setting up a java-backed data webscript w/ opencmis where still have the .get.json.ftl / .get.desc.xml referencing the java class approach, that may be an alternative approach..I haven't done such a thing.
-Darren