1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 20:15:26 +02:00

Update README.md with latest version numbers

This commit is contained in:
sauls8t 2018-03-28 14:25:37 +01:00
parent ad4030bc17
commit 30315a36c7
7 changed files with 680 additions and 663 deletions

View file

@ -31,6 +31,7 @@ import (
"github.com/documize/community/domain"
"github.com/documize/community/domain/conversion/store"
"github.com/documize/community/domain/permission"
indexer "github.com/documize/community/domain/search"
"github.com/documize/community/model/activity"
"github.com/documize/community/model/attachment"
"github.com/documize/community/model/audit"
@ -143,7 +144,7 @@ func (h *Handler) convert(w http.ResponseWriter, r *http.Request, job, folderID
return
}
nd, err := processDocument(ctx, h.Runtime, h.Store, filename, job, folderID, fileResult)
nd, err := processDocument(ctx, h.Runtime, h.Store, h.Indexer, filename, job, folderID, fileResult)
if err != nil {
ctx.Transaction.Rollback()
response.WriteServerError(w, method, err)
@ -157,7 +158,7 @@ func (h *Handler) convert(w http.ResponseWriter, r *http.Request, job, folderID
response.WriteJSON(w, nd)
}
func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.Store, filename, job, folderID string, fileResult *api.DocumentConversionResponse) (newDocument doc.Document, err error) {
func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.Store, indexer indexer.Indexer, filename, job, folderID string, fileResult *api.DocumentConversionResponse) (newDocument doc.Document, err error) {
// Convert into database objects
document := convertFileResult(filename, fileResult)
document.Job = job
@ -203,8 +204,13 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
err = errors.Wrap(err, "cannot insert new page for new document")
return
}
// pp, _ := store.Page.Get(ctx, pageID)
go indexer.IndexContent(ctx, p)
}
da := []attachment.Attachment{}
for _, e := range fileResult.EmbeddedFiles {
//fmt.Println("DEBUG embedded file info", document.OrgId, document.Job, e.Name, len(e.Data), e.ID)
var a attachment.Attachment
@ -222,6 +228,8 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
err = errors.Wrap(err, "cannot insert attachment for new document")
return
}
da = append(da, a)
}
store.Activity.RecordUserActivity(ctx, activity.UserActivity{
@ -244,6 +252,8 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
return
}
indexer.IndexDocument(ctx, newDocument, da)
store.Audit.Record(ctx, audit.EventTypeDocumentUpload)
return