Low

PutDoc adapter callbacks that have been determined by SDL Contenta Engineering to be low in usefulness.

pcm_make_object_name
This method is not invoked with the current release. It would only be invoked if no name is provided in the PI attribute name. Epic Cat Editor custom code insures that there is always a name value.
Sample PI:
<SPEECH><?xy_object id="" name="speech-example-895" 
objecttype="DataModule" modified="yes" access="write"?>
Example: The implementation in that module:
sub pcm_make_object_name {
my $self = shift;
my $idpath = shift;
my $filename = shift;
my $name = File::Basename::basename($filename);
$name=~s/([^\.]*).*/$1/; # Strip out extension
return($name);
}
Arguments passed to this callback are:
  • $idpath - SDL Contenta ID_PATH of object in which the new object will be created. (Should be $parent_idpath)
  • $filename - The filename of the file entity containing the newly authored data.
pcm_see_top_object
Argument passed to this callback is:
  • $top_idpath - The idpath of the top level object, the one that the user selected for editing, the one passed to GetDocPerl for export of this document.
    Assume that top_idpath is not the currently selected object. If you need to get information about this object, you can select it with:
    my $DataO = $self->{CmdO}->Select($top_idpath);

    You could use the recommended Push/Pop but a select is safe here because import has not started.

    If this callback fires, it means that the Editor (user) modified at least one file entity and import has not yet begun.

    pcm_preparse_modified_entities( ) is invoked after this method returns.

pcm_entity_init
This callback is deprecated. Use pcm_preparse_modified_entities instead.
pcm_preparse_modified_entities

There is a large and very descriptive comment in CustomPutDocDefault.pm, explaining how to use this callback. To find the comment, search for the subroutine definition, sub pcm_preparse_modified_entities. This subroutine includes sample code.

This is one of the first callbacks fired. It gives you an opportunity to examine the modified data before the import process starts.

This callback is provided because, currently, the PutDoc import process is not a transaction that can be rolled back. If you need to abort the import of data (for example, because it doesn't parse), this is where you would halt the process.

No other callbacks are fired if this method returns $CustomO->{abort}. When $self->{abort} is returned, the PutDoc adapter immediately returns, leaving the SDL Contenta database unchanged—or you can throw and exception, for example:
die "You must include 3 para0 elements in a para."