Package org.joget.plugin.base

Examples of org.joget.plugin.base.PluginManager


     * @return
     * @throws Exception
     */
    public static FormBinder parseBinderFromJsonObject(JSONObject obj, String binderType) throws Exception {
        FormBinder binder = null;
        PluginManager pluginManager = (PluginManager) appContext.getBean("pluginManager");
        if (!obj.isNull(FormUtil.PROPERTY_PROPERTIES)) {
            JSONObject objProperty = obj.getJSONObject(FormUtil.PROPERTY_PROPERTIES);
            if (!objProperty.isNull(binderType)) {
                String binderStr = objProperty.getString(binderType);
                JSONObject binderObj = new JSONObject(binderStr);

                // create binder object
                if (!binderObj.isNull(FormUtil.PROPERTY_CLASS_NAME)) {
                    String className = binderObj.getString(FormUtil.PROPERTY_CLASS_NAME);
                    if (className != null && className.trim().length() > 0) {
                        binder = (FormBinder) pluginManager.getPlugin(className);
                        if (binder != null) {
                            // set child properties
                            Map<String, Object> properties = FormUtil.parsePropertyFromJsonObject(binderObj);
                            binder.setProperties(properties);
                        }
View Full Code Here


     * @return
     * @throws Exception
     */
    public static FormValidator parseValidatorFromJsonObject(JSONObject obj) throws Exception {
        FormValidator validator = null;
        PluginManager pluginManager = (PluginManager) appContext.getBean("pluginManager");
        if (!obj.isNull(FormUtil.PROPERTY_PROPERTIES)) {
            JSONObject objProperty = obj.getJSONObject(FormUtil.PROPERTY_PROPERTIES);
            if (!objProperty.isNull(FormUtil.PROPERTY_VALIDATOR)) {
                String validatorStr = objProperty.getString(FormUtil.PROPERTY_VALIDATOR);
                JSONObject validatorObj = new JSONObject(validatorStr);

                // create validator object
                if (!validatorObj.isNull(FormUtil.PROPERTY_CLASS_NAME)) {
                    String className = validatorObj.getString(FormUtil.PROPERTY_CLASS_NAME);
                    if (className != null && className.trim().length() > 0) {
                        validator = (FormValidator) pluginManager.getPlugin(className);
                        if (validator != null) {
                            // set child properties
                            Map<String, Object> properties = FormUtil.parsePropertyFromJsonObject(validatorObj);
                            validator.setProperties(properties);
                        }
View Full Code Here

     * @param templatePath
     * @param dataModel
     * @return
     */
    public static String generateElementHtml(final Element element, final FormData formData, final String templatePath, Map dataModel) {
        PluginManager pluginManager = (PluginManager) appContext.getBean("pluginManager");
        return pluginManager.getPluginFreeMarkerTemplate(dataModel, element.getClassName(), "/templates/" + templatePath, "message/form/" + element.getName().replace(" ", ""));
    }
View Full Code Here

                    FormBinder binder = null;
                   
                    JSONObject jo = new JSONObject(binderData);
                    // create binder object
                    if (!jo.isNull(FormUtil.PROPERTY_CLASS_NAME)) {
                        PluginManager pluginManager = (PluginManager) appContext.getBean("pluginManager");
                       
                        String className = jo.getString(FormUtil.PROPERTY_CLASS_NAME);
                        if (className != null && className.trim().length() > 0) {
                            binder = (FormBinder) pluginManager.getPlugin(className);
                            if (binder != null) {
                                // set child properties
                                Map<String, Object> properties = FormUtil.parsePropertyFromJsonObject(jo);
                                binder.setProperties(properties);
                            }
View Full Code Here

public class AppWorkflowHelper implements WorkflowHelper {
   
    @Override
    public boolean executeTool(WorkflowAssignment assignment) {
        ApplicationContext appContext = AppUtil.getApplicationContext();
        PluginManager pluginManager = (PluginManager) appContext.getBean("pluginManager");
        AppDefinition appDef = null;
       
        if (assignment != null) {
            WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");
            PackageDefinitionDao packageDefinitionDao = (PackageDefinitionDao) appContext.getBean("packageDefinitionDao");
           
            String processDefId = assignment.getProcessDefId();
            WorkflowProcess process = workflowManager.getProcess(processDefId);
            if (process != null) {
                String packageId = process.getPackageId();
                Long packageVersion = Long.parseLong(process.getVersion());
                PackageDefinition packageDef = packageDefinitionDao.loadPackageDefinition(packageId, packageVersion);
                if (packageDef != null) {
                    appDef = packageDef.getAppDefinition();
                }
            }
        }

        if (appDef != null && appDef.getPackageDefinition() != null) {
            PackageDefinition packageDef = appDef.getPackageDefinition();
            String processDefId = WorkflowUtil.getProcessDefIdWithoutVersion(assignment.getProcessDefId());
            PackageActivityPlugin activityPluginMeta = packageDef.getPackageActivityPlugin(processDefId, assignment.getActivityDefId());

            Plugin plugin = null;

            if (activityPluginMeta != null) {
                plugin = pluginManager.getPlugin(activityPluginMeta.getPluginName());
            }

            if (plugin != null) {
                Map propertiesMap = AppPluginUtil.getDefaultProperties(plugin, activityPluginMeta.getPluginProperties(), appDef);
                propertiesMap.put("workflowAssignment", assignment);
View Full Code Here

     */
    protected List<String> getParticipantsByPlugin(PackageParticipant participant, String processDefId, String processId, String version, String activityId) {
        List<String> resultList = new ArrayList<String>();
        ApplicationContext appContext = AppUtil.getApplicationContext();
        WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");
        PluginManager pluginManager = (PluginManager) appContext.getBean("pluginManager");
        String properties = participant.getPluginProperties();
        String participantId = participant.getParticipantId();
        try {
            AppDefinition appDef = AppUtil.getCurrentAppDefinition();
            ParticipantPlugin plugin = (ParticipantPlugin) pluginManager.getPlugin(participant.getValue());
            Map propertyMap = AppPluginUtil.getDefaultProperties((Plugin)plugin, properties, appDef);
            propertyMap.put("pluginManager", pluginManager);
            WorkflowActivity activity = workflowManager.getActivityById(activityId);
            propertyMap.put("workflowActivity", activity);
           
View Full Code Here

        auditTrailManager.addAuditTrail(clazz, method, message);
    }

    @Override
    public WorkflowDeadline executeDeadlinePlugin(String processId, String activityId, WorkflowDeadline deadline, Date processStartedTime, Date activityAcceptedTime, Date activityActivatedTime) {
        PluginManager pluginManager = (PluginManager) AppUtil.getApplicationContext().getBean("pluginManager");
        PackageDefinitionDao packageDefinitionDao = (PackageDefinitionDao) AppUtil.getApplicationContext().getBean("packageDefinitionDao");
        WorkflowManager workflowManager = (WorkflowManager) AppUtil.getApplicationContext().getBean("workflowManager");

        Collection<Plugin> pluginList = pluginManager.list(DeadlinePlugin.class);
        for (Plugin plugin : pluginList) {
            DeadlinePlugin p = (DeadlinePlugin) plugin;
            try {
                AppDefinition appDef = null;
View Full Code Here

        return propertyMap;
    }
   
    public static String getMessage(String key, String pluginName, String translationPath){
        PluginManager pluginManager = (PluginManager) appContext.getBean("pluginManager");
        return pluginManager.getMessage(key, pluginName, translationPath);
    }
View Full Code Here

     */
    public String getDefaultUserviewTheme() {
        String className = ResourceBundleUtil.getMessage("userview.default.theme.classname");
       
        if (className != null && !className.isEmpty()) {
            PluginManager pluginManager = (PluginManager) AppUtil.getApplicationContext().getBean("pluginManager");
            Plugin plugin = pluginManager.getPlugin(className);
            if (plugin != null && plugin instanceof UserviewTheme) {
                return className;
            }
        }
       
View Full Code Here

TOP

Related Classes of org.joget.plugin.base.PluginManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.