public void RaiseCallbackEvent(string eventArgument) { Security.Token tok = (Security.Token)Page.Session["Token"]; if (tok != null && tok.Authenticated && tok.GetCurrentUser().Registered) { List <Security.ComputableWorkflowReference> computableWf = Page.Session["ComputableWorkflowReferenceList"] as List <Security.ComputableWorkflowReference>; Security.ComputableWorkflowReference reference = computableWf[Int32.Parse(eventArgument)]; if (reference != null) { if (reference.Remove()) { result = "OK"; } else { result = "Error"; } } else { result = "Not found"; } } else { result = "User not logged in"; } }
public void RaiseCallbackEvent(string eventArgument) { Security.Token tok = (Security.Token)Page.Session["Token"]; if (tok != null && tok.Authenticated && tok.GetCurrentUser().Registered) { List <Security.ComputableWorkflowReference> computableWf = Page.Session["ComputableWorkflowReferenceList"] as List <Security.ComputableWorkflowReference>; Security.ComputableWorkflowReference reference = computableWf[Int32.Parse(eventArgument)]; if (reference != null) { XmlDocument xmlDoc = reference.GetWorkflow().GetXMLDocument(); if (xmlDoc.GetElementsByTagName("TEXT").Count > 0 || xmlDoc.GetElementsByTagName("IMAGE").Count > 0 || xmlDoc.GetElementsByTagName("HTMLCODE").Count > 0) { Page.Session["UsingStaticFields"] = true; } else { Page.Session["UsingStaticFields"] = false; } Page.Session["WFE_CurrentWorkflow"] = reference; Page.Session["themeReturn"] = "http://" + Security.EnvironmentManagement.getEnvValue("webServerAddress") + "/FormFillier/index.aspx"; result = "OK"; } else { result = "Not found"; } } else { result = "User not logged in"; } }
public void RaiseCallbackEvent(string eventArgument) { this.fromClient = eventArgument;//(IComputableWorkflow)Session["wf"]; Security.ComputableWorkflowReference cref = (Security.ComputableWorkflowReference)Session["wfr"]; if (cref != null) { cref.SaveFilling(); } }
public void RaiseCallbackEvent(string eventArgument) { string[] array = eventArgument.Split('|'); Security.Token tok = (Security.Token)Page.Session["Token"]; Security.User usr = tok.GetCurrentUser(); Security.ComputableWorkflowReference wf = null; if (array[0].Equals("-200")) { wf = (Security.ComputableWorkflowReference)Page.Session["WFE_CurrentWorkflow"]; } else { wf = ((List <Security.ComputableWorkflowReference>)Page.Session["ComputableWorkflowReferenceList"])[Int32.Parse(array[0])]; } string gruppo = ""; List <Security.Contact> contUsr = new List <Security.Contact>(); bool flag = false; List <Security.Contact> contSend = new List <Security.Contact>(); string[] array2 = merge(array).ToArray(); for (int i = 1; i < array2.Length - 1; i++) { string[] grp = array2[i].Split('/'); if (grp[1] != gruppo) { if (i > 1) { flag = flag || wf.PermitContacts(contSend); } gruppo = grp[1]; contUsr = usr.GetContactsByGroup(gruppo); contSend = new List <Security.Contact>(); } contSend.Add(contUsr[Int32.Parse(grp[0])]); } flag = flag || wf.PermitContacts(contSend); if (flag) { result = "OK"; } else { result = "ERROR"; } }
private void loadWf(string wfId, string crId, string user, string serv, string tokMail) { Trace.Warn("Begin load workflow"); Security.ComputableWorkflowReference cref = Security.Token.GetWorkflow(wfId, crId, user, serv, tokMail); if (cref == null) { contentAll.Style.Add("background", "#A7A7A7 url('../lib/image/lock2.png') no-repeat center"); contentAll.Style.Add("-moz-opacity", "0.35"); contentAll.Visible = true; Page.Controls.Add(new LiteralControl("<script>setType(-2);</script>")); Session["wf"] = null; } else { Session["wfr"] = cref; workflow = cref.GetWorkflow(); Session["wf"] = workflow; //si fa la prima visualizzazione renderNode(workflow.GetState()); #region caricamento del tema 2° versione pro Security.Theme theme = ((Security.ComputableWorkflowReference)Session["wfr"]).GetTheme(); Page.Header.Controls.Add(new LiteralControl(@"<style type='text/css'>" + theme.CSS + "</style" + ">")); if (theme.Title == "") { formTitle.InnerText = "Testo di prova"; } else { formTitle.InnerText = theme.Title; formTitle.Style.Add("font-family", "Verdana"); formTitle.Style.Add("font-size", "30px"); } #endregion } Trace.Warn("End load workflow"); }
public WorkflowInformations GetWorkflow(int compilationRequestId, string username, string service, string token) { Storage.StorageManager manager = new Storage.StorageManager(); Storage.CompilationRequest compilationRequest = manager.getEntityByID <Storage.CompilationRequest>(compilationRequestId); WorkflowInformations infs = new WorkflowInformations(); infs.status = ResultStatus.OK; if (compilationRequest == null) { infs.status = ResultStatus.WRONG_COMPILATION_REQUEST_ID; return(infs); } Storage.Publication publication = compilationRequest.Publication; Security.ComputableWorkflowReference cw = Security.Token.GetWorkflow("" + publication.publicationID, "" + compilationRequestId, username, service, token); if (cw == null) { infs.status = ResultStatus.WRONG_COMPILATION_REQUEST_ID; return(infs); } infs.description = cw.GetWorkflow().GetEntireWorkflowDescription(); infs.publicationDescription = cw.GetWorkflowDescription(); infs.status = ResultStatus.OK; /* * if (publication.isPublic) * { * //pubblico * IComputableWorkflow cw = (IComputableWorkflow)manager.getWorkflowByPublication(publication); * cw.setWFname(publication.namePublication); * infs.description = cw.GetEntireWorkflowDescription(); * infs.publicationDescription = publication.description; * } * else * { * //privato * if (token==null || !compilationRequest.token.Equals(token)) * { * infs.status = ResultStatus.WRONG_TOKEN; * return infs; * } * Storage.Contact contact = compilationRequest.Contact; * if (username==null || service == null || * !(contact.externalUserID.Equals(username) && (contact.Service.nameService.Equals(service)))) * { * infs.status = ResultStatus.WRONG_USERNAME_OR_SERVICE; * return infs; * } * if (compilationRequest.compiled) * { * infs.status = ResultStatus.ALREADY_COMPILED; * } * IComputableWorkflow cw = (IComputableWorkflow)manager.getWorkflowByPublication(publication); * cw.setWFname(publication.namePublication); * infs.description = cw.GetEntireWorkflowDescription(); * infs.publicationDescription = publication.description; * } */ return(infs); }