qaengine/src/ClientInterface.cxx
//--------------------------------------------------------------------------------
// Admin wants to create new project - copy of the one saved during build
//--------------------------------------------------------------------------------
Admin wants to create new project - copy of the one saved during build
Admin wants to create new project - copy of the one saved during build
int ClientInterface::admin_DupProject(string& reply,int socket,string projName,string copyFrom,ScopeSet scope) {
string policyFileName  = m_SharedRoot+"/"+projName+".policy.xml";
string projectFileName = m_SharedRoot+"/"+projName+".project.xml";
   TaskDriver* currentProject = m_Clients[socket]->getAdminProject();
   if(copyFrom.length()==0) {
       currentProject->createPolicy(policyFileName);
       currentProject->createProject(projectFileName);
   } else {
       string policyCopyName  = m_ModelRoot+"/"+copyFrom+"/policy.xml";
       string projectCopyName = m_ModelRoot+"/"+copyFrom+"/project.xml";
       currentProject->createPolicy(policyFileName,policyCopyName);
       currentProject->createProject(projectFileName,projectCopyName);
   }
   int id = currentProject->getRoot();
   char buf[100];
   sprintf(buf,"%d",id);
   reply = buf;
   reply+="\t";
   PropertiesMap map = currentProject->getNodeProperties(id,scope);
   PropertiesMap::iterator i;
   for(i=map.begin();i!=map.end();i++) {
		reply+=i->first;
		reply+="\t";
		reply+=i->second;
		reply+="\t";
   }
   return 0;
}
int ClientInterface :: admin_DupProject ( string & reply , int socket , string projName , string copyFrom , ScopeSet scope ) { string policyFileName = m_SharedRoot + " " + projName + " " ; string projectFileName = m_SharedRoot + " " + projName + " " ; TaskDriver * currentProject = m_Clients [ socket ] -> getAdminProject ( ) ; if ( copyFrom . length ( ) == 0 ) { currentProject -> createPolicy ( policyFileName ) ; currentProject -> createProject ( projectFileName ) ; } else { string policyCopyName = m_ModelRoot + " " + copyFrom + " " ; string projectCopyName = m_ModelRoot + " " + copyFrom + " " ; currentProject -> createPolicy ( policyFileName , policyCopyName ) ; currentProject -> createProject ( projectFileName , projectCopyName ) ; } int id = currentProject -> getRoot ( ) ; char buf [ 100 ] ; sprintf ( buf , " " , id ) ; reply = buf ; reply += " \t " ; PropertiesMap map = currentProject -> getNodeProperties ( id , scope ) ; PropertiesMap :: iterator i ; for ( i = map . begin ( ) ; i != map . end ( ) ; i ++ ) { reply += i -> first ; reply += " \t " ; reply += i -> second ; reply += " \t " ; } return 0 ; }
Admin wants to create new project - copy of the one saved during build
Admin wants to create new project - copy of the one saved during build