Package org.wso2.carbon.registry.social.api.activity

Examples of org.wso2.carbon.registry.social.api.activity.Activity


   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here


   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

            registry.commitTransaction();
            if (getConfigUserRegistry() instanceof UserRegistry) {
                String userId = ((UserRegistry) getConfigUserRegistry()).getUserName();
                // Recording Activities
                ActivityManager manager = new ActivityManagerImpl();
                Activity activity = new ActivityImpl();
                activity.setTitle("added " + gName + "gadget to the gadget repository");
                activity.setUrl(gUrl);
                activity.setBody(gScreen);
                manager.createActivity(userId, "self", "gs", null, activity);
            }

            return true;
View Full Code Here

            DashboardService dashboardService = new DashboardService();
            response = dashboardService.addGadgetToUser(userId, tabId, url, dashboardName, gadgetGroup);
            if (response) {
                // Record Activities
                ActivityManager manager = new ActivityManagerImpl();
                Activity activity = new ActivityImpl();
                activity.setTitle("added new Gadget to the Dashboard ");
                String gadgetViewUrl = "../gadgetrepo/gadget-page.jsp?gadgetPath=" + gadgetPath + "&tab=" + tabId + "&grp=" + gadgetGroup.substring(0, gadgetGroup.indexOf("#"));
                activity.setUrl(gadgetViewUrl);
                manager.createActivity(userId, "self", "gs", null, activity);
            }
        } catch (Exception e) {
            log.error(e);
            if (registry != null) {
View Full Code Here

            gadgetComment.setCreatedTime(new Date());

            registry.addComment(gadgetPath, gadgetComment);
            // Recording Activities
            ActivityManager manager = new ActivityManagerImpl();
            Activity activity = new ActivityImpl();
            activity.setTitle("commented on Gadget");
            activity.setUrl("../" + comment.getCommentPath());
            activity.setBody(comment.getCommentText());
            manager.createActivity(comment.getAuthorUserName(), "self", "gs", null, activity);
            return true;
        } catch (Exception e) {
            log.error("Backend server error : Could not make the comment", e);
            return false;
View Full Code Here

            if (registry instanceof UserRegistry) {
                String userId = ((UserRegistry) registry).getUserName();
                // Recording Activities
                ActivityManager manager = new ActivityManagerImpl();
                Activity activity = new ActivityImpl();
                activity.setTitle("rated gadget with rating: " + rating);
                String gadgetViewUrl = "../gadgetrepo/gadget-page.jsp?gadgetPath=" + gadgetPath + "&tab=" + tabId + "&grp=" + gadgetGroup;
                activity.setUrl(gadgetViewUrl);
                activity.setBody(rating + "");
                manager.createActivity(userId, "self", "gs", null, activity);
            }

            return true;
        } catch (Exception e) {
View Full Code Here

            registry.commitTransaction();
            if (getConfigUserRegistry() instanceof UserRegistry) {
                String userId = ((UserRegistry) getConfigUserRegistry()).getUserName();
                // Recording Activities
                ActivityManager manager = new ActivityManagerImpl();
                Activity activity = new ActivityImpl();
                activity.setTitle("added " + gName + "gadget to the gadget repository");
                activity.setUrl(gUrl);
                //activity.setBody(gScreen);
                manager.createActivity(userId, "self", "gs", null, activity);
            }

            return true;
View Full Code Here

     *
     */
    public Activity getActivity(String userId, String groupId, String appId, Set<String> fields,
                                String activityId) throws SocialDataException {
        //TODO: Set<String> fields is not currently used -- all fields are retrieved
        Activity userActivity = null;
        if ((userId == null || userId.trim().equals("") || appId == null ||
                appId.trim().equals("") || activityId == null || activityId.trim().equals(""))) {
            throw new SocialDataException("Invalid parameters provided. " +
                    "One or more of the parameter is either null or empty");
        }
View Full Code Here

     *
     * @param activityResource The registry resource to retrieve properties from
     * @return An Activity object with the its attributes added
     */
    private Activity getPropertyAddedActivityObj(Resource activityResource) {
        Activity activityObj = new ActivityImpl();
        String value;
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_APP_ID)) != null) {
            activityObj.setAppId(value);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_BODY)) != null) {
            activityObj.setBody(value);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_BODY_ID)) != null) {
            activityObj.setBodyId(value);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_EXTERNAL_ID)) != null) {
            activityObj.setExternalId(value);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_ID)) != null) {
            activityObj.setId(value);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_UPDATED)) != null) {
            // this property holds the date in long (ms)
            Date updatedDate = new Date(Long.valueOf(value));
            activityObj.setUpdated(updatedDate);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_POSTED_TIME)) != null) {
            activityObj.setPostedTime(Long.valueOf(value));
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_PRIORITY)) != null) {
            activityObj.setPriority(Float.valueOf(value));
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_STREAM_FAVICON_URL)) != null) {
            activityObj.setStreamFaviconUrl(value);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_STREAM_SOURCE_URL)) != null) {
            activityObj.setStreamSourceUrl(value);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_STREAM_TITLE)) != null) {
            activityObj.setStreamTitle(value);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_STREAM_URL)) != null) {
            activityObj.setStreamUrl(value);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_TITLE)) != null) {
            activityObj.setTitle(value);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_TITLE_ID)) != null) {
            activityObj.setTitleId(value);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_USER_ID)) != null) {
            activityObj.setUserId(value);
        }
        if ((value = activityResource.getProperty(
                SocialImplConstants.ACTIVITY_URL)) != null) {
            activityObj.setUrl(value);
        }
        return activityObj;
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.social.api.activity.Activity

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.