/**
  * it validates activity schema according to version standard
  * @param      $id
  * @param null $version
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function validateActivity($id, $version = null)
 {
     $activityData = $this->activityManager->getActivityData($id);
     $settings = $this->settingsManager->getSettings($activityData['organization_id']);
     $transactionData = $this->activityManager->getTransactionData($id);
     $resultData = $this->activityManager->getResultData($id);
     $organization = $this->organizationManager->getOrganization($activityData->organization_id);
     $orgElem = $this->organizationManager->getOrganizationElement();
     $activityElement = $this->activityManager->getActivityElement();
     if ($version == null) {
         $version = config('app.default_version_name');
     }
     return $this->validateCompletedActivity($activityData, $transactionData, $resultData, $settings, $activityElement, $orgElem, $organization, $version);
 }
 /**
  * Download of activity xml files
  * @param $activityId
  * @return \Illuminate\Http\Response
  */
 public function downloadActivityXml($activityId)
 {
     $activityData = $this->activityManager->getActivityData($activityId);
     $activityElement = $this->activityManager->getActivityElement();
     $xmlService = $activityElement->getActivityXmlService();
     $xml = $xmlService->generateTemporaryActivityXml($this->activityManager->getActivityData($activityId), $this->activityManager->getTransactionData($activityId), $this->activityManager->getResultData($activityId), $this->settingsManager->getSettings($activityData['organization_id']), $activityElement, $this->organizationManager->getOrganizationElement(), $this->organizationManager->getOrganization($activityData->organization_id));
     return response()->make($xml, 200, ['Content-type' => 'text/xml', 'Content-Disposition' => sprintf('attachment; filename=activityXmlFile.xml')]);
 }
 /**
  * generate activity xml
  * @param Activity $activity
  */
 public function generateXml(Activity $activity)
 {
     $activity_id = $activity->id;
     $org_id = $activity->organization_id;
     $settings = $this->getSettings($org_id);
     $transactionData = $this->activityManager->getTransactionData($activity_id);
     $resultData = $this->activityManager->getResultData($activity_id);
     $organization = $this->organizationManager->getOrganization($org_id);
     $orgElem = $this->organizationManager->getOrganizationElement();
     $activityElement = $this->activityManager->getActivityElement();
     $xmlService = $activityElement->getActivityXmlService();
     $xmlService->generateActivityXml($activity, $transactionData, $resultData, $settings, $activityElement, $orgElem, $organization);
 }