当前位置: 首页>>代码示例>>Java>>正文


Java RestrictTo类代码示例

本文整理汇总了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);
}
 
开发者ID:isisaddons,项目名称:isis-app-kitchensink,代码行数:19,代码来源:KitchensinkFixturesService.java

示例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);
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-audit,代码行数:17,代码来源:AuditEntries.java

示例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);
        }
    }
}
 
开发者ID:isisaddons,项目名称:isis-app-todoapp,代码行数:24,代码来源:ToDoItem.java

示例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;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:20,代码来源:EstatioSecurityModuleFixturesMenu.java

示例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;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:21,代码来源:Invoice.java

示例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();
}
 
开发者ID:estatio,项目名称:estatio,代码行数:21,代码来源:EstatioFixtureScripts.java

示例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();
}
 
开发者ID:estatio,项目名称:estatio,代码行数:23,代码来源:EstatioFixtureScripts.java

示例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());

}
 
开发者ID:estatio,项目名称:estatio,代码行数:19,代码来源:EstatioImpersonateMenu.java

示例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());
}
 
开发者ID:estatio,项目名称:estatio,代码行数:18,代码来源:BadCommandTargets.java

示例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;
}
 
开发者ID:leandrogonqn,项目名称:Proyecto2017Seguros,代码行数:15,代码来源:ClientesPorCumpleaños.java

示例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();
}
 
开发者ID:incodehq,项目名称:ecpcrm,代码行数:12,代码来源:ExternalLinksService.java

示例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();
}
 
开发者ID:incodehq,项目名称:ecpcrm,代码行数:14,代码来源:EcpCrmPrototypingExtensions.java

示例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();
}
 
开发者ID:TesisTarjetasMejorar,项目名称:TarjetasISIS,代码行数:12,代码来源:DominioFixturesService.java

示例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();
}
 
开发者ID:isisaddons,项目名称:isis-app-todoapp,代码行数:14,代码来源:ToDoAppPrototypingExtensions.java


注:本文中的org.apache.isis.applib.annotation.RestrictTo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。