Mostrando entradas con la etiqueta spaces. Mostrar todas las entradas
Mostrando entradas con la etiqueta spaces. Mostrar todas las entradas

9 abr 2013

WebCenter Spaces, navigation from one space to another space specifiying the destination path

Recently on a project we have the requirement of jumping from a Space to another one, but not the landing page.

This is the hierarchy and the desired navigation.






By default you can access to SpaceA with this URL: http://server/webcenter/spaces/spaceA

To access to second space the URL is http://server/webcenter/spaces/spaceB

Inside of SpacesB if you try to move to a "detail page" you can use http://server/webcenter/faces/news/detail because the navigation of the Space is the "default navigation" stored in memory.

Now imagine you're on SpaceA "home page", if you try to move to "detail page" of SpaceB you will get an error of 404 page not found.





This is produced because your current navigation is the default navigation defined in SpaceA.

To bypass this problem, we need to read the "default navigation" of SpaceB and create the correct link to the page.

First, we need the path of the "default navigation" of SpaceB, to get this value, we have to log as space administrator and go to the tab called "Resources".

Go to: http://server/webcenter/spaces/spaceB/admin

Select the correct resource and click "Edit Properties".


You will see a popup similar to this one, copy the value of the "Metadata File" clicking on "more" icon.





Now we have all needed information. It's time to create a "<af:goLink>" from one space to another.

Check this code:
<af:golink destination="#{navigationContext.navigationModel['/oracle/webcenter/siteresources/scopedMD/s8195d183_d2b1_4c90_b0fa_b541d2031f79/navigation/gsrbe2d4c14_2b20_4e1b_94aa_cc1930641d4e/default-navigation.xml'].node['news/detail'].goLinkPrettyUrl}" id="gl1">
</af:golink>


This is the syntax of the Expression Language (EL) used:

 #{navigationContext.navigationModel['<path to xml>'].node['<hierarchy>'].goLinkPrettyUrl}

This <af:goLink> will produce a HTML output like this:

http://server/webcenter/faces/news/detail?wc.contextURL=/spaces/spaceA&&wcnav.model=%2Foracle%2Fwebcenter%2Fsiteresources%2FscopedMD%2Fs8195d183_d2b1_4c90_b0fa_b541d2031f79%2Fnavigation%2Fgsrbe2d4c14_2b20_4e1b_94aa_cc1930641d4e%2Fdefault-navigation

 Souces:
  • WebCenter Developer's guide (link)

1 ago 2012

Configuración REST para WebCenter Spaces (PS3, PS4)

WebCenter Spaces incluye una API REST para consumir sus servicios, esta API es necesaria para alguno de los siguientes casos:

  • Utilizar la aplicación de iPhone / iPad
  • Utilizar datos de Spaces desde una aplicación WebCenter Portal
  • Subir recursos a Spaces (PageTemplate, Content Presenter Templates, etc...)

Para mi ejemplo voy a configurar mi máquina virtual (owc) para que permita este tipo de conexiones.

Es importante indicar que esto solo es necesario en WebCenter PS3 y PS4, en la nueva PS5 ya viene configurado de serie.

Probamos a conectar a la siguiente URL:

  • http://<host>:<port>/rest/api/resourceIndex
En mi caso: http://owc1:8888/rest/api/resourceIndex





Como se puede observar no tenemos acceso, realizaremos los pasos que incluye la documentación oficial, que consiste en:
  • Configurar Identity Asserter
  • Configurar el servidor de almacenes de credenciales.

Pasos a seguir


1.- Creamos el keystore

cd /oracle/jdk/bin (cualquier directorio Java)

./keytool -genkeypair -keyalg RSA -dname "cn=spaces,dc=oracle,dc=com" -alias orakey -keypass welcome1 -keystore /home/oracle/default-keystore.jks -storepass welcome1 -validity 1064

./keytool -exportcert -v -alias orakey -keystore /home/oracle/default-keystore.jks -storepass welcome1 -rfc -file /home/oracle/orakey.cer

./keytool -importcert -alias webcenter_spaces_ws -file /home/oracle/orakey.cer -keystore /home/oracle/default-keystore.jks -storepass welcome1

./keytool -importcert -alias df_orakey_public -file /home/oracle/orakey.cer -keystore /home/oracle/default-keystore.jks -storepass welcome1

2.- Lo copiamos a (Todos los manejados)

cp /home/oracle/default-keystore.jks /oracle/middleware/user_projects/domains/dev_domain/config/fmwconfig

scp /home/oracle/default-keystore.jks oracle@owc2:/oracle/middleware/user_projects/domains/dev_domain/config/fmwconfig/

vi /oracle/middleware/user_projects/domains/dev_domain/config/fmwconfig/jps-config.xml

Añadimos:

<propertySet name="trust.provider.embedded">
<property value="oracle.security.jps.internal.trust.provider.embedded.EmbeddedProviderImpl" name="trust.provider.className"/>
<property value="60" name="trust.clockSkew"/>
<property value="1800" name="trust.token.validityPeriod"/>
<property value="false" name="trust.token.includeCertificate"/>
<property value="orakey" name="trust.aliasName"/>
<property value="orakey" name="trust.issuerName"/>
</propertySet>





3.- Configuro el JKS a través de wlst.sh

/oracle/middleware/Oracle_WC1/common/bin/wlst.sh

connect('weblogic','Oracle11g','t3://owc1:7001')
updateCred(map="oracle.wsm.security", key="keystore-csf-key", user="owsm", password="welcome1", desc="Keystore key")

updateCred(map="oracle.wsm.security", key="enc-csf-key", user="orakey", password="welcome1", desc="Encryption key")

updateCred(map="oracle.wsm.security", key="sign-csf-key", user="orakey", password="welcome1", desc="Signing key")

disconnect()

exit()





4.- Reiniciamos los servidores

Reiniciamos todos los servidores manejados.

5.- Configuramos WLS Trust Service Asserter


  1. Accedemos a la consola de WLS
  2. Navegamos a Security Realms -> myrealm
  3. Nuevo proveedor de autenticación
  4. Nombre del "asserter" (por ejemplo, TrustServiceIdAsserter).
  5. Seleccionamos TrustServiceIdentityAsserter como tipo.
  6. Activar cambios




6.- Configuramos a través de WLST

/oracle/middleware/Oracle_WC1/common/bin/wlst.sh

connect('weblogic','Oracle11g','t3://owc1:7001')

createCred(map="o.webcenter.jf.csf.map", key="keygen.algorithm", user="keygen.algorithm", password="AES")

createCred(map="o.webcenter.jf.csf.map", key="cipher.transformation", user="cipher.transformation", password="AES/CBC/PKCS5Padding")

disconnect()
exit()



7.- Reiniciamos los servidores

Reiniciamos los nodos manejados



Por último, accedo a: http://owc1:8888/rest/api/resourceIndex y vemos el resultado obtenido



Fuentes de información:

22 feb 2012

WebCenter Spaces - Changing the Maximum File Upload Size

By default WebCenter Spaces PS4 should be setup to allow uploads of files up to 2Gb. But there is a little bug that restricts the file to be only "2Mb".


Those are the steps to change the default "max-filesize" to 2Gb
  1. Locate your WebCenter wlst.sh or wlst.cmd and execute it.

  2. Connect to admin server with this command:

    connect('weblogic','<weblogic-password>','t3://<ip-admin-server>:7001')

  3. Now export the metadata that defines the "uploadedFileMaxDiskSpace" parameter.

    exportMetadata(application='webcenter',server='WC_Spaces',toLocation='/home/oracle',docs='/oracle/webcenter/webcenterapp/metadata/webcenter-config.xml')

  4. Modify the file "webcenter-config.xml" and locate the line with this parameter.

    <webcenter:uploadedFileMaxDiskSpace>2097152</webcenter:uploadedFileMaxDiskSpace>

  5. Save the file and proceed to the upload, reconnect to wlst.sh

  6. Connect again to admin server

    connect('weblogic','<weblogic-password>','t3://<ip-admin-server>:7001')

  7. Execute the upload command:

    importMetadata(application='webcenter',server='WC_Spaces',fromLocation='/home/oracle',docs='/oracle/webcenter/webcenterapp/metadata/webcenter-config.xml')

  8. Restart WC_Spaces managed node and is ready to test.