本文整理汇总了Java中org.apache.isis.applib.annotation.InvokeOn.COLLECTION_ONLY属性的典型用法代码示例。如果您正苦于以下问题:Java InvokeOn.COLLECTION_ONLY属性的具体用法?Java InvokeOn.COLLECTION_ONLY怎么用?Java InvokeOn.COLLECTION_ONLY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.isis.applib.annotation.InvokeOn
的用法示例。
在下文中一共展示了InvokeOn.COLLECTION_ONLY属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: totalCost
@Action(
semantics = SemanticsOf.SAFE,
invokeOn = InvokeOn.COLLECTION_ONLY
)
public BigDecimal totalCost() {
BigDecimal total = (BigDecimal) scratchpad.get("runningTotal");
if(getCost() != null) {
total = total != null ? total.add(getCost()) : getCost();
scratchpad.put("runningTotal", total);
}
return total.setScale(2, BigDecimal.ROUND_HALF_EVEN);
}
示例2: act
@Action(
semantics = SemanticsOf.SAFE,
invokeOn = InvokeOn.COLLECTION_ONLY
)
@ActionLayout(contributed = Contributed.AS_ACTION)
public Object act() throws IOException {
final List<byte[]> pdfBytes = createOrLookupPdfBytes();
final Document document = getDocument();
// in a bulk situation it's possible that some DnC's have a document, others do not.
// we just ignore those that do not
if (document != null) {
appendBytes(document, pdfBytes);
final List<Document> supportingDocs = attachmentsProvider.attachmentsFor(document);
for (Document supportingDoc : supportingDocs) {
appendBytes(supportingDoc, pdfBytes);
}
}
if(interactionContext.isLast()) {
if(pdfBytes.isEmpty()) {
messageService.warnUser("No documents to be merged");
return null;
}
final byte[] mergedBytes = pdfBoxService.merge(pdfBytes.toArray(new byte[][] {}));
return new Blob(fileName, MIME_TYPE_APPLICATION_PDF, mergedBytes);
}
return null;
}
示例3: assignTasksToMe
@Action(semantics = SemanticsOf.IDEMPOTENT, invokeOn = InvokeOn.COLLECTION_ONLY)
public Task assignTasksToMe() {
setPersonAssignedTo(personRepository.me());
return this;
}