java - 获取 Websphere 门户中的所有用户

标签 java atom-feed websphere-portal

我可以获取 Websphere 门户中的所有用户吗? 我在链接上开发:http://localhost:10039/wps/contenthandler/um/secure/users/profiles 但有些硬 这是:

String targetURL = "http://localhost:10039/wps/contenthandler/um/secure/users/profiles";
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = null;
     NodeList nList = null;
    Document doc = null;
    try {
        db = dbf.newDocumentBuilder();
    } catch (ParserConfigurationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    try {
         doc = db.parse(new URL(targetURL).openStream());
            nList = doc.getElementsByTagName("entry");
            for (int temp = 0; temp < nList.getLength(); temp++) {

                Node nNode = nList.item(temp);

                if (nNode.getNodeType() == Node.ELEMENT_NODE) {

                 Element eElement = (Element) nNode;


                }
               }
    } catch (SAXException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

任何人都可以帮助我 提前致谢!

最佳答案

您是否试图在门户上下文中运行时获取它?如果是这样,为什么要使用笨重的休息接口(interface)而不是直接调用 PUMA SPI

com.ibm.portal.um.PumaProfile 
com.ibm.portal.um.PumaController 
com.ibm.portal.um.PumaLocator 

以下示例向您展示如何执行 JNDI 查找

 Context ctx = new InitialContext();
 Name myjndiname = new CompositeName(PumaHome.JNDI_NAME);
 PumaHome myHome = (PumaHome) ctx.lookup(myjndiname);

然后您可以使用 findusersbyattribute 从 pumalocator 获取该列表

或者您可以只为用户发出 xmlaccess 请求。

关于java - 获取 Websphere 门户中的所有用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48072962/

相关文章:

java - 无法在 Tomcat 中部署使用 MYSQL 的 Web 服务

用于读取 RSS 和 ATOM 提要的 java 库

c# - 通过 LINQ to XML 解析 Atom 提要

java - [java.lang.ClassCastException : CustomPortlet incompatible with javax. portlet.Portlet

java - 使用 Mockito 测试抽象类不会给出预期结果

java - 如何使用 Bamboo 开始 Play,而不需要永远继续部署?

javascript - 在 get 查询中传递变量

c# - 从 C# 读取 gmail 帐户的 Atom 提要

jquery - 将请求参数从 javascript 发送到 portletRequest 对象

java - IBM WebSphere Portal 中的 "/wps/portal"和 "/wps/myportal"有什么区别?