public void CreateListAddField() { if (!ContextSharePoint.VerifyServer(Site)) { Assert.Inconclusive(); } var contentType = new ContentType(Site.RootWeb, this.Logger, "TESTHELLO", "TEST", "Elemento"); contentType.Create(string.Empty); ListSharePoint = new ListSharePoint(Site.RootWeb, Logger, "LISTATEST"); Assert.IsTrue(ListSharePoint.Create("descripcion", ListTemplateType.Contacts, true)); var siteColumn = new Entities.Artefacts.SiteColumn(new ParamsSiteColumnBaseExtended { AddPrefix = false, FieldType = SPFieldType.Text, Group = "Lista", Logger = this.Logger, MultiValue = false, Name = "Field1", Requiered = true, Web = Site.RootWeb }); Assert.IsTrue(ListSharePoint.AddField(siteColumn)); Assert.IsTrue(ListSharePoint.DeleteField(siteColumn)); Assert.IsTrue(ListSharePoint.Delete()); }
public void CreateContentTypebyGuid() { if (!ContextSharePoint.VerifyServer(Site)) { Assert.Inconclusive(); } ContentType = new ContentType(Site.RootWeb, Logger, "Nuevo tipo Contenido", "TEst", "Elemento"); Assert.IsTrue(ContentType.Create("0x0100B84152A0E015D14CA1300027B66FAD1F")); Assert.IsTrue(ContentType.Delete()); }
public void CreateContentType() { if (!ContextSharePoint.VerifyServer(Site)) { Assert.Inconclusive(); } ContentType = new ContentType(Site.RootWeb, Logger, "Nuevo Tipo Contenido1", "TEST", "Item"); Assert.IsTrue(ContentType.Create(string.Empty)); Assert.IsTrue(ContentType.Delete()); }
/// <summary> /// Create a new MemberType /// </summary> /// <param Name="Text">The Name of the MemberType</param> /// <param Name="u">Creator of the MemberType</param> public static MemberType MakeNew(BusinessLogic.User u, string Text) { int ParentId = -1; int level = 1; Guid uniqueId = Guid.NewGuid(); CMSNode n = CMSNode.MakeNew(ParentId, _objectType, u.Id, level, Text, uniqueId); ContentType.Create(n.Id, Text, ""); return(new MemberType(n.Id)); }
/// <summary> /// Create a new MemberType /// </summary> /// <param name="Text">The name of the MemberType</param> /// <param name="u">Creator of the MemberType</param> public static MemberType MakeNew(User u, string Text) { int ParentId = -1; int level = 1; Guid uniqueId = Guid.NewGuid(); CMSNode n = CMSNode.MakeNew(ParentId, _objectType, u.Id, level, Text, uniqueId); ContentType.Create(n.Id, Text, ""); MemberType mt = new MemberType(n.Id); NewEventArgs e = new NewEventArgs(); mt.OnNew(e); return(mt); }
public void CreateListAddContentType() { if (!ContextSharePoint.VerifyServer(Site)) { Assert.Inconclusive(); } var contentType = new ContentType(Site.RootWeb, this.Logger, "TESTHELLO", "TEST", "Elemento"); contentType.Create(string.Empty); ListSharePoint = new ListSharePoint(Site.RootWeb, Logger, "LISTATEST"); Assert.IsTrue(ListSharePoint.Create("descripcion", ListTemplateType.Contacts, true)); Assert.IsTrue(ListSharePoint.AddContentType("TESTHELLO")); Assert.IsTrue(ListSharePoint.DeleteContentType("TESTHELLO")); Assert.IsFalse(ListSharePoint.AddContentType("TESTBYE")); Assert.IsTrue(ListSharePoint.Delete()); }
protected void btnSave_Click(object sender, System.EventArgs e) { if (!Page.IsValid) { return; } string iconFileName = null; string bigIconFileName = null; Stream iconStream = null; Stream bigIconStream = null; if (fIcon.PostedFile != null && fIcon.PostedFile.ContentLength > 0) { iconFileName = fIcon.PostedFile.FileName; iconStream = fIcon.PostedFile.InputStream; } if (fBigIcon.PostedFile != null && fBigIcon.PostedFile.ContentLength > 0) { bigIconFileName = fBigIcon.PostedFile.FileName; bigIconStream = fBigIcon.PostedFile.InputStream; } if (iconId > 0) { ContentType.Update(iconId, tbFriendlyName.Text, iconFileName, iconStream, bigIconFileName, bigIconStream, cbAllowWebDav.Checked, cbInNewWindow.Checked, cbForceDownload.Checked); } else { ContentType.Create(tbExtension.Text, tbMimeType.Text, tbFriendlyName.Text, iconFileName, iconStream, bigIconFileName, bigIconStream, cbAllowWebDav.Checked, cbInNewWindow.Checked, cbForceDownload.Checked); } Response.Redirect("~/Admin/DocumentTypes.aspx"); }
/// <summary> /// Constructs a new /// <see cref="UrlEncodedFormEntity">UrlEncodedFormEntity</see> /// with the list /// of parameters in the specified encoding. /// </summary> /// <param name="parameters">iterable collection of name/value pairs</param> /// <param name="charset">encoding the name/value pairs be encoded with</param> /// <since>4.2</since> public UrlEncodedFormEntity(IEnumerable <NameValuePair> parameters, Encoding charset ) : base(URLEncodedUtils.Format(parameters, charset != null ? charset : HTTP.DefContentCharset ), ContentType.Create(URLEncodedUtils.ContentType, charset)) { }
/// <summary> /// Constructs a new /// <see cref="UrlEncodedFormEntity">UrlEncodedFormEntity</see> /// with the list /// of parameters in the specified encoding. /// </summary> /// <param name="parameters">list of name/value pairs</param> /// <param name="charset">encoding the name/value pairs be encoded with</param> /// <exception cref="System.IO.UnsupportedEncodingException">if the encoding isn't supported /// </exception> public UrlEncodedFormEntity(IList <NameValuePair> parameters, string charset) : base (URLEncodedUtils.Format(parameters, charset != null ? charset : HTTP.DefContentCharset .Name()), ContentType.Create(URLEncodedUtils.ContentType, charset)) { }