������� ��������� - ��������� Java, ������� ����� ������������ ��� ���������� ����������� � ������������ �������������, ����� ��� �������, ���������� ���� � Host On-Demand, ���� �� ������� LDAP. ������� ��������� ��������� ��������� ��� �������� ������ ��� ������ �������������, ����� ��� ������� �� ����� ASCII ������ ����, ����� ��������� ��� �������� �� �� ������ ����� ������ ����������. ��������, ������� ����� ������������ ���:
������� ��������� ���������� ���� ASCII, ������� �������� ����������� ���� ������, ������������� � �������. ���� ��������� ���� ������ ���� � ������� XML � ����� ���������� .xml.
������� ��������� ����� ���������, ��������� ���� ����������� ���������������� ���������, ���� ��������� ��������� ������.
����� ��������� ����������� ��������� ������������...
� ����������� ���������� ������������ ������� ��������� ������� ������ �������� � ��������� ����:
��� �������� add, delete � update �� ������� XML-����� ��� ����� ������������.
� �������� Windows ���� ������� ��� �������� ��� ������� ������� ��������� � ������� ����� ��������� � �������� C:\Program Files\IBM\HostOnDemand\lib\samples\DirUtil. ���� ������� - ��� DirUtil.cmd, � ������ ���������� ����� - sample.xml. ��������� ���� ��� ���� �������� ��� ������ ������������ ������ � ������ ���������� ����� ����������� � �������� hostondemand\lib\samples\DirUtilCommandFiles. ������ ���������� ����� ���������� Sample.xml. ��������� ����� ��� ����� �������� ����������:
����� ��������� ������� ���������, ������� � ��������� ������:
������� ���������� �����. |
DirUtil-xxx ���_�����.xml ������������� ������ [���_�����] [����] [CO |
��������� ����� Host On-Demand ������ ���� ������� �� ������� Host On-Demand, ��������� ���������� ���_�����, ����� ������� ��������� ��������� ���������� � ������������ Host On-Demand ��� LDAP. |
��������, � AIX ����� ���������:
DirUtil-AIX file.xml admin password myhostname 8999 CON
����������� ��������� ������� ��������� - ��� ����������� ��������� ���������� ��������� ������. � ��� ������� �� ���������� ��������������, �������� ��� ����������� � ������������� �������, ������� �������� ���� � Host On-Demand, ���� �� ������� LDAP. ��������� ������� ��������� ��������� ��������� ��� �������� ������ ��� ������ �������������, ����� ��� ������� �� ����� ASCII ������ ����, ����� ��������� ��� �������� �� �� ������ ����� ������ ����������.
���������� ���� sample.xml, ������� ��� ��������� � ����� DirUtil. ���� ��������� ���� ������ ���� � ������� XML, � � ���� ������ ���� ���������� .xml, ����� ����� ����������� ����������� ���������.
� 64-��������� ������������ ������� Windows ������� ����� ��������� � ������� ����� DirUtilGUI.bat, ������� ��������� � �������� C:\Program Files\IBM\HostOnDemand\lib\samples\DirUtil.
� 32-��������� ������������ ������� Windows ������� ����� ��������� � ������� ����� DirUtilGUI.bat, ������� ��������� � �������� C:\Program Files (x86)\IBM\HostOnDemand\lib\samples\DirUtil.
� ������������ ������� �� ������ Unix/Linux ������� ����� ��������� � ������� ����� DirUtilGUI.sh, ������� ��������� � �������� /opt/IBM/HostOnDemand/lib/samples/DirUtil.
����������:��� �������� �� ���������, � ������� ���������� ������� HOD. ���� ������� HOD ���������� � �������� ������������� ��������, ������������� ����� ������� <<�������_���������_HOD>>\lib\samples\DirUtil. ��������� ����� ��� ����� �������� ����������:
� ����������� ���������� ���� ���� ��� ������������ � ������, � ������� ������ ���� ������� ��� ������������ � ������ ��������������. �� ���������, � �������� ����� ������������ ������ �������� admin, � � �������� ������ - password.
������� �������� ��� ����� - ��� localhost, � ������� �������� ����� ����� - ��� 8999. � ������ ��������� ����� ����� ������ ������ ��� ����� � ����� �����.
�� ������ ������� XML-����, ���������� �������� � ������������, ������ ��� ������. ����� �������� � ���� ����������, ���������� � ��������.
������������� ���������� ���� HTML ��� �������� ������ ������������ ��� ������������� ������ ������������� ��� ����� ��� �����, �������� � xml-�����. ���� ���� HTML ������������� ������������, ���� ������ XML-����. ������������� ���������������� ����� HTML ������������� ���, ������������� ����� xml-�����, � �� ���������� ���� ��, ��� ��������� xml-����.
������������� ������ ������������� ��� ����� � ����� html ���������, ������ ���� ������� ������������� ���������� ���� HTML ��� �������� ������ � ������ ������������� ��� ����� ����� �������� � ����� HTML �� ��������� ��� ���������� ���������.
�������� ������ �� ������� ����� �������, ����� ������ ��������. ����� ����� ����������� ��� ������ � ����� ������, ������� �� ������ �����������.
����� �������� �� �������, ����� ������� ���������� ������� DirUtilGUI.
���� ���������� ��� ������� �������� �������� ������ ��� ����� HTML:
<action type = "list"> <userlist> <userid>*</userid> </userlist> </action>
<action type = "list"> <grouplist> <groupid>*</groupid> </grouplist> </action>
� ����������� ���� ��������� ��������� ����������� ������ ��� �������������� ��������� XML, ������� ����� ���� �������� � ���� XML, ������������ �������� ���������. ��� ���� ��������������� ������� ����� ������������� �� XML. ������, ������������ � "<!--" � ����������� "-->", ��������� �������������. � ��������� ����������� ������� ��������.
����� ������� ��� �������� ���� XML, ���� ������������ �������� ASCII, ������� ��������� ���������� ������� unicode. ���� �� ������������ �������� ASCII ��� ����� �����������, �� �������� ��������� �� ������ DIR0037 Fatal error: Invalid XML Character ��� ������������� ����� XML � �������� ���������. ��������� ������ �������� ASCII, ������� ��������� ���������� ������� unicode.
<dirscript>
<action>
<group>
<groupid>
<description>
<parent>
<removeusers>
<user>
<userid>
<groupid>
<description>
<authentication>
<pw>
<nativeid>
<savepref>
<session>
<filename>
<groupid>
<userid>
<description>
<userlist>
<userid>
<groupid>
<filename>
<grouplist>
<userid>
<groupid>
<filename>
�������� ������� ����� XML, ������� �������� � ���� ��� ������ �������� � �������������� �������� ��� ��������� �������� ���������.
��������: ���
����������� ��������: <action type=xxx>
�������������� ��������: ���
��������, ������� ����������� ��� ����������, ������������ � ������� <action>. � �������� <dirscript> ����� ���� ��������� ��������� ��������. �������� ����� XML �� ��������� ���� �������� <dirscript>, ���� ����� ��������, �������� ��������� ������������.
��������: add, delete, update ��� list
����������� ��������: ������ �������� <action> ��������� �� ������� ���� ���� �� ��������� ���������:
������� ��������� �� ������������ ������� <grouplist> ��� LDAP. |
�������������� ������� ��� ������.
��������: ���
����������� ��������:
groupid
������������� � ������� �������. ���� �� ����������� LDAP, groupid
����� ��������� ������� ��� �� ��������, ��� � �� ������� ��������.�������������� ��������:
�������������� ������� ��� ������������.
��������: ���
����������� ��������:
userid
������������� � ������ �������. ���� �� ����������� LDAP, userid
����� ��������� ������� ��� �� ��������, ��� � �� ������� ��������.�������������� ��������:
��������������, �������������� ��� ������������. ����� ������������ ���� ����������� �������������� (������ ���� �� ����� ����������� LDAP), ���� �������������� ������. ��� ������������ �� ����� ���������������� ������� ��������������, ���� ���� ������� �� ������ ��� ���� �������� add ��� ���� ������� native � �� �� ����������� LDAP.
��������: pw ��� native
����������� ��������:
�������������� ��������:
�������������� ������� ��� ������.
��������: ���
����������� ��������:
� �������� <session> ��������� �� ������� ���� ���� �� ��������� ����� ���������:
� �������� ������ ����� ������� ��������� ������������� ��� ��������� �����, �� ��������� � ����� � ��� �� �������� ������ � �������������, � ������ ������. |
�������������� ��������: ���
�������������� ������� ��� ������ �� ������ �������������.
��������: ���
������������ ��������: ������ �� ����������������� ��������� ����� ������������ ������ �� ������ ����:
���� ����������� ��� <userid> ��� <groupid>, ������� ��������� ������, ��� ��� ����� �������� ������������ ������ �����������, � ���������� ����� � ������������ � ����. |
�������������� ��������: ������� ���� ������� ������ ���� ���, ����� ��������� ������ �� ���� ����:
���� �� �� ������� ��� �����, ������� ��������� ������� �������� ������ � ���� �� ���������. ���� �� ��������� - DirUtilList.xml, ������� ��������� � �������� hostondemand\lib\samples\DirUtil. ������ ���, ����� �������� ���� �� ������, ������� list ��������� ���������� ������ � ���� DirUtilList.xml. �������� ������ ������������� ������ �������. |
�������������� ������� ��� ������ �����.
������� ��������� �� ������������ ���� ������� ��� LDAP. |
��������: ���
������������ ��������: ������ �� ����������������� ��������� ����� ������������ ������ �� ������ ����:
���� ����������� ��� <userid> ��� <groupid>, ������� ��������� ������, ��� ��� ����� �������� ������������ ������ �����������, � ���������� ����� � ������������ � ����. |
�������������� ��������: ������� ���� ������� ������ ���� ���, ����� ��������� ������ �� ���� ����:
���� �� �� ������� ��� �����, ������� ��������� ������� �������� ������ � ���� �� ���������. ���� �� ��������� - DirUtilList.xml, ������� ��������� � �������� hostondemand\lib\samples\DirUtil. ������ ���, ����� �������� ���� �� ������, ������� list ��������� ���������� ������ � ���� DirUtilList.xml. �������� ������ ������������� ������ �������. |
����� ���������� ������ ����� XML, �������������� �������� add � list. � ��� ����������� ��� ������, � ��� ������ ����������� ������������, � �����, ���� ������ �������������� � ����������� �������, ��� ������ ����������� ��� ���� ������������� � �����. (����� ������� ��� �������� �������������, ������ ��� ������, �������� ��� �������� �� delete ��� update � ��������������� ������� �������� ��������.) � Windows NT � Windows 2000 ���� ������ ����� sample.xml ��������� � �������� C:\Program Files\IBM\HostOnDemand\lib\samples\DirUtil. ������ ����� sample.xml ��� ������ ������������ ������ ���������� � �������� hostondemand\lib\samples\DirUtilCommandFiles.
� ���� ������� ������������ �������� ������ � ��� ���������� �����: ������ ������������� � ����� ������������ � �������� XML-���� �� ��������� ������� ��������. ����� ������������ � ����� �������� �������� ������ � ������, ��� ������������ �� ��������� �������, �������� ������ ����� � �������������� ������� List. |
<?xml version="1.0" encoding="UTF-8"?> <!-- ������ DTD - DTD ������ ��������.-- <!DOCTYPE dirscript [ <!ELEMENT dirscript (action)+> <!ELEMENT action (group | user | session)+> <!ELEMENT group (groupid, description?, parent?, removeusers?)> <!ELEMENT user (userid, groupid*, description?, authentication?, savepref?, removegroupid?)> <!ELEMENT session (filename?, (groupid | userid)+, description?)> <!ELEMENT groupid (#PCDATA)> <!ELEMENT userid (#PCDATA)> <!ELEMENT description (#PCDATA)> <!ELEMENT userlist (userid+, groupid+, filename+)> <!ELEMENT grouplist (userid+, groupid+, filename+)> <!ELEMENT parent (#PCDATA)> <!ELEMENT removeusers (#PCDATA)> <!ELEMENT removegroupid (#PCDATA)> <!ELEMENT authentication ((pw?, changepw?) | (nativeid))> <!ELEMENT pw (#PCDATA)> <!ELEMENT changepw (#PCDATA)> <!ELEMENT nativeid (#PCDATA)> <!ELEMENT savepref (#PCDATA)> <!ELEMENT filename (#PCDATA)> <!ATTLIST action type (add | delete | update | list) #REQUIRED> <!ATTLIST authentication type (pw | native) #REQUIRED> ]> <!-- End DTD --> <dirscript> <action type="add"> <!-- �������� ��� ������ --> <group> <groupid>3270GROUP</groupid> <description>������ � �������� 3270</description> </group> <group> <groupid>5250GROUP</groupid> <description>������ � �������� 5250</description> </group> <group> <groupid>mygroup</groupid> <description>������ � ������������ �������</description> <!-- ������������ ������� ������� ��������� ������ ��� ������������� LDAP --> <!-- <parent>3270GROUP</parent> --> </group> <!-- �������� ������������ � ������ 3270 � ���� ��� ������. --> <user> <userid>user1</userid> <description>First User</description> <authentication type="pw"> <pw>mypw</pw> <changepw>yes</changepw> </authentication> <groupid>3270GROUP</groupid> </user> <!-- �������� ������������ � ������ 5250, �� �������� ��� ��������� ������������ ������ --> <user> <userid>user2</userid> <description>������ ������������</description> <authentication type="pw"> <pw>mypw</pw> <changepw>yes</changepw> </authentication> <groupid>3270GROUP</groupid> <savepref>no</savepref> </user> <!-- ����� ����������� � ��������� ������ ���������� ��-�� ����, ��� ���� ����� �� ������������. --> <!-- ���� �� ������ �������� �����, ������������� ����� � ���������� ������ --> <!-- ����� � ������� ����� ����������� ����� �������� DirUtil. --> <!-- �������� ����� � ������ 3270 --> <!-- <session> <description>������� 3270</description> <filename>3270dsp.hod</filename> <groupid>3270GROUP</groupid> </session> --> <!-- �������� ����� � ������ 5250 --> <!-- <session> <description>������� 5250</description> <filename>5250dsp.hod</filename> <groupid>5250GROUP</groupid> </session> --> <!-- �������� ����� � ������������ user1 --> <!-- <session> <description>������� 3270</description> <filename>3270prt.hod</filename> <userid>user1</userid> </session> --> </action> <!-- ������� ������ ���� ������������� � ����� � ������� � �������� ����� � �������� XML-���� �� ��������� --> <!-- <action type = "list"> <userlist> <userid>*</userid> </userlist> <grouplist> <userid>*</userid> <groupid>*</groupid> </grouplist> </action> --> </dirscript>
������ ������ | |
������������� �������� ����������� | |
������� ������ |
������ ������
�������� ������� list, ������ �� � �������� ���� ��������: <action type="list">. ����� �� ������ ������ ����� �� ���� (��� ���) ���� ������ (���������� ������ � ������������ ������������� � �������):
����� ��� ����� �� �������������� ��� LDAP. |
��� ������� ���� ������ �� ������ �������� �������� ������ � ������� ��������� <userid> � <groupid>. ������ �� ������ �������� � �������� ������ ������� �����������. ��������� �� ������ ������������ ����� ����� �������� ����������� � ������ ��������� �� � ����� ����� ������ ������, �� ������ ����������� ����� ��������� ������, ��� ��� ���������.
�������� �� ���������: ���� �� �� ������� ������� ��������� <userid> ��� <groupid> (��� ��� �� ������� ������� ��� ��� ��������), �� ��� ���� ��������� ������� list �� ��������� ����� ������������ ������ �����������. ��� ���� �������������� ��������� �������� ������� �����.
������� ��������� ������� �������� ������ ������ ������ � XML-����.
������������� �������� �����������
�������� ����������� �������� ��������� (*).
������� ��������� ������������ ����������� ����� ���������� �������� ����������� � ���� ������� �����, <groupid> � <userid>. ������� ����������� ����� ���� � ����� �� ������� ���������, � ����� ������� ��������� ��� �� ����� �� ���� �� � ����� �� ���. ��� ����� ���������� ������� ������ ���, ������������ ���������-��������� ��������� ��� ������� ��������� �����������. ����, ������� �������� ������, �� �������� ����� �� ���� ID-�����, ������� �������� ������, ��� ���� ������� ������� �������� ����������� (*) � �� ��������� ���������� ����� ��� ����� ���� � �������������� ������� �����������.
������� ����������� ���������� �������� �����������:
<userid>*</userid> | ��� ������������ |
<groupid>*</groupid> | ��� ������ |
<userid>a*</userid> <groupid>*</groupid> |
������������, ID ������� ���������� � ����� "a", �� ���� ������� |
<userid>a*s</userid> <groupid>hod</groupid> |
������������, ID ������� ���������� � ����� "a" � ������������� ������ "s", � ������ hod |
<userid>alhines</userid> <groupid>hod</groupid> |
������������ "alhines" � ������ hod |
������� ������
�������, � ������� � ��������� � �������� list ������������ ��� ��������:
����� ������� ���������� ��� ������� list, ��������, ����� ����������� �������� ������, ����� �� �� ���������, ��� � ��������� ������� ���������� �� ������� ���������. �� ������ ��������� ������� ���������� ��� ������� list �� �������, � ���� ������� ��� � �� �������, � � ���� �������. |
��������� ��� �������� ������ ������� list ������������ � XML-����, �� ������ ����� ������������ ��� ��� ���������� ������ ������� ������� ���������. ��� ����� ���������� �������� � �������� XML-����� ������� �������� � list �� add, delete ��� modify.
���� ��� ����� ��������� ������ �� ������� ��� ��������� ����� (� ������� ���� <filename>), ������� ��������� ������� ���������� ���������� ������� list � �������� ���� ���� � �������. �������� ������ ������� ������. ���� �� �� ������� ��� ��������� �����, ������� ��������� �������� ���������� � ����� �� ���������, DirUtilList.xml, ����������� � �������� hostondemand\lib\samples\DirUtil. ������ ���, ����� �������� ���� ��� ������ �� ������, ������� list ��������� ���������� � ���� DirUtilList.xml.
���� �� �� ������ ������� �������������� ���� �����, ��������� ����� ����� ��: ������� ��������� ����� ���������� �������� ������ � ���� �� ���������, �������� � ���� ���������� ������� ������ ������.
� ������ Unix: ���������, ��� ����� ����� �������� ������ XML �������� ����������� ��� ������������ ���� ������������ ������� Unix. ��������, ���� ���� ������������ ������� �� ���������� ��� ������� � ���� � ����� �����, ������������� ���� ����������� �������� ����� �������� � ����, ��� ��� ����� �������� ����������������. � �������� ������� ���, ��������, �� ������� ������� �������� ���� � �������� ���������� ������. |
<dirscript> <action type="list"> <userlist> <userid>*</userid> <groupid>*</groupid> </userlist> <grouplist> <userid>*</userid> <groupid>*</groupid> </grouplist> <action> <dirscript>� XML-����� �� ���������, DirUtilList.xml: ������������ ��������� �������� ����������:
<!--����� �� ������: Userlist --> <!--�: userid= * --> <!-- groupid= * --> <dirscript> <action type="list"> <user> <userid>user1</userid> <groupid>hod</groupid> <description></description> <authentication>pw</authentication> </user> <user> <userid>user2</userid> <groupid>group2</groupid> <description></description> <authentication>nativeid</authentication> </user> </action> </dirscript> <!--����� �� ������: Grouplist --> <!--�: userid= * --> <!-- groupid= * --> <dirscript> <action type="list"> <group> <groupid>hod1</groupid> <description>������������ HOD</description> <parent></parent> </group> <group> <groupid>group2</groupid> <description>������ ������������</description> <parent></parent> </group> </action> </dirscript>