Search in sources :

Example 6 with ApplicationException

use of org.apache.isis.applib.ApplicationException in project estatio by estatio.

the class LeaseTermImportAbstract method fetchLease.

private Lease fetchLease(final String leaseReference) {
    final Lease lease;
    lease = leaseRepository.findLeaseByReference(leaseReference.trim().replaceAll("~", "+"));
    if (lease == null) {
        throw new ApplicationException(String.format("Lease with reference %s not found.", leaseReference));
    }
    return lease;
}
Also used : ApplicationException(org.apache.isis.applib.ApplicationException) Lease(org.estatio.module.lease.dom.Lease)

Example 7 with ApplicationException

use of org.apache.isis.applib.ApplicationException in project estatio by estatio.

the class CommunicationChannelImport method fetchLease.

private Lease fetchLease(final String leaseReference) {
    final Lease lease;
    lease = leaseRepository.findLeaseByReference(leaseReference.trim().replaceAll("~", "+"));
    if (lease == null) {
        throw new ApplicationException(String.format("Lease with reference %s not found.", leaseReference));
    }
    return lease;
}
Also used : ApplicationException(org.apache.isis.applib.ApplicationException) Lease(org.estatio.module.lease.dom.Lease)

Example 8 with ApplicationException

use of org.apache.isis.applib.ApplicationException in project estatio by estatio.

the class BankMandateImport method fetchLease.

private Lease fetchLease(final String leaseReference) {
    final Lease lease;
    lease = leaseRepository.findLeaseByReference(leaseReference.trim().replaceAll("~", "+"));
    if (lease == null) {
        throw new ApplicationException(String.format("Lease with reference %s not found.", leaseReference));
    }
    return lease;
}
Also used : ApplicationException(org.apache.isis.applib.ApplicationException) Lease(org.estatio.module.lease.dom.Lease)

Example 9 with ApplicationException

use of org.apache.isis.applib.ApplicationException in project estatio by estatio.

the class BreakOptionImport method fetchLease.

private Lease fetchLease(final String leaseReference) {
    final Lease lease;
    lease = leaseRepository.findLeaseByReference(leaseReference.trim().replaceAll("~", "+"));
    if (lease == null) {
        throw new ApplicationException(String.format("Lease with reference %s not found.", leaseReference));
    }
    return lease;
}
Also used : ApplicationException(org.apache.isis.applib.ApplicationException) Lease(org.estatio.module.lease.dom.Lease)

Example 10 with ApplicationException

use of org.apache.isis.applib.ApplicationException in project estatio by estatio.

the class BudgetImportExport method findOrCreateBudgetAndBudgetItem.

private BudgetItem findOrCreateBudgetAndBudgetItem(final Charge incomingCharge) {
    Property property = propertyRepository.findPropertyByReference(getPropertyReference());
    if (property == null)
        throw new ApplicationException(String.format("Property with reference [%s] not found.", getPropertyReference()));
    Budget budget = budgetRepository.findOrCreateBudget(property, getBudgetStartDate(), getBudgetEndDate());
    BudgetItem budgetItem = budget.findOrCreateBudgetItem(incomingCharge).updateOrCreateBudgetItemValue(getBudgetedValue(), getBudgetStartDate(), BudgetCalculationType.BUDGETED).updateOrCreateBudgetItemValue(getAuditedValue(), getBudgetEndDate(), BudgetCalculationType.ACTUAL);
    return budgetItem;
}
Also used : ApplicationException(org.apache.isis.applib.ApplicationException) BudgetItem(org.estatio.module.budget.dom.budgetitem.BudgetItem) Budget(org.estatio.module.budget.dom.budget.Budget) Property(org.estatio.module.asset.dom.Property)

Aggregations

ApplicationException (org.apache.isis.applib.ApplicationException)23 Lease (org.estatio.module.lease.dom.Lease)11 Programmatic (org.apache.isis.applib.annotation.Programmatic)6 Charge (org.estatio.module.charge.dom.Charge)4 Property (org.estatio.module.asset.dom.Property)3 IOException (java.io.IOException)2 Budget (org.estatio.module.budget.dom.budget.Budget)2 BudgetCalculationType (org.estatio.module.budget.dom.budgetcalculation.BudgetCalculationType)2 BudgetItem (org.estatio.module.budget.dom.budgetitem.BudgetItem)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 InputStreamReader (java.io.InputStreamReader)1 UnknownHostException (java.net.UnknownHostException)1 ArrayList (java.util.ArrayList)1 DataSource (javax.activation.DataSource)1 HttpHost (org.apache.http.HttpHost)1 StatusLine (org.apache.http.StatusLine)1 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)1 HttpGet (org.apache.http.client.methods.HttpGet)1 HttpClientContext (org.apache.http.client.protocol.HttpClientContext)1 Action (org.apache.isis.applib.annotation.Action)1