ITPUB??ì3
ITPUB论坛 » Oracle Application Server套件 » 请教一下PORTAL有关LDAP数据修改问题

标题: 请教一下PORTAL有关LDAP数据修改问题
离线 hinger
初级会员



精华贴数 0
个人空间 0
技术积分 34 (35998)
社区积分 2 (24989)
注册日期 2004-8-30
论坛徽章:0
      
      

发表于 2008-5-21 11:23 
请教一下PORTAL有关LDAP数据修改问题

1> 通过unix 命令行来修改LDAP数据

ldapGrpModify.ldif内容:
dn: cn=part1,cn=portal,cn=Groups,dc=company,dc=net
uniquemember: cn=111111,cn=users,dc=company,dc=net
uniquemember: cn=222222,cn=users,dc=company,dc=net

命令格式:
ldapmodify -h ip: port -D cn=UserId -w passwd -v -f ldapGrpModify.ldif

其中:part1是我建的一个group ,里面有一个attribute (uniquemember)

通过上面的命令,可以增加2条记录: cn=111111,cn=users,dc=company,dc=net和cn=222222,cn=users,dc=company,dc=net

如果我要删除其中的一条记录,ldif的内容应该怎么写呢?命令格式是什么样的?
(例:只删除这cn=111111,cn=users,dc=company,dc=net)

2> 如果通过ODM来直接增加删除 uniquemember的内容,又出错,详细如附件.

[LDAP:error code 19 - Admin Domain restricts modification of Attribute:modifytimestamp.]

oracle.ldap.admin.common.SaveChangeException:修改 失败.

--------------------------------------------------------------------------
查找了一些资料,LDAP方面介绍的很少。 有没有经历过这个问题的,帮助分析一下,谢谢啊!
--------------------------------------------------------------------------
测试了一下:replace是把整个uniquemember的内容替换掉

If the file /tmp/entrymods exists and has the following contents:

dn: cn=Modify Me, o=University of Higher Learning, c=US
changetype: modify
replace: mail
mail: modme@student.of.life.edu[/email]
-
add: title
title: Grand Poobah
-
add: jpegPhoto
jpegPhoto:< file:///tmp/modme.jpeg
-
delete: description   
-

The command ldapmodify -b -r -f /tmp/entrymods will do the following:

Replace the contents of the Modify Me entrys mail attribute with the value [email=modme@student.of.life.edu]modme@student.of.life.edu
.
Add a title of Grand Poobah.
Add the contents of the file /tmp/modme.jpeg as a jpegPhoto.
Completely remove the description attribute.

[ 本帖最后由 hinger 于 2008-5-21 11:25 编辑 ]




hinger 上传了这个附件:
2008-5-21 11:23
error.jpg (136.49 KB)
 

__________________
-----------------------------------------------------鸟蛋孵化中!~
只看该作者    顶部
离线 wanghhui



精华贴数 0
个人空间 0
技术积分 90 (17873)
社区积分 0 (1706283)
注册日期 2008-2-26
论坛徽章:0
      
      

发表于 2008-5-21 13:56 
1. OID版本
2. ODM版本
3. 用ldapmodify做只能先delete然后add,replace不适用。写程序做的话推荐用Java。


__________________
助人为乐
OID,SSO,OIM,OVD,OAM,JAAS,LDAP,OPENDS,SUNDS
只看该作者    顶部
离线 hinger
初级会员



精华贴数 0
个人空间 0
技术积分 34 (35998)
社区积分 2 (24989)
注册日期 2004-8-30
论坛徽章:0
      
      

发表于 2008-5-22 13:37 


QUOTE:
原帖由 wanghhui 于 2008-5-21 13:56 发表
1. OID版本
2. ODM版本
3. 用ldapmodify做只能先delete然后add,replace不适用。写程序做的话推荐用Java。

ODM 版本: 9.0.4.0.0

有没有代码供参考一下,或者 command 也行


__________________
-----------------------------------------------------鸟蛋孵化中!~
只看该作者    顶部
离线 wanghhui



精华贴数 0
个人空间 0
技术积分 90 (17873)
社区积分 0 (1706283)
注册日期 2008-2-26
论坛徽章:0
      
      

发表于 2008-5-22 13:58 
版本太低了,考虑升级。
代码去Sun的JNDI tutorial看一下Directory编程的例程,最清晰明了。


__________________
助人为乐
OID,SSO,OIM,OVD,OAM,JAAS,LDAP,OPENDS,SUNDS
只看该作者    顶部
离线 wanghhui



精华贴数 0
个人空间 0
技术积分 90 (17873)
社区积分 0 (1706283)
注册日期 2008-2-26
论坛徽章:0
      
      

发表于 2008-5-22 13:59 
你Shell编程或者perl编程水平如何?这2个也能做。也不麻烦。


__________________
助人为乐
OID,SSO,OIM,OVD,OAM,JAAS,LDAP,OPENDS,SUNDS
只看该作者    顶部
离线 hinger
初级会员



精华贴数 0
个人空间 0
技术积分 34 (35998)
社区积分 2 (24989)
注册日期 2004-8-30
论坛徽章:0
      
      

发表于 2008-5-22 16:00 


QUOTE:
原帖由 wanghhui 于 2008-5-22 13:58 发表
版本太低了,考虑升级。
代码去Sun的JNDI tutorial看一下Directory编程的例程,最清晰明了。

版本低的问题,系统安装的就是这个,我也没有办法,近期升级不大可能。

oracle.ldap.admin.common.SaveChangeException:修改 失败   应该不是版本的问题吧?

最近要有一批新的用户添加到系统中,所以在研究LDAP。
考虑2种方法,一种是 ldapadd新用户,然后ldapmodify 用户所在Group的Attribute
                   另一种是 ldapadd新用户,然后在ODM中直接修改Group的Attribute :uniquemember

用ODM修改Attribute时候就出错    
所以也不敢随便修改,怕把LDAP搞坏了。

我的shell 和perl 能力也不够

下午到sun 网站转了一圈,也没有找到Directory 例程,还请指点指点


__________________
-----------------------------------------------------鸟蛋孵化中!~
只看该作者    顶部
离线 wanghhui



精华贴数 0
个人空间 0
技术积分 90 (17873)
社区积分 0 (1706283)
注册日期 2008-2-26
论坛徽章:0
      
      

发表于 2008-5-22 16:19 
---------x-----------x----------x----------x-----------x-----------x-----------
        //initiate connection to corperation LDAP server
        Hashtable envOracleLdap = new Hashtable();
        envOracleLdap.put(Context.INITIAL_CONTEXT_FACTORY,
                          "com.sun.jndi.ldap.LdapCtxFactory");
        envOracleLdap.put(Context.PROVIDER_URL, LOCAL_SERVER);

        DirContext ctxSunOracleLdap = new InitialDirContext(envOracleLdap);


        Attributes matchAttrs =
            new BasicAttributes(true); // ignore attribute name case
        matchAttrs.put(new BasicAttribute("sn", surName));
        matchAttrs.put(new BasicAttribute("cn", firstName));
        NamingEnumeration answer =
            ctxSunOracleLdap.search("cn=Users, dc=cn,dc=oracle,dc=com",
                                    matchAttrs, returningAttributes);

        return answer;
----------x---------x-----------x-----------x----------x---------
这是一段查询的代码。
自己去Sun学习下。
http://java.sun.com/products/jndi/tutorial/trailmap.html

[ 本帖最后由 wanghhui 于 2008-5-22 16:21 编辑 ]


__________________
助人为乐
OID,SSO,OIM,OVD,OAM,JAAS,LDAP,OPENDS,SUNDS
只看该作者    顶部
离线 hinger
初级会员



精华贴数 0
个人空间 0
技术积分 34 (35998)
社区积分 2 (24989)
注册日期 2004-8-30
论坛徽章:0
      
      

发表于 2008-5-22 16:47 
谢谢啊!
用ODM 修改时出现的错误,应该怎么处理呢?
(这是我最担心的)


__________________
-----------------------------------------------------鸟蛋孵化中!~
只看该作者    顶部
离线 wanghhui



精华贴数 0
个人空间 0
技术积分 90 (17873)
社区积分 0 (1706283)
注册日期 2008-2-26
论坛徽章:0
      
      

发表于 2008-5-22 17:00 
基本你是撞到老版本的bug了。不升级基本无解。


__________________
助人为乐
OID,SSO,OIM,OVD,OAM,JAAS,LDAP,OPENDS,SUNDS
只看该作者    顶部
离线 hinger
初级会员



精华贴数 0
个人空间 0
技术积分 34 (35998)
社区积分 2 (24989)
注册日期 2004-8-30
论坛徽章:0
      
      

发表于 2008-5-22 17:07 
回复 #9 wanghhui 的帖子

汗!
增加Attribute的值,如果有几千行的数据,有没有什么影响呢?


__________________
-----------------------------------------------------鸟蛋孵化中!~
只看该作者    顶部
相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问