Search in sources :

Example 1 with RSConnectPublishResult

use of org.rstudio.studio.client.rsconnect.model.RSConnectPublishResult in project rstudio by rstudio.

the class RSConnect method publishWithWizard.

private void publishWithWizard(final RSConnectPublishInput input) {
    RSConnectPublishWizard wizard = new RSConnectPublishWizard(input, new ProgressOperationWithInput<RSConnectPublishResult>() {

        @Override
        public void execute(RSConnectPublishResult result, ProgressIndicator indicator) {
            switch(result.getPublishType()) {
                case RSConnectPublishResult.PUBLISH_STATIC:
                case RSConnectPublishResult.PUBLISH_CODE:
                    // always launch the browser--the wizard implies we're 
                    // doing a first-time publish, and we may need to do some
                    // post-publish configuration
                    fireRSConnectPublishEvent(result, true);
                    indicator.onCompleted();
                    break;
                case RSConnectPublishResult.PUBLISH_RPUBS:
                    uploadToRPubs(input, result, indicator);
                    break;
            }
        }
    });
    wizard.showModal();
}
Also used : ProgressIndicator(org.rstudio.core.client.widget.ProgressIndicator) RSConnectPublishResult(org.rstudio.studio.client.rsconnect.model.RSConnectPublishResult) RSConnectPublishWizard(org.rstudio.studio.client.rsconnect.ui.RSConnectPublishWizard)

Example 2 with RSConnectPublishResult

use of org.rstudio.studio.client.rsconnect.model.RSConnectPublishResult in project rstudio by rstudio.

the class RSConnectDeploy method getResult.

public RSConnectPublishResult getResult() {
    // compose the list of files that have been manually added; we want to
    // include all the ones the user added but didn't later uncheck, so
    // cross-reference the list we kept with the one returned by the dialog
    ArrayList<String> deployFiles = getFileList();
    ArrayList<String> additionalFiles = new ArrayList<String>();
    for (String filePath : filesAddedManually_) {
        if (deployFiles.contains(filePath)) {
            additionalFiles.add(filePath);
        }
    }
    String appTitle = appName_.getTitle();
    // if we're redeploying to the same account, use the previous app name;
    // otherwise, read the new name the user's entered
    String appName = isUpdate() ? fromPrevious_.getName() : appName_.getName();
    // new content
    if (fromPrevious_ == null && !getSelectedAccount().equals(prefs_.preferredPublishAccount().getGlobalValue())) {
        prefs_.preferredPublishAccount().setGlobalValue(getSelectedAccount());
        prefs_.writeUIPrefs();
    }
    return new RSConnectPublishResult(appName, isUpdate() ? null : appTitle, getSelectedAccount(), source_, new RSConnectPublishSettings(deployFiles, additionalFiles, getIgnoredFileList(), asMultipleRmd_, asStatic_), isUpdate());
}
Also used : RSConnectPublishSettings(org.rstudio.studio.client.rsconnect.model.RSConnectPublishSettings) ArrayList(java.util.ArrayList) RSConnectPublishResult(org.rstudio.studio.client.rsconnect.model.RSConnectPublishResult)

Aggregations

RSConnectPublishResult (org.rstudio.studio.client.rsconnect.model.RSConnectPublishResult)2 ArrayList (java.util.ArrayList)1 ProgressIndicator (org.rstudio.core.client.widget.ProgressIndicator)1 RSConnectPublishSettings (org.rstudio.studio.client.rsconnect.model.RSConnectPublishSettings)1 RSConnectPublishWizard (org.rstudio.studio.client.rsconnect.ui.RSConnectPublishWizard)1