本文整理汇总了Java中org.apache.isis.applib.annotation.ActionSemantics.Of类的典型用法代码示例。如果您正苦于以下问题:Java Of类的具体用法?Java Of怎么用?Java Of使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Of类属于org.apache.isis.applib.annotation.ActionSemantics包,在下文中一共展示了Of类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: imprimirFactura
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
@NotContributed(NotContributed.As.ASSOCIATION)
@NotInServiceMenu
@ActionSemantics(Of.SAFE)
@MemberOrder(sequence = "10")
public Blob imprimirFactura(final Factura _factura) throws Exception {
try (PDDocument pdfDocument = cargarPlantilla(_factura)) {
final ByteArrayOutputStream target = new ByteArrayOutputStream();
pdfDocument.save(target);
final String name = "Factura-" + _factura.getNumero() + ".pdf";
final String mimeType = "application/pdf";
final byte[] bytes = target.toByteArray();
return new Blob(name, mimeType, bytes);
}
}
示例2: listarMesasAsignadas
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
/**
* Permite listar mesas asignadas a los mozos, si es que estos poseen
* @see dom.persona.Persona.getUsuario()
* @see dom.usuario.Usuario.getNombre()
* @return List<Mesa>
*/
@Named("Listar")
@ActionSemantics(Of.SAFE)
@MemberOrder(sequence = "2")
public List<Mesa> listarMesasAsignadas() {
final Mozo mozo = uniqueMatch(Mozo.class, new Predicate<Mozo>() {
@Override
public boolean apply(Mozo _mozo) {
// TODO Auto-generated method stub
return _mozo.getUsuario().getNombre()
.equals(getUser().getName());
}
});
if (mozo == null) {
informUser("No tiene mesas asignadas.");
return null;
}
return mozo.getListamesas();
}
示例3: listarOfertasAlta
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
/**
* Obtiene una lista de Ofertas que se encuentren de alta
* @return List<Oferta>
*/
@Named("Listar")
@ActionSemantics(Of.SAFE)
@MemberOrder(sequence = "2")
public List<Oferta> listarOfertasAlta() {
return allMatches(Oferta.class, new Predicate<Oferta>() {
@Override
public boolean apply(Oferta input) {
// TODO Auto-generated method stub
return (!input.getBaja())
&& input.getFechaInicio().before(new Date())
&& input.getCaducidad().after(new Date()) ? true
: false;
}
});
}
示例4: downloadCustomerConfirmation
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
@NotContributed(NotContributed.As.ASSOCIATION) // ie contributed as action
@NotInServiceMenu
@ActionSemantics(Of.SAFE)
@MemberOrder(sequence = "10")
public Blob downloadCustomerConfirmation(
final Order order) throws Exception {
try (PDDocument pdfDocument = loadAndPopulateTemplate(order)) {
final ByteArrayOutputStream target = new ByteArrayOutputStream();
pdfDocument.save(target);
final String name = "customerConfirmation-" + order.getNumber() + ".pdf";
final String mimeType = "application/pdf";
final byte[] bytes = target.toByteArray();
return new Blob(name, mimeType, bytes);
}
}
示例5: recentChanges
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
/**
* Depending on which services are available, returns either a list of {@link CommandJdo command}s that have
* caused a change in the domain object or a list of {@link AuditEntryJdo audit entries} capturing the 'effect'
* of that change.
*
* <p>
* If {@link CommandJdo command}s are returned, then the corresponding {@link AuditEntryJdo audit entries} are
* available from each command.
*/
@NotInServiceMenu
@ActionSemantics(Of.SAFE)
@MemberOrder(sequence="30")
public List<? extends DomainChangeJdoAbstract> recentChanges (
final Object targetDomainObject,
final @Optional @Named("From") LocalDate from,
final @Optional @Named("To") LocalDate to) {
final Bookmark targetBookmark = bookmarkService.bookmarkFor(targetDomainObject);
final List<DomainChangeJdoAbstract> changes = Lists.newArrayList();
if(commandServiceRepository != null) {
changes.addAll(commandServiceRepository.findByTargetAndFromAndTo(targetBookmark, from, to));
}
if(publishingServiceRepository != null) {
changes.addAll(publishingServiceRepository.findByTargetAndFromAndTo(targetBookmark, from, to));
}
changes.addAll(auditingServiceRepository.findByTargetAndFromAndTo(targetBookmark, from, to));
Collections.sort(changes, DomainChangeJdoAbstract.compareByTimestampDescThenType());
return changes;
}
示例6: putCharge
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
@ActionSemantics(Of.IDEMPOTENT)
public void putCharge(
@Named("atPath") final String atPath,
@Named("reference") final String reference,
@Named("name") final String name,
@Named("description") @Optional final String description,
@Named("taxReference") final String taxReference,
@Named("sortOrder") @Optional final String sortOrder,
@Named("chargeGroupReference") final String chargeGroupReference,
@Named("chargeGroupName") final String chargeGroupName,
@Named("externalReference") @Optional final String externalReference) {
final ChargeGroup chargeGroup = fetchOrCreateChargeGroup(chargeGroupReference, chargeGroupName);
final ApplicationTenancy applicationTenancy = applicationTenancies.findTenancyByPath(atPath);
final Tax tax = taxes.findOrCreate(taxReference, taxReference, applicationTenancy);
final Charge charge = charges.newCharge(applicationTenancy, reference, name, description, tax, chargeGroup);
charge.setExternalReference(externalReference);
charge.setSortOrder(sortOrder);
}
示例7: putApplicationTenancy
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
@ActionSemantics(Of.IDEMPOTENT)
public void putApplicationTenancy(
@Named("path") final String path,
@Named("name") final String name) {
ApplicationTenancy applicationTenancy = applicationTenancies.findTenancyByPath(path);
if (applicationTenancy == null) {
final ApplicationTenancyLevel parentLevel = ApplicationTenancyLevel.of(path).parent();
final ApplicationTenancy parentApplicationTenancy =
parentLevel != null
? applicationTenancies.findTenancyByPath(parentLevel.getPath())
: null;
applicationTenancy = applicationTenancies.newTenancy(name, path, parentApplicationTenancy);
}
applicationTenancy.setName(name);
// TODO: EST-467, to remove
getContainer().flush();
}
示例8: putTax
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
@ActionSemantics(Of.IDEMPOTENT)
public void putTax(
@Named("atPath") final String atPath,
@Named("reference") final String reference,
@Named("name") final String name,
@Named("description") final String description,
@Named("externalReference") @Optional final String externalReference,
@Named("ratePercentage") final BigDecimal percentage,
@Named("rateStartDate") final LocalDate startDate,
@Named("rateExternalReference") @Optional final String rateExternalReference) {
final ApplicationTenancy applicationTenancy = applicationTenancies.findTenancyByPath(atPath);
final Tax tax = taxes.findOrCreate(reference, name, applicationTenancy);
tax.setExternalReference(externalReference);
tax.setDescription(description);
final TaxRate rate = tax.newRate(startDate, percentage);
rate.setExternalReference(rateExternalReference);
}
示例9: putPerson
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
@ActionSemantics(Of.IDEMPOTENT)
public void putPerson(
@Named("atPath") final String atPath,
@Named("reference") final String reference,
@Named("initials") @Optional final String initials,
@Named("firstName") final String firstName,
@Named("lastName") final String lastName,
@Named("Gender") @Optional final String gender) {
final ApplicationTenancy applicationTenancy = applicationTenancies.findTenancyByPath(atPath);
Person person = (Person) parties.findPartyByReference(reference);
if (person == null) {
person = persons.newPerson(
reference,
initials,
firstName,
lastName,
gender == null ? PersonGenderType.UNKNOWN : PersonGenderType.valueOf(gender), applicationTenancy);
}
person.setApplicationTenancyPath(applicationTenancy.getPath());
person.setFirstName(firstName);
person.setLastName(lastName);
}
示例10: putOrganisation
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
@ActionSemantics(Of.IDEMPOTENT)
public void putOrganisation(
@Named("atPath") final String atPath,
@Named("reference") final String reference,
@Named("name") final String name,
@Named("vatCode") @Optional final String vatCode,
@Named("fiscalCode") @Optional final String fiscalCode) {
final ApplicationTenancy applicationTenancy = applicationTenancies.findTenancyByPath(atPath);
Organisation org = (Organisation) parties.findPartyByReferenceOrNull(reference);
if (org == null) {
org = organisations.newOrganisation(reference, name, applicationTenancy);
}
org.setApplicationTenancyPath(atPath);
org.setName(name);
org.setFiscalCode(fiscalCode);
org.setVatCode(vatCode);
}
示例11: putPropertyPostalAddress
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
@ActionSemantics(Of.IDEMPOTENT)
public void putPropertyPostalAddress(
@Named("propertyReference") final String propertyReference,
@Named("address1") @Optional final String address1,
@Named("address2") @Optional final String address2,
@Named("city") final String city,
@Named("postalCode") @Optional final String postalCode,
@Named("stateCode") @Optional final String stateCode,
@Named("countryCode") final String countryCode) {
final Property property = properties.findPropertyByReferenceElseNull(propertyReference);
if (property == null) {
throw new ApplicationException(String.format("Property with reference %s not found.", propertyReference));
}
final CommunicationChannel comm = communicationChannelContributions.findCommunicationChannelForType(property, null);
if (comm == null) {
communicationChannelContributions.newPostal(property, CommunicationChannelType.POSTAL_ADDRESS, countries.findCountry(countryCode), states.findState(stateCode), address1, address2, null, postalCode, city);
}
}
示例12: putPartyEmailAddress
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
@ActionSemantics(Of.IDEMPOTENT)
public void putPartyEmailAddress(
@Named("reference") final String partyReference,
@Named("emailAddress") final String emailAddress,
@Named("legal") @Optional final Boolean legal
) {
final Party party = fetchParty(partyReference);
CommunicationChannel comm = emailAddresses.findByEmailAddress(party, emailAddress);
if (comm == null) {
comm = communicationChannels.newEmail(party, CommunicationChannelType.EMAIL_ADDRESS, emailAddress);
if (legal != null) {
comm.setLegal(legal);
}
}
}
示例13: putLease
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
@ActionSemantics(Of.IDEMPOTENT)
public void putLease(
@Named("reference") final String reference,
@Named("name") final String name,
@Named("tenantReference") final String tenantReference,
@Named("landlordReference") final String landlordReference,
@Named("type") final String type,
@Named("startDate") @Optional final LocalDate startDate,
@Named("endDate") @Optional final LocalDate endDate,
@Named("tenancyStartDate") @Optional final LocalDate tenancyStartDate,
@Named("tenancyEndDate") @Optional final LocalDate tenancyEndDate,
@Named("propertyReference") @Optional final String propertyReference
) {
final Party tenant = fetchParty(tenantReference);
final Party landlord = fetchParty(landlordReference);
Lease lease = leases.findLeaseByReferenceElseNull(reference);
final LeaseType leaseType = leaseTypes.findOrCreate(type, null);
final Property property = fetchProperty(propertyReference, null, false);
if (lease == null) {
lease = leases.newLease(property.getApplicationTenancy(), reference, name, leaseType, startDate, endDate, tenancyStartDate, tenancyEndDate, landlord, tenant);
}
lease.setTenancyStartDate(tenancyStartDate);
lease.setTenancyEndDate(tenancyEndDate);
}
示例14: putLeaseTermForTurnoverRent
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
@ActionSemantics(Of.IDEMPOTENT)
public void putLeaseTermForTurnoverRent(
// start generic fields
@Named("leaseReference") final String leaseReference,
@Named("tenantReference") final String tenantReference,
@Named("unitReference") @Optional final String unitReference,
@Named("itemSequence") final BigInteger itemSequence,
@Named("itemType") final String itemType,
@Named("itemStartDate") final LocalDate itemStartDate,
@Named("sequence") final BigInteger sequence,
@Named("startDate") @Optional final LocalDate startDate,
@Named("endDate") @Optional final LocalDate endDate,
@Named("status") @Optional final String status,
// end generic fields
@Named("turnoverRentRule") @Optional final String turnoverRentRule,
@Named("auditedTurnover") @Optional final BigDecimal auditedTurnover,
@Named("auditedTurnoverRent") @Optional final BigDecimal auditedTurnoverRent) {
final LeaseTermForTurnoverRent term = (LeaseTermForTurnoverRent) putLeaseTerm(leaseReference, unitReference, itemSequence, itemType, itemStartDate, startDate, endDate, sequence, status);
if (term != null) {
term.setTurnoverRentRule(turnoverRentRule);
term.setAuditedTurnover(auditedTurnover);
term.setAuditedTurnoverRent(auditedTurnoverRent);
}
}
示例15: putLeaseTermForServiceCharge
import org.apache.isis.applib.annotation.ActionSemantics.Of; //导入依赖的package包/类
@ActionSemantics(Of.IDEMPOTENT)
public void putLeaseTermForServiceCharge(
// start generic fields
@Named("leaseReference") final String leaseReference,
@Named("tenantReference") final String tenantReference,
@Named("unitReference") @Optional final String unitReference,
@Named("itemSequence") final BigInteger itemSequence,
@Named("itemType") final String itemType,
@Named("itemStartDate") final LocalDate itemStartDate,
@Named("sequence") final BigInteger sequence,
@Named("startDate") @Optional final LocalDate startDate,
@Named("endDate") @Optional final LocalDate endDate,
@Named("status") @Optional final String status,
// end generic fields
@Named("auditedValue") @Optional final BigDecimal auditedValue,
@Named("budgetedValue") @Optional final BigDecimal budgetedValue) {
final LeaseTermForServiceCharge term = (LeaseTermForServiceCharge) putLeaseTerm(leaseReference, unitReference, itemSequence, itemType, itemStartDate, startDate, endDate, sequence, status);
if (term != null) {
term.setAuditedValue(auditedValue);
term.setBudgetedValue(budgetedValue);
}
}