Search in sources :

Example 1 with RSConnectPublishSettings

use of org.rstudio.studio.client.rsconnect.model.RSConnectPublishSettings 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)

Example 2 with RSConnectPublishSettings

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

the class RSConnect method deployToRSConnect.

private void deployToRSConnect(String sourceFile, String deployDir, String deployFile, String websiteDir, String description, JsArrayString deployFiles, JsArrayString additionalFiles, JsArrayString ignoredFiles, boolean isSelfContained, boolean isShiny, boolean asMultiple, boolean asStatic, boolean launch, JavaScriptObject jsoRecord) {
    // front if we can
    if (Desktop.isDesktop())
        Desktop.getFrame().bringMainFrameToFront();
    else
        WindowEx.get().focus();
    ArrayList<String> deployFilesList = JsArrayUtil.fromJsArrayString(deployFiles);
    ArrayList<String> additionalFilesList = JsArrayUtil.fromJsArrayString(additionalFiles);
    ArrayList<String> ignoredFilesList = JsArrayUtil.fromJsArrayString(ignoredFiles);
    RSConnectDeploymentRecord record = jsoRecord.cast();
    events_.fireEvent(new RSConnectDeployInitiatedEvent(new RSConnectPublishSource(sourceFile, deployDir, deployFile, websiteDir, isSelfContained, asStatic, isShiny, description), new RSConnectPublishSettings(deployFilesList, additionalFilesList, ignoredFilesList, asMultiple, asStatic), launch, record));
}
Also used : RSConnectPublishSettings(org.rstudio.studio.client.rsconnect.model.RSConnectPublishSettings) RSConnectDeployInitiatedEvent(org.rstudio.studio.client.rsconnect.events.RSConnectDeployInitiatedEvent) JsArrayString(com.google.gwt.core.client.JsArrayString) RSConnectDeploymentRecord(org.rstudio.studio.client.rsconnect.model.RSConnectDeploymentRecord) RSConnectPublishSource(org.rstudio.studio.client.rsconnect.model.RSConnectPublishSource)

Aggregations

RSConnectPublishSettings (org.rstudio.studio.client.rsconnect.model.RSConnectPublishSettings)2 JsArrayString (com.google.gwt.core.client.JsArrayString)1 ArrayList (java.util.ArrayList)1 RSConnectDeployInitiatedEvent (org.rstudio.studio.client.rsconnect.events.RSConnectDeployInitiatedEvent)1 RSConnectDeploymentRecord (org.rstudio.studio.client.rsconnect.model.RSConnectDeploymentRecord)1 RSConnectPublishResult (org.rstudio.studio.client.rsconnect.model.RSConnectPublishResult)1 RSConnectPublishSource (org.rstudio.studio.client.rsconnect.model.RSConnectPublishSource)1