Showing posts with label wci. Show all posts
Showing posts with label wci. Show all posts

Wednesday, January 26, 2011

WCI LDAP Directory query size limit

In one of my previously articles I was talking about how to export users from Oracle WebCenter Interaction LDAP Directory. This works well if you want to export a limited number of users. If you try to export all users registered inside the portal you will realize that you are not able to get more then 1000 users at once. In case you use some LDAP browser and then you click to export the entire user tree you will get only limited set. There are many reasons for this limitation but basically is done because of performance reasons.
In case you want to export all users let's say to migrate to another system you can change the limitation to a value which allows you to export all users. You can do this by doing following:

Go to the server where your WCI LDAP Directory service runs. The limitation is configured in the configuration.xml file, which you can find under: %WCI_INSTALL_PATH%/settings/.

Inside the folder open the configuration.xml file and search for the component: aluidirectory:backend:rdbms. Inside the component section you should see the following configuration:

        <setting name="query:sizelimit">
            <value xsi:type="xsd:integer">1000</value>
        </setting>

Change the value to a number which will allows you to export all users from the database. Make sure that you restart the LDAP Directory Service after you make the change.


IMPORTANT: After you finish with the export, change back to the original value and restart the service again.

Wednesday, October 20, 2010

Encrypting and decrypting portlet properties in Oracle WCI Portal

A useful feature from Oracle WCI portal is the possibility to save crypted portlet properties. Using an private key by the portlet administrator, enables him to save the encrypted settings and then by using an public key to read the information into the portlet view page. 
To do this first we have to generate private and public key. You can generate public key using some of the tools in internet or just use java by doing the following:
1 // RSA by default 1024bit 2 KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); 3 4 KeyPair generatedKeyPair = keyGen.genKeyPair(); 5 6 // save the keys 7 PrivateKey privateKey = keyPair.getPrivate(); 8 PublicKey publicKey = keyPair.getPublic(); 9 10 X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(publicKey.getEncoded()); 11 12 // save the public key 13 FileOutputStream fos = new FileOutputStream("public.key"); 14 fos.write(x509EncodedKeySpec.getEncoded()); 15 fos.close(); 16 17 // save the private key 18 PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec( 19 privateKey.getEncoded()); 20 fos = new FileOutputStream("private.key"); 21 fos.write(pkcs8EncodedKeySpec.getEncoded()); 22 fos.close(); 23 24 25 26




We do have now our RSA public and private keys which we will use to decrypt and encrypt the portlet setting. In our portlet application we have to read those keys and generate KeyPair which then we use inside the Chiper to decrypt or encrypt the properties. The code bellow shows you how to read the keys and generate the key pairs.




1 // get the cipher and load the private key 2 Cipher cipher = Cipher.getInstance("RSA"); 3 4 // Read Public Key. 5 File filePublicKey = new File("public.key"); 6 FileInputStream fis = new FileInputStream("public.key"); 7 byte[] encodedPublicKey = new byte[(int) filePublicKey.length()]; 8 fis.read(encodedPublicKey); 9 fis.close(); 10 11 // Read Private Key. 12 File filePrivateKey = new File("private.key"); 13 fis = new FileInputStream("private.key"); 14 byte[] encodedPrivateKey = new byte[(int) filePrivateKey.length()]; 15 fis.read(encodedPrivateKey); 16 fis.close(); 17 18 // Generate KeyPair. 19 KeyFactory keyFactory = KeyFactory.getInstance(algorithm); 20 X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(encodedPublicKey); 21 22 PublicKey publicKey = keyFactory.generatePublic(publicKeySpec); 23 PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(encodedPrivateKey); 24 PrivateKey privateKey = keyFactory.generatePrivate(privateKeySpec); 25 26 KeyPair keyPari = new KeyPair(publicKey, privateKey); 27




Having the KeyPair we can do the decrypting and encrypting process and then save this information inside the WCI portlet settings.


1 // code follows 2 3 // to encrypt property and then save 4 cipher.init(Cipher.ENCRYPT_MODE, keyPair.getPublic()); 5 6 portletContext.getResponse().setEncryptedSettingValue(SettingType.Portlet, "YourPropertyName", propertyValue, cipher); 7 8 9 // to read a encrypted property 10 cipher.init(Cipher.DECRYPT_MODE, keyPair.getPrivate()); 11 String prop = portletContext.getRequest().getEncryptedSettingValue(SettingType.Portlet, "YourPropertyName", cipher); 12 13 14 15 16 17

Monday, July 19, 2010

WCI Updates in Oracle Metalink

I’ve been asked several times, how to search and download patches and updates for the WCI portal. The support for WCI is very healthy and gives a lot of optimizations/updates you can install. Using the new Metalink interface is very easy to do, let’s start:

  • First thing you have to do, login into the Metalink (Oracle Support) portal using your customer account.
  • Inside the Metalink portal click on the Patches & Updates

image

  • On the right side you do have now a several options to search for :

image

  • Because we want to search for specific product, click on the link Product or Family (Advanced Search). The application will change the searchable options with the following screen:

image

  • In field Product type the name of the product, for example “Interactions”. You will get a list with suggestions, from which you can select the product you want. From the Release drop-down, select the version for which you look for updates. Next you can select the platform you run your portal application, like shown on the screen bellow:

image

  • Click now on search and you will get a screen with all available updates.