Exemplo n.º 1
0
    protected void btnOk_OnClick(object sender, EventArgs e)
    {
        pnlLog.Visible     = true;
        pnlContent.Visible = false;

        CurrentError = string.Empty;
        CurrentLog.Close();
        EnsureLog();

        int    actionValue = ValidationHelper.GetInteger(drpAction.SelectedValue, 0);
        Action action      = (Action)actionValue;

        int whatValue = ValidationHelper.GetInteger(drpWhat.SelectedValue, 0);

        currentWhat = (What)whatValue;

        ctlAsync.Parameter = currentUser;
        switch (action)
        {
        case Action.PublishAndFinish:
            // Publish and finish workflow
            titleElemAsync.TitleText  = GetString("content.publishingdocuments");
            titleElemAsync.TitleImage = GetImageUrl("CMSModules/CMS_Workflows/publish.png");
            ctlAsync.RunAsync(PublishAndFinish, WindowsIdentity.GetCurrent());
            break;

        case Action.RemoveWorkflow:
            // Remove workflow
            titleElemAsync.TitleText  = GetString("workflowdocuments.removingwf");
            titleElemAsync.TitleImage = GetImageUrl("CMSModules/CMS_Workflows/removeworkflow.png");
            ctlAsync.RunAsync(RemoveWorkflow, WindowsIdentity.GetCurrent());
            break;
        }
    }
 private void ctlAsync_OnFinished(object sender, EventArgs e)
 {
     DestroyLog();
     ClearSelection();
     if (HandlePossibleErrors())
     {
         // If error occurred
         if (multiple)
         {
             RefreshListing();
         }
         else
         {
             RefreshContentTree();
         }
     }
     else
     {
         string refreshScript = ValidationHelper.GetString(ctlAsync.Parameter, string.Empty);
         if (!string.IsNullOrEmpty(refreshScript))
         {
             AddScript(refreshScript);
         }
         CloseDialog();
     }
     // Finalize log context
     CurrentLog.Close();
 }
    /// <summary>
    /// Runs async thread.
    /// </summary>
    /// <param name="action">Method to run</param>
    protected void RunAsync(AsyncAction action)
    {
        pnlLog.Visible        = true;
        pnlGeneralTab.Visible = false;

        CurrentLog.Close();
        CurrentError = string.Empty;

        bool copyPerm = CopyPermissions && sameSite;

        AddScript("InitializeLog();");
        switch (CurrentAction)
        {
        case Action.Copy:
            ctlAsync.Parameter = ValidationHelper.GetBoolean(WindowHelper.GetItem(Action.Copy + underlying), false) + ";" + copyPerm;
            break;

        case Action.Link:
        case Action.LinkDoc:
            ctlAsync.Parameter = ValidationHelper.GetBoolean(WindowHelper.GetItem(Action.Link + underlying), false) + ";" + copyPerm;
            break;

        case Action.Move:
            ctlAsync.Parameter = copyPerm;
            break;
        }
        ctlAsync.RunAsync(action, WindowsIdentity.GetCurrent());
    }
Exemplo n.º 4
0
 private void ctlAsync_OnCancel(object sender, EventArgs e)
 {
     CurrentError    = GetString(canceledString);
     ltlScript.Text += ScriptHelper.GetScript("var __pendingCallbacks = new Array();");
     lblError.Text   = CurrentError;
     CurrentLog.Close();
 }
Exemplo n.º 5
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        // For root, the additional checkbox must be checked
        if (plcDeleteRoot.Visible && !chkDeleteRoot.Checked)
        {
            ShowError(ResHelper.GetString("delete.rootnotchecked"));
            return;
        }

        // Check whether path is selected
        if (chkUseDeletedPath.Checked && String.IsNullOrEmpty(Convert.ToString(selAltPath.Value)))
        {
            ShowError(ResHelper.GetString("content.delete.altpathempty"));
            return;
        }

        string deleteMode = pnlDeleteRoot.Visible ? "rootoptions" : "documentoptions";

        pnlLog.Visible     = true;
        pnlContent.Visible = false;

        CurrentError = string.Empty;
        CurrentLog.Close();
        EnsureLog();

        ctlAsync.Parameter = CultureCode + ";" + currentSite.SiteName + ";" + IsMultipleAction + ";" + AllLevels + ";" + deleteMode;
        ctlAsync.RunAsync(Delete, WindowsIdentity.GetCurrent());
    }
Exemplo n.º 6
0
 /// <summary>
 /// On finished event
 /// </summary>
 private void ctlAsync_OnFinished(object sender, EventArgs e)
 {
     lblError.Text = CurrentError;
     CurrentLog.Close();
     pnlLog.Visible  = false;
     pnlGrid.Visible = true;
 }
Exemplo n.º 7
0
 protected void ctlAsync_OnCancel(object sender, EventArgs e)
 {
     CurrentLog.Close();
     securityElem.LoadOperators(true);
     securityElem.ErrorLabel.Text = CurrentError;
     securityElem.InfoLabel.Text  = CurrentInfo;
 }
Exemplo n.º 8
0
 private void ctlAsync_OnCancel(object sender, EventArgs e)
 {
     ctlAsync.Parameter = null;
     AddError(GetString("om.deletioncanceled"));
     ltlScript.Text += ScriptHelper.GetScript("var __pendingCallbacks = new Array();RefreshCurrent();");
     lblError.Text   = CurrentError;
     CurrentLog.Close();
 }
Exemplo n.º 9
0
 private void HandlePossibleErrors()
 {
     CurrentLog.Close();
     TerminateCallbacks();
     lblError.Text = CurrentError;
     lblInfo.Text  = CurrentInfo;
     ugRecycleBin.ResetSelection();
 }
 private void ctlAsync_OnError(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(CurrentError))
     {
         ShowError(CurrentError);
     }
     CurrentLog.Close();
 }
Exemplo n.º 11
0
    protected void btnTranslate_Click(object sender, EventArgs e)
    {
        // Check if data are correct
        var error = translationElem.ValidateData();

        if (!String.IsNullOrEmpty(error))
        {
            ShowError(error);
            return;
        }

        if (isSelect)
        {
            // If in select mode, prepare node IDs now
            TreeProvider tree = new TreeProvider(currentUser);
            DataSet      ds   = tree.SelectNodes(CurrentSiteName, pathElem.Value.ToString(), TreeProvider.ALL_CULTURES, true, TreeProvider.ALL_CLASSNAMES, null,
                                                 "DocumentName", TreeProvider.ALL_LEVELS, false, 0, TreeProvider.SELECTNODES_REQUIRED_COLUMNS + ",DocumentName,NodeParentID,NodeSiteID,NodeAliasPath");

            if (!DataHelper.DataSourceIsEmpty(ds))
            {
                foreach (DataTable table in ds.Tables)
                {
                    foreach (DataRow dr in table.Rows)
                    {
                        TreeNode node = TreeNode.New(ValidationHelper.GetString(dr["ClassName"], string.Empty), dr);

                        if (IsUserAuthorizedToTranslateDocument(node, currentSite.SiteName, translationElem.TargetLanguage))
                        {
                            nodeIds.Add(ValidationHelper.GetInteger(dr["NodeID"], 0));
                        }
                        else
                        {
                            HideUI();
                            plcMessages.AddError(String.Format(GetString("cmsdesk.notauthorizedtotranslatedocument"), HTMLHelper.HTMLEncode(node.NodeAliasPath)));
                            return;
                        }
                    }
                }
            }
            else
            {
                ShowError(GetString("translationservice.nodocumentstotranslate"));
                return;
            }

            targetCulture = translationElem.TargetLanguage;
        }

        pnlLog.Visible     = true;
        pnlContent.Visible = false;

        CurrentError = string.Empty;
        CurrentLog.Close();
        EnsureLog();

        ctlAsync.Parameter = AllLevels;
        ctlAsync.RunAsync(Translate, WindowsIdentity.GetCurrent());
    }
Exemplo n.º 12
0
    /// <summary>
    /// On finished event
    /// </summary>
    private void ctlAsync_OnFinished(object sender, EventArgs e)
    {
        mErrorText = CurrentError;
        CurrentLog.Close();
        pnlLog.Visible  = false;
        pnlGrid.Visible = true;

        PostProcessData();
    }
 private void HandlePossibleError()
 {
     if (!string.IsNullOrEmpty(CurrentError))
     {
         ShowError(CurrentError);
     }
     // Clear selection
     CurrentLog.Close();
 }
 private void HandlePossibleErrors()
 {
     CurrentLog.Close();
     ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "terminatePendingCallbacks", ScriptHelper.GetScript("var __pendingCallbacks = new Array();"));
     if (!String.IsNullOrEmpty(CurrentError))
     {
         ShowError(CurrentError);
     }
 }
Exemplo n.º 15
0
 private void HandlePossibleErrors()
 {
     CurrentLog.Close();
     TerminateCallbacks();
     lblError.Text = CurrentError;
     lblInfo.Text  = CurrentInfo;
     ugRecycleBin.ResetSelection();
     ReloadFilter((CurrentSite != null) ? CurrentSite.SiteID : -1, IsSingleSite, true);
 }
Exemplo n.º 16
0
    /// <summary>
    /// Ensures log for asynchronous control
    /// </summary>
    private void EnsureAsyncLog()
    {
        pnlLog.Visible     = true;
        pnlContent.Visible = false;

        CurrentError = string.Empty;
        CurrentLog.Close();
        EnsureLog();
    }
    /// <summary>
    /// Runs async thread.
    /// </summary>
    /// <param name="action">Method to run</param>
    protected void RunAsync(AsyncAction action)
    {
        pnlLog.Visible = true;

        CurrentLog.Close();
        EnsureLog();

        ctlAsync.RunAsync(action, WindowsIdentity.GetCurrent());
    }
Exemplo n.º 18
0
    protected void btnSaveAll_Click(object sender, EventArgs e)
    {
        pnlLog.Visible = true;

        CurrentError = string.Empty;
        CurrentLog.Close();
        EnsureLog();

        ctlAsync.RunAsync(Deploy, WindowsIdentity.GetCurrent());
    }
 private void ctlAsync_OnCancel(object sender, EventArgs e)
 {
     CurrentInfo     = GetString(canceledString);
     ltlScript.Text += ScriptHelper.GetScript("var __pendingCallbacks = new Array();");
     if (!String.IsNullOrEmpty(CurrentInfo))
     {
         ShowConfirmation(CurrentInfo);
     }
     CurrentLog.Close();
 }
Exemplo n.º 20
0
 private void ctlAsync_OnError(object sender, EventArgs e)
 {
     if (ctlAsync.Status == AsyncWorkerStatusEnum.Running)
     {
         ctlAsync.Stop();
     }
     ctlAsync.Parameter = null;
     lblError.Text      = CurrentError;
     CurrentLog.Close();
 }
Exemplo n.º 21
0
    private void ctlAsync_OnFinished(object sender, EventArgs e)
    {
        lblError.Text = CurrentError;
        CurrentLog.Close();

        if (ctlAsync.Parameter != null)
        {
            AddScript(ctlAsync.Parameter.ToString());
        }
    }
Exemplo n.º 22
0
    private void ctlAsync_OnCancel(object sender, EventArgs e)
    {
        ctlAsync.Parameter = null;
        string cancel = GetString("DeleteDocument.DeletionCanceled");

        AddLog(cancel);
        ltlScript.Text += ScriptHelper.GetScript("var __pendingCallbacks = new Array();RefreshCurrent();");
        ShowConfirmation(cancel);
        CurrentLog.Close();
    }
Exemplo n.º 23
0
 /// <summary>
 /// On finished event
 /// </summary>
 private void ctlAsync_OnFinished(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(CurrentError))
     {
         mErrorText = CurrentError;
     }
     CurrentLog.Close();
     pnlLog.Visible  = false;
     pnlGrid.Visible = true;
 }
Exemplo n.º 24
0
 private void HandlePossibleError()
 {
     if (!string.IsNullOrEmpty(CurrentError))
     {
         lblError.Text    = CurrentError;
         lblError.Visible = true;
     }
     // Clear selection
     CurrentLog.Close();
 }
Exemplo n.º 25
0
    protected void btnSourceControl_Click(object sender, EventArgs e)
    {
        pnlLog.Visible = true;

        CurrentError = string.Empty;
        CurrentLog.Close();
        EnsureLog();

        ctlAsync.Parameter = new bool[] { chkSaveCSS.Checked, chkSaveLayouts.Checked, chkSavePageTemplate.Checked, chkSaveTransformation.Checked, chkSaveWebpartLayout.Checked, chkSaveWebpartContainer.Checked };
        ctlAsync.RunAsync(SaveExternally, WindowsIdentity.GetCurrent());
    }
Exemplo n.º 26
0
    private void ctlAsync_OnFinished(object sender, EventArgs e)
    {
        CurrentLog.Close();

        if (!String.IsNullOrEmpty(CurrentError))
        {
            RedirectTo("error", CurrentError);
        }

        URLHelper.Redirect(redirectUrl);
    }
Exemplo n.º 27
0
    protected void btnOk_OnClick(object sender, EventArgs e)
    {
        pnlLog.Visible = true;
        //pnlContent.Visible = false;

        CurrentError = string.Empty;
        CurrentLog.Close();
        EnsureLog();

        int    actionValue = ValidationHelper.GetInteger(drpAction.SelectedValue, 0);
        Action action      = (Action)actionValue;

        int whatValue = ValidationHelper.GetInteger(drpWhat.SelectedValue, 0);

        currentWhat = (What)whatValue;

        ctlAsync.Parameter = new BinSettingsContainer(currentUser, currentWhat);
        switch (action)
        {
        case Action.Restore:
            switch (currentWhat)
            {
            case What.AllDocuments:
                titleElemAsync.TitleImage = GetImageUrl("CMSModules/CMS_RecycleBin/restoreall.png");
                break;

            case What.SelectedDocuments:
                titleElemAsync.TitleImage = GetImageUrl("CMSModules/CMS_RecycleBin/restoreselected.png");
                if (ugRecycleBin.SelectedItems.Count <= 0)
                {
                    return;
                }
                break;
            }
            titleElemAsync.TitleText = GetString("Recyclebin.RestoringDocuments");
            RunAsync(Restore);
            break;

        case Action.Delete:
            switch (currentWhat)
            {
            case What.AllDocuments:
                titleElemAsync.TitleImage = GetImageUrl("CMSModules/CMS_RecycleBin/emptybin.png");
                break;

            case What.SelectedDocuments:
                titleElemAsync.TitleImage = GetImageUrl("CMSModules/CMS_RecycleBin/emptyselected.png");
                break;
            }
            titleElemAsync.TitleText = GetString("recyclebin.emptyingbin");
            RunAsync(EmptyBin);
            break;
        }
    }
Exemplo n.º 28
0
 private void ctlAsync_OnFinished(object sender, EventArgs e)
 {
     if (!HandlePossibleErrors())
     {
         AddScript(refreshScript);
     }
     else
     {
         AddScript("DestroyLog();");
     }
     CurrentLog.Close();
 }
Exemplo n.º 29
0
    /// <summary>
    /// Executes given action asynchronously
    /// </summary>
    /// <param name="action">Action to run</param>
    protected void RunAsync(AsyncAction action)
    {
        pnlLog.Visible = true;
        CurrentLog.Close();
        EnsureLog();
        CurrentError       = string.Empty;
        CurrentInfo        = string.Empty;
        eventType          = EventLogProvider.EVENT_TYPE_INFORMATION;
        plcContent.Visible = false;

        ctlAsync.RunAsync(action, WindowsIdentity.GetCurrent());
    }