Package org.useware.kernel.model

Examples of org.useware.kernel.model.Dialog


        dialogs.add(new ServletContainerExample());
        dialogs.add(new UndertowServerExample());
    }
    @Override
    public Dialog getDialog(String name) {
        Dialog dialog = null;

        for(Sample sample : dialogs)
        {
            if(sample.getName().equals(name))
            {
View Full Code Here


                    .mappedBy(global)
                    .add(attributes).mappedBy(attributesMapping)
                .end()
        .build();

        Dialog dialog = new Dialog(QName.valueOf("org.jboss.as:servlet-container"), root);
        return dialog;
    }
View Full Code Here

                    .start(filter).end()
                    .start(errorHandler).end()
                .end()
        .build();

        Dialog dialog = new Dialog(QName.valueOf("org.jboss.as:undertow-subsystem"), root);
        return dialog;
    }
View Full Code Here

        if (null == cachedWidgets.get(name) )
        {

            // fetch dialog meta data
            final Dialog dialog  =  repository.getDialog(name);

            // create coordinator instance
            final InteractionCoordinator coordinator = new InteractionCoordinator(
                    dialog, globalContext, this
            );
            coordinators.put(name, coordinator);

            // top level interaction unit & context
            final Context context = new Context();

            // build reification pipeline
            Function<Context> prepareContext = new Function<Context>() {
                @Override
                public void execute(Control<Context> control) {
                    context.set(ContextKey.EVENTBUS, coordinator.getLocalBus());
                    context.set(ContextKey.COORDINATOR, coordinator);

                    control.proceed();
                }
            };

            Function<Context> readOperationMetaData = new Function<Context>() {
                @Override
                public void execute(final Control<Context> control) {
                    ReadOperationDescriptions operationMetaData = new ReadOperationDescriptions(framework.getDispatcher());
                    operationMetaData.prepareAsync(dialog, context, new ReificationBootstrap.Callback()
                    {
                        @Override
                        public void onError(Throwable caught) {
                            Log.error("ReadOperationDescriptions failed: " + caught.getMessage(), caught);
                            control.abort();
                        }

                        @Override
                        public void onSuccess() {
                            Log.info("Successfully retrieved operation meta data");
                            control.proceed();
                        }
                    });
                }
            };

            Function<Context> readResourceMetaData = new Function<Context>() {
                @Override
                public void execute(final Control<Context> control) {
                    ReificationBootstrap readResourceDescription = new ReadResourceDescription(framework.getDispatcher());
                    readResourceDescription.prepareAsync(dialog, context, new ReificationBootstrap.Callback()
                    {
                        @Override
                        public void onSuccess()
                        {
                            Log.info("Successfully retrieved resource meta data");

                            // setup & start the reification pipeline
                            ReificationPipeline pipeline = new ReificationPipeline(
                                    new UniqueIdCheckStep(),
                                    new BuildUserInterfaceStep(),
                                    new ImplicitBehaviourStep(framework.getDispatcher()),
                                    new IntegrityStep());

                            pipeline.execute(dialog, context);

                            control.proceed();
                        }

                        @Override
                        public void onError(final Throwable caught)
                        {
                            Log.error("ReadResourceDescription failed: " + caught.getMessage(), caught);
                            control.abort();
                        }
                    });
                }
            };

            Outcome<Context> outcome = new Outcome<Context>() {
                @Override
                public void onFailure(final Context context) {
                    Window.alert("Reification failed");
                }

                @Override
                public void onSuccess(final Context context) {
                    // show result
                    ReificationWidget widget = context.get(ContextKey.WIDGET);
                    assert widget !=null;

                    cachedWidgets.put(name, widget);
                    BranchActivation activation = new BranchActivation();
                    dialog.getInterfaceModel().accept(activation);
                    //System.out.println("<< Default Activation: "+activation.getCandidate()+">>");

                    callback.onSuccess(widget.asWidget());
                }
            };
View Full Code Here

        if (null == cachedWidgets.get(name) || this.enableCache == false)
        {

            // fetch dialog meta data
            final Dialog dialog  =  repository.getDialog(name);

            // create coordinator instance
            final InteractionCoordinator coordinator = new InteractionCoordinator(
                    dialog, globalContext, this
            );
            coordinators.put(name, coordinator);

            // top level interaction unit & context
            final Context context = new Context();

            final ProgressWindow progress = new ProgressWindow("Building Dialog");


            // build reification pipeline
            Function<Context> prepareContext = new Function<Context>() {
                @Override
                public void execute(Control<Context> control) {
                    context.set(ContextKey.EVENTBUS, coordinator.getLocalBus());
                    context.set(ContextKey.COORDINATOR, coordinator);
                    context.set(ContextKey.SECURITY_CONTEXT, framework.getSecurityFramework());
                    control.proceed();
                }
            };

            Function<Context> readOperationMetaData = new Function<Context>() {
                @Override
                public void execute(final Control<Context> control) {

                    ReadOperationDescriptions operationMetaData = new ReadOperationDescriptions(framework.getDispatcher());
                    operationMetaData.prepareAsync(dialog, context, new ReificationBootstrap.Callback()
                    {
                        @Override
                        public void onError(Throwable caught) {
                            Log.error("ReadOperationDescriptions failed: " + caught.getMessage(), caught);
                            progress.getBar().setProgress(25.0);
                            control.abort();
                        }

                        @Override
                        public void onSuccess() {
                            Log.info("Successfully retrieved operation meta data");
                            progress.getBar().setProgress(25.0);
                            control.proceed();
                        }
                    });
                }
            };

            Function<Context> createSecurityContext = new Function<Context>() {
                @Override
                public void execute(final Control<Context> control) {

                    SecurityFramework securityFramework = framework.getSecurityFramework();

                    RequiredResources resourceVisitor = new RequiredResources();
                    dialog.getInterfaceModel().accept(resourceVisitor);

                    securityFramework.createSecurityContext(activeDialog, resourceVisitor.getRequiredresources(),
                            new AsyncCallback<SecurityContext>() {
                                @Override
                                public void onFailure(Throwable caught) {
                                    Console.error("Failed to create security context", caught.getMessage());
                                    progress.getBar().setProgress(50.0);
                                    control.abort();
                                }

                                @Override
                                public void onSuccess(SecurityContext result) {
                                    control.getContext().set(ContextKey.SECURITY_CONTEXT, result);
                                    progress.getBar().setProgress(50.0);
                                    control.proceed();
                                }
                            }
                    );

                }
            };


            Function<Context> readResourceMetaData = new Function<Context>() {
                @Override
                public void execute(final Control<Context> control) {
                    ReificationBootstrap readResourceDescription = new ReadResourceDescription(framework.getDispatcher());
                    readResourceDescription.prepareAsync(dialog, context, new ReificationBootstrap.Callback()
                    {
                        @Override
                        public void onSuccess()
                        {
                            Log.info("Successfully retrieved resource meta data");

                            // setup & start the reification pipeline
                            ReificationPipeline pipeline = new ReificationPipeline(
                                    new UniqueIdCheckStep(),
                                    new BuildUserInterfaceStep(),
                                    new ImplicitBehaviourStep(framework.getDispatcher()),
                                    new IntegrityStep());

                            pipeline.execute(dialog, context);

                            progress.getBar().setProgress(100.0);

                            control.proceed();
                        }

                        @Override
                        public void onError(final Throwable caught)
                        {
                            Log.error("ReadResourceDescription failed: " + caught.getMessage(), caught);
                            progress.getBar().setProgress(100.0);
                            control.abort();
                        }
                    });
                }
            };

            Outcome<Context> outcome = new Outcome<Context>() {
                @Override
                public void onFailure(final Context context) {

                    progress.hide();
                    Window.alert("Reification failed");
                }

                @Override
                public void onSuccess(final Context context) {

                    progress.hide();

                    // show result
                    ReificationWidget widget = context.get(ContextKey.WIDGET);
                    assert widget !=null;

                    cachedWidgets.put(name, widget);
                    BranchActivation activation = new BranchActivation();
                    dialog.getInterfaceModel().accept(activation);
                    //System.out.println("<< Default Activation: "+activation.getCandidate()+">>");

                    callback.onSuccess(widget.asWidget());
                }
            };
View Full Code Here

        return samples;
    }

    @Override
    public Dialog getDialog(String name) {
        Dialog dialog = null;

        for(Sample sample : samples)
        {
            if(sample.getName().equals(name))
            {
View Full Code Here

        dialogs.add(new UndertowServerExample());
        dialogs.add(new IOSubsystemExample());
    }
    @Override
    public Dialog getDialog(String name) {
        Dialog dialog = null;

        for(Sample sample : dialogs)
        {
            if(sample.getName().equals(name))
            {
View Full Code Here

        if (null == cachedWidgets.get(name) || this.enableCache == false)
        {

            // fetch dialog meta data
            final Dialog dialog  =  repository.getDialog(name);

            // create coordinator instance
            final InteractionCoordinator coordinator = new InteractionCoordinator(
                    dialog, globalContext, this
            );
            coordinators.put(name, coordinator);

            // top level interaction unit & context
            final Context context = new Context();

            final ProgressWindow progress = new ProgressWindow("Building Dialog");


            // build reification pipeline
            Function<Context> prepareContext = new Function<Context>() {
                @Override
                public void execute(Control<Context> control) {
                    context.set(ContextKey.EVENTBUS, coordinator.getLocalBus());
                    context.set(ContextKey.COORDINATOR, coordinator);

                    control.proceed();
                }
            };

            Function<Context> readOperationMetaData = new Function<Context>() {
                @Override
                public void execute(final Control<Context> control) {

                    ReadOperationDescriptions operationMetaData = new ReadOperationDescriptions(framework.getDispatcher());
                    operationMetaData.prepareAsync(dialog, context, new ReificationBootstrap.Callback()
                    {
                        @Override
                        public void onError(Throwable caught) {
                            Log.error("ReadOperationDescriptions failed: " + caught.getMessage(), caught);
                            progress.getBar().setProgress(50.0);
                            control.abort();
                        }

                        @Override
                        public void onSuccess() {
                            Log.info("Successfully retrieved operation meta data");
                            progress.getBar().setProgress(50.0);
                            control.proceed();
                        }
                    });
                }
            };

            Function<Context> readResourceMetaData = new Function<Context>() {
                @Override
                public void execute(final Control<Context> control) {
                    ReificationBootstrap readResourceDescription = new ReadResourceDescription(framework.getDispatcher());
                    readResourceDescription.prepareAsync(dialog, context, new ReificationBootstrap.Callback()
                    {
                        @Override
                        public void onSuccess()
                        {
                            Log.info("Successfully retrieved resource meta data");

                            // setup & start the reification pipeline
                            ReificationPipeline pipeline = new ReificationPipeline(
                                    new UniqueIdCheckStep(),
                                    new BuildUserInterfaceStep(),
                                    new ImplicitBehaviourStep(framework.getDispatcher()),
                                    new IntegrityStep());

                            pipeline.execute(dialog, context);

                            progress.getBar().setProgress(100.0);

                            control.proceed();
                        }

                        @Override
                        public void onError(final Throwable caught)
                        {
                            Log.error("ReadResourceDescription failed: " + caught.getMessage(), caught);
                            progress.getBar().setProgress(100.0);
                            control.abort();
                        }
                    });
                }
            };

            Outcome<Context> outcome = new Outcome<Context>() {
                @Override
                public void onFailure(final Context context) {

                    progress.hide();
                    Window.alert("Reification failed");
                }

                @Override
                public void onSuccess(final Context context) {

                    progress.hide();

                    // show result
                    ReificationWidget widget = context.get(ContextKey.WIDGET);
                    assert widget !=null;

                    cachedWidgets.put(name, widget);
                    BranchActivation activation = new BranchActivation();
                    dialog.getInterfaceModel().accept(activation);
                    //System.out.println("<< Default Activation: "+activation.getCandidate()+">>");

                    callback.onSuccess(widget.asWidget());
                }
            };
View Full Code Here

                .end()

                .build();

        Dialog dialog = new Dialog(QName.valueOf("org.jboss.as:datasource-subsystem"), root);
        return dialog;
    }
View Full Code Here


                .end()
        .build();

        Dialog dialog = new Dialog(QName.valueOf("org.jboss.as:undertow-subsystem"), root);
        return dialog;
    }
View Full Code Here

TOP

Related Classes of org.useware.kernel.model.Dialog

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.