Hi douglascrp,
luckily I spotted your post among all the spam that is currently flooding this forums.
Technically, there shouldn't be issues with using Aikau in non-Aikau pages. But you need to be mindful of some core aspects of how Aikau dependencies are loaded.
One thing I have learnt is to avoid having two web scripts on the same non-Aikau page (i.e. a page not served by a single full-page web script) call the processJsonModel FreeMarker directive. Since both calls are processed independantly from each other, you are likely to end up loading the same widgets or instantiating the same services twice at runtime. Maybe the service instantiation would not occur with the latest changes to Aikau that were blogged about a few days ago, but I am not sure of this
I think the best way would be to add a custom service that you want to call from a doclib action into the jsonModel of the share-header web script, which executes processJsonModel on all out-of-the-box non-Aikau pages. Any runtime widgets that you may require should be referenced (directly or transitively) by defining a "widgets" property in your custom service module (client) JS. The Dojo dependency handler should pick up those dependencies in the JS source and include them into the aggregated JS file.
In my current project I have even added some custom dependency rules to enhance how Aikau picks up dependencies from code in custom source files.
The only thing you should need to do then would be to fire a publication from your doclib action in such a way that your service can react to it. Theoretically, that should be as simple as writing this in your YUI action code:
<blockcode>
require(['alfresco/core/Core'], function(Core){
var myCore = new Core();
myCore.alfPublish('topic', payload);
});
</blockcode>
"require" should be globally available in any page that includes share-header.
Using an extension module with an evaluator should allow you to modify the jsonModel of share-header only on those pages where you actually need those widgets / services.
Regards
Axel