Skip to content

Instantly share code, notes, and snippets.

@dulichan
Created August 7, 2013 03:24
Show Gist options
  • Save dulichan/6170926 to your computer and use it in GitHub Desktop.
Save dulichan/6170926 to your computer and use it in GitHub Desktop.
Synchronous issue with GenericArtifactManager
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment