Search in sources :

Example 1 with IncomingDocViewModel

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();
}
Also used : IncomingDocViewModel(org.estatio.module.capex.app.document.IncomingDocViewModel)

Example 2 with IncomingDocViewModel

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);
}
Also used : IncomingDocViewModel(org.estatio.module.capex.app.document.IncomingDocViewModel) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 3 with IncomingDocViewModel

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);
}
Also used : IncomingDocViewModel(org.estatio.module.capex.app.document.IncomingDocViewModel) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 4 with IncomingDocViewModel

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);
}
Also used : IncomingDocViewModel(org.estatio.module.capex.app.document.IncomingDocViewModel) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Aggregations

IncomingDocViewModel (org.estatio.module.capex.app.document.IncomingDocViewModel)4 Action (org.apache.isis.applib.annotation.Action)3 ActionLayout (org.apache.isis.applib.annotation.ActionLayout)3