Class Sdk

java.lang.Object
net.spreadsheetspace.sdk.Sdk

public class Sdk extends Object
SpreadSheetSpace Software Development Kit class.
  • Constructor Details

    • Sdk

      public Sdk(String orchestratorServer, String username, String password) throws Exception
      Constructor of SpreadSheetSpace Sdk. Call it for initialize the sdk. You can verify the result in the State of Sdk. See the documentation of "State" for more details.
      Parameters:
      orchestratorServer - Server address of SpreadSheetSpace infrastructure (e.g. "https://www.spreadsheetspace.net")
      username - The username that will be used to authenticate on the SpreadSheetSpace server.
      password - The password that will be used to authenticate on the SpreadSheetSpace server.
      Throws:
      Exception
    • Sdk

      public Sdk(String orchestratorServer, String token) throws Exception
      Constructor of SpreadSheetSpace Sdk. Call it for initialize the sdk. You can verify the result in the State of Sdk. See the documentation of "State" for more details.
      Parameters:
      orchestratorServer - Server address of SpreadSheetSpace infrastructure (e.g. "https://www.spreadsheetspace.net")
      token - The token that will be used to authenticate the user on the SpreadSheetSpace server.
      Throws:
      Exception
    • Sdk

      public Sdk(String orchestratorServer, String token, Sdk.TokenType type) throws Exception
      Constructor of SpreadSheetSpace Sdk. Call it for initialize the sdk. You can verify the result in the State of Sdk. See the documentation of "State" for more details.
      Parameters:
      orchestratorServer - Server address of SpreadSheetSpace infrastructure (e.g. "https://www.spreadsheetspace.net")
      token - The token that will be used to authenticate the user on the SpreadSheetSpace server.
      type - The type of token (APP_TOKEN or BEARER_JWT).
      Throws:
      Exception
  • Method Details

    • contextDestroyed

      public void contextDestroyed()
      This method destroy Sdk notification thread. Call this method if you used any subscribeNotificationView.
    • getViewServer

      protected ViewServer getViewServer()
    • getHistoryServer

      protected String getHistoryServer()
    • publishPublicView

      public ViewDescriptor publishPublicView(String id, String view_server, String comment)
      Publish on T-Space of an existing Public View. See the documentation of "createPublicView" to know how to create a public View.
      Parameters:
      id - This string represents the View identifier.
      view_server - This string represents the server address where the View is stored.
      comment - This string represents a detailed description of the View. This description is shows as a comment on T-Space.
      Returns:
      Return a descriptor of the created View. See the documentation of "ViewDescriptor" for more details.
    • createPublicView

      public ViewDescriptor createPublicView(String description, String[][] table, String excelTemplate, boolean isTable, boolean hasHeaders, Integer rows, Integer cols, boolean tagged, Timestamp ts) throws FileNotFoundException, IOException
      Create a SpreadSheetSpace View on the T-Space. This View is hidden, you have to "Publish" it to make it visible. See the documentation of "publishPublicView" for more details.
      Parameters:
      description - The description of the View.
      table - A matrix that represents the values ​​of the View cells.
      excelTemplate - The path to the Excel file that will be used as a template. Set it "null" if you want to create a View without template.
      isTable - Set it "true" if you want to create a View with Excel table.
      hasHeaders - If "isTable" is "true" set it true if the first line of your data rappresent the header of your Excel table.
      rows - rows represent the number of rows of your View. If rows equals "-1" and cols equals "-1" the View is full-sheet.
      cols - cols represent the number of columns of your View. If rows equals "-1" and cols equals "-1" the View is full-sheet.
      tagged - set it "true" if you want to create a history version of your View.
      ts - set it if you want to set a specific timestamp to your View.
      Returns:
      Return a descriptor of the created View. See the documentation of "ViewDescriptor" for more details.
      Throws:
      FileNotFoundException
      IOException
    • createPublicView

      public ViewDescriptor createPublicView(String description, String[][] table, String excelTemplate, boolean isTable, boolean hasHeaders, Integer rows, Integer cols, boolean tagged) throws FileNotFoundException, IOException
      Create a SpreadSheetSpace View on the T-Space. This View is hidden, you have to "Publish" it to make it visible. See the documentation of "publishPublicView" for more details.
      Parameters:
      description - The description of the View.
      table - A matrix that represents the values ​​of the View cells.
      excelTemplate - The path to the Excel file that will be used as a template. Set it "null" if you want to create a View without template.
      isTable - Set it "true" if you want to create a View with Excel table.
      hasHeaders - If "isTable" is "true" set it true if the first line of your data rappresent the header of your Excel table.
      rows - rows represent the number of rows of your View. If rows equals "-1" and cols equals "-1" the View is full-sheet.
      cols - cols represent the number of columns of your View. If rows equals "-1" and cols equals "-1" the View is full-sheet.
      tagged - set it "true" if you want to create a history version of your View.
      Returns:
      Return a descriptor of the created View. See the documentation of "ViewDescriptor" for more details.
      Throws:
      FileNotFoundException
      IOException
    • createPrivateView

      public ViewDescriptor createPrivateView(String description, Set<String> recipients, String[][] table, String excelTemplate, boolean isTable, boolean hasHeaders, Integer rows, Integer cols, boolean encrypt, boolean tagged, Timestamp ts) throws IOException
      Create a SpreadSheetSpace View and send it to a specific set of recipients.
      Parameters:
      description - The description of the View.
      recipients - A list of mail addresses that represent the recipients of the View.
      table - A matrix that represents the values ​​of the View cells.
      excelTemplate - The path to the Excel file that will be used as a template. Set it "null" if you want to create a View without template.
      isTable - Set it "true" if you want to create a View with Excel table.
      hasHeaders - If "isTable" is "true" set it true if the first line of your data rappresent the header of your Excel table.
      rows - rows represent the number of rows of your View.
      cols - cols represent the number of columns of your View.
      encrypt - set it "true" if you want to encrypt your View.
      tagged - set it "true" if you want to create a history version of your View.
      ts - set it if you want to set a specific timestamp to your View.
      Returns:
      Return a descriptor of the created View. See the documentation of "ViewDescriptor" for more details.
      Throws:
      FileNotFoundException
      IOException
    • createPrivateView

      public ViewDescriptor createPrivateView(String description, Set<String> recipients, String[][] table, String excelTemplate, boolean isTable, boolean hasHeaders, Integer rows, Integer cols, boolean encrypt, boolean tagged) throws IOException
      Create a SpreadSheetSpace View and send it to a specific set of recipients.
      Parameters:
      description - The description of the View.
      recipients - A list of mail addresses that represent the recipients of the View.
      table - A matrix that represents the values ​​of the View cells.
      excelTemplate - The path to the Excel file that will be used as a template. Set it "null" if you want to create a View without template.
      isTable - Set it "true" if you want to create a View with Excel table.
      hasHeaders - If "isTable" is "true" set it true if the first line of your data rappresent the header of your Excel table.
      rows - rows represent the number of rows of your View.
      cols - cols represent the number of columns of your View.
      encrypt - set it "true" if you want to encrypt your View.
      tagged - set it "true" if you want to create a history version of your View.
      Returns:
      Return a descriptor of the created View. See the documentation of "ViewDescriptor" for more details.
      Throws:
      FileNotFoundException
      IOException
    • createPrivateForm

      public ViewDescriptor createPrivateForm(String description, String recipient, String[][] table, String excelTemplate, boolean isTable, boolean hasHeaders, Integer rows, Integer cols, boolean encrypt, boolean tagged, Timestamp ts) throws IOException
      Create a SpreadSheetSpace Form and send it to a specific recipient.
      Parameters:
      description - The description of the Form.
      recipient - A mail addresses that represent the recipient of the Form.
      table - A matrix that represents the values ​​of the Form cells.
      excelTemplate - The path to the Excel file that will be used as a template. Set it "null" if you want to create a Form without template.
      isTable - Set it "true" if you want to create a Form with Excel table.
      hasHeaders - If "isTable" is "true" set it true if the first line of your data rappresent the header of your Excel table.
      rows - rows represent the number of rows of your Form.
      cols - cols represent the number of columns of your Form.
      encrypt - set it "true" if you want to encrypt this element
      tagged - set it "true" if you want to create a history version of your View.
      ts - set it if you want to set a specific timestamp to your View.
      Returns:
      Return a descriptor of the created Form. See the documentation of "ViewDescriptor" for more details.
      Throws:
      FileNotFoundException
      IOException
    • createPrivateForm

      public ViewDescriptor createPrivateForm(String description, String recipient, String[][] table, String excelTemplate, boolean isTable, boolean hasHeaders, Integer rows, Integer cols, boolean encrypt, boolean tagged) throws IOException
      Create a SpreadSheetSpace Form and send it to a specific recipient.
      Parameters:
      description - The description of the Form.
      recipient - A mail addresses that represent the recipient of the Form.
      table - A matrix that represents the values ​​of the Form cells.
      excelTemplate - The path to the Excel file that will be used as a template. Set it "null" if you want to create a Form without template.
      isTable - Set it "true" if you want to create a Form with Excel table.
      hasHeaders - If "isTable" is "true" set it true if the first line of your data rappresent the header of your Excel table.
      rows - rows represent the number of rows of your Form.
      cols - cols represent the number of columns of your Form.
      encrypt - set it "true" if you want to encrypt this element
      tagged - set it "true" if you want to create a history version of your View.
      Returns:
      Return a descriptor of the created Form. See the documentation of "ViewDescriptor" for more details.
      Throws:
      FileNotFoundException
      IOException
    • createPrivateCoedit

      public ViewDescriptor createPrivateCoedit(String description, Set<String> recipients, String[][] table, String excelTemplate, boolean isTable, boolean hasHeaders, Integer rows, Integer cols, boolean encrypt, boolean tagged) throws IOException
      Create a SpreadSheetSpace Coedit and send it to a specific set of recipients.
      Parameters:
      description - The description of the View.
      recipients - A list of mail addresses that represent the recipients of the Coedit.
      table - A matrix that represents the values ​​of the View cells.
      excelTemplate - The path to the Excel file that will be used as a template. Set it "null" if you want to create a Coedit without template.
      isTable - Set it "true" if you want to create a View with Excel table.
      hasHeaders - If "isTable" is "true" set it true if the first line of your data rappresent the header of your Excel table.
      rows - rows represent the number of rows of your Coedit.
      cols - cols represent the number of columns of your Coedit.
      encrypt - set it "true" if you want to encrypt your Coedit.
      tagged - set it "true" if you want to create a history version of your Coedit.
      Returns:
      Return a descriptor of the created Coedit. See the documentation of "ViewDescriptor" for more details.
      Throws:
      FileNotFoundException
      IOException
    • createPrivateCoedit

      public ViewDescriptor createPrivateCoedit(String description, Set<String> recipients, String[][] table, String excelTemplate, boolean isTable, boolean hasHeaders, Integer rows, Integer cols, boolean encrypt, boolean tagged, Timestamp ts) throws IOException
      Create a SpreadSheetSpace Coedit and send it to a specific set of recipients.
      Parameters:
      description - The description of the View.
      recipients - A list of mail addresses that represent the recipients of the Coedit.
      table - A matrix that represents the values ​​of the View cells.
      excelTemplate - The path to the Excel file that will be used as a template. Set it "null" if you want to create a Coedit without template.
      isTable - Set it "true" if you want to create a View with Excel table.
      hasHeaders - If "isTable" is "true" set it true if the first line of your data rappresent the header of your Excel table.
      rows - rows represent the number of rows of your Coedit.
      cols - cols represent the number of columns of your Coedit.
      encrypt - set it "true" if you want to encrypt your Coedit.
      tagged - set it "true" if you want to create a history version of your Coedit.
      ts - set it if you want to set a specific timestamp to your View.
      Returns:
      Return a descriptor of the created Coedit. See the documentation of "ViewDescriptor" for more details.
      Throws:
      FileNotFoundException
      IOException
    • updateView

      public ViewDescriptor updateView(ViewDescriptor viewDescriptor, String[][] table, String excelTemplate, boolean encrypt, boolean tagged, Timestamp ts)
      Update the data and the template of an existing SpreadSheetSpace View. See the documentation of "createPrivateView" to know how to create a View.
      Parameters:
      viewDescriptor - A descriptor of the View that that you want to update. See the documentation of "ViewDescriptor" for more details.
      table - A matrix that represents the values ​​of the View cells.
      excelTemplate - The path to the Excel file that will be used as a template. Set it "null" if you don't want to update the View template.
      encrypt - set it "true" if you want to encrypt your View.
      tagged - set it "true" if you want to create a history version of your View.
      ts - set it if you want to set a specific timestamp to your View.
      Returns:
      Return a descriptor of the updated View. See the documentation of "ViewDescriptor" for more details.
    • updateView

      public ViewDescriptor updateView(ViewDescriptor viewDescriptor, String[][] table, String excelTemplate, boolean encrypt, boolean tagged)
      Update the data and the template of an existing SpreadSheetSpace View. See the documentation of "createPrivateView" to know how to create a View.
      Parameters:
      viewDescriptor - A descriptor of the View that that you want to update. See the documentation of "ViewDescriptor" for more details.
      table - A matrix that represents the values ​​of the View cells.
      excelTemplate - The path to the Excel file that will be used as a template. Set it "null" if you don't want to update the View template.
      encrypt - set it "true" if you want to encrypt your View.
      tagged - set it "true" if you want to create a history version of your View.
      Returns:
      Return a descriptor of the updated View. See the documentation of "ViewDescriptor" for more details.
    • updateView

      public ViewDescriptor updateView(ViewDescriptor viewDescriptor, String[][] table, String excelTemplate, boolean encrypt, boolean tagged, Timestamp ts, boolean forceLock)
      Update the data and the template of an existing SpreadSheetSpace View. See the documentation of "createPrivateView" to know how to create a View.
      Parameters:
      viewDescriptor - A descriptor of the View that that you want to update. See the documentation of "ViewDescriptor" for more details.
      table - A matrix that represents the values ​​of the View cells.
      excelTemplate - The path to the Excel file that will be used as a template. Set it "null" if you don't want to update the View template.
      encrypt - set it "true" if you want to encrypt your View.
      tagged - set it "true" if you want to create a history version of your View.
      ts - set it if you want to set a specific timestamp to your View.
      forceLock - set it "true" id you want to force lock in your coedit
      Returns:
      Return a descriptor of the updated View. See the documentation of "ViewDescriptor" for more details.
    • updateView

      public ViewDescriptor updateView(ViewDescriptor viewDescriptor, String[][] table, String excelTemplate, boolean encrypt, boolean tagged, boolean forceLock)
      Update the data and the template of an existing SpreadSheetSpace View. See the documentation of "createPrivateView" to know how to create a View.
      Parameters:
      viewDescriptor - A descriptor of the View that that you want to update. See the documentation of "ViewDescriptor" for more details.
      table - A matrix that represents the values ​​of the View cells.
      excelTemplate - The path to the Excel file that will be used as a template. Set it "null" if you don't want to update the View template.
      encrypt - set it "true" if you want to encrypt your View.
      tagged - set it "true" if you want to create a history version of your View.
      forceLock - set it "true" id you want to force lock in your coedit
      Returns:
      Return a descriptor of the updated View. See the documentation of "ViewDescriptor" for more details.
    • deleteView

      public ViewDescriptor deleteView(String viewId, String viewServer)
      Delete an owned view on SpreadSheetSpace.
      Parameters:
      viewId - This string represents the View identifier.
      viewServer - This string represents the server address where the View is stored.
      Returns:
      Return a descriptor of the deleted View. See the documentation of "ViewDescriptor" for more details.
    • deleteHistoryView

      public ViewDescriptor deleteHistoryView(String viewId, String viewServer)
      Delete the history of a view on SpreadSheetSpace.
      Parameters:
      viewId - This string represents the View identifier.
      viewServer - This string represents the server address where the View is stored.
      Returns:
      Return a descriptor of the deleted history View. See the documentation of "ViewDescriptor" for more details.
    • deleteViews

      public ViewDescriptor deleteViews(List<ViewObj> listView)
      Delete owned views on SpreadSheetSpace.
      Parameters:
      listView - This list represents a list of Views to delete.
      Returns:
      Return a descriptor of the deleted View. See the documentation of "ViewDescriptor" for more details.
    • deleteHisotryViews

      public ViewDescriptor deleteHisotryViews(ViewObj view)
    • getAddressBook

      public AddressBookDescriptor getAddressBook()
      Retrieve my addressbook list.
      Returns:
      Return a descriptor of Addressbook list. See the documentation of "AddressbookDescriptor" for more details.
    • getOwnedView

      public ListViewDescriptor getOwnedView()
      Retrieve my owned views list.
      Returns:
      Return a descriptor of UserView list. See the documentation of "ListViewDescriptor" for more details.
    • getInboxView

      public ListViewDescriptor getInboxView()
      Retrieve my inbox views list.
      Returns:
      Return a descriptor of UserView list. See the documentation of "ListViewDescriptor" for more details.
    • generateKey

      public GenerateKeyDescriptor generateKey()
      Generate your personal public and private keys.
      Returns:
      Return a descriptor of your keys. See the documentation of "GenerateKeyDescriptor" for more details.
    • getValuesView

      public ValuesViewDescriptor getValuesView(String view_id, String view_server, String private_key, String excelTemplate)
      Retrieve values from view.
      Parameters:
      view_id - This string represents the View identifier.
      view_server - This string represents the server address where the View is stored.
      private_key - This string represents your private key.
      excelTemplate - The path in where to store the View Excel template file. Set it "null" if you don't want to retrieve the View template.
      Returns:
      Return a descriptor of view's values. See the documentation of "ValuesViewDescriptor" for more details.
    • addRecipients

      public ChangeRecipientDescriptor addRecipients(String id, String view_server, LinkedList<String> listRecipient)
      Add recipient(s) to existing view.
      Parameters:
      id - This string represents the View identifier.
      view_server - This string represents the server address where the View is stored.
      listRecipient - Recipient mail list to added.
      Returns:
      Return a descriptor of addRecipients. See the documentation of "ChangeRecipientDescriptor" for more details.
    • removeRecipients

      public ChangeRecipientDescriptor removeRecipients(String id, String view_server, LinkedList<String> listRecipient)
      Remove recipient(s) to existing view.
      Parameters:
      id - This string represents the View identifier.
      view_server - This string represents the server address where the View is stored
      listRecipient - Recipient mail list to remove.
      Returns:
      Return a descriptor of removeRecipients. See the documentation of "ChangeRecipientDescriptor" for more details.
    • subscribeNotificationView

      public void subscribeNotificationView(ViewDescriptor viewDescriptor, NotificationCallback notificationCallback)
      Subscription to perform a callback function when you receive an update notification of a specific view.
      Parameters:
      viewDescriptor - This object represents a descriptor of an existing View. See the documentation of "ViewDescriptor" for more details.
      notificationCallback - This object represent a callback routines
    • subscribeNotificationView

      public void subscribeNotificationView(UserView userView, NotificationCallback notificationCallback)
      Subscription to perform a callback function when you receive an update notification of a specific view.
      Parameters:
      userView - This object represents a descriptor of an existing View. See the documentation of "UserView" for more details.
      notificationCallback -
    • subscribeNotificationView

      public void subscribeNotificationView(String id, String viewServer, NotificationCallback notificationCallback)
      Subscription to perform a callback function when you receive an update notification of a specific view.
      Parameters:
      id - This string represents the View identifier.
      viewServer - This string represents the server address where the View is stored
      notificationCallback -
    • unsubscribeNotificationView

      public void unsubscribeNotificationView(ViewDescriptor viewDescriptor)
      Deletes a subscription previously created to receive an update of a specific view.
      Parameters:
      viewDescriptor - This object represents a descriptor of an existing View. See the documentation of "ViewDescriptor" for more details.
    • unsubscribeNotificationView

      public void unsubscribeNotificationView(UserView userView)
      Deletes a subscription previously created to receive an update of a specific view.
      Parameters:
      userView - This object represents a descriptor of an existing View. See the documentation of "UserView" for more details.
    • unsubscribeNotificationView

      public void unsubscribeNotificationView(String viewId, String viewServer)
      Deletes a subscription previously created to receive an update of a specific view.
      Parameters:
      viewId - This string represents the View identifier.
      viewServer - This string represents the server address where the View is stored