本文整理汇总了Java中org.apache.isis.applib.annotation.RestrictTo类的典型用法代码示例。如果您正苦于以下问题:Java RestrictTo类的具体用法?Java RestrictTo怎么用?Java RestrictTo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RestrictTo类属于org.apache.isis.applib.annotation包,在下文中一共展示了RestrictTo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runFixtureScript
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(
restrictTo = RestrictTo.PROTOTYPING
)
@ActionLayout(
cssClassFa="fa fa-bolt"
)
@MemberOrder(sequence = "499.10.1")
@Override
public List<FixtureResult> runFixtureScript(
final FixtureScript fixtureScript,
@ParameterLayout(
named="Parameters",
describedAs = "Script-specific parameters (key=value) ",
multiLine = 10)
@Parameter(optionality = Optionality.OPTIONAL)
final String parameters) {
return super.runFixtureScript(fixtureScript, parameters);
}
示例2: listAuditEntries
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(
semantics = SemanticsOf.SAFE,
restrictTo = RestrictTo.PROTOTYPING
)
@ActionLayout(
named = "List Audit Entries (demo)"
)
public List<AuditEntry> listAuditEntries(
@ParameterLayout(named = "From")
@Parameter(optionality = Optionality.OPTIONAL)
final LocalDate from,
@ParameterLayout(named = "To")
@Parameter(optionality = Optionality.OPTIONAL)
final LocalDate to) {
return auditingServiceRepository.findByFromAndTo(from, to);
}
示例3: demoException
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(
semantics = SemanticsOf.SAFE,
restrictTo = RestrictTo.PROTOTYPING
)
public void demoException(
final DemoExceptionType type) {
switch(type) {
case NON_RECOVERABLE_EXCEPTION:
throw new NonRecoverableException("Demo throwing " + type.name());
case RECOVERABLE_EXCEPTION:
throw new RecoverableException("Demo throwing " + type.name());
case RECOVERABLE_EXCEPTION_AUTO_ESCALATED:
try {
// this will trigger an exception (because category cannot be null), causing the xactn to be aborted
setCategory(null);
transactionService.flushTransaction();
} catch(final Exception e) {
// it's a programming mistake to throw only a recoverable exception here, because of the xactn's state.
// the framework should instead auto-escalate this to a non-recoverable exception
throw new RecoverableException("Demo throwing " + type.name(), e);
}
}
}
示例4: installFixturesAndReturnFirstRole
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(
semantics = SemanticsOf.NON_IDEMPOTENT,
restrictTo = RestrictTo.PROTOTYPING
)
@MemberOrder(sequence="20")
public Object installFixturesAndReturnFirstRole() {
final List<FixtureResult> fixtureResultList = findFixtureScriptFor(SecurityModuleAppSetUp.class).run(null);
for (FixtureResult fixtureResult : fixtureResultList) {
final Object object = fixtureResult.getObject();
if(object instanceof ApplicationRole) {
return object;
}
}
getContainer().warnUser("No rules found in fixture; returning all results");
return fixtureResultList;
}
开发者ID:isisaddons-legacy,项目名称:isis-module-security,代码行数:17,代码来源:SecurityModuleAppFixturesService.java
示例5: installFixturesAndReturnFirstRole
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(
semantics = SemanticsOf.NON_IDEMPOTENT,
restrictTo = RestrictTo.PROTOTYPING
)
@ActionLayout(
cssClassFa = "fa-bolt"
)
@MemberOrder(sequence = "20")
public Object installFixturesAndReturnFirstRole() {
final List<FixtureResult> fixtureResultList = fixtureScripts.findFixtureScriptFor(EstatioSecurityModuleSeedFixture.class).run(null);
for (FixtureResult fixtureResult : fixtureResultList) {
final Object object = fixtureResult.getObject();
if (object instanceof ApplicationRole) {
return object;
}
}
container.warnUser("No rules found in fixture; returning all results");
return fixtureResultList;
}
示例6: updateAttribute
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(
semantics = SemanticsOf.IDEMPOTENT,
restrictTo = RestrictTo.PROTOTYPING
)
public Invoice updateAttribute(
final InvoiceAttributeName name,
@Parameter(maxLength = NotesType.Meta.MAX_LEN)
@ParameterLayout(multiLine = Invoice.DescriptionType.Meta.MULTI_LINE) final String value,
InvoiceAttributeAction action
) {
final InvoiceAttribute invoiceAttribute = invoiceAttributeRepository.findByInvoiceAndName(this, name);
if (invoiceAttribute == null) {
invoiceAttributeRepository.newAttribute(this, name, value, action.isOverride());
} else {
if (action.isForceful())
invoiceAttribute.setValue(value);
invoiceAttribute.setOverridden(action.isOverride());
}
return this;
}
示例7: createRetroInvoicesForProperty
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(
restrictTo = RestrictTo.PROTOTYPING
)
@MemberOrder(sequence = "2")
public List<FixtureResult> createRetroInvoicesForProperty(
final Property property,
@ParameterLayout(
named = "Start due date"
)
final LocalDate startDueDate,
@Parameter(optionality = Optionality.OPTIONAL)
@ParameterLayout(
named = "Nextdue date"
)
final LocalDate nextDueDate) {
final CreateRetroInvoices creator = container.newTransientInstance(CreateRetroInvoices.class);
final FixtureScript.ExecutionContext executionContext = fixtureScripts.newExecutionContext(null);
creator.createProperty(property, startDueDate, nextDueDate, executionContext);
return executionContext.getResults();
}
示例8: createRetroInvoicesForLease
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(
restrictTo = RestrictTo.PROTOTYPING
)
@ActionLayout(
cssClassFa = "fa-bolt"
)
@MemberOrder(sequence = "3")
public List<FixtureResult> createRetroInvoicesForLease(
final Lease lease,
@ParameterLayout(
named = "Start due date"
)
final LocalDate startDueDate,
@ParameterLayout(
named = "Nextdue date"
)
final LocalDate nextDueDate) {
final CreateRetroInvoices creator = container.newTransientInstance(CreateRetroInvoices.class);
final FixtureScript.ExecutionContext executionContext = fixtureScripts.newExecutionContext(null);
creator.createLease(lease, startDueDate, nextDueDate, executionContext);
return executionContext.getResults();
}
示例9: impersonate
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(restrictTo = RestrictTo.PROTOTYPING)
@MemberOrder(sequence = "1")
public void impersonate(
final ApplicationUser applicationUser,
@Nullable
final List<ApplicationRole> applicationRoleList) {
if(estatioUserService.isImpersonating()) {
stopImpersonating();
}
final List<String> roleNames = asRoleNames(applicationRoleList);
estatioUserService.setUser(applicationUser.getUsername(), roleNames);
messageService.informUser("Now impersonating " + applicationUser.getName());
}
示例10: findBadCommandTargets
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(semantics = SemanticsOf.SAFE, restrictTo = RestrictTo.PROTOTYPING)
public List<BadTarget> findBadCommandTargets() {
Set<String> badObjectTypes = Sets.newTreeSet();
List<Map<String, Object>> rows = isisJdoSupport
.executeSql("select distinct(substring(target, 1, charindex(':', target)-1)) as objectType from isiscommand.Command order by 1");
for (Map<String, Object> row : rows) {
String targetStr = (String) row.get("objectType");
addIfBad(badObjectTypes, targetStr);
}
return Lists.newArrayList(
FluentIterable.from(badObjectTypes)
.transform(x -> new BadTarget(x))
.toList());
}
示例11: ordenar
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(semantics = SemanticsOf.SAFE, restrictTo = RestrictTo.PROTOTYPING)
@ActionLayout(cssClassFa = "fa-birthday-cake", named = "Cumpleaños Clientes")
public List<ClientesCumpleañosViewModel> cumpleaños() {
final List<Cliente> clientes = clienteRepository.listarActivos();
Iterator<Cliente> it = clientes.iterator();
while (it.hasNext()) {
Cliente item = it.next();
if (item.getClienteFechaNacimiento() == null)
it.remove();
}
List<ClientesCumpleañosViewModel> listaClientes = Lists.newArrayList(Iterables.transform(clientes, ordenar()));
Collections.sort(listaClientes);
return listaClientes;
}
示例12: goToDocs
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@ActionLayout(
cssClassFa = "fa-external-link"
)
@Action(
semantics = SemanticsOf.SAFE,
restrictTo = RestrictTo.PROTOTYPING
)
@MemberOrder(sequence="500.30.1")
public URL goToDocs(final ExternalLink link) throws MalformedURLException {
return link.open();
}
示例13: recreateSimpleObjectsThenOpenDashboard
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(
restrictTo = RestrictTo.PROTOTYPING
)
@ActionLayout(
cssClassFa="fa fa-refresh"
)
@MemberOrder(sequence = "500.10.2")
public Object recreateSimpleObjectsThenOpenDashboard() {
final FixtureScript fs = fixtureScripts.findFixtureScriptFor(
DemoFixture.class);
final List<FixtureResult> unusedResults = fs.run(null);
return homePageService.homePage();
}
示例14: recreateObjectsAndReturnFirst
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(
restrictTo = RestrictTo.NO_RESTRICTIONS
)
@ActionLayout(
cssClassFa="fa fa-refresh"
)
@MemberOrder(sequence="20")
public Object recreateObjectsAndReturnFirst() {
final List<FixtureResult> run = findFixtureScriptFor(RecrearEquipo.class).run(null);
return run.get(0).getObject();
}
示例15: recreateToDoItemsThenOpenDashboard
import org.apache.isis.applib.annotation.RestrictTo; //导入依赖的package包/类
@Action(
restrictTo = RestrictTo.PROTOTYPING
)
@ActionLayout(
cssClassFa="fa fa-refresh"
)
@MemberOrder(sequence = "500.10.2")
public Object recreateToDoItemsThenOpenDashboard() {
final FixtureScript fs = fixtureScripts.findFixtureScriptFor(
RecreateToDoItemsForCurrentUser.class);
fs.run(null);
return toDoAppDashboardService.lookup();
}