[AIX Solaris HP-UX Linux Windows][z/OS]

Intelligent Management:執行時期作業使用者喜好設定管理作業

當使用 wsadmin 工具時,您可以利用 Jacl 和 Jython Script 語言來複製、設定和取得喜好設定。 請使用 UserPreferences 群組中的指令和參數。

使用者喜好設定儲存在 Cell 環境定義之下,或儲存在各資源類型的環境定義中。 下列清單提供 Cell 層次和各資源層次的範例:
  • cells/myCell/preferences/User_1/preferenceset.xml
  • cells/myCell/applications/TestAppA.ear/preferences/User_1/preferenceset.xml
  • cells/myCell/nodes/myNode/servers/myServer/preferences/User_1/preferenceset.xml
  • cells/myCell/clusters/myCluster/preferences/User_1/preferenceset.xml
  • cells/myCell/serviceclasses/Platinum/preferences/User_1/preferenceset.xml
請利用下列指令來操作執行時期作業的喜好設定:

如需利用 Jython 與喜好設定物件互動的範例,請參閱Jython 喜好設定物件指令

clonePreference

clonePreference 指令會在使用者或角色之前複製喜好設定。

目標物件

母項的 configID

必要參數

-name 指定要複製的喜好設定名稱。(字串,必要)

選用參數

  • -scope:指定在複製喜好設定時,要儲存的喜好設定範圍。 如果您沒有指定範圍,就會使用 configID 的範圍。(字串,選用)範圍可以是下列值之一:
    • Applications
    • Servers
    • Clusters
    • ServiceClasses
  • -touser:指定要擷取其喜好設定的使用者。 如果您沒有指示這個值,預設值是將使用者 ID 用於執行指令的階段作業。(字串,選用)
  • -torole:指定要擷取其喜好設定的角色。 如果已指定 -touser 參數,會忽略這個值。 (字串,選用)
  • -fromuser:指定取得喜好設定副本的使用者。 您可以在清單中放置若干使用者來指示多位使用者,例如:user1,user2,user3。 在這份清單中,請勿使用空格。(字串,選用)
  • -fromrole:指定取得喜好設定副本的角色。 (字串,選用)

批次模式用法範例

  • 使用 Jython:
    cellid= AdminConfig.getid("/Cell:myCell")
    AdminTask.clonePreference(cellid, '[-name ChartGroups -fromuser user1 -touser user2,user3,user4,user5]')
    AdminConfig.save()
  • 使用 Jacl:
    $AdminTask clonePreference cells/dabtcCell02|cell.xml#Cell_1 {-name ChartGroups -fromuser user1
    	-touser user2,user3,user4,user5}

互動模式用法範例

  • 使用 Jython:
    AdminTask.clonePreference('[-interactive]')
  • 使用 Jacl:
    $AdminTask clonePreference {-interactive}

getPreferences

通過傳入角色或使用者名稱,getPreferences 指令會根據您指定的喜好設定文件來傳回喜好設定的集合。 您必須擁有管理者專用權,才能取得特定使用者或使用者角色的喜好設定。

目標物件

母項的 configID

必要參數

  • -name:指定喜好設定的名稱。(字串,必要)

選用參數

  • -scope:指定喜好設定的範圍。 您可以選擇下列有效值之一:
    • Applications
    • Servers
    • Clusters
    • ServiceClasses
    預設範圍是空白或未定義。 如果範圍空白,就會從所讀取的文件處衍生範圍。 比方說,如果文件在 Cell 範圍中,那麼範圍就是 Cell 範圍。 如果文件是在特定的伺服器環境定義中,就假定範圍適用於這個伺服器。 (字串,選用)
  • -user:指定要擷取其喜好設定的使用者名稱。 如果沒有指示使用者,預設動作是使用執行 Script 的使用者名稱。 (字串,選用)
  • -role:指定要擷取其喜好設定的使用者角色。 (字串,選用)

回覆值

指令會傳回包含喜好設定的 DescriptivePropertyGroup 物件,如果找不到喜好設定,會傳回空值。

批次模式用法範例

  • 使用 Jython 字串:
    cellid= AdminConfig.getid("/Cell:myCell")
    AdminTask.getPreferences(cellid, '[-name ChartGroups -user user1]')
  • 使用 Jacl:
    $AdminTask getPreferences cells/dabtcCell02|cell.xml#Cell_1 {-name Reports -user user1}

互動模式用法範例

  • 使用 Jython 字串:
    AdminTask.getPreferences('[-interactive]')
  • 使用 Jacl:
    $AdminTask getPreferences {-interactive}

setPreference

setPreference 指令會設定喜好設定文件中的特定喜好設定。 您必須擁有管理者專用權,才能設定特定使用者或使用者角色的喜好設定。

目標物件

母項的 configID

必要參數

  • -name:指定喜好設定的名稱。(字串,必要)
  • -propertyLongName:指定內容群組中內容的完整路徑,用正斜線 (/) 字元來定界。 如果這個內容直接包含在根內容群組中,可以使用內容的簡稱,因為它與完整名稱完全相等。(字串,必要)
  • -propertyValue:指定喜好設定要設的新值。 (字串,必要)

選用參數

  • -scope:指定在複製喜好設定時,要儲存的喜好設定範圍。 如果您沒有指定範圍,會使用 configID 的範圍。(字串,選用)範圍可以是下列值之一:
    • Applications
    • Servers
    • Clusters
    • ServiceClasses
  • -user:指定要儲存其喜好設定的使用者名稱。 如果沒有指示使用者,預設動作是使用執行 Script 的使用者名稱。 (字串,選用)
  • -role:指定要儲存其喜好設定的使用者角色。 (字串,選用)

批次模式用法範例

  • 使用 Jython 字串:
    AdminTask.setPreference(cellid, '[-name myChartGroup -propertyLongName defaultChartSize -propertyValue large]')
  • 使用 Jacl:
    $AdminTask setPreference cells/dabtcCell02|cell.xml#Cell_1 {-name Reports -user user1 -propertyLongName
    	defaultChartSize -propertyValue large}

互動模式用法範例

  • 使用 Jython 字串:
    AdminTask.setPreference('[-interactive]')
  • 使用 Jacl:
    $AdminTask setPreference {-interactive}

Jython 喜好設定物件指令

請搭配 Jython 指令,利用下列範例與喜好設定物件互動:

按使用者列出喜好設定

prefSets = AdminConfig.list("PreferenceSet")
print prefSets

移除使用者的喜好設定

prefid = AdminConfig.getid("/PreferenceSet:User_1")
AdminConfig.remove(prefid)
AdminConfig.save()

列出所有使用者的喜好設定,按使用者分組

prefs = AdminConfig.list("Preferences")
print prefs

指出主題類型的圖示 參照主題



時間戳記圖示 前次更新: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=rwve_xadmuserprefs
檔名:rwve_xadmuserprefs.html