1
0
-1
2 answers
- 10-1
There did not have any error captured at joget.log
- Anders
Can you elaborate on "but it is not able to install it with the joget Console." with more details?
Add your comment... - 10-1
Hi,
And I build the Plugin successfully. but it is not able to install it with the joget Console.
What error are you getting? The exception and stacktrace would tell you what is wrong with the code.Add your comment...
Dear Expert,
I am creating a simple permission plugin to disable a section if the user using a Mobile View. by "MobileUtil.isMobileView()"
And I build the Plugin successfully. but it is not able to install it with the joget Console.
here is the Source Code.
Activator.java
package org.joget.tutorial; import java.util.ArrayList; import java.util.Collection; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; public class Activator implements BundleActivator { protected Collection<ServiceRegistration> registrationList; public void start(BundleContext context) { registrationList = new ArrayList<ServiceRegistration>(); //Register plugin here registrationList.add(context.registerService(NotMobileView.class.getName(), new NotMobileView(), null)); } public void stop(BundleContext context) { for (ServiceRegistration registration : registrationList) { registration.unregister(); } } }NotMobileView.java
package org.joget.tutorial; import org.joget.apps.app.service.AppPluginUtil; import org.joget.apps.app.service.AppUtil; import org.joget.apps.form.model.FormPermission; import org.joget.apps.userview.model.UserviewPermission; import org.joget.apps.app.service.MobileUtil; public class NotMobileView extends UserviewPermission implements FormPermission { public NotMobileView() { } @Override public String getName() { return "Not MobileView"; } @Override public String getVersion() { return "5.0.0"; } @Override public String getDescription() { return AppPluginUtil.getMessage("org.joget.tutorial.NotMobileView.pluginDesc", getClassName(), "messages/NotMobileView"); } @Override public String getLabel() { return AppPluginUtil.getMessage("org.joget.tutorial.NotMobileView.pluginLabel", getClassName(), "messages/NotMobileView"); } @Override public String getClassName() { return getClass().getName(); } @Override public String getPropertyOptions() { return AppUtil.readPluginResource(getClassName(), "/properties/NotMobileView.json", null, true, "messages/NotMobileView"); } @Override public boolean isAuthorize() { boolean isAuthorize; isAuthorize = false; if (!MobileUtil.isMobileView()) { isAuthorize = true; } return isAuthorize; } }NotMobileView.json
[{ "title":"@@userview.notmobileview.config@@", "properties":[{ "name":"permission", "label":"@@userview.notmobileview.permission@@", "type":"elementselect", "options_ajax":"[CONTEXT_PATH]/web/property/json/getElements?classname=org.joget.apps.userview.model.UserviewPermission", "url":"[CONTEXT_PATH]/web/property/json[APP_PATH]/getPropertyOptions" }] }]NotMobileView.properties
and the Jar folder structure is
Any Idea what I am doing Wrong ?
Best Regards
Tony Chu