It's impossible to obtain the ComponentTemplate Name from the transport package,because it is not included in the package.
The only thing you can do is obtain the ComponentTemplate uri and then try to get its name, with somehing like this:
public class CustomDeployer extends Module{
private static Logger log = LoggerFactory.getLogger(CustomDeployer.class);
public CustomDeployer(Configuration config, Processor processor)
throws ConfigurationException {
super(config, processor);
}
@Override
public void process(TransportPackage data) throws ProcessingException {
// obtain pages.xml
ProcessorInstructions instructions = data.getProcessorInstructions();
MetaData pageMetaInfo = instructions.getMetaData("Pages");
MetaDataFile pageMeta = data.getMetaData("Pages", pageMetaInfo.getName());
Iterator<Page> itPage = pageMeta.iterator();
while (itPage.hasNext()){
Page page = itPage.next();
Iterator<ComponentPresentationKey> itCP = page.getComponentPresentationKeys();
while (itCP.hasNext())
{
ComponentPresentationKey key = itCP.next();
log.debug("component: "+key.getComponentId().getItemId());
log.debug("template: "+key.getTemplateId().getItemId());
}
}
}
But in the presentation side, there is no reference to the Component Template name unless it is published as a dynamic ComponentPresentation.