AnsweredAssumed Answered

Help extending the 'People' Javascript API in 2.1.

Question asked by chrisb on Jun 3, 2007
Latest reply on Jun 4, 2007 by kevinr
I am currently trying to add some extra functionality to the People Javascript API functionality.

My new functionality will most likely just consist of new methods for creating alfresco users using the Java API calls (I already have some code to do this).

I just wanted to clarify a few things in terms of the best approach for the organisation and deployment of the new functionality, especially bearing in mind these features may be added to the Javascript API anyway at a later date?

I am planning to create a new POJO class (PeopleUtils?) under the org.alfresco.repo.jscript package, using the skeleton of the current as a starting point and adding the methods I need.

What is the best way to build / structure the new class for ease of deployment and modularity? Can I build the class and config files into a separate WAR file and deploy as an extension, or would I have to rebuild Alfresco to add in my extra Javascript functionality?

The wiki briefly mentions a new extension mechanism for additions to the Javascript API available for this as of 2.0, but doesn't go into much detail. It also gives the ScriptLogger as an example and suggests extending from org.alfresco.repo.jscript.BaseScriptImplementation. However in the 2.1.0 HEAD the ScriptLogger class extends BaseProcessorExtension?

I'll admit I am not a Spring / JavaBeans expert by any means so feel free to let me know if I am missing something obvious  :) . Just after some advice and details on how to structure things to avoid a lot of rework later!