protected override void SaveSearchableDocument(Document document) { //Save searchable document string searchableFileName; byte[] extractedContent = base.GetDocumentSignedContent(document, document.Content.Blob, out searchableFileName); searchableFileName = string.Concat(document.IdDocument, Path.GetExtension(searchableFileName)); DocumentService.AddSearchableToFileTable(document, searchableFileName, extractedContent, DocumentType.Searchable); }
protected override void SaveSearchableAttributes(Document document) { using (MemoryStream searchableStream = new MemoryStream()) { XmlDocument doc = new XmlDocument(); searchableStream.Position = 0; XmlElement rootElement = doc.CreateElement("Attributes"); foreach (DocumentAttributeValue item in document.AttributeValues) { XmlElement element = doc.CreateElement(item.Attribute.Name); element.InnerText = item.Value.ToString(); rootElement.AppendChild(element); } doc.AppendChild(rootElement); doc.Save(searchableStream); //Save searchable attribute document string attributesFileName = string.Concat(document.IdDocument, Path.GetExtension(document.Name), ".xml"); DocumentService.AddSearchableToFileTable(document, attributesFileName, searchableStream.ToArray(), DocumentType.SearchableAttributes); } }