ShareUpdateServiceImpl (gCube Share Updates Portlet 1.7.0-3.7.0 API)
Date: 2015-05-19

org.gcube.portlets.user.shareupdates.server

## Class ShareUpdateServiceImpl

- java.lang.Object
- - javax.servlet.GenericServlet
  - - javax.servlet.http.HttpServlet
    - - com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
      - - com.google.gwt.user.server.rpc.RemoteServiceServlet
        - - org.gcube.portlets.user.shareupdates.server.ShareUpdateServiceImpl

- All Implemented Interfaces:
    com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, ShareUpdateService

      public class ShareUpdateServiceImpl
      extends com.google.gwt.user.server.rpc.RemoteServiceServlet
      implements ShareUpdateService

  The server side implementation of the RPC service.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `TEST_USER`
    `static String` | `UPLOAD_DIR`

    - ### Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet

      `perThreadRequest, perThreadResponse`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ShareUpdateServiceImpl()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `LinkPreview` | `checkLink(String linkToCheck)` tries the following in the indicated order for Populating the Link preview Open Graph protocol Meta "title" and "description" tags Best guess from page content (not recommended) Schema.org microdata <-- This is still a TODO
    `LinkPreview` | `checkUploadedFile(String fileName, String fileabsolutePathOnServer)` generate a preview of the file, upload the file on the storage and shorts the link
    `void` | `destroy()`
    `String` | `getDevelopmentUser()`
    `ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean>` | `getHashtags()`
    `static ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean>` | `getOrganizationUsers(String scope, String currUser, boolean withinPortal)`
    `ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean>` | `getPortalUsers()`
    `ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean>` | `getSelectedUserIds(ArrayList<String> fullNames)`
    `UserSettings` | `getUserSettings()`
    `void` | `init()` connect to cassandra at startup
    `org.gcube.portal.databook.shared.ClientFeed` | `share(String postText, org.gcube.portal.databook.shared.FeedType feedType, org.gcube.portal.databook.shared.PrivacyLevel pLevel, String vreId, LinkPreview preview, String urlThumbnail, ArrayList<String> mentionedUserFullNames, String fileName, String filePathOnServer, boolean notifyGroup)`

    - ### Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet

      `checkPermutationStrongName, doGetSerializationPolicy, getCodeServerPolicyUrl, getRequestModuleBasePath, getSerializationPolicy, init, loadPolicyFromCodeServer, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processCall, processPost, shouldCompressResponse`

    - ### Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet

      `doPost, doUnexpectedFailure, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContent`

    - ### Methods inherited from class javax.servlet.http.HttpServlet

      `doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service`

    - ### Methods inherited from class javax.servlet.GenericServlet

      `getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TEST_USER

          public static final String TEST_USER

      See Also:
        Constant Field Values

    - #### UPLOAD_DIR

          public static final String UPLOAD_DIR

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ShareUpdateServiceImpl

          public ShareUpdateServiceImpl()

  - ### Method Detail

    - #### init

          public void init()

      connect to cassandra at startup
      Overrides:
        `init` in class `javax.servlet.GenericServlet`

    - #### destroy

          public void destroy()

      Specified by:
        `destroy` in interface `javax.servlet.Servlet`
      Overrides:
        `destroy` in class `javax.servlet.GenericServlet`

    - #### getDevelopmentUser

          public String getDevelopmentUser()

    - #### share

          public org.gcube.portal.databook.shared.ClientFeed share(String postText,
                                                          org.gcube.portal.databook.shared.FeedType feedType,
                                                          org.gcube.portal.databook.shared.PrivacyLevel pLevel,
                                                          String vreId,
                                                          LinkPreview preview,
                                                          String urlThumbnail,
                                                          ArrayList<String> mentionedUserFullNames,
                                                          String fileName,
                                                          String filePathOnServer,
                                                          boolean notifyGroup)

      Specified by:
        `share` in interface `ShareUpdateService`

    - #### getUserSettings

          public UserSettings getUserSettings()

      Specified by:
        `getUserSettings` in interface `ShareUpdateService`

    - #### checkUploadedFile

          public LinkPreview checkUploadedFile(String fileName,
                                      String fileabsolutePathOnServer)

      generate a preview of the file, upload the file on the storage and shorts the link
      Specified by:
        `checkUploadedFile` in interface `ShareUpdateService`

    - #### checkLink

          public LinkPreview checkLink(String linkToCheck)

      tries the following in the indicated order for Populating the Link preview Open Graph protocol Meta "title" and "description" tags Best guess from page content (not recommended) Schema.org microdata <-- This is still a TODO
      Specified by:
        `checkLink` in interface `ShareUpdateService`

    - #### getSelectedUserIds

          public ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean> getSelectedUserIds(ArrayList<String> fullNames)

      Returns:
        the screennames of the addressee (user logins e.g. pino.pini)

    - #### getPortalUsers

          public ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean> getPortalUsers()

      Specified by:
        `getPortalUsers` in interface `ShareUpdateService`

    - #### getHashtags

          public ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean> getHashtags()

      Specified by:
        `getHashtags` in interface `ShareUpdateService`

    - #### getOrganizationUsers

          public static ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean> getOrganizationUsers(String scope,
                                                                                            String currUser,
                                                                                            boolean withinPortal)

      Parameters:
        `session` - the Asl Session
        `withinPortal` - true when is on Liferay portal
      Returns:
        the users belonging to the current organization (scope)

Copyright © 2015. All Rights Reserved.