本文整理汇总了Java中org.apache.isis.applib.annotation.Publishing类的典型用法代码示例。如果您正苦于以下问题:Java Publishing类的具体用法?Java Publishing怎么用?Java Publishing使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Publishing类属于org.apache.isis.applib.annotation包,在下文中一共展示了Publishing类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: completed
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(
domainEvent =CompletedDomainEvent.class,
publishing = Publishing.ENABLED,
invokeOn = InvokeOn.OBJECT_AND_COLLECTION
)
public ToDoItem completed() {
setComplete(true);
//
// remainder of method just demonstrates the use of the ActionInvocationContext service
//
@SuppressWarnings("unused")
final List<Object> allObjects = actionInvocationContext.getDomainObjects();
LOG.debug("completed: "
+ actionInvocationContext.getIndex() +
" [" + actionInvocationContext.getSize() + "]"
+ (actionInvocationContext.isFirst() ? " (first)" : "")
+ (actionInvocationContext.isLast() ? " (last)" : ""));
// if invoked as a regular action, return this object;
// otherwise return null (so go back to the list)
return actionInvocationContext.getInvokedOn() == InvokedOn.COLLECTION? null: this;
}
示例2: completeBatch
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(
semantics = SemanticsOf.IDEMPOTENT_ARE_YOU_SURE,
command = CommandReification.DISABLED,
publishing = Publishing.DISABLED
)
public PaymentBatchManager completeBatch(
final DateTime requestedExecutionDate,
@Nullable final String comment) {
// use the wrapper factory to generate events
wrapperFactory.wrap(PaymentBatch_complete()).act(requestedExecutionDate, comment);
// rather than return this manager, create a new one (force page reload)
final PaymentBatchManager paymentBatchManager = new PaymentBatchManager();
serviceRegistry2.injectServicesInto(paymentBatchManager);
return new PaymentBatchManager(paymentBatchManager.getSelectedBatchIdx());
}
示例3: downloadExcelExportForCompletedBatches
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(
semantics = SemanticsOf.SAFE,
command = CommandReification.DISABLED,
publishing = Publishing.DISABLED
)
public Blob downloadExcelExportForCompletedBatches(
@Nullable final String documentName,
final LocalDate startExecutionDate,
final LocalDate endExecutionDate
) {
List<PaymentLineForExcelExportV1> lineVms = new ArrayList<>();
List<PaymentBatch> batchesToExport = getCompletedBatches()
.stream()
.filter(
x->
x.getRequestedExecutionDate().toLocalDate().isAfter(startExecutionDate.minusDays(1))
&&
x.getRequestedExecutionDate().toLocalDate().isBefore(endExecutionDate.plusDays(1))
)
.collect(Collectors.toList());
for (PaymentBatch batch : batchesToExport){
lineVms.addAll(batch.paymentLinesForExcelExport());
}
String name = documentName!=null ? documentName.concat(".xlsx") : "export.xlsx";
return excelService.toExcel(lineVms, PaymentLineForExcelExportV1.class, "export", name);
}
示例4: act
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(
semantics = SemanticsOf.IDEMPOTENT,
command = CommandReification.DISABLED,
publishing = Publishing.DISABLED
)
public PaymentBatch act(
final List<IncomingInvoice> incomingInvoices,
@ParameterLayout(describedAs = "Whether the removed invoices should also be rejected")
final boolean rejectAlso,
@ParameterLayout(describedAs = "If rejecting, then explain why so that the error can be fixed")
@Nullable
final String rejectionReason) {
for (IncomingInvoice incomingInvoice : incomingInvoices) {
paymentBatch.removeLineFor(incomingInvoice);
if(rejectAlso) {
stateTransitionService.trigger(
incomingInvoice, IncomingInvoiceApprovalStateTransitionType.REJECT, null, rejectionReason);
}
}
return paymentBatch;
}
示例5: uploadIndexValues
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(publishing = Publishing.DISABLED, semantics = SemanticsOf.IDEMPOTENT)
@MemberOrder(sequence="2")
public List<IndexValueMaintLineItem> uploadIndexValues(
@Parameter(fileAccept = ".xlsx")
@ParameterLayout(named = "Excel spreadsheet")
final Blob spreadsheet,
final Country country) {
final ApplicationTenancy applicationTenancy = estatioApplicationTenancyRepository.findOrCreateTenancyFor(country);
List<IndexValueMaintLineItem> lineItems =
excelService.fromExcel(spreadsheet, IndexValueMaintLineItem.class, IndexValueMaintLineItem.class.getSimpleName());
for (IndexValueMaintLineItem lineItem : lineItems) {
lineItem.setAtPath(applicationTenancy.getPath());
}
return lineItems;
}
示例6: upload
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(publishing = Publishing.DISABLED, semantics = SemanticsOf.IDEMPOTENT)
public LeaseTermForServiceChargeBudgetAuditManager upload(
@Parameter(fileAccept = ".xlsx")
@ParameterLayout(named = "Excel spreadsheet")
final Blob spreadsheet) {
List<LeaseTermForServiceChargeBudgetAuditLineItem> lineItems =
excelService.fromExcel(spreadsheet, LeaseTermForServiceChargeBudgetAuditLineItem.class, "lease terms");
for (LeaseTermForServiceChargeBudgetAuditLineItem lineItem : lineItems) {
final LeaseTermForServiceCharge leaseTerm = lineItem.getLeaseTerm();
leaseTerm.setAuditedValue(lineItem.getAuditedValue());
leaseTerm.setBudgetedValue(lineItem.getBudgetedValue());
final LeaseTermForServiceCharge nextLeaseTerm = (LeaseTermForServiceCharge) leaseTerm.getNext();
final LeaseTermForServiceCharge nextLeaseTermUploaded = lineItem.getNextLeaseTerm();
if (nextLeaseTerm != null && nextLeaseTerm == nextLeaseTermUploaded) {
nextLeaseTerm.setBudgetedValue(lineItem.getNextBudgetedValue());
}
}
return this;
}
示例7: updateName
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(
command = CommandReification.ENABLED,
publishing = Publishing.ENABLED,
semantics = SemanticsOf.IDEMPOTENT,
domainEvent = UpdateNameDomainEvent.class
)
public SimpleObject updateName(@ParameterLayout(named="Name") final String name) {
setName(name);
return this;
}
示例8: getNotes
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Property(
command = CommandReification.ENABLED,
publishing = Publishing.ENABLED,
domainEvent = NotesDomainEvent.class
)
public String getNotes() {
return notes;
}
示例9: updateSomeStringOptionalWithMultiChoices
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(semantics=SemanticsOf.IDEMPOTENT, publishing = Publishing.ENABLED)
public TextObject updateSomeStringOptionalWithMultiChoices(
// @Nullable
@ParameterLayout(named = "Choose some string(s)")
final List<String> strings) {
final String asStr = SeparatorUtil.asStr(strings);
setSomeStringOptionalWithMultiChoices(asStr);
return this;
}
示例10: updateSomeStringOptionalWithMultiAutoComplete
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(semantics=SemanticsOf.IDEMPOTENT, publishing = Publishing.ENABLED)
public TextObject updateSomeStringOptionalWithMultiAutoComplete(
@Nullable
final List<String> strings) {
setSomeStringOptionalWithMultiAutoComplete(SeparatorUtil.asStr(strings));
return this;
}
示例11: importBlob
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(publishing = Publishing.DISABLED, semantics = SemanticsOf.IDEMPOTENT)
@CollectionLayout(paged = -1)
public List<ChargeImport> importBlob(
@Parameter(fileAccept = ".xlsx")
@ParameterLayout(named = "Excel spreadsheet") final Blob spreadsheet) {
List<ChargeImport> lineItems =
excelService.fromExcel(spreadsheet, ChargeImport.class, ChargeImport.class.getSimpleName());
ChargeImport previous = null;
for (ChargeImport lineItem : lineItems){
lineItem.importData(previous);
previous = lineItem;
}
return lineItems;
}
示例12: importBudget
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(publishing = Publishing.DISABLED, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout()
@CollectionLayout()
public Budget importBudget(
@Parameter(fileAccept = ".xlsx")
@ParameterLayout(named = "Excel spreadsheet")
final Blob spreadsheet) {
WorksheetSpec spec1 = new WorksheetSpec(BudgetImportExport.class, "budget");
WorksheetSpec spec2 = new WorksheetSpec(KeyItemImportExportLineItem.class, "keyItems");
WorksheetSpec spec3 = new WorksheetSpec(BudgetOverrideImportExport.class, "overrides");
WorksheetSpec spec4 = new WorksheetSpec(ChargeImport.class, "charges");
List<List<?>> objects =
excelService.fromExcel(spreadsheet, Arrays.asList(spec1, spec2, spec3, spec4));
// first upsert charges
List<ChargeImport> chargeImportLines = (List<ChargeImport>) objects.get(3);
for (ChargeImport lineItem : chargeImportLines){
lineItem.importData(null);
}
// import budget en items
List<BudgetImportExport> budgetItemLines = importBudgetAndItems(objects);
// import keyTables
importKeyTables(budgetItemLines, objects);
// import overrides
importOverrides(objects);
return getBudget();
}
示例13: importExportBudget
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(
semantics = SemanticsOf.IDEMPOTENT,
publishing = Publishing.DISABLED
)
@ActionLayout(contributed = Contributed.AS_ACTION)
public BudgetImportExportManager importExportBudget(Budget budget) {
return new BudgetImportExportManager(budget);
}
示例14: reset
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(
semantics = SemanticsOf.IDEMPOTENT_ARE_YOU_SURE,
command = CommandReification.DISABLED,
publishing = Publishing.DISABLED
)
public PaymentBatchManager reset() {
final List<PaymentBatch> newBatches = this.getNewBatches();
for (PaymentBatch newBatch : newBatches) {
newBatch.clearLines();
}
return new PaymentBatchManager();
}
示例15: nextBatch
import org.apache.isis.applib.annotation.Publishing; //导入依赖的package包/类
@Action(
semantics = SemanticsOf.SAFE,
command = CommandReification.DISABLED,
publishing = Publishing.DISABLED
)
public PaymentBatchManager nextBatch() {
int selectedBatchIdx = this.getSelectedBatchIdx();
if (selectedBatchIdx >= 0) {
int nextBatchIdx = ++selectedBatchIdx;
if (nextBatchIdx < this.getNewBatches().size()) {
return new PaymentBatchManager(nextBatchIdx);
}
}
return this;
}