class AlfrescoAPI::RenditionsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/alfresco_api/api/renditions_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_rendition(node_id, rendition_body_create, opts = {}) click to toggle source

Create rendition Note: this endpoint is available in Alfresco 5.2 and newer versions. An asynchronous request to create a rendition for file nodeId. The rendition is specified by name id in the request body: “`JSON { "id":"doclib" } “` @param node_id The identifier of a node. @param rendition_body_create The rendition "id". @param [Hash] opts the optional parameters @return [nil]

# File lib/alfresco_api/api/renditions_api.rb, line 29
def create_rendition(node_id, rendition_body_create, opts = {})
  create_rendition_with_http_info(node_id, rendition_body_create, opts)
  return nil
end
create_rendition_with_http_info(node_id, rendition_body_create, opts = {}) click to toggle source

Create rendition Note: this endpoint is available in Alfresco 5.2 and newer versions. An asynchronous request to create a rendition for file nodeId. The rendition is specified by name id in the request body: &#x60;&#x60;&#x60;JSON { "id&quot;:&quot;doclib&quot; } &#x60;&#x60;&#x60; @param node_id The identifier of a node. @param rendition_body_create The rendition "id&quot;. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/alfresco_api/api/renditions_api.rb, line 40
def create_rendition_with_http_info(node_id, rendition_body_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: RenditionsApi.create_rendition ..."
  end
  # verify the required parameter 'node_id' is set
  if @api_client.config.client_side_validation && node_id.nil?
    fail ArgumentError, "Missing the required parameter 'node_id' when calling RenditionsApi.create_rendition"
  end
  # verify the required parameter 'rendition_body_create' is set
  if @api_client.config.client_side_validation && rendition_body_create.nil?
    fail ArgumentError, "Missing the required parameter 'rendition_body_create' when calling RenditionsApi.create_rendition"
  end
  # resource path
  local_var_path = "/nodes/{nodeId}/renditions".sub('{' + 'nodeId' + '}', node_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(rendition_body_create)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RenditionsApi#create_rendition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_rendition(node_id, rendition_id, opts = {}) click to toggle source

Get rendition information Note: this endpoint is available in Alfresco 5.2 and newer versions. Gets the rendition information for renditionId of file nodeId. @param node_id The identifier of a node. @param rendition_id The name of a thumbnail rendition, for example doclib, or pdf. @param [Hash] opts the optional parameters @return [RenditionEntry]

# File lib/alfresco_api/api/renditions_api.rb, line 89
def get_rendition(node_id, rendition_id, opts = {})
  data, _status_code, _headers = get_rendition_with_http_info(node_id, rendition_id, opts)
  return data
end
get_rendition_content(node_id, rendition_id, opts = {}) click to toggle source

Get rendition content Note: this endpoint is available in Alfresco 5.2 and newer versions. Gets the rendition content for renditionId of file nodeId. @param node_id The identifier of a node. @param rendition_id The name of a thumbnail rendition, for example doclib, or pdf. @param [Hash] opts the optional parameters @option opts [BOOLEAN] :attachment true enables a web browser to download the file as an attachment. false means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to false if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of false is ignored, and the attachment will be returned in the response. (default to true) @option opts [DateTime] :if_modified_since Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, &#x60;Wed, 09 Mar 2016 16:56:34 GMT&#x60;. @option opts [BOOLEAN] :placeholder If true and there is no rendition for this nodeId and renditionId, then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. (default to false) @return [nil]

# File lib/alfresco_api/api/renditions_api.rb, line 153
def get_rendition_content(node_id, rendition_id, opts = {})
  get_rendition_content_with_http_info(node_id, rendition_id, opts)
  return nil
end
get_rendition_content_with_http_info(node_id, rendition_id, opts = {}) click to toggle source

Get rendition content Note: this endpoint is available in Alfresco 5.2 and newer versions. Gets the rendition content for renditionId of file nodeId. @param node_id The identifier of a node. @param rendition_id The name of a thumbnail rendition, for example doclib, or pdf. @param [Hash] opts the optional parameters @option opts [BOOLEAN] :attachment true enables a web browser to download the file as an attachment. false means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to false if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of false is ignored, and the attachment will be returned in the response. @option opts [DateTime] :if_modified_since Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, &#x60;Wed, 09 Mar 2016 16:56:34 GMT&#x60;. @option opts [BOOLEAN] :placeholder If true and there is no rendition for this nodeId and renditionId, then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/alfresco_api/api/renditions_api.rb, line 167
def get_rendition_content_with_http_info(node_id, rendition_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: RenditionsApi.get_rendition_content ..."
  end
  # verify the required parameter 'node_id' is set
  if @api_client.config.client_side_validation && node_id.nil?
    fail ArgumentError, "Missing the required parameter 'node_id' when calling RenditionsApi.get_rendition_content"
  end
  # verify the required parameter 'rendition_id' is set
  if @api_client.config.client_side_validation && rendition_id.nil?
    fail ArgumentError, "Missing the required parameter 'rendition_id' when calling RenditionsApi.get_rendition_content"
  end
  # resource path
  local_var_path = "/nodes/{nodeId}/renditions/{renditionId}/content".sub('{' + 'nodeId' + '}', node_id.to_s).sub('{' + 'renditionId' + '}', rendition_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'attachment'] = opts[:'attachment'] if !opts[:'attachment'].nil?
  query_params[:'placeholder'] = opts[:'placeholder'] if !opts[:'placeholder'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RenditionsApi#get_rendition_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_rendition_with_http_info(node_id, rendition_id, opts = {}) click to toggle source

Get rendition information Note: this endpoint is available in Alfresco 5.2 and newer versions. Gets the rendition information for renditionId of file nodeId. @param node_id The identifier of a node. @param rendition_id The name of a thumbnail rendition, for example doclib, or pdf. @param [Hash] opts the optional parameters @return [Array<(RenditionEntry, Fixnum, Hash)>] RenditionEntry data, response status code and response headers

# File lib/alfresco_api/api/renditions_api.rb, line 100
def get_rendition_with_http_info(node_id, rendition_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: RenditionsApi.get_rendition ..."
  end
  # verify the required parameter 'node_id' is set
  if @api_client.config.client_side_validation && node_id.nil?
    fail ArgumentError, "Missing the required parameter 'node_id' when calling RenditionsApi.get_rendition"
  end
  # verify the required parameter 'rendition_id' is set
  if @api_client.config.client_side_validation && rendition_id.nil?
    fail ArgumentError, "Missing the required parameter 'rendition_id' when calling RenditionsApi.get_rendition"
  end
  # resource path
  local_var_path = "/nodes/{nodeId}/renditions/{renditionId}".sub('{' + 'nodeId' + '}', node_id.to_s).sub('{' + 'renditionId' + '}', rendition_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'RenditionEntry')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RenditionsApi#get_rendition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_renditions(node_id, opts = {}) click to toggle source

List renditions Note: this endpoint is available in Alfresco 5.2 and newer versions. Gets a list of the rendition information for each rendition of the the file nodeId, including the rendition id. Each rendition returned has a status: CREATED means it is available to view or download, NOT_CREATED means the rendition can be requested. You can use the where parameter to filter the returned renditions by status. For example, the following where clause will return just the CREATED renditions: “` (status='CREATED') “` @param node_id The identifier of a node. @param [Hash] opts the optional parameters @option opts [String] :where A string to restrict the returned objects by using a predicate. @return [RenditionPaging]

# File lib/alfresco_api/api/renditions_api.rb, line 219
def list_renditions(node_id, opts = {})
  data, _status_code, _headers = list_renditions_with_http_info(node_id, opts)
  return data
end
list_renditions_with_http_info(node_id, opts = {}) click to toggle source

List renditions Note: this endpoint is available in Alfresco 5.2 and newer versions. Gets a list of the rendition information for each rendition of the the file nodeId, including the rendition id. Each rendition returned has a status: CREATED means it is available to view or download, NOT_CREATED means the rendition can be requested. You can use the where parameter to filter the returned renditions by status. For example, the following where clause will return just the CREATED renditions: &#x60;&#x60;&#x60; (status&#x3D;&#39;CREATED&#39;) &#x60;&#x60;&#x60; @param node_id The identifier of a node. @param [Hash] opts the optional parameters @option opts [String] :where A string to restrict the returned objects by using a predicate. @return [Array<(RenditionPaging, Fixnum, Hash)>] RenditionPaging data, response status code and response headers

# File lib/alfresco_api/api/renditions_api.rb, line 230
def list_renditions_with_http_info(node_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: RenditionsApi.list_renditions ..."
  end
  # verify the required parameter 'node_id' is set
  if @api_client.config.client_side_validation && node_id.nil?
    fail ArgumentError, "Missing the required parameter 'node_id' when calling RenditionsApi.list_renditions"
  end
  # resource path
  local_var_path = "/nodes/{nodeId}/renditions".sub('{' + 'nodeId' + '}', node_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'RenditionPaging')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RenditionsApi#list_renditions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end