Example #1
0
        public void ProcessRequest()
        {
            // Ottieni istanza MTEXT
            MTextModelProvider mtext = ModelProviderFactory <MTextModelProvider> .GetInstance();

            // Carica scheda documento
            DocsPaWR.SchedaDocumento schedaDocumentoSelezionata = CheckInOut.CheckInOutServices.CurrentSchedaDocumento;

            // Carica modello
            String databinding = schedaDocumentoSelezionata.template.PATH_MODELLO_1;

            // Elabora FQN
            String fqn = MTextUtils.Id2FullQualifiedName(documentNumber);

            // Crea documento
            try
            {
                fqn = mtext.CreateDocument(fqn, MTextUtils.CustomObject2Dictionary(schedaDocumentoSelezionata.template), databinding);
            }
            catch (Exception e)
            {
                Response.StatusCode = 500;
                this.WriteResponse(fqn, e.Message);
                return;
            }

            // Ottieni URL per EDIT
            String url = mtext.GetDocumentEditUrl(fqn);

            // Restituisci stringa fqn|editURL
            this.WriteResponse(fqn, url);
        }
Example #2
0
        /// <summary>
        /// Funzione per la cancellazione di un documento M/Text dal server M/Text
        /// </summary>
        /// <param name="idDocument">Id del documento da cancellare</param>
        private void ProcessDelete(String idDocument)
        {
            try
            {
                // Eliminazione del documento da M/Text
                MTextModelProvider mTextProvider = ModelProviderFactory <MTextModelProvider> .GetInstance();

                mTextProvider.DeleteDocument(MTextUtils.Id2FullQualifiedName(idDocument));
            }
            catch (Exception e)
            {
                // Non viene intrapresa alcuna azione
            }
        }
Example #3
0
 protected void btnAddTemplateAtt_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(this.txtModelNameAtt.Text))
     {
         try
         {
             String mTextBindingName = MTextUtils.GetNameFromQualifiedName(this.txtModelNameAtt.Text);
             this.ddlMTextModelAtt.Items.Add(new ListItem(mTextBindingName, this.txtModelNameAtt.Text));
         }
         catch (Exception ex)
         {
             ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('Nome del data bind non valido.');", true);
         }
     }
 }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Reperimento del template in definizione
            Templates template = (Templates)Session["templateSelPerModelli"];

            // Generazione di un dizionario creato a partire dai campi del template
            List <LabelValuePair> sampleValues = MTextUtils.GetSampleLabelValueCollection(new List <OggettoCustom>(template.ELENCO_OGGETTI));
            MTextModelProvider    provider     = ModelProviderFactory <MTextModelProvider> .GetInstance();

            Byte[] dataSource = provider.GetXmlExample(template.DESCRIZIONE, sampleValues);

            this.Response.Clear();

            // Scrittura del content nella response
            this.WriteDataSource(dataSource);
        }
Example #5
0
        private void ImageButton2_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            if (CheckBox2.Checked)
            {
                string[] amministrazione       = ((string)Session["AMMDATASET"]).Split('@');
                string   codiceAmministrazione = amministrazione[0];

                ((SAAdminTool.DocsPaWR.Templates)Session["templateSelPerModelli"]).PATH_MODELLO_2 = "";
                DocsPaWR.Templates template = (SAAdminTool.DocsPaWR.Templates)Session["templateSelPerModelli"];
                ProfilazioneDocManager.eliminaModelli(template.DESCRIZIONE, codiceAmministrazione, "Modello2.rtf", "doc", (SAAdminTool.DocsPaWR.Templates)Session["templateSelPerModelli"], this);

                // Se è attivo M/Text viene visualizzata la modalità Classica per il modello principale
                if (MTextUtils.IsActiveMTextIntegration())
                {
                    this.ddlModelTypeAtt.SelectedIndex = 0;
                    this.pnlModelTypeAtt.Visible       = false;
                    this.uploadPathDue.Visible         = true;
                }

                CheckBox2.Checked = false;
            }
        }
Example #6
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Modello1.Enabled  = false;
            Modello2.Enabled  = false;
            Allegato.Enabled  = false;
            ModelloSU.Enabled = false;

            // Se i modelli M/Text sono attivi e non si è in postback vengono rese visibili le righe con
            // le drop down per la scelta del tipo del modello e vengono popolate le liste dei modelli
            if (MTextUtils.IsActiveMTextIntegration() && !IsPostBack)
            {
                this.trGenerateMTextSourceModel.Visible = true;
                this.trModelChoiceMainDocument.Visible  = true;
                //this.trModelChoiceAtt.Visible = true;
                try
                {
                    List <ModelInfo> models = ModelProviderFactory <MTextModelProvider> .GetInstance().GetModels();

                    foreach (ModelInfo model in models)
                    {
                        this.ddlMTextModelMain.Items.Add(new ListItem(model.Name, model.Path));
                        this.ddlMTextModelAtt.Items.Add(new ListItem(model.Name, model.Path));
                    }
                }
                catch (Exception ex)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Errore durante il reperimento dei modelli M/Text');", true);
                }
            }


            this.linkTag.NavigateUrl = "metaTagsCampiWORD_PITRE.doc";
            string valoreChiave;

            valoreChiave = utils.InitConfigurationKeys.GetValue("0", "FE_EXPORT_DA_MODELLO");
            if (!string.IsNullOrEmpty(valoreChiave) && valoreChiave.Equals("1"))
            {
                Tr2.Visible = true;
            }
            else
            {
                Tr2.Visible = false;
            }


            DocsPaWR.Templates template = (SAAdminTool.DocsPaWR.Templates)Session["templateSelPerModelli"];

            // Se l'estensione del modello 1 è MTXT viene attivata la visualizzazione M/Text
            // altrimenti quella normale
            if (!String.IsNullOrEmpty(template.PATH_MODELLO_1_EXT) && template.PATH_MODELLO_1_EXT == "MTXT" && !IsPostBack)
            {
                this.ddlModelTypeMain.SelectedIndex = 1;
                this.CheckBox1.Checked        = true;
                this.pnlModelTypeMain.Visible = true;
                this.uploadPathUno.Visible    = false;

                // Toppa temporanea in attesa di prox versione M/Text
                int index = this.ddlMTextModelMain.Items.IndexOf(new ListItem(MTextUtils.GetNameFromQualifiedName(template.PATH_MODELLO_1), template.PATH_MODELLO_1));
                if (index == -1)
                {
                    this.ddlMTextModelMain.Items.Add(new ListItem(MTextUtils.GetNameFromQualifiedName(template.PATH_MODELLO_1), template.PATH_MODELLO_1));
                    index = this.ddlMTextModelMain.Items.Count - 1;
                }
                // Fine toppa temporanea

                this.ddlMTextModelMain.SelectedIndex = index;
            }
            else
            if (template.PATH_MODELLO_1 != "")
            {
                CheckBox1.Checked = true;
                Modello1.Enabled  = true;
            }

            // Se l'estensione del modello 2 è MTXT viene attivata la visualizzazione M/Text
            // altrimenti quella normale
            if (!String.IsNullOrEmpty(template.PATH_MODELLO_2_EXT) && template.PATH_MODELLO_2_EXT == "MTXT" && !IsPostBack)
            {
                this.ddlModelTypeAtt.SelectedIndex = 1;
                this.CheckBox2.Checked             = true;
                this.pnlModelTypeAtt.Visible       = true;
                this.uploadPathDue.Visible         = false;

                // Toppa temporanea in attesa di prox versione M/Text
                int index = this.ddlMTextModelAtt.Items.IndexOf(new ListItem(MTextUtils.GetNameFromQualifiedName(template.PATH_MODELLO_2), template.PATH_MODELLO_2));
                if (index == -1)
                {
                    this.ddlMTextModelAtt.Items.Add(new ListItem(MTextUtils.GetNameFromQualifiedName(template.PATH_MODELLO_2), template.PATH_MODELLO_2));
                    index = this.ddlMTextModelAtt.Items.Count - 1;
                }
                // Fine toppa temporanea

                this.ddlMTextModelAtt.SelectedIndex = index;
            }
            else
            if (template.PATH_MODELLO_2 != "")
            {
                CheckBox2.Checked = true;
                Modello2.Enabled  = true;
            }

            if (template.PATH_MODELLO_STAMPA_UNIONE != "")
            {
                CheckBox4.Checked = true;
                ModelloSU.Enabled = true;
            }
            if (template.PATH_ALLEGATO_1 != "")
            {
                CheckBox3.Checked = true;
                Allegato.Enabled  = true;
            }

            if (!string.IsNullOrEmpty(template.PATH_MODELLO_EXCEL))
            {
                CheckBox5.Checked  = true;
                ModelloExc.Enabled = true;
            }

            if (System.Configuration.ConfigurationManager.AppSettings["MODELLO_DOCUMENTO"] != null && System.Configuration.ConfigurationManager.AppSettings["MODELLO_DOCUMENTO"] == "1")
            {
                uploadPathDue.Visible = false;
                CheckBox2.Visible     = false;
                ImageButton2.Visible  = false;
            }

            if (SHOW_STAMPA_UNIONE)
            {
                this.PanelSU.Visible = true;
            }
            else
            {
                this.PanelSU.Visible = false;
            }
        }