Create task template HTTP call context.

@param TaskTemplate $taskTemplate Task template object to be created

@return HttpCallContext
338697
private function _getCreateTaskTemplateContext(TaskTemplate $taskTemplate)
    {
        $result = new HttpCallContext();
        $result->setMethod(Resources::HTTP_POST);
        $result->setHeaders($this->_batchHeaders);
        $result->setUri($this->getUri());
        $result->setPath('/$1/TaskTemplates');
        $result->setBody($this->wrapAtomEntry($taskTemplate));
        $result->addStatusCode(Resources::STATUS_CREATED);

        return $result;
    }
481633
public function load($template)
    {
        $template = $this->findFirstExistingTemplate($template);
        if (!isset($this->loadedTemplates[ $template ])) {
            $class = $this->getTemplateClassName($template);

            $this->loadedTemplates[ $template ] = new $class($this);
            if (!$this->loadedTemplates[ $template ] instanceof Template) {
                throw new TemplatingException("The compiled class for {$template} is invalid");
            }
        }

        return $this->loadedTemplates[ $template ];
    }
1184986
public function setPreMessageTemplate($template = null)
    {
        if (null !== $template) {
            $template = (string) $template;
        }
        $this->abstractOptions['messageTemplates']
                              [self::PRE_MESSAGE_TEMPLATE_KEY] = $template;
        return $this;
    }
1329991
public function template($name, $tempId = null)
    {
        Util::operateArray($this->smsData['templates'], $name, $tempId);

        return $this;
    }
1147440
public function templateAction()
    {
        try {
            $jobEntity = $this->initializeJob()->get($this->params());
            $jobEntity->setTemplate($this->params('template', 'default'));
            $this->repositoryService->store($jobEntity);
            $this->notification()->success(/* @translate*/ 'Template changed');
        } catch (\Exception $e) {
            $this->notification()->danger(/* @translate */ 'Template not changed');
        }

        return new JsonModel(array());
    }
560558
protected function renderTemplate($template, array $context = [])
    {
        $app = $this->getContainer();

        if ($this->pathAdded === false) {
            $this->addTwigPath('templates');
            $this->pathAdded = true;
        }

        return $app['twig']->render($template, $context);
    }
332364
public function createTemplateAsync($template_document, $template_name)
    {
        return $this->createTemplateAsyncWithHttpInfo($template_document, $template_name)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
383038
public function create(Template $Template)
    {
        $response = $this->mailjet->post(Resources::$Template,
            ['body' => $Template->format()]);
        if (!$response->success()) {
            $this->throwError("TemplateManager:create() failed", $response);
        }

        return $response->getData();
    }
1278329
private function buildTemplate($template)
    {
        $this->template = $template;
        $offset = "{
            x: $this->offsetX,
            y: $this->offsetY
        }";

        if ($this->offsetX == 20 && $this->offsetY == 20 || $this->offset == 20) {
            $offset = $this->offset;
        }

        $this->placement['enter'] = 'right';

        return "{
            icon: '$this->icon',
            title: '$this->title',
            message: '$this->message',
            url: '$this->url',
            target: '$this->target'
        }, {
            element: '$this->element',
            position: $this->position,
            type: '$this->type',
            allow_dismiss: $this->allowDismiss,
            newest_on_top: $this->newestFirst,
            showProgressbar: $this->progress,
            placement: " . json_encode($this->placement) . ",
            offset: $offset,
            spacing: $this->spacing,
            z_index: $this->zIndex,
            mouse_over: '$this->mouseOver',
            delay: $this->delay,
            timer: $this->timer,
            url_target: '$this->urlTarget',
            animate: " . json_encode($this->animate) . ",
            onShow: $this->onShow,
            onShown: $this->onShown,
            onClose: $this->onClose,
            onClosed: $this->onClosed,
            icon_type: '$this->iconType',
            template: `$this->template`
        }
        ";
    }
960382
public function patch($tasklist, $task, Task $postBody, $optParams = array()) {
      $params = array('tasklist' => $tasklist, 'task' => $task, 'postBody' => $postBody);
      $params = array_merge($params, $optParams);
      $data = $this->__call('patch', array($params));
      if ($this->useObjects()) {
        return new Task($data);
      } else {
        return $data;
      }
    }
276422
public function createTemplate(Template &$template)
		{
			$form_data = array(
				'template_name' => $template->getName(),
				'template_subject' => $template->getSubject(),
				'template_body_plain' => $template->getBodyPlain(),
				'template_body_html' => $template->getBodyHtml(),
				'template_body_mobile' => $template->getBodyMobile(),
				'charset' => $template->getCharacterSet(),
				'encoding' => $template->getCharacterEncoding(),
				'folder_id' => $template->getFolderId()
			);
			$data = $this->call('createtemplate', $form_data);

			$template->setTemplateId(trim($data[1]));

			//return $template;
		}
895890
public function setHTMLTemplate($template)
    {
        if (substr($template, -3) == '.ss') {
            $template = substr($template, 0, -3);
        }
        $this->HTMLTemplate = $template;

        return $this;
    }
591287
protected function _getTemplate()
    {
        if (is_null($this->_template)) {
            foreach ($this->_map as $method => $className) {
                if ($this->_sql instanceof $className) {
                    $this->_template = $this->$method();
                    break;
                }
            }
        }
        return $this->_template;
    }
199147
private TeaServletTemplateSource createTemplateSource(
                                         ContextSource contextSource) {
        return TeaServletTemplateSource.createTemplateSource(
            getServletContext(),
            (TeaServletContextSource) contextSource,
            getProperties().subMap("template"),
            getLog());
    }
186246
public function buildTemplate()
    {
        if (!empty($this->template)) {
            return $this->template;
        }

        $this->template = [
            'imageUrl' => $this->imageUrl,
            'action' => $this->actionBuilder->buildTemplateAction(),
        ];

        return $this->template;
    }
496611
public Context setTemplate(Template template) {
        checkThread();
        if (template != null) {
            setEngine(template.getEngine());
        }
        this.template = template;
        return this;
    }
62927
public static HttpTemplate template(TemplateType type, String template) {
        return new HttpTemplate(type).withTemplate(template);
    }