Sometimes you may need to develop a custom user interface to view or manage Aliases. Below you have an example code which I use to load list of Webcenter Content Aliases. What more, you can with this code get users list per each Alias:
IdcClient idcClient; IdcContext userContext; // .......... // UcmAlias is my custom object which contains alias metadata Map<String,UcmAlias> aliases = new LinkedHashMap<String,UcmAlias>(); DataBinder binder = idcClient.createBinder(); binder.putLocal("IdcService", "GET_ALIASES"); ServiceResponse response = idcClient.sendRequest (userContext, binder); DataBinder serverBinder = response.getResponseAsBinder(); DataResultSet resultSet = serverBinder.getResultSet("Alias"); for (DataObject dataObject : resultSet.getRows()) { UcmAlias alias = new UcmAlias(); String nazwa = dataObject.get("dAlias"); alias.setDAlias(nazwa); alias.setDAliasDescription(dataObject.get("dAliasDescription")); alias.setDAliasDisplayName(dataObject.get("dAliasDisplayName")); List<String> users = new ArrayList<String>(); alias.setUsers(users); aliases.put(nazwa,alias); } DataResultSet resultSet1 = serverBinder.getResultSet("AliasUserMap"); for (DataObject dataObject : resultSet1.getRows()) { String nazwa = dataObject.get("dAlias"); String user = dataObject.get("dUserName"); aliases.get(nazwa).getUsers().add(user); } // here you get list of all aliases in custom map
No comments:
Post a Comment