Adds the project and a new hubID to the sharedProjects db document.
343283
function addProject(project) {
		var hub = generateUniqueHubId();
		//TODO Also add name of project owner? Replace by projectJSON all over the file.
		var query = sharedProject.findOne({location: project});
		return query.exec()
		.then(function(doc) {
			return doc ? Promise.resolve(doc) : sharedProject.create({location: project, hubid: hub});
		});
	}
827946
def project_add_tags(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/addTags' % object_id, input_params, always_retry=always_retry, **kwargs)
652583
function addWelcomeProjectPath(path) {
        var welcomeProjects = ProjectModel._addWelcomeProjectPath(path,
                                                                 PreferencesManager.getViewState("welcomeProjects"));
        PreferencesManager.setViewState("welcomeProjects", welcomeProjects);
    }
493126
public void addDocumentParticipantObject(String documentUniqueId, String repositoryUniqueId, String homeCommunityId)
	{
		List<TypeValuePairType> tvp = new LinkedList<>();
        //SEK - 10/19/2011 - added check for empty or null, RE: Issue Tracker artifact artf2295 (was Issue 135)
 		if (!EventUtils.isEmptyOrNull(repositoryUniqueId)) {
			tvp.add(getTypeValuePair("Repository Unique Id", repositoryUniqueId.getBytes()));
		}
		if (!EventUtils.isEmptyOrNull(homeCommunityId)) {
			tvp.add(getTypeValuePair("ihe:homeCommunityID", homeCommunityId.getBytes()));
		}
		
		addParticipantObjectIdentification(
				new RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectIDTypeCodes.ReportNumber(), 
				null, 
				null, 
				tvp, 
				documentUniqueId, 
				RFC3881ParticipantObjectTypeCodes.SYSTEM, 
				RFC3881ParticipantObjectTypeRoleCodes.REPORT,
				null, 
				null);
	}
969057
public ItemRequest<Project> addMembers(String project) {
    
        String path = String.format("/projects/%s/addMembers", project);
        return new ItemRequest<Project>(this, Project.class, path, "POST");
    }
1326811
def update_project(id, **kwargs):
    
    content = update_project_raw(id, **kwargs)
    if content:
        return utils.format_json(content)
86006
def _sync_projects(self, projects_json):
        """""""
        for project_json in projects_json:
            project_id = project_json['id']
            self.projects[project_id] = Project(project_json, self)
994381
def add_project(project,**kwargs):
    
    user_id = kwargs.get('user_id')

    existing_proj = get_project_by_name(project.name,user_id=user_id)

    if len(existing_proj) > 0:
        raise HydraError("A Project with the name \"%s\" already exists"%(project.name,))

    #check_perm(user_id, 'add_project')
    proj_i = Project()
    proj_i.name = project.name
    proj_i.description = project.description
    proj_i.created_by = user_id

    attr_map = hdb.add_resource_attributes(proj_i, project.attributes)
    db.DBSession.flush() #Needed to get the resource attr's ID
    proj_data = _add_project_attribute_data(proj_i, attr_map, project.attribute_data)
    proj_i.attribute_data = proj_data

    proj_i.set_owner(user_id)

    db.DBSession.add(proj_i)
    db.DBSession.flush()

    return proj_i
210147
def add_subproject(self, fname, conf_path):
        """"""
        config = Config(conf_file=conf_path)
        proj = Project(self.app,
                       dependency_map=self.dependency_map)
        proj.parse_name_from_config(config)
        proj.parse_config(config)
        proj.setup()
        self.subprojects[fname] = proj
509663
def add_project_name_or_id_arg(arg_parser, required=True, help_text_suffix="manage"):
    
    project_name_or_id = arg_parser.add_mutually_exclusive_group(required=required)
    name_help_text = "Name of the project to {}.".format(help_text_suffix)
    add_project_name_arg(project_name_or_id, required=False, help_text=name_help_text)
    id_help_text = "ID of the project to {}.".format(help_text_suffix)
    add_project_id_arg(project_name_or_id, required=False, help_text=id_help_text)
199830
def add_doc(self, doc):
        
        if isinstance(doc, HelloDoc) and doc.validate():
            self.docs.append(doc)
        else:
            if not doc.validate():
                raise Exception("HelloDoc Errors %s" % (doc.errors,))
            else:
                raise Exception("add_doc doc must be an instance of class HelloDoc")
255274
public void addDependencies( String pomPath, List<String> scopes ) throws ProjectException {
        addDependencies( new Project( pomPath), scopes );
    }
159665
void addBusHub(BusHub hub) {
		if (this.hubs == null) {
			this.hubs = new WeakArrayList<>();
		}
		this.hubs.add(hub);
	}
1172298
def addprojectmember(self, project_id, user_id, access_level):
        
        # if isinstance(access_level, basestring):
        if access_level.lower() == 'master':
            access_level = 40
        elif access_level.lower() == 'developer':
            access_level = 30
        elif access_level.lower() == 'reporter':
            access_level = 20
        else:
            access_level = 10

        data = {'id': project_id, 'user_id': user_id, 'access_level': access_level}

        request = requests.post(
            '{0}/{1}/members'.format(self.projects_url, project_id),
            headers=self.headers, data=data, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 201:
            return True
        else:
            return False
947970
public void add(Project project2) {
        analysisTargets = appendWithoutDuplicates(analysisTargets, project2.analysisTargets);
        srcDirList = appendWithoutDuplicates(srcDirList, project2.srcDirList);
        auxClasspathEntryList = appendWithoutDuplicates(auxClasspathEntryList, project2.auxClasspathEntryList);
    }
631362
void addDocument(Document doc) throws IOException
   {
      update(Collections.<String> emptyList(), Arrays.asList(new Document[]{doc}));
   }
638552
public function add()
    {
        $this->layout->title = Lang::get('add_project');
        $this->requireAdmin();

        $method = $this->request->getMethod();

        $pub = null;
        $values = $this->getParams();

        if ($method != 'POST') {
            $sshKey = new SshKey();
            $key = $sshKey->generate();

            $values['key']    = $key['private_key'];
            $values['pubkey'] = $key['public_key'];
            $pub = $key['public_key'];
        }

        $form = $this->projectForm($values);

        if ($method != 'POST' || ($method == 'POST' && !$form->validate())) {
            $view           = new b8\View('ProjectForm');
            $view->type     = 'add';
            $view->project  = null;
            $view->form     = $form;
            $view->key      = $pub;

            return $view->render();
        } else {
            $title = $this->getParam('title', 'New Project');
            $reference = $this->getParam('reference', null);
            $type = $this->getParam('type', null);

            $options = array(
                'ssh_private_key' => $this->getParam('key', null),
                'ssh_public_key' => $this->getParam('pubkey', null),
                'build_config' => $this->getParam('build_config', null),
                'allow_public_status' => $this->getParam('allow_public_status', 0),
                'branch' => $this->getParam('branch', null),
                'group' => $this->getParam('group_id', null),
            );

            $project = $this->projectService->createProject($title, $type, $reference, $options);

            $response = new b8\Http\Response\RedirectResponse();
            $response->setHeader('Location', PHPCI_URL.'project/view/' . $project->getId());
            return $response;
        }
    }