Posts

Showing posts from 2016

WCP 11gR1: Change the Password Programmatically

Recently we implemented a Custom Interface for changing the password in a WebCenter Portal 11.1.1.8 environment. Here I am sharing some of the code to achieve it (taken from WebCenter API). Java Code Snippet: public void setPassword(ActionEvent event) { String METHOD_NAME = "setPassword"; logger.entering(CLASS_NAME, "setPassword"); final String userName = WebCenterSecurityUtils.getUserName(); try { FacesContext fCtx = FacesContext.getCurrentInstance(); Application app = fCtx.getApplication(); // This managed bean returns if the Change Password is allowed in WebCenter boolean allowPasswordChange = ((Boolean)ADFContext.getCurrent().getExpressionEvaluator().evaluate("#{o_w_wa_i_v_b_changePasswordBean.passwordChangeAllowed}")).booleanValue() if (!allowPasswordChange) { logger.fine(CLASS_NAME, "setPassword", "skipping passwd change as admin has disabled it"); WCApplicationContext

WCP 11gR1: Last Login of Portal Users

Hi. Recently I was asked about how to retrieve the latest login time of a specific user in WebCenter Portal 11.1.1.8 Basically, the solution was consuming WebCenter Analytics schema which holds analytics about user login. SELECT DISTINCT ASDIM_USERS.USERID AS "User", ASFACT_WC_LOGINS_0.OCCURRED as "last_login" FROM ASFACT_WC_LOGINS_0 , ASDIM_USERS WHERE ASFACT_WC_LOGINS_0.USERID = ASDIM_USERS.ID AND ASDIM_USERS.USERID = 'myuser' ORDER BY ASFACT_WC_LOGINS_0.OCCURRED DESC   Obviously, WebCenter Portal has to be configured with WebCenter Analytics Collector for using the above query consuming the ACTIVITIES Schema. Thanks to Paco Roldán for collaborating on it :).

WCC: Check if Framework Folders is enabled using RIDC

Useful snippet of code for check if your WebCenter Content is using Folders_g or Framework Folders as the Foldering Service in your RIDC Code. The clue is the use of CONFIG_INFO IDC Service. private synchronized void checkFrameworkFoldersEnabled() throws IdcClientException { final String METHOD_NAME = "checkFrameworkFoldersEnabled"; logger.entering(CLASS_NAME, METHOD_NAME); // Get IdcClient and IdcContext if necessary if (!configChecked) { DataBinder binder = idcClient.createBinder(); binder.putLocal("IdcService", "CONFIG_INFO"); DataBinder rb = idcClient.sendRequest(defaultIdcContext, binder).getResponseAsBinder(); DataResultSet resultSet = rb.getResultSet("EnabledComponents"); List<DataObject> components = resultSet.getRows(); for (DataObject component : components) { if (("FrameworkFolders".equals(component.get("name"))) && ("En

WCC: The power of GET_FS_DOC_INFO service

Image
GET_FS_DOC_INFO service is an IDC Service that I used in some of my solutions. It provides very useful information regarding to the URLs and Paths of the Documents in WebCenter Content. IsSoap=1 Output of GET_FS_DOC_INFO This service requires the following Input Paramters: dID: Specific Revision ID of the document Why is it too nice this service? :). It retrieves the following useful information: relativeURL: Relative URL to Web Layout File containerLocation: File System Path to the File (without the file name) renditionFiles: In case of having attachments! absoluteURL: Absolute URL to the Web Layout File webViewableFile: File System Path location of the Web Viewable Format primaryFile: File System Path location of the Native Format References (Thanks Jonathan and Sonal): http://contentmgmtsys.blogspot.com/2015/04/ucm-retrieve-vault-and-weblayout-path.html  

WCP: Get the Page Variants of a Page

I decided to create this blog post based on a quesiton I found on OTN WebCenter Portal Forum . How to retrieve the Page Variants from a given Page Path programatically? Page Variants are created in the same folder of the Page and it uses the following naming convenion: [Source Page Name] +   "_" + [Device Group Name] + "jspx"  Using the following code snippet you can get the Page Variants for the Current Page and then modify it as desired :) public void changeVariantsOfCurrentPage() { // Get Page Service for editing Page Attributes PageService pageService = getEditModePageService(); // Get Current Page Path final String pagePath = (String)ADFContext.getCurrent().getExpressionEvaluator().evaluate("#{pageDocBean.pagePath}"); if ((pagePath != null) && (pagePath.length() > 0)) { // For each possible Device Agent detect if it has a pageVariant List<DeviceGroup> allDeviceGroups = getAllDeviceGroups(); for (DeviceGroup

WCC: Folders_g to FrameworkFolders Quick Reference

Planning to migrate from Folders_g to Framework Folders? If so then find here a useful tables about how to migrate you RIDC code to be compatible with Framework Folders. Parameters Mapping   Parameter in Folders_g Parameter in Framework Folders dCollectionPath path dCollectionID fFolderGUID dCollectionName fFolderName dSecurityGroup fSecurityGroup dParentCollectionID fParentGUID xCollectionID parent dCollectionOwner fOwner dCollectionCreator fCreator dCollectionModifier fLastModifier dDocAccount fDocAccount dLinkID fLinkID dLinkName fLinkName dCreateDate fCreateDate dLastModifiedDate fLastModifiedDate todCollectionID destination todCollectionPath destination toContentName fFileName xClbraUserList fClbraUserList xClbraRoleList