use of org.estatio.module.capex.app.document.IncomingDocViewModel in project estatio by estatio.
the class PdfAdvisorForEstatio method determineDocument.
private Document determineDocument(final InstanceKey instanceKey, final Class<? extends IncomingDocViewModel> viewModelClass) {
final InstanceKey.TypeKey typeKey = instanceKey.getTypeKey();
final String objectType = typeKey.getObjectType();
if (!Objects.equals(objectType, viewModelClass.getName())) {
return null;
}
final String identifier = instanceKey.getIdentifier();
final String xmlStr = urlEncodingService.decode(identifier);
final IncomingDocViewModel viewModel = jaxbService.fromXml(viewModelClass, xmlStr);
return viewModel.getDocument();
}
use of org.estatio.module.capex.app.document.IncomingDocViewModel in project estatio by estatio.
the class Task_categoriseDocumentAsOrder method act.
@Action(domainEvent = ActionDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(contributed = Contributed.AS_ACTION, cssClassFa = "folder-open-o")
public Object act(@Nullable final Property property, @Nullable final String comment, final boolean goToNext) {
final Object nextTaskIfAny = nextTaskOrWarnIfRequired(goToNext);
Object mixinResult = mixin().act(property, comment);
if (mixinResult instanceof IncomingDocViewModel) {
IncomingDocViewModel viewModel = (IncomingDocViewModel) mixinResult;
// to support 'goToNext' when finished with the view model
viewModel.setOriginatingTask(task);
}
return coalesce(nextTaskIfAny, mixinResult);
}
use of org.estatio.module.capex.app.document.IncomingDocViewModel in project estatio by estatio.
the class Task_categoriseDocumentAsPropertyInvoice method act.
@Action(domainEvent = Task_categoriseDocumentAsOrder.ActionDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(contributed = Contributed.AS_ACTION, cssClassFa = "folder-open-o")
public Object act(final Property property, @Nullable final String comment, final boolean goToNext) {
final Object nextTaskIfAny = nextTaskOrWarnIfRequired(goToNext);
Object mixinResult = mixin().act(property, comment);
if (mixinResult instanceof IncomingDocViewModel) {
IncomingDocViewModel viewModel = (IncomingDocViewModel) mixinResult;
// to support 'goToNext' when finished with the view model
viewModel.setOriginatingTask(task);
}
return coalesce(nextTaskIfAny, mixinResult);
}
use of org.estatio.module.capex.app.document.IncomingDocViewModel in project estatio by estatio.
the class Task_categoriseDocumentAsOtherInvoice method act.
@Action(domainEvent = ActionDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(contributed = Contributed.AS_ACTION, cssClassFa = "folder-open-o")
public Object act(final IncomingInvoiceType incomingInvoiceType, @Nullable final String comment, final boolean goToNext) {
final Object nextTaskIfAny = nextTaskOrWarnIfRequired(goToNext);
Object mixinResult = mixin().act(incomingInvoiceType, comment);
if (mixinResult instanceof IncomingDocViewModel) {
IncomingDocViewModel viewModel = (IncomingDocViewModel) mixinResult;
// to support 'goToNext' when finished with the view model
viewModel.setOriginatingTask(task);
}
return coalesce(nextTaskIfAny, mixinResult);
}
Aggregations