Package pl.net.bluesoft.rnd.processtool.plugins

Examples of pl.net.bluesoft.rnd.processtool.plugins.ProcessToolRegistry


        }
    }

  public static Map<BundleItem, Collection<WidgetItem>> loadAvailableWidgets(Application application)
            throws ClassNotFoundException {
    ProcessToolRegistry reg = GenericEditorApplication.getRegistry();
        I18NSource i18NSource = I18NSource.ThreadUtil.getThreadI18nSource();

    Map<BundleItem, Collection<WidgetItem>> availableWidgets = new HashMap<BundleItem, Collection<WidgetItem>>();

        Map<String, Class<? extends ProcessToolWidget>> registeredWidgets = reg.getAvailableWidgets();
        if (registeredWidgets == null || registeredWidgets.size() == 0) {
            return  availableWidgets;
        }

        // Widgets are available in registry by both @AliasName and their class name
View Full Code Here


  private ProcessToolWidget getWidget(ProcessStateWidget w, ProcessStateConfiguration stateConfiguration, ProcessToolContext ctx,
                    String generatorKey, WidgetEventBus widgetEventBus) {
    ProcessToolWidget processToolWidget;
    try {
      ProcessToolRegistry toolRegistry = VaadinUtility.getProcessToolContext(application.getContext()).getRegistry();
      processToolWidget = w.getClassName() == null ? toolRegistry.makeWidget(w.getName()) : toolRegistry.makeWidget(w.getClassName());
      processToolWidget.setContext(stateConfiguration, w, i18NSource, bpmSession, application,
                                   bpmSession.getPermissionsForWidget(w, ctx), isOwner);
      processToolWidget.setGeneratorKey(generatorKey);
      processToolWidget.setWidgetEventBus(widgetEventBus);
      if (processToolWidget instanceof ProcessToolDataWidget) {
View Full Code Here

    application.getJsHelper().postAndRedirectStep(url, json);
  }

 
  private Class<?> getStepClass(String stepType) {
    ProcessToolRegistry reg = GenericEditorApplication.getRegistry();
        Map<String,ProcessToolProcessStep> availableSteps = reg.getAvailableSteps();
        for (ProcessToolProcessStep stepInstance : availableSteps.values()) {
            Class stepClass = stepInstance.getClass();
            AliasName a = Classes.getClassAnnotation(stepClass, AliasName.class);
            if (stepType.equals(a.name())) {
              return stepClass;
View Full Code Here

    protected void handleRequest(final PortletRequest request, final PortletResponse response) throws PortletException, IOException {
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
        try {

            ProcessToolRegistry registry = (ProcessToolRegistry) getPortletConfig()
                    .getPortletContext().getAttribute(ProcessToolRegistry.class.getName());
            registry.withProcessToolContext(new ProcessToolContextCallback() {
                @Override
                public void withContext(ProcessToolContext ctx) {
                    ProcessToolContext.Util.setThreadProcessToolContext(ctx);
                    try {
                        try {
View Full Code Here

    }

    private void displayDefinitionList() {
        definitionList.removeAllComponents();
        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        ProcessToolRegistry registry = ctx.getRegistry();
        ProcessDefinitionDAO dao = registry.getProcessDefinitionDAO(ctx.getHibernateSession());
        List<ProcessDefinitionConfig> latestConfigurations = new ArrayList(dao.getActiveConfigurations());
        Collections.sort(latestConfigurations, ProcessDefinitionConfig.DEFAULT_COMPARATOR);

        for (final ProcessDefinitionConfig cfg : latestConfigurations) {
            HorizontalLayout buttonLayout = new HorizontalLayout();
            buttonLayout.setSpacing(true);

            buttonLayout.addComponent(linkButton(getLocalizedMessage(!cfg.getEnabled() ? "processdefinitions.console.enable" : "processdefinitions.console.disable"),
                    new Runnable() {
                        @Override
                        public void run() {
                            ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
                            final ProcessToolRegistry registry = ctx.getRegistry();
                            final ProcessDefinitionDAO dao = registry.getProcessDefinitionDAO(ctx.getHibernateSession());
                            dao.setConfigurationEnabled(cfg, !cfg.getEnabled());
                            String msg = getLocalizedMessage(!cfg.getEnabled() ? "processdefinitions.console.enable.success" : "processdefinitions.console.disable.success");
                            Window.Notification n = new Window.Notification(msg);
                            n.setDelayMsec(-1);
                            getApplication().getMainWindow().showNotification(n);
View Full Code Here

                        + getLocalizedMessage("processdefinitions.console.uploadedon") + " " + formatFullDate(cfg.getCreateDate()));
    }

    private VerticalLayout getHistoryPanel(ProcessDefinitionConfig cfg) {
        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        final ProcessToolRegistry registry = ctx.getRegistry();
        final ProcessDefinitionDAO dao = registry.getProcessDefinitionDAO(ctx.getHibernateSession());
        List<ProcessDefinitionConfig> configurationVersions = new ArrayList<ProcessDefinitionConfig>(dao.getConfigurationVersions(cfg));
        Collections.sort(configurationVersions, ProcessDefinitionConfig.DEFAULT_COMPARATOR);

        VerticalLayout vl = new VerticalLayout();
        vl.setWidth("100%");
View Full Code Here

        // to preserve functionality used in portlet based Vaadin applications
        ServletContext servletContext = request.getSession().getServletContext();
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
        try {
            ProcessToolRegistry registry = (ProcessToolRegistry) servletContext.getAttribute(ProcessToolRegistry.class.getName());

            final String providerId = "step-editor";
            if (!registry.hasI18NProvider(providerId)) {
                registry.registerI18NProvider(
                        new PropertiesBasedI18NProvider(new PropertyLoader() {
                            @Override
                            public InputStream loadProperty(String path) throws IOException {
                                return getClass().getClassLoader().getResourceAsStream(path);
                            }
                        }, providerId + "-messages"),
                        providerId
                );
            }

            registry.withProcessToolContext(new ProcessToolContextCallback() {
                @Override
                public void withContext(ProcessToolContext ctx) {
                    ProcessToolContext.Util.setThreadProcessToolContext(ctx);
                }
            });
View Full Code Here

    }

    @Override
    public void loadData() {
        processLogoEditor.loadData();
    ProcessToolRegistry registry = ((ProcessEditorApplication)ProcessEditorApplication.getCurrent()).getRegistry();
    for (String taskItemClass : from(registry.getAvailableTaskItemProviders().keySet()).ordered()) {
      taskItemClassField.addItem(taskItemClass);
    }
    taskItemClassField.setValue(processConfig.getTaskItemClass());
    }
View Full Code Here

    private final Logger logger = Logger.getLogger(Activator.class.getName());

    @Override
    public void start(BundleContext bundleContext) throws Exception {
        final ProcessToolRegistry toolRegistry = getRegistry(bundleContext);
        toolRegistry.registerModelExtension(FilesCheckerConfiguration.class);
        toolRegistry.registerModelExtension(FilesCheckerRuleConfiguration.class);

    toolRegistry.commitModelExtensions();
//
//        toolRegistry.commitModelExtensions();
        new Thread(new Runnable() {

            @Override
            public void run() {
                run = true;
                while (run) {
                    try {
                        Thread.sleep(10000);
                        try {
                            toolRegistry.withProcessToolContext(new ProcessToolContextCallback() {
                                @Override
                                public void withContext(ProcessToolContext ctx) {
                                    ProcessToolContext.Util.setThreadProcessToolContext(ctx);
                                    try {
                                        new FilesChecker(ctx).run();
View Full Code Here

  private final Logger logger = Logger.getLogger(Activator.class.getName());

  @Override
  public void start(final BundleContext context) throws Exception {

    final ProcessToolRegistry toolRegistry = getRegistry(context);
    toolRegistry.registerModelExtension(EmailCheckerConfiguration.class);
    toolRegistry.registerModelExtension(EmailCheckerRuleConfiguration.class);
    toolRegistry.commitModelExtensions();
    new Thread(new Runnable() {

      @Override
      public void run() {
        run = true;
        while (run) {
          try {
            Thread.sleep(10000);
            try {
              toolRegistry.withProcessToolContext(new ProcessToolContextCallback() {
                @Override
                public void withContext(ProcessToolContext ctx) {
                  ProcessToolContext.Util.setThreadProcessToolContext(ctx);
                  try {
                    new EmailChecker(ctx).run();
View Full Code Here

TOP

Related Classes of pl.net.bluesoft.rnd.processtool.plugins.ProcessToolRegistry

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.