This commit is contained in:
2020-04-15 22:59:49 +00:00
parent 464cab837e
commit a6737df4f0
9 changed files with 68 additions and 48 deletions

View File

@@ -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
---
=-=-=-=-=

View File

@@ -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,

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -21,8 +21,7 @@ namespace AyaNova.Models
public virtual DbSet<DataListView> DataListView { get; set; }
public virtual DbSet<Tag> Tag { get; set; }
public virtual DbSet<FormCustom> FormCustom { get; set; }
public virtual DbSet<PickListTemplate> PickListTemplate { get; set; }
public virtual DbSet<WikiPage> WikiPage { get; set; }
public virtual DbSet<PickListTemplate> 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

View File

@@ -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<string> Tags { get; set; }

View File

@@ -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<string> Tags { get; set; }
//relations

View File

@@ -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; }
}
}

View File

@@ -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);
// }