cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

getting the root node, when checking in updated content

akrithalllal
1-Newbie

getting the root node, when checking in updated content

I am able to burst a document and its images into ACM, creating the correct folder structure based on the xml. But when i check out a piece of that content and add an image, then check it back in, i am unable to get the root node of that content. The Root node contains the values i need to the folder structure, thus the image is being saved in a default place - 'No MetaData'. Here is the image path code form the burst config.

<locnhook sourcetype="graphic" type="acl"><![CDATA[function ln_burst::generate_graphic_path(oid)

{

  local tagname = oid_name(oid);

  local folder_name;

  local arr[1];

  local doc = oid_doc(oid);

  # All elements get stored in the Library

  folder_name = '/Libraries/Commentaries Work-Academic';

  # get the publication title

  # EX:  Fundamentals of Financial Planning

  if(defined($main::BURSTINFO[$doc.'.pub_folder'])) { folder_name = $main::BURSTINFO[$doc.'.pub_folder']; }

  else

  {

     # the publication title is needed for folder name

    local publication_name;

   local publication_subject;

  if(defined($main::BURSTINFO[$doc.'.publication_name'])) {

  publication_name = $main::BURSTINFO[$doc.'.publication_name'];

  publication_subject = $main::BURSTINFO[$doc.'.publication_subject'];

  }

  else {

  if(oid_root()){

  if(oid_attr(oid, "dc.title")){

  publication_name = oid_attr(oid, "dc.title");

  publication_subject = oid_attr(oid, "dc.subject");

  }

  }

  else{

  publication_name = 'No MetaData';

  }

  # store in global array

  if(!defined($main::BURSTINFO[$doc.'.publication_name'])) {

  $main::BURSTINFO[$doc.'.publication_name'] = $publication_name;

  $main::BURSTINFO[$doc.'.publication_subject'] = $publication_subject;

  }

  }

    folder_name .= '/' . $publication_subject;

    # use first letter of name for alpha index folder

  if($publication_name = "No MetaData"){

  folder_name .= '/NM';

  }

  else{

    folder_name .= '/' .substr($publication_name, 1, 1);

  }

    # append the publication title

    folder_name .= '/' . $publication_name . '/';

  }

  # level, index and toc folders are done, else...

  # assign folder for element

  # Images

  folder_name .= 'Images';

  #local fid=open('D:\Source\XML\BurstDevLog.txt', "a+");

  #put( fid, "folder name: $folder_name" );

  #put( fid, "\n " . time_date() . "\n" );

  #close(fid);

  if(index(folder_name, '&')) {

    gsub('\&ldquo;', '"', $folder_name);

    gsub('\&rdquo;', '"', $folder_name);

    gsub('\&rsquo;', "'", $folder_name);

    gsub('\&lsquo;', "'", $folder_name);

    gsub('\&amp;', "and", $folder_name);

  }

  # store in global array

  if(!defined($main::BURSTINFO[$doc.'.pub_folder'])) {$main::BURSTINFO[$doc.'.pub_folder'] = folder_name;}

  return folder_name;

}

dms::set_burst_hook_value(ln_burst::generate_graphic_path(dms::burst_hook_first_oid()));

]]></locnhook>

0 REPLIES 0
Top Tags