sad<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%><%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%><%@ taglib uri="/WEB-INF/tld/portal-internal.tld" prefix="wps-internal"%><%@ taglib uri="/WEB-INF/tld/resolver-v6.tld" prefix="portal-resolver"%> <%@ taglib uri="/WEB-INF/tld/people.tld" prefix="pa"%> <%@ taglib uri="/WEB-INF/tld/menu.tld" prefix="menu"%><%@ taglib uri="/WEB-INF/tld/engine.tld" prefix="wps"%><%@ page session="true" contentType="text/html" import="java.util.*,java.lang.*,com.ibm.portal.um.*,com.ibm.workplace.wcm.api.*"%> <%@ taglib uri="/WEB-INF/tld/portal.tld" prefix="portal"%><%@ page import="java.util.*,javax.servlet.jsp.JspWriter,java.io.*"%><%@ page import="com.ibm.workplace.wcm.api.*"%> <%@ page import="com.ibm.workplace.wcm.api.exceptions.*"%> <%@page import="java.util.*"%> <%@page import="java.io.*"%> <%@page import="java.net.*"%> <%@page import="java.text.*"%> <%@ page<c:set var="prefLanguage" value="ar" />import="java.text.*,java.util.*,java.lang.*,java.util.logging.*,com.ibm.workplace.wcm.api.*,com.ibm.portal.um.*"%> <wps:if locale="en"> <c:set var="prefLanguage" value="en" /> </wps:if> <wps:if locale="ar"> </wps:if> <% try { DocumentId docId = null; DocumentIdIterator itemsIterator = null;.getDocumentLibrary("Web Content");Workspace myworkspace = WCM_API.getRepository() .getSystemWorkspace(); if (myworkspace == null) { out.println("Unable to get a valid workspace.<br/>"); } else { out.println("Found workspace<br/>"); } myworkspace.login(); //Set the workspace to the correct library. DocumentLibrary MyLibrary = myworkspaceout.print("<br/><br/>Document id: " + docId.getId());if (MyLibrary == null) { out.println("Library is null<br/>"); } else { out.println("<br/>My lib is not null"); myworkspace.setCurrentDocumentLibrary(MyLibrary); } itemsIterator = myworkspace.findByName( DocumentTypes.AuthoringTemplate, "Article"); docId = (DocumentId) itemsIterator.next();itemsIterator = myworkspace.findByName(DocumentTypes.Content, "Sample Article"); docId = (DocumentId) itemsIterator.next(); out.print("<br/><br/>Document id: " + docId.toString()); myworkspace.logout(); } catch (Exception e) { out.println("Exception " + e.getMessage()); e.printStackTrace();}
We created this Blog to help IBM Portal Developers. We are providing tips and solutions for most common issues in portal development. We are writing in portlet development, theme development, WCM and Portal admin. Feel free if you need any inquiry in Portal 8.0/8.5. Complete Blog : http://ibmwcmsteps.blogspot.ae/
Search This Blog
Tuesday, July 22, 2014
How to access IBM WCM library using JAVA API?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment