qaengine/src/ClientInterface.cxx
//--------------------------------------------------------------------------------
// Admin wants to open specified project
//--------------------------------------------------------------------------------
Admin wants to open specified project
Admin wants to open specified project
int ClientInterface::admin_OpenProject(string& reply,int socket,string project,ScopeSet scope) {
string policyFileName  = m_SharedRoot+"/"+project+".policy.xml";
string projectFileName = m_SharedRoot+"/"+project+".project.xml";
   TaskDriver* currentProject = m_Clients[socket]->getAdminProject();
   if(currentProject->openPolicy(policyFileName)!=0) return -1;
   if(currentProject->openProject(projectFileName)!=0) {
	   currentProject->createProject(projectFileName);
   }
   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_OpenProject ( string & reply , int socket , string project , ScopeSet scope ) { string policyFileName = m_SharedRoot + " " + project + " " ; string projectFileName = m_SharedRoot + " " + project + " " ; TaskDriver * currentProject = m_Clients [ socket ] -> getAdminProject ( ) ; if ( currentProject -> openPolicy ( policyFileName ) != 0 ) return -1 ; if ( currentProject -> openProject ( projectFileName ) != 0 ) { currentProject -> createProject ( projectFileName ) ; } 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 open specified project
Admin wants to open specified project