_ext/jboss_developer.rb
# Private: Creates the payload for a POST / PATCH to Drupal.
#
# page      - Page object from awestruct
# content   - Transformed content of the page
#
# Returns a Ruby Hash of the HTTP payload.
Creates the payload for a POST / PATCH to Drupal.
page      - Page object from awestruct
content   - Transformed content of the page

Returns a Ruby Hash of the HTTP payload.
Creates the payload for a POST / PATCH to Drupal . page - Page object from awestruct content - Transformed content of the page Returns a Ruby Hash of the HTTP payload .
def create_payload(page, content)
        path = create_path page
        drupal_type = page.drupal_type || 'page'
        payload = {title: [{:value => (page.title || page.site.title || path.gsub('/', ''))}],
                   _links: {type: {href: File.join(@base_url, '/rest/type/node/', drupal_type)}},
                   body: [{value: content,
                           summary: page.description,
                           format: (page.drupal_format || 'full_html')}],
                   path: {alias: File.join('/', path)},
                   status: [{value: '1', lang: 'en'}]
        }
        if page.drupal_type == 'rhd_solution_overview'
          payload[:field_solution_name] = [{:value => page.solution.name }]
          payload[:field_solution_tag_line] = [{:value => page.solution.long_description }]
        end
        payload
      end
def create_payload ( page , content ) path = create_path page drupal_type = page . drupal_type || 'page' payload = { title : [ { :value => ( page . title || page . site . title || path . gsub ( '/' , '' ) ) } ] , _links : { type : { href : File . join ( @base_url , '/rest/type/node/' , drupal_type ) } } , body : [ { value : content , summary : page . description , format : ( page . drupal_format || 'full_html' ) } ] , path : { alias : File . join ( '/' , path ) } , status : [ { value : '1' , lang : 'en' } ] } if page . drupal_type == 'rhd_solution_overview' payload [ :field_solution_name ] = [ { :value => page . solution . name } ] payload [ :field_solution_tag_line ] = [ { :value => page . solution . long_description } ] end payload end
Private: Creates the payload for a POST / PATCH to Drupal.
Private : Creates the payload for a POST / PATCH to Drupal .
page
<not_specific>
content
<not_specific>