中庭公用设施
atrium-tools的Python项目详细描述
该工具包收集了一整套工具,用以与或根据文献资料中心进行通信 使用Nuxeo服务器与客户应用程序之间的APIREST接口
两个主要成分:
-
中庭&壳牌:客户应用程序提供多个向中庭基地的导航动作
Nuxeolib:根据Nuxeo文献所述协议实施APIREST的基本书店,
以及一些基于中庭协议的实用工具。
安装
基础设施
在这里,我们将利用世界蟒蛇的标准机制:strong>pip安装这套蟒蛇。 中庭工具包被配置为标准的蟒蛇包,并被放入 官方存款pypi。这里唯一建议的安装方式是基于蟒蛇的虚拟环境。我们假设 复制这个网站码到您的网站上以设置一个投票箱在您的网站上。 ααα1
更新程序包版本:
ααα2可询问现有设施:
ααα3 或者解散包装: ααα4 并关闭大约arcium
python
ααα5
Arcium \ u壳应用程序
导言
该应用程序允许查询中庭基地,就像Unix或Strong中的LS命令,或Windows中的。
认证
访问Nuxeo服务器需要验证。可采用两种认证方法:
使用命令行上的
Login=xxx
参数。然后,密码 将被请求进行秘密询问使用文件(https
文件中,可以指定"Code"对
此文件必须如此保护:
αααα6
换句话说,只有使用者才能访问该文件
。
此文本文件包含以下格式的行:
αααα7
如果存在/.netrc
文件,且界定了home
环境变量,
因此,没有必要使用Login=XXX
的论据。
中庭连接将自动建立在>文件
中所描述的身份上。
论据
αααα8
一些澄清:
- 可以指定起始目标:
或用cd
作为机构空间
- 或使用
来为个人空间使用set=ACL
仅适用于指定的文件夹
rm&acl
可从文件夹到
文件夹中推翻地适用于所有儿童文件夹
subs
适用于从文件夹到
文件夹中的所有儿童文件夹。
subs&acl
选项中,可以使用"%"来代替独立的许可Draw
LSLS>LS>LSDraw
使用
以下实例中的一些使用实例()假定: 认证是通过Netrc文件进行的: αααα9
nuxeolib
这个模块e包括所有通往努克肖阿皮雷斯特的低级呼叫,并允许开发应用程序。 访问中庭数据库的实用工具。checkout(ref)
- 复制这个网站码到您的网站上以设置一个投票箱在您的网站上。
- 检查(ref,version=minor,how=)
create \ \ snapshot(ref,version=minor)
create \ \ version(ref,increment=minor',save \ \ udocument=true)
set ^ up property(ref,xpath,value)
Delete(ref)
get=uu children(ref)
get \ \ parent(ref)
get=uv versions(ref)
lock(ref)
unlock(ref)
move(ref,target,name=none)
publish(ref,target)
copy(ref,target,name=none)
add=permission(ref,permission,user,acl=local)
get ^ uu relations(ref)
Delete \ \ relation(source,destination)
- 创建关系(Ref,目的地)
query(query,language=none)
get \ \ b0(ref)
get \ \ bs(ref)
- 附着\ \ b0(ref,blob)
- 打开\ \ batch()
close \ \ batch(batch \ \ uid)
upload \ \ uFiles(Input \ \ Unames=none,batch \ \ uID=none)
change=title(UID,title)
get \ \ document(name)
get the uid of a document from its path
create \ \ U document \ \ xE4(path)\ \ xE4 Name, 文件类型 Properties=NONE, Files=None, From \ \ uID=none αααα10
Update \ \ U Document \ \ xE4(UID) Title, 文件类型 Properties=NONE, Files=none αααα
read ^ uu document(doc ^ uid)
αααα12get \ \ acls(doc \ \ id)
Delete=U Document(doc=UID)
change \UState(UID,State=U)
read \ \ user(name)
αααα13- 创建USER(USER) First \ \ name=none, Last \ \ name=none, e-mail=a@b.c, 密码,密码 公司=none αααα
- 最新用户 First \ \ name=none, Last \ \ name=none, 电子邮件=none 密码=none, Company=None, is \ \ n=none)
- 删除\ \ user(user)\ \ fs20
get \ \ users(query=u*,data=false,max \ \ sults=none)
αααα15get \ \ directory(domain)
αααα16add \ \ directory \ \ entry(directory,entry)
- get \ \ groups(模式)
- 创建集团(集团)
get \ \ group(group)
add \ \ user \ \ uu to \ \ group(group,user)
add \ \ subgroup \ \ uu to \ \ group(group,subgroup)
- 删除组(组)
init=session(host=u local',login=',password=',auth=)
Initiate the session according to the host modes:local,dev,product
connect(host,login,auth=)
on to p of the init \ \ session function permit to enter the hidden password
get \ \ Login(
) 检索实际登录purge=U document(session,path,title=',edms=)
深度删除一个纪念品(包括从垃圾桶中删除)init=objects ^ uu string(lines,constructor,key,output ^ ud dict)
init=objects(file \ \ n name,constructor,key,output \ \ n dict)
read a csv file,building a dictionary of objects
- We assume the input file obeys the following format:
- The first line contains the object field list
- fields are separated by empty lines are ignored
线条以\ \ \ \ \ \ \ \ \ \ \ \ \ \
每个线路生成一个物体,使用特定的制造商- We assume the input file obeys the following format:
测试中庭处于非活动状态(会话,用户)
测试心房是否处于非活动状态
获取FDS(会话,cat="laboratoire")
正在读取实验室项目活动在中庭基地声明的所有功能域:
我们得到laboratoire projet activate类型的所有主空间,然后在读取functionaldomain元数据时 这种方法是必需的,因为功能域词汇表没有区别 实验室项目活动
测试用户角色(会话、用户、fd)
测试此用户是否具有此功能域的角色
返回2个值: 如果用户存在,bool=true role or none=授予的角色。
获取用户工作区(主机、会话、电子邮件)
获取用户个人空间以建立中庭烫发链接
建立帐户创建邮件(电子邮件、prenom、nom、pwd、racine、url、role='reader')
创建帐户后构造邮件内容
- 此邮件发送
- 密码
- 指向个人空间的perma链接
生成日志创建邮件(email、prenom、nom、racine、role='reader')
创建帐户后构造邮件内容
- 此邮件发送
- 密码
- 指向个人空间的perma链接
发送邮件(发件人、收件人、邮件)
向单个目的地发送电子邮件 必须使用mimetext工具构造消息本身。
获取随机密码()
创建随机密码的实用程序
创建用户(主机、会话、nom、prenom、电子邮件、racine)
创建用户帐户
- 指定主机模式(local dev prod)
- 说出姓名和名字
- 电子邮件是帐户标识符
- 指定功能域(即实验室)
开发中心的安装,du包中庭工具
在peut installer ce package a partir degitlab上,例如en téléchargent et installent l'archive au format zip。 可能的原因有:关于souhaite contributer的项目部分的指导 开发区。
逻辑是语言巨蟒的核心。相容性发展 版本=3.6 du langage python。 Donc il est不可缺少的Qu'une版本>;=3.6 du langage python soit installée sur votre machine
套间倾注装置la suite logiciele voici les deux méthodes:
结束语:
< Buff行情>mkdir我的工作区 CD我的工作区 git克隆git@gitlab.in2p3.fr>git@gitlab.in2p3.fr:中庭/中庭工具.git
小环杯调节剂用量:
> python -V
> python -m venv atrium
> source atrium/bin/activate (*sous Unix*)
> atrium \Scripts\activate (*sous Windows*)
> pip install atrium-tools
> python -m atrium_shell.atrium_shell login=<myatriumaccount> -ls
7
档案压缩部分:
一部分站点gitlabhttps://gitlab.in2p3.fr/atrium/atrium\u tools 安装程序和拉链l'archive