Pular para o conteúdo principal

Adicionando "owners" para todas as comunidades

Here's another administration script to cover a common request to add a particular user (e.g. an administrator) to the ACL for every community. We can do this using two wsadmin commands:
  • CommunitiesService.fetchAllComms()
  • CommunitiesService.addMembersToCommunityByEmail()
In environments with many communities, you'd want to use CommunitiesService.fetchBatchComm() instead of retrieving them all in one shot, and that would require some additional code to handle the batches that I won't illustrate here. In the simple approach, you can just combine these two commands with a bit of glue to yield the following:

from java.util import ArrayList

# Initialize Communities Administration
execfile("communitiesAdmin.py")

# Define the new owner to add
newOwnerList = ArrayList()
newOwnerList = ["admin@ibm.com"]

# Get all communities
comms = CommunitiesService.fetchAllComm()

# Loop through the communities and add the new owner to each
for comm in comms:
    CommunitiesService.addMembersToCommunityByEmail(comm["uuid"],1,newOwnerList)

In the real world, I'd pass in the email address of the user to add as an argument to the command, but you get the idea. The addMembersToCommunityByEmail() command can use the community name instead of UUID, but we already have the UUID from fetchAllComms(), so it's better to use that and avoid name collisions that would result in an error.


Also note that because fetchAllComms() returns communities and subcommunities in indeterminate order, you'll need to run the command twice to cover the scenario where we try to update the ACL for a subcommunity before the user has been added to the parent community. The first pass will update all parent communities and any subcommunities processed after their parents, and the second pass will catch any of the subcommunities that were processed before their parents.

by Chad Scott

Comentários

Postagens mais visitadas deste blog

Como adicionar uma rota no MAC OSX

Andres-MBP:~ a190468$ sudo route -n add -net 10.28.0.0/16 10.26.32.254 Password: ***** add net 10.28.0.0: gateway 10.26.32.254 Andres-MBP:~ a190468$  Andres-MBP:~ a190468$  Andres-MBP:~ a190468$ ping 10.28.236.125 PING 10.28.236.125 (10.28.236.125): 56 data bytes 64 bytes from 10.28.236.125: icmp_seq=0 ttl=120 time=3.796 ms 64 bytes from 10.28.236.125: icmp_seq=1 ttl=120 time=2.466 ms 64 bytes from 10.28.236.125: icmp_seq=2 ttl=120 time=2.392 ms Classe B com endereços 10.28.x.x com gateway 10.26.32.254.

Como alterar o default route no seu MAC

Pois bem, hoje estou em um cliente trabalhando com o meu MAC. Meu Mac esta conectado na rede do cliente, que usa um endereço classe A (10.26.x.x). Estou conectado com o meu 3G no celular. Gostaria de usar como rota padrão a saída de rede do meu 3G, visto que a rede do cliente não tem acesso a internet. Pois bem, para que isto aconteça temos que alterar as rotas de TCP/IP. Alterar a rota default 0.0.0.0 para sair pelo 3G. Com o comando "netstat -rn" você consegue visualizar qual a rede que esta como rota padrão.  MacBook-Pro:~ user$ netstat -rn Routing tables Internet: Destination        Gateway            Flags        Refs      Use   Netif Expire default            192.168.0.254      UGSc           27        0     en1 default            10.26.32.254       UGScI           1        0     en0 default            link#10            UCSI            0        0   utun0 Podemos definir pesos para cada uma das rotas também. Em ambos os casos teríamos que remove

Instalando IBM Connections 5, CR2 e IBM DOCs no Linux - Guias

Charles Price que é um dos integrantes da equipe L2 de suporte da IBM criou alguns guias de instalação de produtos IBM para o Linux. Aqui estão os guias: Installation guide IBM Connections 5.0 on Linux Installation guide IBM Connections 5.0 CR2 on Linux Installation guide IBM Docs 1.0.7 on IBM Connections 5.0 CR2 on Linux  IBM DOCs e CCM para o linux são dois tópicos mais difíceis de se encontrar material, sendo assim, fica a dica. Aqui a profile do Charles Price