I wanna test my plugin licencing like explained in the link https://developer.atlassian.com/display/UPM/Tutorial%3A+Adding+Licensing+Support+to+Your+Add-on
Please look Step 6. Test the Plugin Licencing. I need to test my plugin valid or not without using servlets.
How can I do this?
Thanks for helps
#if(!licenseOk)
#parse("licenseError.vm")
#else
#parse("someView.vm")
#end
Install the latest version of the Universal Plugin Manager which comes bundled with the licensing module right in the plugins screen. (see Step 8) If you're using UPM < 2.0.1 and don't have a licensing page of your own, you cannot use the licenses.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok. well, I get it. How can I disable modules? or I have a page "sample.jspa" , and How can I make it invisible? How can I handle with it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using the latest version of UPM as described step 8. If my license exprises, my plugin is still usable?UPM makes the modules disabled or somehing else. How does it manage valid and invalid licenses?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
See ComponentAccessor.getPluginAccessor() and getPluginController(). They should provide you with the disable functions you need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's your job to decide what to do when the licenses expire. It only provides a way to tell what the license status is and then you decide how you want to handle it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Florin. Do you know a documentation page about it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, there is no other documentation that I know about. It's usually trial and error for me. I usually check this in the velocity files and render a message about the license being expired instead of showing the normal page. But this depends on what your plugin actually does. You usually need to check it somewhere at the "entrance" to the functionality it provides.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, I want to to use it in a velocity(vm) file. Can you give me your example please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh, well. licenseOk is initialized in a java class or it is a velocity parameter, or anything else?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
#if(!licenseOk)
#parse("licenseError.vm")
#else
#parse("someView.vm")
#end
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is a initVelocityContext method in LicenseServlet.java. Can I add like this?
private Map<String, Object> initVelocityContext(HttpServletResponse resp) { resp.setContentType("text/html;charset=utf-8"); URI servletUri = URI.create(applicationProperties.getBaseUrl() + "/plugins/servlet/crm-plugin/license"); final Map<String, Object> context = new HashMap<String, Object>(); context.put("servletUri", servletUri); context.put("displayLicenseAdminUi", true); try { context.put("license", licenseManager.getLicense()); context.put("upmLicensingAware", licenseManager.isUpmLicensingAware()); context.put("pluginKey", licenseManager.getPluginKey()); if (licenseManager.isUpmLicensingAware()) { context.put("warningMessage", i18nResolver.getText("plugin.license.storage.admin.upm.licensing.aware", licenseManager.getPluginManagementUri())); } } catch (PluginLicenseStoragePluginUnresolvedException e) { context.put("errorMessage", i18nResolver.getText("plugin.license.storage.admin.plugin.unavailable")); context.put("displayLicenseAdminUi", false); } return context; }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In my case, I calculated it (see example in generated LicenseServlet.java from tutorial above) and put it in the velocity context.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, I can use it from license-admin.vm, but I cannot access it from another velocity files. What am I doing wrong? :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can get the license status like following: (in resources/license-admin.vm)
How can I get it from this vm? (resources/secure/settings.vm)
I tried to append the same velocity file(license), but all values are empty :S What is wrong with it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must populate the velocity context with those values in order to use them in the vm. Are you sure the context contains the values you need?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.