示例#1
0
// ShowRepository shows the details regarding a repository
func (controller *Repository) ShowRepository() {
	repo := controller.GetRepository()
	controller.Data["repository"] = repo
	controller.SetCustomTitle(repo.Name)

	controller.Data["institution"] = repo.GetInstitution()
	controller.Data["identification"] = repo.GetIdentification()

	if repo.HasBeenProcessed() {
		process := harvest.NewProcess(repo.LastProcess)

		storage := wisply.NewStorage(repo)

		collections := storage.GetCollections()

		controller.Data["collections"] = collections

		collectionsJSON, _ := json.Marshal(collections)
		controller.Data["collectionsJSON"] = string(collectionsJSON)

		controller.Data["process"] = process
		controller.IndicateLastModification(process.Process.End)
	}
	controller.LoadTemplate("repository")
}
示例#2
0
// ShowProcess displays the log of a process
func (controller *Process) show() {
	process := controller.GetProcess()

	if process.IsRunning {
		operationID := process.GetCurrentOperation().ID
		operation := action.NewOperation(operationID)
		controller.Data["operation"] = operation
	}
	controller.Data["operations"] = process.GetOperations()
	controller.Data["harvestProcess"] = harvest.NewProcess(process.Action.ID)
}