Ejemplo n.º 1
0
            uploadContent = False
        elif opt == '--import-tags':
            importTags = True
        elif opt == '--no-configuration':
            update_config = False
        elif opt == '--no-members':
            add_members = False
        elif opt == '--no-dashboard':
            update_dashboard = False
        elif opt == '--no-delete':
            deleteTempFiles = False
        elif opt == '--multipart-handler':
            mplib = arg

    sc = alfresco.ShareClient(url=url,
                              tenant=tenant,
                              debug=_debug,
                              mplib=mplib)
    print "Log in (%s)" % (username)
    loginres = sc.doLogin(username, password)
    if not loginres['success']:
        print "Could not log in using specified credentials"
        sys.exit(1)
    try:
        filenamenoext = os.path.splitext(os.path.split(filename)[1])[0]
        thisdir = os.path.dirname(filename)
        if thisdir is not "":
            thisdir = thisdir + os.sep
        """if thisdir == "":"""
        """    thisdir = os.path.dirname(sys.argv[0])"""
        sd = json.loads(open(filename).read())
        siteId = str(sd['shortName'])
Ejemplo n.º 2
0
        urlm = re.match(
            '^(https?\\://[\w\\-\\.\\:]+/share)/page/site/(\w+)/[\w\\-\\./]*$',
            siteurl)
        if idm is not None:

            sitename = idm.group(0)
        elif urlm is not None:
            url = urlm.group(1)
            sitename = urlm.group(2)
        else:
            raise Exception("Not a valid site URL or ID (%s)" % (siteurl))
    else:
        usage()
        sys.exit(1)

    sc = alfresco.ShareClient(url, tenant=tenant, debug=_debug)
    print "Log in (%s)" % (username)
    loginres = sc.doLogin(username, password)
    if not loginres['success']:
        print "Could not log in using specified credentials"
        sys.exit(1)
    print "Delete site '%s'" % (sitename)
    try:
        sc.deleteSite(sitename)
        """site shortname is blocked by site in trashcan - https://issues.alfresco.com/jira/browse/ACE-2756"""
        print "... Deleted site '%s' - site shortname is locked by site in user trashcan (delete in profile)" % (
            sitename)
    except alfresco.SurfRequestError, e:
        if e.code == 404:
            print "Site '%s' does not exist" % (sitename)
        else:
Ejemplo n.º 3
0
    # Check mandatory parameters
    if firstname is None:
        print "You must supply a first name for the new user"
        sys.exit(1)
    if firstname is None:
        print "You must supply a last name for the new user"
        sys.exit(1)
    if userpassword is None:
        pass1 = "1"
        pass2 = "2"
        while pass1 != pass2:
            pass1 = getpass.getpass("Enter user password: "******"Re-type user password: "******"-system-", debug=_debug)
    loginres = sc.doLogin(username, password)
    if not loginres['success']:
        print "Could not log in using specified credentials"
        sys.exit(1)
    try:
        qd = sc.doJSONPost(
            "proxy/alfresco/internal/cloud/accounts/signupqueue", {
                'email': email,
                'source': 'test-share-signup-page'
            })
    finally:
        sc.doLogout()
    usc = alfresco.ShareClient(url=url, tenant='-default-', debug=_debug)
    try:
        ud = usc.doJSONPost(