From a6737df4f0cbc1016c63a8be8f2fd9a0e5de3dff Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 15 Apr 2020 22:59:49 +0000 Subject: [PATCH] --- devdocs/specs/core-wiki.txt | 41 ++++++++++++++++++++++++++++++ server/AyaNova/biz/AyaType.cs | 2 +- server/AyaNova/biz/UserBiz.cs | 4 +-- server/AyaNova/biz/WidgetBiz.cs | 6 ++--- server/AyaNova/models/AyContext.cs | 3 +-- server/AyaNova/models/User.cs | 1 + server/AyaNova/models/Widget.cs | 1 + server/AyaNova/models/WikiPage.cs | 22 ---------------- server/AyaNova/util/AySchema.cs | 36 +++++++++++++------------- 9 files changed, 68 insertions(+), 48 deletions(-) delete mode 100644 server/AyaNova/models/WikiPage.cs diff --git a/devdocs/specs/core-wiki.txt b/devdocs/specs/core-wiki.txt index e129a966..1a9f711d 100644 --- a/devdocs/specs/core-wiki.txt +++ b/devdocs/specs/core-wiki.txt @@ -3,3 +3,44 @@ NOTE: This applies to all core business object types that are basically real world and have an id and a type (all are wikiable, attachable and reviewable) Not utility type objects like datalist etc +Sample markdown doc with all elements: + +=-=-=-=-= +Headings +# Heading 1st level +## Heading 2nd level +### Heading 3rd level +#### Heading 4th level +##### Heading 5th level +###### Heading 6th level + +Alternate text styles +*Italic* +**Bold** + +Hyperlink +[Link](https://ayanova.com) + +Image +![Image](https://www.ayanova.com/images/AyaNova60x60.png) + +Block quotes +> Blockquote +> more block quote + +Unordered list +* List +* List +* List + +Ordered list +1. One +2. Two +3. Three + + +Horizontal rule +--- + +=-=-=-=-= + diff --git a/server/AyaNova/biz/AyaType.cs b/server/AyaNova/biz/AyaType.cs index 4bcdfe7c..80c13aa2 100644 --- a/server/AyaNova/biz/AyaType.cs +++ b/server/AyaNova/biz/AyaType.cs @@ -34,7 +34,7 @@ namespace AyaNova.Biz License = 5, LogFile = 6, PickListTemplate = 7, - WikiPage = 8, + DEPRECATED_REUSELATER_08 = 8, ServerJob = 9, AyaNova7Import = 10, TrialSeeder = 11, diff --git a/server/AyaNova/biz/UserBiz.cs b/server/AyaNova/biz/UserBiz.cs index f59af1e0..53da4801 100644 --- a/server/AyaNova/biz/UserBiz.cs +++ b/server/AyaNova/biz/UserBiz.cs @@ -221,7 +221,7 @@ namespace AyaNova.Biz { //SEARCH INDEXING var SearchParams = new Search.SearchIndexProcessObjectParameters(UserTranslationId, obj.Id, BizType); - SearchParams.AddText(obj.Notes).AddText(obj.Name).AddText(obj.EmployeeNumber).AddText(obj.Tags).AddCustomFields(obj.CustomFields); + SearchParams.AddText(obj.Notes).AddText(obj.Name).AddText(obj.EmployeeNumber).AddText(obj.Tags).AddText(obj.WikiContent).AddCustomFields(obj.CustomFields); if (isNew) await Search.ProcessNewObjectKeywordsAsync(SearchParams); @@ -234,7 +234,7 @@ namespace AyaNova.Biz var obj = await ct.User.SingleOrDefaultAsync(m => m.Id == id); var SearchParams = new Search.SearchIndexProcessObjectParameters(); if (obj != null) - SearchParams.AddText(obj.Notes).AddText(obj.Name).AddText(obj.EmployeeNumber).AddText(obj.Tags).AddCustomFields(obj.CustomFields); + SearchParams.AddText(obj.Notes).AddText(obj.Name).AddText(obj.EmployeeNumber).AddText(obj.Tags).AddText(obj.WikiContent).AddCustomFields(obj.CustomFields); return SearchParams; } diff --git a/server/AyaNova/biz/WidgetBiz.cs b/server/AyaNova/biz/WidgetBiz.cs index 14c34a83..0fe815df 100644 --- a/server/AyaNova/biz/WidgetBiz.cs +++ b/server/AyaNova/biz/WidgetBiz.cs @@ -99,7 +99,7 @@ namespace AyaNova.Biz { Widget outObj = new Widget(); - CopyObject.Copy(dbObj, outObj); + CopyObject.Copy(dbObj, outObj, "WikiContent"); // outObj.Name = Util.StringUtil.NameUniquify(outObj.Name, 255); //generate unique name string newUniqueName = string.Empty; @@ -202,7 +202,7 @@ namespace AyaNova.Biz { //SEARCH INDEXING var SearchParams = new Search.SearchIndexProcessObjectParameters(UserTranslationId, obj.Id, BizType); - SearchParams.AddText(obj.Notes).AddText(obj.Name).AddText(obj.Serial).AddText(obj.Tags).AddCustomFields(obj.CustomFields); + SearchParams.AddText(obj.Notes).AddText(obj.Name).AddText(obj.Serial).AddText(obj.WikiContent).AddText(obj.Tags).AddCustomFields(obj.CustomFields); if (isNew) @@ -216,7 +216,7 @@ namespace AyaNova.Biz var obj = await ct.Widget.SingleOrDefaultAsync(m => m.Id == id); var SearchParams = new Search.SearchIndexProcessObjectParameters(); if (obj != null) - SearchParams.AddText(obj.Notes).AddText(obj.Name).AddText(obj.Serial).AddText(obj.Tags).AddCustomFields(obj.CustomFields); + SearchParams.AddText(obj.Notes).AddText(obj.Name).AddText(obj.Serial).AddText(obj.WikiContent).AddText(obj.Tags).AddCustomFields(obj.CustomFields); return SearchParams; } diff --git a/server/AyaNova/models/AyContext.cs b/server/AyaNova/models/AyContext.cs index 39d71ef7..6fee3aeb 100644 --- a/server/AyaNova/models/AyContext.cs +++ b/server/AyaNova/models/AyContext.cs @@ -21,8 +21,7 @@ namespace AyaNova.Models public virtual DbSet DataListView { get; set; } public virtual DbSet Tag { get; set; } public virtual DbSet FormCustom { get; set; } - public virtual DbSet PickListTemplate { get; set; } - public virtual DbSet WikiPage { get; set; } + public virtual DbSet PickListTemplate { get; set; } //Note: had to add this constructor to work with the code in startup.cs that gets the connection string from the appsettings.json file diff --git a/server/AyaNova/models/User.cs b/server/AyaNova/models/User.cs index b25e54e5..245eb062 100644 --- a/server/AyaNova/models/User.cs +++ b/server/AyaNova/models/User.cs @@ -35,6 +35,7 @@ namespace AyaNova.Models public long? CustomerId { get; set; } public long? HeadOfficeId { get; set; } public long? SubVendorId { get; set; } + public string WikiContent { get; set; } public string CustomFields { get; set; } public List Tags { get; set; } diff --git a/server/AyaNova/models/Widget.cs b/server/AyaNova/models/Widget.cs index ac4c85cc..daa40bc9 100644 --- a/server/AyaNova/models/Widget.cs +++ b/server/AyaNova/models/Widget.cs @@ -24,6 +24,7 @@ namespace AyaNova.Models public DateTime? EndDate { get; set; } public string Notes { get; set; } public int? Count { get; set; } + public string WikiContent {get;set;} public string CustomFields { get; set; } public List Tags { get; set; } //relations diff --git a/server/AyaNova/models/WikiPage.cs b/server/AyaNova/models/WikiPage.cs deleted file mode 100644 index 61b974f8..00000000 --- a/server/AyaNova/models/WikiPage.cs +++ /dev/null @@ -1,22 +0,0 @@ -using AyaNova.Biz; -using System.ComponentModel.DataAnnotations; - -namespace AyaNova.Models -{ - - public partial class WikiPage - { - public long Id { get; set; } - public uint ConcurrencyToken { get; set; } - - - //----------------------------------------- - [Required] - public long ObjectId { get; set; } - [Required] - public AyaType ObjectType { get; set; }//int - - public string Content { get; set; } - - } -} \ No newline at end of file diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index dc5de0be..ea1e98ea 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -20,10 +20,10 @@ namespace AyaNova.Util /////////// CHANGE THIS ON NEW SCHEMA UPDATE //////////////////// //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!! - private const int DESIRED_SCHEMA_LEVEL = 11; + private const int DESIRED_SCHEMA_LEVEL = 10; - internal const long EXPECTED_COLUMN_COUNT = 105; - internal const long EXPECTED_INDEX_COUNT = 33; + internal const long EXPECTED_COLUMN_COUNT = 103; + internal const long EXPECTED_INDEX_COUNT = 31; //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!! @@ -172,7 +172,7 @@ namespace AyaNova.Util await ExecQueryAsync("CREATE TABLE auser (id BIGSERIAL PRIMARY KEY, active bool not null, name varchar(255) not null unique, " + "login text not null, password text not null, salt text not null, roles integer not null, " + "dlkey text, dlkeyexpire timestamp, usertype integer not null, employeenumber varchar(255), notes text, customerid bigint, " + - "headofficeid bigint, subvendorid bigint, customfields text, tags varchar(255) ARRAY)"); + "headofficeid bigint, subvendorid bigint, wikicontent text null, customfields text, tags varchar(255) ARRAY)"); //Index for name fetching await ExecQueryAsync("CREATE UNIQUE INDEX auser_name_id_idx ON auser (id, name);"); @@ -212,7 +212,7 @@ namespace AyaNova.Util //id, text, longtext, boolean, currency, await ExecQueryAsync("CREATE TABLE awidget (id BIGSERIAL PRIMARY KEY, name varchar(255) not null unique, serial bigint not null," + "startdate timestamp, enddate timestamp, dollaramount decimal(19,5), active bool, usertype int4, count integer," + - "notes text, userid bigint null, customfields text, tags varchar(255) ARRAY)"); + "notes text, userid bigint null, wikicontent text null, customfields text, tags varchar(255) ARRAY)"); //TEST TEST TEST ONLY FOR DEVELOPMENT TESTING TO ENSURE UNIQUENESS //exec("CREATE UNIQUE INDEX awidget_serial_idx ON awidget (serial);"); @@ -315,22 +315,22 @@ namespace AyaNova.Util } - ////////////////////////////////////////////////// - // WikiPage table - if (currentSchema < 11) - { - LogUpdateMessage(log); + // ////////////////////////////////////////////////// + // // WikiPage table + // if (currentSchema < 11) + // { + // LogUpdateMessage(log); - await ExecQueryAsync("CREATE TABLE awikipage (id BIGSERIAL PRIMARY KEY, " + - "objectid bigint not null, objecttype integer not null, " + - "content text)"); + // await ExecQueryAsync("CREATE TABLE awikipage (id BIGSERIAL PRIMARY KEY, " + + // "objectid bigint not null, objecttype integer not null, " + + // "content text)"); - //INDEX: Most selective first as there is more unique ID's than unique types - //to take advantage of this always query with where objectid=xx and objecttype=yy order - await ExecQueryAsync("CREATE INDEX awikipage_typeid_idx ON awikipage (objectid, objecttype );"); + // //INDEX: Most selective first as there is more unique ID's than unique types + // //to take advantage of this always query with where objectid=xx and objecttype=yy order + // await ExecQueryAsync("CREATE INDEX awikipage_typeid_idx ON awikipage (objectid, objecttype );"); - await SetSchemaLevelAsync(++currentSchema); - } + // await SetSchemaLevelAsync(++currentSchema); + // }