Package org.drools.guvnor.client.rpc

Examples of org.drools.guvnor.client.rpc.RepositoryServiceAsync


     *
     * @param config
     */
    protected void save(final NewAssetWithContentConfiguration< ? extends PortableObject> config,
                        final T content) {
        RepositoryServiceAsync repositoryService = GWT.create( RepositoryService.class );
        repositoryService.createNewRule( config,
                                         createCreateAssetCallback( content ) );
    }
View Full Code Here


public class SampleRepositoryInstaller {

    //Only ask for installation for the first time.
    public static void askToInstall() {
        final RepositoryServiceAsync repositoryService = GWT.create(RepositoryService.class);
        repositoryService.isDoNotInstallSample(
                new GenericCallback<Boolean>() {
                    public void onSuccess(Boolean isDoNotInstallSample) {
                        if (!isDoNotInstallSample) {
                            repositoryService.setDoNotInstallSample(
                                    new GenericCallback<Void>() {
                                        public void onSuccess(Void v) {
                                        }
                                    });
                            new NewRepositoryDialog().show();
View Full Code Here

                                 new BackupManager() );
                break;

            case 4 :
                EventLogPresenter.EventLogView eventLogView = new EventLogViewImpl();
                RepositoryServiceAsync repositoryService = RepositoryServiceFactory.getService();
                new EventLogPresenter( repositoryService,
                                       eventLogView );
                tabbedPanel.add( constants.EventLog(),
                                 eventLogView );
                break;
View Full Code Here

                        new BackupManager());
                break;

            case 4:
                EventLogPresenter.EventLogView eventLogView = new EventLogViewImpl();
                RepositoryServiceAsync repositoryService = RepositoryServiceFactory.getService();
                new EventLogPresenter(repositoryService,
                        eventLogView);
                tabbedPanel.add(constants.EventLog(),
                        eventLogView);
                break;
View Full Code Here

        } );
        return btn;
    }

    private Button getCopyButton(final String snapshotName, final String packageName) {
        final RepositoryServiceAsync serv = RepositoryServiceFactory.getService();
        Button btn = new Button( constants.Copy() );
        btn.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent event) {
                serv.listSnapshots( packageName, createGenericCallback( snapshotName, packageName, serv ) );
            }
        } );
        return btn;
    }
View Full Code Here

        });
        return btn;
    }

    private Button getCopyButton(final String snapshotName, final String packageName) {
        final RepositoryServiceAsync serv = RepositoryServiceFactory.getService();
        Button btn = new Button(constants.Copy());
        btn.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                serv.listSnapshots(packageName, new GenericCallback<SnapshotInfo[]>() {
                    public void onSuccess(final SnapshotInfo[] snaps) {
                        final FormStylePopup copy = new FormStylePopup("images/snapshot.png", Format.format(constants.CopySnapshotText(), snapshotName));
                        final TextBox box = new TextBox();
                        final List<RadioButton> options = new ArrayList<RadioButton>();
                        VerticalPanel vert = new VerticalPanel();
            for (int i = 0; i < snaps.length; i++) {
              RadioButton existing = new RadioButton(
                  "snapshotNameGroup", snaps[i].name);   //NON-NLS
              options.add(existing);
              vert.add(existing);
            }
            final RadioButton newBut = new RadioButton("snapshotNameGroup", "NEW NAME");   //NON-NLS
            vert.add(newBut);

            copy.addAttribute(constants.ExistingSnapshots(), vert);
            copy.addAttribute(constants.NewSnapshotNameIs(), box );
                        Button ok = new Button(constants.OK());
                        copy.addAttribute( "", ok );
                        ok.addClickListener( new ClickListener() {
                            public void onClick(Widget w) {
                              if (newBut.isChecked()) {
                                if (checkUnique(snaps, box.getText())) {
                                    serv.copyOrRemoveSnapshot( packageName, snapshotName, false, box.getText(), new GenericCallback() {
                                        public void onSuccess(Object data) {
                                            copy.hide();
                                                Window.alert(Format.format(constants.CreatedSnapshot0ForPackage1(), box.getText(), packageName));
                                        }
                                    });
                                }
                              } else {
                                for (RadioButton rb : options) {
                                  if (rb.isChecked()) {
                                    final String newName = rb.getText();
                                        serv.copyOrRemoveSnapshot( packageName, snapshotName, false, newName, new GenericCallback() {
                                            public void onSuccess(Object data) {
                                                copy.hide();
                                                    Window.alert(Format.format(constants.Snapshot0ForPackage1WasCopiedFrom2(), newName, packageName, snapshotName));
                                            }
                                        });
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.rpc.RepositoryServiceAsync

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.