/**
  * Creates a new app node for the passed application and attaches
  * it to the system configuration.
  *
  * @param \TechDivision\Application\Interfaces\ApplicationInterface $application The application to create a new AppNode for
  *
  * @return void
  */
 public function newFromApplication(ApplicationInterface $application)
 {
     // load the system configuration
     $systemConfiguration = $this->getInitialContext()->getSystemConfiguration();
     // create a new AppNode and initialize it with the values from this instance
     $appNode = new AppNode();
     $appNode->setNodeName(AppService::NODE_NAME);
     $appNode->setName($application->getName());
     $appNode->setWebappPath($application->getWebappPath());
     $appNode->setParentUuid($systemConfiguration->getUuid());
     $appNode->setUuid($appNode->newUuid());
     // persist the AppNode instance
     $this->persist($appNode);
 }