Package org.eurekastreams.commons.actions.context

Examples of org.eurekastreams.commons.actions.context.Principal


        final List<ActivityDTO> activityResults = new ArrayList<ActivityDTO>();
        activityResults.add(currentActivity);

        final PostActivityRequest request = new PostActivityRequest(currentActivity);

        final Principal currentPrincipal = new DefaultPrincipal(ACCOUNT_ID, OPENSOCIAL_ID, USER_ID);

        context.checking(new Expectations()
        {
            {
                oneOf(recipientRetrieverMock).getStreamScope(currentActivity);
View Full Code Here


    {
        final long personId = 28328L;
        final TaskHandlerActionContext<PrincipalActionContext> taskContext = context
                .mock(TaskHandlerActionContext.class);
        final PrincipalActionContext principalActionContext = context.mock(PrincipalActionContext.class);
        final Principal principal = context.mock(Principal.class);
        final String url = "http://foo.com";
        final SetSharedResourceLikeRequest actionRequest = new SetSharedResourceLikeRequest(url, true);
        final SharedResource sharedResourceFoundOrInserted = new SharedResource("http://fOO.com");
        findOrInsertSharedResourceMapper.setReturnedResource(sharedResourceFoundOrInserted);
View Full Code Here

        formData.put("name", newName);
        formData.put("membershipcriteria", "somegroup");
        formData.put(PersonUpdater.ORIGINAL_DISPLAY_NAME_KEY, originalDisplayedName + " Last");

        final List<UserActionRequest> getUpdateCacheRequests = new ArrayList<UserActionRequest>();
        final Principal userPrinicpal = context.mock(Principal.class);

        final List<UserActionRequest> taskActionRequests = new ArrayList<UserActionRequest>();
        final UserActionRequest cacheUpdatingActionRequest = new UserActionRequest("foo", null, null);
        taskActionRequests.add(cacheUpdatingActionRequest);
View Full Code Here

                return new SessionException("Provided session ID does not match request session ID.");
            }
        }

        // get the principal (throws if none available)
        Principal principal = getPrincipal(request);

        // Skip determining the client - this flavor of the API is intended for preauth, so it would be directly
        // accessed by a user's app and thus the client would not apply. (Client is used for OAuth scenarios where
        // an app is accessing the API on behalf of a user.) When this code is updated/refactored to fully replace
        // ActionResource (the Noelios version of the API), then determining the client will need to be done.
View Full Code Here

        for (Transformer<Request, Principal> extractor : principalExtractors)
        {
            // NOTE: Passing null because the extractors still use a Noelios request instead of a servlet request, so it
            // would not be compatible. This is ok, because the extractor used by this endpoint doesn't look at the
            // request anyway.
            Principal result = extractor.transform(null);
            if (result != null)
            {
                return result;
            }
        }
View Full Code Here

     */
    @RequestMapping(value = "stream", method = RequestMethod.GET)
    public ModelAndView getStreamContact(@RequestParam("type") final EntityType streamType,
            @RequestParam("id") final long id, final HttpServletResponse response)
    {
        Principal principal = principalPopulator.getPrincipal(null, null);

        // get info about stream
        ServiceAction action = typeToFetchActionIndex.get(streamType);
        if (action == null)
        {
View Full Code Here

        // In the future, have a PrincipalRequired property on actions, and check whether a principal was provided.

        // ---- run ----
        try
        {
            Principal principal = null;
            ActionContext innerContext = context.getActionContext();
            boolean sourceHasPrincipal = innerContext instanceof PrincipalActionContext;
            if (sourceHasPrincipal)
            {
                principal = ((PrincipalActionContext) innerContext).getPrincipal();
View Full Code Here

     * @return Return value from the execution strategy.
     */
    public Serializable execute(final ExecutionStrategy execution, final Serializable params,
            final ActionContext parentContext)
    {
        Principal principal = null;
        if (parentContext instanceof PrincipalActionContext)
        {
            principal = ((PrincipalActionContext) parentContext).getPrincipal();
        }
        return execute(execution, params, principal);
View Full Code Here

     * @return Return value from the execution strategy.
     */
    public Serializable execute(final TaskHandlerExecutionStrategy execution, final Serializable params,
            final TaskHandlerActionContext< ? extends ActionContext> parentContext)
    {
        Principal principal = null;
        ActionContext parentInnerContext = parentContext.getActionContext();
        if (parentInnerContext instanceof PrincipalActionContext)
        {
            principal = ((PrincipalActionContext) parentInnerContext).getPrincipal();
        }
View Full Code Here

     */
    @Override
    public Principal transform(final Request inRequest)
    {
        String accountid = null;
        Principal result = null;

        if (inRequest.getAttributes().containsKey("org.restlet.http.headers"))
        {
            Form httpHeaders = (Form) inRequest.getAttributes().get("org.restlet.http.headers");

View Full Code Here

TOP

Related Classes of org.eurekastreams.commons.actions.context.Principal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.