• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ApplicationTenancy类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.isisaddons.module.security.dom.tenancy.ApplicationTenancy的典型用法代码示例。如果您正苦于以下问题:Java ApplicationTenancy类的具体用法?Java ApplicationTenancy怎么用?Java ApplicationTenancy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ApplicationTenancy类属于org.isisaddons.module.security.dom.tenancy包,在下文中一共展示了ApplicationTenancy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: userProfileName

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Override
@Programmatic
public String userProfileName() {
    final ApplicationUser applicationUser = meService.me();

    final StringBuilder buf = new StringBuilder();
    final String username = applicationUser.getName();
    final ApplicationTenancy tenancy = applicationUser.getTenancy();

    buf.append("Hi ");
    buf.append(username);
    if (tenancy.getName() != null) {
        buf.append(" @").append(tenancy.getName());
    }

    return buf.toString();
}
 
开发者ID:bibryam,项目名称:rotabuilder,代码行数:18,代码来源:UserProfileServiceShowingTenancy.java


示例2: hides

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Override
public String hides(Object domainObject, ApplicationUser applicationUser) {
    if (!(domainObject instanceof AbstractPersistable)) {
        return null;
    }

    final AbstractPersistable persistable = (AbstractPersistable) domainObject;
    final ApplicationTenancy applicationUserTenancy = applicationUser.getTenancy();
    final ApplicationTenancy persistableApplicationTenancy = persistable.getApplicationTenancy();

    if (applicationUserTenancy == null || persistableApplicationTenancy == null) {
        return "missing tenancy";
    }

    return applicationUserTenancy.equals(persistableApplicationTenancy) ? null: "different tenancies";
}
 
开发者ID:bibryam,项目名称:rotabuilder,代码行数:17,代码来源:ApplicationTenancyEvaluatorForRoster.java


示例3: registerUser

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Override
public void registerUser(
        final UserDetails userDetails) {

    final Password password = new Password(userDetails.getPassword());
    final ApplicationRole initialRole = getInitialRole();
    final Boolean enabled = true;
    final String username = userDetails.getUsername();
    final String emailAddress = userDetails.getEmailAddress();
    final ApplicationUser applicationUser = applicationUserRepository.newLocalUser(username, password, password, initialRole, enabled, emailAddress);

    final Set<ApplicationRole> additionalRoles = getAdditionalInitialRoles();
    if(additionalRoles != null) {
        for (final ApplicationRole additionalRole : additionalRoles) {
            applicationUser.addRole(additionalRole);
        }
    }

    // set up new user custom
    final ApplicationTenancy applicationTenancy = applicationTenancyRepository.newTenancy(username, "/" + username, null);
    applicationUser.setAtPath(applicationTenancy.getPath());

    fixtureScripts.runFixtureScript(new SematFixture(username, Arrays.asList(SudoService.ACCESS_ALL_ROLE)), null);
}
 
开发者ID:bibryam,项目名称:semat,代码行数:25,代码来源:AppUserRegistrationService.java


示例4: userProfileName

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Override
@Programmatic
public String userProfileName() {
    final ApplicationUser applicationUser = meService.me();

    final StringBuilder buf = new StringBuilder();
    final String username = applicationUser.getName();
    final String atPath = applicationUser.getAtPath();
    final ApplicationTenancy tenancy = applicationTenancyRepository.findByPath(atPath);

    buf.append("Hi ");
    buf.append(username);
    if (tenancy.getName() != null) {
        buf.append(" @").append(tenancy.getName());
    }

    return buf.toString();
}
 
开发者ID:bibryam,项目名称:semat,代码行数:19,代码来源:UserProfileServiceShowingTenancy.java


示例5: hides

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Override
public String hides(Object domainObject, ApplicationUser applicationUser) {
    if (!(domainObject instanceof AbstractPersistable)) {
        return null;
    }

    final AbstractPersistable persistable = (AbstractPersistable) domainObject;
    final String atPath = applicationUser.getAtPath();
    final ApplicationTenancy applicationUserTenancy = applicationTenancyRepository.findByPath(atPath);
    final ApplicationTenancy persistableApplicationTenancy = persistable.getApplicationTenancy();

    if (applicationUserTenancy == null || persistableApplicationTenancy == null) {
        return "missing tenancy";
    }

    return applicationUserTenancy.equals(persistableApplicationTenancy) ? null: "different tenancies";
}
 
开发者ID:bibryam,项目名称:semat,代码行数:18,代码来源:SematApplicationTenancyEvaluator.java


示例6: userProfileName

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Override
@Programmatic
public String userProfileName() {
    final ApplicationUser applicationUser = meService.me();

    final StringBuilder buf = new StringBuilder();
    final String username = applicationUser.getName();
    final ApplicationTenancy tenancy = applicationUser.getTenancy();

    buf.append("Hi ");
    buf.append(username);
    if (!tenancy.getPath().equals(UsersTenancy.TENANCY_PATH + username)) {
        buf.append(" @").append(tenancy.getName());
    }

    return buf.toString();
}
 
开发者ID:isisaddons-legacy,项目名称:isis-app-quickstart,代码行数:18,代码来源:UserProfileServiceShowingTenancy.java


示例7: happyCase

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Test
public void happyCase() throws Exception {

    // given
    final List<ApplicationTenancy> before = applicationTenancyRepository.allTenancies();
    assertThat(before.size(), is(0));
    nextSession();

    // when
    final ApplicationTenancy applicationTenancy = applicationTenancyRepository.newTenancy("uk", "/uk", globalTenancy);
    assertThat(applicationTenancy.getName(), is("uk"));
    nextSession();

    // then
    final List<ApplicationTenancy> after = applicationTenancyRepository.allTenancies();
    assertThat(after.size(), is(1));
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-security,代码行数:18,代码来源:ApplicationTenancyRepositoryIntegTest.java


示例8: putCharge

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的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);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:23,代码来源:Api.java


示例9: putOrganisation

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的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);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:20,代码来源:Api.java


示例10: newOrganisation

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Programmatic
public Organisation newOrganisation(
        final String reference,
        final boolean useNumeratorForReference,
        final String name,
        final ApplicationTenancy applicationTenancy) {

    final Organisation organisation = newTransientInstance(Organisation.class);
    organisation.setApplicationTenancyPath(applicationTenancy.getPath());

    String refToUse = reference;
    if (useNumeratorForReference) {
        refToUse = referenceByNumerator(applicationTenancy);
    }

    organisation.setReference(refToUse);
    organisation.setName(name);
    persist(organisation);
    getContainer().flush();
    return organisation;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:22,代码来源:OrganisationRepository.java


示例11: execute

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Override
protected void execute(final ExecutionContext executionContext) {

    checkParam("path", executionContext, String.class);
    checkParam("name", executionContext, String.class);

    ApplicationTenancy applicationTenancy = repository.findByPath(path);
    if(applicationTenancy == null) {
        final ApplicationTenancy parent =
                path.length() > 1
                        ? repository.findByPath(pathOfParent)
                        : null;
        applicationTenancy = repository.newTenancy(name, path, parent);
    }

    executionContext.addResult(this, path, applicationTenancy);

    object = applicationTenancy;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:20,代码来源:ApplicationTenancyBuilder.java


示例12: execute

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Override
protected void execute(final ExecutionContext executionContext) {

    checkParam("ref", executionContext, String.class);
    checkParam("name", executionContext, String.class);
    checkParam("applicability", executionContext, Applicability.class);

    checkParam("chargeGroup", executionContext, ChargeGroup.class);
    checkParam("applicationTenancy", executionContext, ApplicationTenancy.class);
    checkParam("tax", executionContext, Tax.class);

    defaultParam("description", executionContext, getRef());

    object = repository.upsert(
            ref, name, description,
            applicationTenancy, applicability, tax, chargeGroup);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:18,代码来源:ChargeBuilder.java


示例13: execute

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Override
protected void execute(final ExecutionContext executionContext) {

    executionContext.executeChild(this, new LeaseTypeForItalyRefData());

    defaultParam("reference", executionContext, fakeDataService.strings().fixed(3));
    defaultParam("name", executionContext, fakeDataService.name().lastName() + " Mall");
    defaultParam("leaseType", executionContext, fakeDataService.collections().anyBounded(LeaseType.class));
    defaultParam("atPath", executionContext, ApplicationTenancy_enum.Gb.getPath());

    defaultParam("startDate", executionContext, fakeDataService2
            .dates().before(fakeDataService2.periods().daysUpTo(2 * 365)));
    if (getDuration() == null && getEndDate() == null) {
        defaultParam("endDate", executionContext, getStartDate().plus(fakeDataService2.periods().years(10, 20)));
    }
    final ApplicationTenancy applicationTenancy = applicationTenancies.findTenancyByPath(getAtPath());

    this.lease = leaseRepository.newLease(applicationTenancy, getReference(), getName(), getLeaseType(), getStartDate(), getDuration(), getEndDate(), getLandlord(), getTenant());
}
 
开发者ID:estatio,项目名称:estatio,代码行数:20,代码来源:LeaseBuilderLEGACY.java


示例14: validateNewBrand

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
public String validateNewBrand(
        final String name,
        final BrandCoverage coverage,
        final Country countryOfOrigin,
        final String group,
        final Country countryIfAny) {

    final String atPath = meService.me().getAtPath();
    final ApplicationTenancyLevel userAtPath = ApplicationTenancyLevel.of(atPath);
    if(countryIfAny == null && (userAtPath == null || !userAtPath.isRoot())) {
        return "You may only create country-specific brands";
    }

    final ApplicationTenancy applicationTenancy = estatioApplicationTenancyRepository.findOrCreateTenancyFor(countryIfAny);
    if (brandRepository.findByNameLowerCaseAndAppTenancy(name, applicationTenancy).size() > 0) {
        return String.format("Brand with name %s exists already for %s", name, applicationTenancy.getName());
    }

    return null;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:21,代码来源:BrandMenu.java


示例15: validateNewTextTemplate

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
public TranslatableString validateNewTextTemplate(
        final DocumentType proposedType,
        final LocalDate proposedDate,
        final String name,
        final String mimeType,
        final String fileSuffix,
        final ApplicationTenancy proposedApplicationTenancy,
        final String templateText,
        final RenderingStrategy contentRenderingStrategy,
        final String subjectText,
        final RenderingStrategy subjectRenderingStrategy,
        final boolean previewOnly) {

    final DocumentSort documentSort = DocumentSort.TEXT;

    return validateNewTemplate(proposedType, proposedDate, proposedApplicationTenancy, contentRenderingStrategy,
            documentSort);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:19,代码来源:DocumentTemplateMenu.java


示例16: validateNewClobTemplate

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
public TranslatableString validateNewClobTemplate(
        final DocumentType proposedType,
        final LocalDate proposedDate,
        final String name,
        final String fileSuffix,
        final ApplicationTenancy proposedApplicationTenancy,
        final Clob clob,
        final RenderingStrategy contentRenderingStrategy,
        final String subjectText,
        final RenderingStrategy subjectRenderingStrategy,
        final boolean previewOnly) {

    final DocumentSort documentSort = DocumentSort.CLOB;

    return validateNewTemplate(
            proposedType, proposedDate, proposedApplicationTenancy, contentRenderingStrategy,
            documentSort);

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


示例17: validateNewBlobTemplate

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
public TranslatableString validateNewBlobTemplate(
        final DocumentType proposedType,
        final LocalDate proposedDate,
        final String name,
        final String fileSuffix,
        final ApplicationTenancy proposedApplicationTenancy,
        final Blob blob,
        final RenderingStrategy contentRenderingStrategy,
        final String subjectText,
        final RenderingStrategy subjectRenderingStrategy,
        final boolean previewOnly) {

    final DocumentSort documentSort = DocumentSort.BLOB;

    return validateNewTemplate(
            proposedType, proposedDate, proposedApplicationTenancy, contentRenderingStrategy, documentSort);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:18,代码来源:DocumentTemplateMenu.java


示例18: setUp

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    final ApplicationTenancy applicationTenancy = applicationTenancyRepository.findByPath(
            ApplicationTenancy_enum.Gb.getPath());
    final Party seller = InvoiceForLease_enum.OxfPoison003Gb.getSeller_d().findUsing(serviceRegistry);
    final Party buyer = InvoiceForLease_enum.OxfPoison003Gb.getBuyer_d().findUsing(serviceRegistry);
    final Lease lease = InvoiceForLease_enum.OxfPoison003Gb.getLease_d().findUsing(serviceRegistry);
    final LocalDate startDate = InvoiceForLease_enum.OxfPoison003Gb.getLease_d().getStartDate().plusYears(1);

    InvoiceForLease invoice = invoiceForLeaseRepository.findOrCreateMatchingInvoice(
            applicationTenancy,
            seller, buyer, PaymentMethod.DIRECT_DEBIT, lease,
            InvoiceStatus.NEW, startDate, null);
    invoice.setRunId(runId);
    Assert.assertNotNull(invoice);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:17,代码来源:InvoiceRepository_IntegTest.java


示例19: setUp

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    organisationMenu = new OrganisationMenu();

    organisationMenu.estatioApplicationTenancyRepository = mockEstatioApplicationTenancyRepositoryForCountry;
    organisationMenu.numeratorRepository = mockNumeratorRepository;
    organisationMenu.partyRepository = mockPartyRepository;

    reference = "someReference";
    name = "someName";
    country = new Country();

    applicationTenancy = new ApplicationTenancy();
    context.checking(new Expectations() {{
        allowing(mockEstatioApplicationTenancyRepositoryForCountry).findOrCreateTenancyFor(country);
        will(returnValue(applicationTenancy));
    }});

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


示例20: setup

import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入依赖的package包/类
@Before
public void setup() {
    taxRate = new TaxRate();
    taxRate.setPercentage(new BigDecimal("17.5"));

    context.checking(new Expectations() {
        {
            allowing(mockTax).taxRateFor(with(anyOf(aNull(LocalDate.class),any(LocalDate.class))));
            will(returnValue(taxRate));
        }
    });
    invoiceItem = new InvoiceItem(){
        public ApplicationTenancy getApplicationTenancy() {
            return null;
        }
    };
    invoiceItem.setTax(mockTax);
    invoiceItem.setInvoice(new InvoiceForLease());

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Value类代码示例发布时间:2022-05-23
下一篇:
Java MetricsRegionServerSourceFactory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap