public FlowToken Execute(EntityToken entityToken, ActionToken actionToken, FlowControllerServicesContainer flowControllerServicesContainer) { var token = entityToken as DataEntityToken; var apiKey = token.Data as ApiKey; IssuuApi.SetDefault(apiKey); var treeRefresher = new ParentTreeRefresher(flowControllerServicesContainer); treeRefresher.PostRefreshMesseges(token.Data.GetDataEntityToken()); return(null); }
public static XElement UploadDocument(IMediaFile media) { var data = IssuuApi.NewQuery("issuu.document.upload"); data.Add("name", media.GetName()); data.Add("title", media.Title); IssuuApi.Sign(data); var document = GetDocument(WebRequestFacade.UploadFileEx("http://upload.issuu.com/1_0", media.GetReadStream(), media.GetOrgName(), "file", data)); document.SetAttributeValue("publishing", "true"); return(document); }
public static XElement GetDocument(IMediaFile media) { ServicePoint servicePoint = ServicePointManager.FindServicePoint(new Uri("http://api.issuu.com/1_0")); servicePoint.Expect100Continue = false; System.Net.ServicePointManager.Expect100Continue = false; var data = IssuuApi.NewQuery("issuu.documents.list"); data.Add("orgDocName", media.GetOrgName()); IssuuApi.Sign(data); var client = new System.Net.WebClient(); byte[] responseArray = client.UploadValues("http://api.issuu.com/1_0", data); return(GetDocument(Encoding.ASCII.GetString(responseArray))); }
public ElementAttachingProviderResult GetAlternateElementList(EntityToken parentEntityToken, Dictionary <string, string> piggybag) { if (parentEntityToken is GeneratedDataTypesElementProviderTypeEntityToken) { var token = parentEntityToken as GeneratedDataTypesElementProviderTypeEntityToken; if (token.SerializedTypeName == TypeManager.SerializeType(typeof(ApiKey))) { var label = IssuuApi.GetDefaultLabel(); if (!string.IsNullOrEmpty(label)) { ElementAttachingProviderResult result = new ElementAttachingProviderResult() { Elements = GetRootElements(label, piggybag), Position = ElementAttachingProviderPosition.Top, PositionPriority = 0 }; return(result); } } } return(null); }