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


Java MutableAttributeMap.put方法代码示例

本文整理汇总了Java中org.springframework.webflow.core.collection.MutableAttributeMap.put方法的典型用法代码示例。如果您正苦于以下问题:Java MutableAttributeMap.put方法的具体用法?Java MutableAttributeMap.put怎么用?Java MutableAttributeMap.put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.webflow.core.collection.MutableAttributeMap的用法示例。


在下文中一共展示了MutableAttributeMap.put方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: verifyGetServiceThemeDoesNotExist

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
@Test
public void verifyGetServiceThemeDoesNotExist() {
    final RegisteredServiceImpl r = new RegisteredServiceImpl();
    r.setTheme("myTheme");
    r.setId(1000);
    r.setName("Test Service");
    r.setServiceId("myServiceId");

    this.servicesManager.save(r);

    final MockHttpServletRequest request = new MockHttpServletRequest();
    final RequestContext ctx = mock(RequestContext.class);
    final MutableAttributeMap scope = new LocalAttributeMap();
    scope.put("service", org.jasig.cas.services.TestUtils.getService(r.getServiceId()));
    when(ctx.getFlowScope()).thenReturn(scope);
    RequestContextHolder.setRequestContext(ctx);
    request.addHeader("User-Agent", "Mozilla");
    assertEquals("test", this.serviceThemeResolver.resolveThemeName(request));
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:20,代码来源:ServiceThemeResolverTests.java

示例2: verifyGetServiceThemeDoesNotExist

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
@Test
public void verifyGetServiceThemeDoesNotExist() {
    final RegisteredServiceImpl r = new RegisteredServiceImpl();
    r.setTheme("myTheme");
    r.setId(1000);
    r.setName("Test Service");
    r.setServiceId("myServiceId");

    this.servicesManager.save(r);

    final MockHttpServletRequest request = new MockHttpServletRequest();
    final RequestContext ctx = mock(RequestContext.class);
    final MutableAttributeMap scope = new LocalAttributeMap();
    scope.put("service", TestUtils.getService(r.getServiceId()));
    when(ctx.getFlowScope()).thenReturn(scope);
    RequestContextHolder.setRequestContext(ctx);
    request.addHeader("User-Agent", "Mozilla");
    assertEquals("test", this.serviceThemeResolver.resolveThemeName(request));
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:20,代码来源:ServiceThemeResolverTests.java

示例3: verifyGetServiceThemeDoesNotExist

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
@Test
public void verifyGetServiceThemeDoesNotExist() {
    final RegexRegisteredService r = new RegexRegisteredService();
    r.setTheme("myTheme");
    r.setId(1000);
    r.setName("Test Service");
    r.setServiceId("myServiceId");

    this.servicesManager.save(r);

    final MockHttpServletRequest request = new MockHttpServletRequest();
    final RequestContext ctx = mock(RequestContext.class);
    final MutableAttributeMap scope = new LocalAttributeMap();
    scope.put("service", RegisteredServiceTestUtils.getService(r.getServiceId()));
    when(ctx.getFlowScope()).thenReturn(scope);
    RequestContextHolder.setRequestContext(ctx);
    request.addHeader(WebUtils.USER_AGENT_HEADER, MOZILLA);
    assertEquals(DEFAULT_THEME_NAME, this.serviceThemeResolver.resolveThemeName(request));
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:20,代码来源:ServiceThemeResolverTests.java

示例4: doExecute

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
        @Nonnull final ProfileInterceptorContext interceptorContext) {

    final RequestContext requestContext =
            RequestContextHolder.getRequestContext();

    final MutableAttributeMap<Object> flowScope =
            requestContext.getFlowScope();

    // full name?
    flowScope.put("userName",
            IdPHelper.getPrincipalName(profileRequestContext));

    log.debug("{} Decorated user name", getLogPrefix());
}
 
开发者ID:cmu-cylab-privacylens,项目名称:PrivacyLens,代码行数:17,代码来源:DecorateUserName.java

示例5: doExecute

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
        @Nonnull final ProfileInterceptorContext interceptorContext) {

    final RequestContext requestContext =
            RequestContextHolder.getRequestContext();

    final MutableAttributeMap<Object> flowScope =
            requestContext.getFlowScope();

    final String relyingPartyId =
            IdPHelper.getRelyingPartyId(profileRequestContext);
    flowScope.put("service",
            Oracle.getInstance().getServiceName(relyingPartyId));
    flowScope.put("idpOrganization", General.getInstance().getOrganizationName());

    log.debug("{} Decorated other data", getLogPrefix());
}
 
开发者ID:cmu-cylab-privacylens,项目名称:PrivacyLens,代码行数:19,代码来源:DecorateOther.java

示例6: doExecute

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
        @Nonnull final ProfileInterceptorContext interceptorContext) {

    final RequestContext requestContext =
            RequestContextHolder.getRequestContext();

    final MutableAttributeMap<Object> flowScope =
            requestContext.getFlowScope();
    flowScope.put("adminUrl", General.getInstance().getAdminUrl());
    flowScope.put("adminMail", General.getInstance().getAdminMail());
    flowScope.put("IdPName", General.getInstance().getIdpName());
    flowScope.put("credits", General.getInstance().getCredits());

    log.debug("{} Decorated general data", getLogPrefix());
}
 
开发者ID:cmu-cylab-privacylens,项目名称:PrivacyLens,代码行数:17,代码来源:DecorateGeneral.java

示例7: doExecute

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected void doExecute(
        @Nonnull final ProfileRequestContext profileRequestContext,
        @Nonnull final ProfileInterceptorContext interceptorContext) {

    final RequestContext requestContext =
            RequestContextHolder.getRequestContext();

    final MutableAttributeMap<Object> flowScope =
            requestContext.getFlowScope();

    final HttpServletRequest request =
            (HttpServletRequest) requestContext.getExternalContext()
                    .getNativeRequest();

    // CHANGEME use previous consents
    final List<Attribute> attributes =
            (List<Attribute>) flowScope.get("attributes");

    final String attributeList = getReminderAttributes(attributes);

    flowScope.put("attributeList", attributeList);

    log.debug("{} added reminder list", getLogPrefix());
}
 
开发者ID:cmu-cylab-privacylens,项目名称:PrivacyLens,代码行数:27,代码来源:ReminderAttributeService.java

示例8: testStartBookingFlow

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
public void testStartBookingFlow() {
Booking booking = createTestBooking();

EasyMock.expect(bookingService.createBooking(1L, "keith")).andReturn(booking);

EasyMock.replay(bookingService);

MutableAttributeMap input = new LocalAttributeMap();
input.put("hotelId", "1");
MockExternalContext context = new MockExternalContext();
context.setCurrentUser("keith");
startFlow(input, context);

assertCurrentStateEquals("enterBookingDetails");
assertResponseWrittenEquals("enterBookingDetails", context);
assertTrue(getRequiredFlowAttribute("booking") instanceof Booking);

EasyMock.verify(bookingService);
   }
 
开发者ID:websphere,项目名称:SpringPrimeFacesShowcase,代码行数:20,代码来源:BookingFlowExecutionTests.java

示例9: putAttributeToFlowScope

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static <T> void putAttributeToFlowScope(String key, T value) {
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    MutableAttributeMap<Object> attrMap = requestContext.getFlowScope();
    ArrayList<T> attr = (ArrayList<T>) attrMap.get(key);
    if (attr == null) {
        attrMap.put(key, new ArrayList<T>());
        attr = (ArrayList<T>) attrMap.get(key);
    }
    attr.add(value);
}
 
开发者ID:suewonjp,项目名称:civilizer,代码行数:12,代码来源:ViewUtil.java

示例10: prepare

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
public static void prepare(final Databag databag) {
    final AttributeReleaseModule attributeReleaseModule =
        databag.attributeReleaseModule;
    final String service = databag.service;
    final String principalName = databag.principalName;
    final RequestContext requestContext = databag.requestContext;
    final int limitLoginEvents = AdminViewHelper.limitLoginEvents;

    final MutableAttributeMap<Object> flowScope =
            requestContext.getFlowScope();

    final List<LoginEvent> serviceLoginEvents =
        attributeReleaseModule.listLoginEvents(principalName, service,
            limitLoginEvents);

    final List<Map> serviceLoginList =
        AdminViewHelper.processLoginEvents(serviceLoginEvents);
    flowScope.put("lastLoginEvents", serviceLoginList);
    if (serviceLoginList.size() == limitLoginEvents) {
        flowScope.put("loginEventListFull", true);
    }

    /*
    session.setAttribute("userName",
        Oracle.getInstance().getUserName());
        */
    flowScope.put("relyingParty", service);
    flowScope.put("idpName",
        General.getInstance().getIdpName());

    //final List<Attribute> attributes = IdPHelper.getAttributes(servletContext, request);
    //request.getSession().setAttribute("attributes", attributes);
}
 
开发者ID:cmu-cylab-privacylens,项目名称:PrivacyLens,代码行数:34,代码来源:AdminServiceLoginPrepare.java

示例11: doExecute

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected void doExecute(
        @Nonnull final ProfileRequestContext profileRequestContext,
        @Nonnull final ProfileInterceptorContext interceptorContext) {

    final RequestContext requestContext =
            RequestContextHolder.getRequestContext();

    final MutableAttributeMap<Object> flowScope =
            requestContext.getFlowScope();

    final HttpServletRequest request =
            (HttpServletRequest) requestContext.getExternalContext()
                    .getNativeRequest();
    final String requestContextPath = request.getContextPath();
    final Oracle oracle = Oracle.getInstance();

    final List<Attribute> attributes =
            (List<Attribute>) flowScope.get("attributes");

    final String relyingPartyId =
            IdPHelper.getRelyingPartyId(profileRequestContext);
    final Map<String, Boolean> settingsMap =
            (Map<String, Boolean>) flowScope.get("attributeSettings");
    final List<ToggleBean> toggleBeans =
            generateToggleFromAttributes(attributes, settingsMap, oracle,
                    relyingPartyId, requestContextPath);

    flowScope.put("attributeBeans", toggleBeans);

    log.debug("{} added toggle beans", getLogPrefix());
}
 
开发者ID:cmu-cylab-privacylens,项目名称:PrivacyLens,代码行数:34,代码来源:ToggleBeanService.java

示例12: testStartFlow

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
@Test
public void testStartFlow() {
    ReconciliationCriteria criteria = constructReconciliationCriteria(RUDYARD, KIPLING, null, EMAIL_ADDRESS, PHONE_NUMBER, new Date(0), OR_WEBAPP_IDENTIFIER);
    MutableAttributeMap input = new LocalAttributeMap();
    input.put("personSearch", criteria);
    ExternalContext context = new MockExternalContext();

    startFlow(context);
    assertCurrentStateEquals("addPerson");
}
 
开发者ID:Jasig,项目名称:openregistry,代码行数:11,代码来源:AddSoRPersonFlowTests.java

示例13: doExecute

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
/** {@inheritDoc} */
   @Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
           @Nonnull final ProfileInterceptorContext interceptorContext) {

       final Map<String, IdPAttribute> consentableAttributes =
               getAttributeReleaseContext().getConsentableAttributes();

       final List<Attribute> outAttributes = new ArrayList<Attribute>();
       final Map<String, Boolean> attributeSettings =
               new HashMap<String, Boolean>();

       for (final IdPAttribute attribute : consentableAttributes.values()) {
           final String attributeId = attribute.getId();
           final String attributeName = AttributeUtils.getName(attributeId);
           final String attributeDescription =
                   AttributeUtils.getDescription(attributeId);
           final List<IdPAttributeValue<?>> attributeOriginalValues =
                   attribute.getValues();
           final List<String> attributeValues = new ArrayList<String>();
           for (final IdPAttributeValue<?> originalValue : attributeOriginalValues) {
               attributeValues.add(originalValue.getDisplayValue());
           }
           final Attribute outAttribute =
                   new Attribute(attributeId, attributeName,
                           attributeDescription, attributeValues);

           if (attributeId.equals("eduPersonEntitlement")) {
               attributeProcessor.processEntitlementDescriptions(outAttribute);
           }

           outAttributes.add(outAttribute);
           // CHANGEME get proper settings
           attributeSettings.put(attributeId, false);
       }

       attributeProcessor.markMachineReadableAttributes(outAttributes);
       attributeProcessor.sortAttributes(outAttributes);

       final RequestContext requestContext =
               RequestContextHolder.getRequestContext();

       final MutableAttributeMap<Object> flowScope =
               requestContext.getFlowScope();

       // make available through flow and context
       flowScope.put("attributes", outAttributes);
       flowScope.put("attributeProcessor", attributeProcessor);
       final AttributeContext attributeContext =
               new AttributeContext(outAttributes);
       // overwrite it, because we may have come from the consent interface
       getAttributeReleaseContext().addSubcontext(attributeContext, true);

       // CHANGEME get proper settings (previous consents?)
       flowScope.put("attributeSettings", attributeSettings);
       log.debug("{} Decorated attributes '{}'", getLogPrefix(),
outAttributes);
   }
 
开发者ID:cmu-cylab-privacylens,项目名称:PrivacyLens,代码行数:58,代码来源:DecorateAttributes.java

示例14: doExecute

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
        @Nonnull final ProfileInterceptorContext interceptorContext) {

    final RequestContext requestContext =
            RequestContextHolder.getRequestContext();

    final MutableAttributeMap<Object> flowScope =
            requestContext.getFlowScope();

    final String relyingPartyId =
            IdPHelper.getRelyingPartyId(profileRequestContext);
    flowScope.put("service",
            Oracle.getInstance().getServiceName(relyingPartyId));
    flowScope.put("idpOrganization", General.getInstance().getOrganizationName());

    final AttributeReleaseModule attributeReleaseModule =
            IdPHelper.getAttributeReleaseModule();
    final String principalName =
            IdPHelper.getPrincipalName(profileRequestContext);
    final int limitLoginEvents = AdminViewHelper.limitLoginEvents;
    final int limitRelyingPartyList = AdminViewHelper.limitRelyingPartyList;

    final List<LoginEvent> lastLoginEvents =
            attributeReleaseModule.listLoginEvents(principalName, "",
                    limitLoginEvents);
    final List<Map> loginEventList =
            AdminViewHelper.processLoginEvents(lastLoginEvents);
    flowScope.put("lastLoginEvents", loginEventList);
    if (loginEventList.size() == limitLoginEvents) {
        flowScope.put("loginEventFull", true);
    }

    final List<String> servicesList =
            attributeReleaseModule.listRelyingParties(principalName,
                    limitRelyingPartyList);
    final Map<String, List> serviceLoginEventMap =
            new HashMap<String, List>();
    for (final String service : servicesList) {
        final List<LoginEvent> serviceLoginEvents =
                attributeReleaseModule.listLoginEvents(principalName,
                        service, limitLoginEvents);
        final List<Map> serviceLoginEventList =
                AdminViewHelper.processLoginEvents(serviceLoginEvents);
        serviceLoginEventMap.put(service, serviceLoginEventList);
    }
    flowScope.put("relyingPartiesList", servicesList);
    flowScope.put("serviceLoginEvents", serviceLoginEventMap);
    if (servicesList.size() == limitRelyingPartyList) {
        flowScope.put("relyingPartyListFull", true);
    }

    log.debug("{} Decorated login data", getLogPrefix());
}
 
开发者ID:cmu-cylab-privacylens,项目名称:PrivacyLens,代码行数:55,代码来源:DecorateEvents.java

示例15: putTicketGrantingTicketIntoMap

import org.springframework.webflow.core.collection.MutableAttributeMap; //导入方法依赖的package包/类
/**
 * Put ticket granting ticket into map that is either backed by the flow/request scope.
 * Will override the previous value and blank out the setting if value is null or empty.
 * @param map the map
 * @param ticketValue the ticket value
 */
public static void putTicketGrantingTicketIntoMap(final MutableAttributeMap map,
                                                   @NotNull final String ticketValue) {
    map.put("ticketGrantingTicketId", ticketValue);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:11,代码来源:WebUtils.java


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