Esempio n. 1
0
  private void performCheckIn(String comment, final boolean closeAfter, final Asset asset) {
    asset.setCheckinComment(comment);
    final boolean[] saved = {false};

    if (!saved[0]) LoadingPopup.showMessage(constants.SavingPleaseWait());
    RepositoryServiceFactory.getAssetService()
        .checkinVersion(
            asset,
            new GenericCallback<String>() {

              public void onSuccess(String uuid) {
                if (uuid == null) {
                  ErrorPopup.showMessage(
                      constants.FailedToCheckInTheItemPleaseContactYourSystemAdministrator());
                  return;
                }

                if (uuid.startsWith("ERR")) { // NON-NLS
                  ErrorPopup.showMessage(uuid.substring(5));
                  return;
                }

                flushSuggestionCompletionCache(asset.getMetaData().getModuleName(), asset);
                /*                        if ( editor instanceof DirtyableComposite ) {
                    ((DirtyableComposite) editor).resetDirty();
                }*/

                LoadingPopup.close();
                saved[0] = true;

                // showInfoMessage( constants.SavedOK() );
                if (!closeAfter) {
                  eventBus.fireEvent(
                      new RefreshAssetEditorEvent(asset.getMetaData().getModuleName(), uuid));
                }

                // fire after check-in event
                eventBus.fireEvent(new AfterAssetEditorCheckInEvent(uuid, MultiViewEditor.this));
              }
            });
  }