Hi guys,
I am inserting to the registry using the system registry of the generic
store using the Generic Artifact Manager. The issue is that when I insert
through the GAM - it take sometime to be inserted to the registry. I want
to set get operation for the anon role using the UserManager. Since the
instance is not existing the permission is not applied.
am = new carbon.registry.ArtifactManager(registry, "mobileapp");
var attributes ={
overview_status: "PENDING-REVIEW",
overview_name: ctx.name,
overview_platform:t,
overview_version: ctx.version,
overview_url: ctx.url,
overview_provider: ctx.provider,
overview_description: ctx.description,
overview_market:ctx.markettype,
// overview_recentChanges:ctx.recentChanges,
overview_packageName:ctx.packagename,
overview_category:ctx.category,
images_icon:icon,
images_banner:banner,
images_screenshots:screenshots
};
attributes[attributes.overview_status+"_date"]=printDate();
am.add({
name: ctx.name,
lifecycle:["applifecycle"],
path:path,
attributes:attributes
});
// The above call is not synchrnous. The method returns without
actually adding the asset to the registry.
// A JavaScript way of dealing with such things would be to
implement a callback. Maybe for Java we need a listner.
um.authorizeRole(carbon.user.anonRole, path,
carbon.registry.actions.GET);
//Above call will not work since the asset is not there in the registry
Can someone from registry team explain whether the *addGenericArtifact *method
is synchronous or not. Just for the sake of testing I even tried out a
while loop using exists method- it also go infinite.
Thanks
--
Chan (Dulitha Wijewantha)
Software Engineer - Mobile Development
WSO2Mobile
Lean.Enterprise.Mobileware
* ~Email [email protected] <[email protected]>*
* ~Mobile +94712112165*
* ~Website dulithawijewantha.com
*
* ~Blog blog.dulithawijewantha.com<http://dulichan.github.io/chan/>
*
* ~Twitter @dulitharw <https://twitter.com/dulitharw>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev