public HtmlLocationCssDocumentProcessor(string documentString, DocumentLink documentLink) : base(documentLink, Configuration.WebsiteConfigSections.WebsiteCrawlingSettings.DocumentTypes.HtmlCSS)
 {
     _htmlDocument = new HtmlDocument();
     _htmlDocument.LoadHtml(documentString);
 }
 public abstract Task <DocumentLink> Handle(DocumentLink request, CancellationToken cancellationToken);
Beispiel #3
0
 public abstract RpcResult ResolveDocumentLink(DocumentLink args);
 public HtmlLocationCssDocumentProcessor(WebResponse webResponse, DocumentLink documentLink) : base(documentLink, Configuration.WebsiteConfigSections.WebsiteCrawlingSettings.DocumentTypes.HtmlCSS)
 {
     _htmlDocument = new HtmlDocument();
     _htmlDocument.Load(webResponse.GetResponseStream(), true);
 }
        public DocumentLinkView Get(int?id)
        {
            DocumentLink documentLink = repo.Get(id);

            return(mapper.Map <DocumentLink, DocumentLinkView>(documentLink));
        }
        public void Update(DocumentLinkView documentLinkView)
        {
            DocumentLink documentLink = mapper.Map <DocumentLinkView, DocumentLink> (documentLinkView);

            repo.Update(documentLink);
        }
 public override bool CanResolve(DocumentLink value) => _canResolve.Invoke(value);
Beispiel #8
0
 public virtual Task <DocumentLink> DocumentLinkResolve(DocumentLink item, CancellationToken cancellationToken)
 => throw new NotImplementedException();
 public abstract bool CanResolve(DocumentLink value);
 public override Task <DocumentLink> Handle(DocumentLink request, CancellationToken cancellationToken) => _resolveHandler.Invoke(request, cancellationToken);
Beispiel #11
0
 public static Task <DocumentLink> DocumentLinkResolve(this ILanguageClientDocument mediator, DocumentLink @params)
 {
     return(mediator.SendRequest <DocumentLink, DocumentLink>(DocumentNames.DocumentLinkResolve, @params));
 }
Beispiel #12
0
        public string CreateShareLink(string relativeFullName, User user)
        {
            string fullDisplayName;

            // Check if the file exists.
            if (FindFile(relativeFullName, user.RootFolder, out fullDisplayName) == null)
                return null;

            string key = _context.DocumentLinks.Where(x => x.RelativeFullName == fullDisplayName).Select(x => x.Key).FirstOrDefault();

            if (key == null)
            {
                key = Utilities.GenerateRandomString(Utilities.LetterDigitChars, 8);
                var dl = new DocumentLink
                {
                    Key = key,
                    RelativeFullName = fullDisplayName,
                    User = user
                };

                try
                {
                    _context.DocumentLinks.Add(dl);
                    _context.SaveChanges();
                }
                catch
                {
                    return null;
                }
            }

            return key;
        }
Beispiel #13
0
        public static void updateDoc(sdDocJSON doc)
        {
            SDDocumentation newSDDoc = new SDDocumentation();

            newSDDoc.Status_id = 2;

            using (var curDB = new HelpDesk_DB())
            {
                SDDocumentation oldDoc      = DocumentList[doc.index];
                var             originalDoc = curDB.SDDocumentations.Find(oldDoc.id);
                originalDoc.Status_id = 4;  //Historic

                //Transfer persisting information to new document
                newSDDoc.LearningCenterCategory_id = oldDoc.LearningCenterCategory_id;
                newSDDoc.Original_id = oldDoc.Original_id;
                if (oldDoc.learningCenterOrder != null)
                {
                    newSDDoc.learningCenterOrder = oldDoc.learningCenterOrder;
                }

                curDB.SaveChanges();
                //Rebuilds document list for find reference
                DocumentList = curDB.SDDocumentations.Where(p => p.Status_id == 2).OrderBy(p => p.alias).ToList();
            }

            DocumentLink pdfLink = new DocumentLink();

            pdfLink.link      = doc.documentLink;
            pdfLink.Access_id = doc.PDFaccess;

            //Check for null document links
            if (doc.documentLink != "")
            {
                newSDDoc.DocumentLink_id = addDocumentLink(pdfLink);
            }

            DocumentLink pwLink = new DocumentLink();

            pwLink.link      = doc.passwordHyperlink;
            pwLink.Access_id = doc.PWaccess;
            //check for null pw links
            if (doc.passwordHyperlink != "")
            {
                newSDDoc.PasswordHyperlink_id = addDocumentLink(pwLink);
            }

            newSDDoc.alias = doc.alias;

            newSDDoc.documentTitle = doc.documentTitle;


            newSDDoc.passwordTitle = doc.passwordTitle;


            using (var curDB = new HelpDesk_DB())
            {
                curDB.SDDocumentations.Add(newSDDoc);
                curDB.SaveChanges();

                //Rebuilds document list for find reference
                DocumentList = curDB.SDDocumentations.Where(p => p.Status_id == 2).OrderBy(p => p.alias).ToList();
            }

            log();
        }
 public override string Resolve(DocumentLink link)
 {
     return($"/project/{link.Uid}");
 }
Beispiel #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HelpDesk_DB db       = new HelpDesk_DB();
            string      findItem = "";

            //Dymanically Build SD Documentation Table
            if (Request.QueryString["find"] != null)
            {
                findItem = Request.QueryString["find"].ToString();

                //TODO: Parameterize Query
                List <SDDocumentation> docList = db.SDDocumentations.SqlQuery("SELECT * FROM SDDocumentation WHERE alias LIKE @p0 AND Status_id = '2'", "%" + findItem + "%").ToList();


                foreach (SDDocumentation doc in docList)
                {
                    TableRow row = new TableRow();
                    SDDocumentationTable.Rows.Add(row);

                    //Document Hyperlink
                    if (doc.DocumentLink_id != null)
                    {
                        DocumentLink docLink = db.DocumentLinks.FirstOrDefault(p => p.Id == doc.DocumentLink_id);
                        this.addCell(row, doc.documentTitle, docLink.link);
                    }
                    else
                    {
                        //blank cell
                        this.addCell(row, "");
                    }

                    //Password Hyperlink
                    if (doc.PasswordHyperlink_id != null)
                    {
                        DocumentLink passwordDocLink = db.DocumentLinks.FirstOrDefault(p => p.Id == doc.PasswordHyperlink_id);
                        this.addCell(row, doc.passwordTitle, passwordDocLink.link);
                    }
                    else
                    {
                        //blank cell
                        this.addCell(row, "");
                    }
                }


                List <InfoGathering> infoGathList = db.InfoGatherings.SqlQuery("SELECT * FROM InfoGathering WHERE searchableAlias LIKE @p0 AND Status_id = '2'", "%" + findItem + "%").ToList <InfoGathering>();
                foreach (InfoGathering infoDoc in infoGathList)
                {
                    TableRow row = new TableRow();
                    InfoGatheringTable.Rows.Add(row);

                    DocumentLink docLink = db.DocumentLinks.FirstOrDefault(p => p.Id == infoDoc.infoGathLink_id);
                    //Check for nulls even though there shouldn't be any
                    if (docLink != null)
                    {
                        this.addCell(row, infoDoc.infoGathTitle, docLink.link);
                    }
                    else
                    {
                        this.addCell(row, "N/A");
                    }
                    this.addCell(row, infoDoc.assignmentGroup);
                    this.addCell(row, infoDoc.supportInfo);
                    this.addCell(row, infoDoc.supportHours);
                    this.addCell(row, infoDoc.contactInfo);
                    this.addCell(row, infoDoc.passwordAttributes);
                    DocumentLink pwLink = db.DocumentLinks.FirstOrDefault(p => p.Id == infoDoc.PasswordHyperlink_id);
                    if (pwLink != null)
                    {
                        this.addCell(row, infoDoc.passwordTitle, pwLink.link);
                    }
                    else
                    {
                        this.addCell(row, "N/A");
                    }
                    this.addCell(row, infoDoc.aliases);
                }
            }
        }