Mostrando entradas con la etiqueta webcenter content. Mostrar todas las entradas
Mostrando entradas con la etiqueta webcenter content. Mostrar todas las entradas

14 oct 2016

Change JSESSIONID cookie on WebCenter Content / UCM

Sometimes we hate an issue, last week was one of them. Due an incompatibility with a legacy portal that customer already has, I was forced to modify UCM session cookie.

If you check Oracle Support website with this task, you will find this note DocID 1507003.1

Not really usefull for me, isn't it? :-)

You should be familiar with <session-descriptor> under weblogic.xml file

More info: https://docs.oracle.com/cd/E13222_01/wls/docs81/webapp/weblogic_xml.html#1038173

On my first attempt I tried to modify only cookie-path, but for some reason UCM was not capable to get the session from another path.

So I get deeper on the code and tried to modify JSESSIONID name cookie. This are the steps you should follow to.

Locate your "cs.ear" file


Go to your weblogic console of WCC domain in my VM for example
http://wcp:7001/console/

Go to "deployments" option menu

 

Now locate your "WCC" main web-app



Click over the deployment and you will get into details and will find the location of the EAR on the installation.

 

In my case /u01/oracle/middleware/Oracle_ECM1/ucm/idc/components/ServletPlugin/cs.ear

Download the file to your desktop.

Modify descriptors file


Now is necessary to modify web.xml and weblogic.xml

This is how weblogic.xml should look like


<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app" xsi:schemalocation="http://www.bea.com/ns/weblogic/weblogic-web-app.xsd">
 <session-descriptor>
  <persistent-store-type>replicated_if_clustered</persistent-store-type>
  <cache-size>0</cache-size>
  <timeout-secs>1200</timeout-secs>
  <cookie-name>UCMJSESSIONID</cookie-name>
 </session-descriptor>
 <container-descriptor>
  <resource-reload-check-secs>1</resource-reload-check-secs>
 </container-descriptor>
 <security-role-assignment>
  <role-name>SSOrole</role-name>
  <principal-name>users</principal-name>
 </security-role-assignment>
</weblogic-web-app>


As you see I've added the <cookie-name> to the original file.

And this is how web.xml should look like
(only the beggining of the file, the rest is unmodified)


<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 <display-name>cs_servlet</display-name>

 <welcome-file-list>
  <welcome-file>portal.htm</welcome-file>
 </welcome-file-list>

 <!-- [ JPS Integration ] -->
 <filter>
  <filter-name>JpsFilter</filter-name>
  <filter-class>oracle.security.jps.ee.http.JpsFilter</filter-class>
  <init-param>
   <param-name>enable.anonymous</param-name>
   <param-value>true</param-value>
  </init-param>
  <init-param>
   <param-name>remove.anonymous.role</param-name>
   <param-value>false</param-value>
  </init-param>
  <init-param>
   <param-name>application.name</param-name>
   <param-value>IDCCS</param-value>
  </init-param>
  <init-param>
   <param-name>IdcSessionKey</param-name>
   <param-value>UCMJSESSIONID</param-value>
  </init-param>
 </filter>

 <filter-mapping>
  <filter-name>JpsFilter</filter-name>
  <url-pattern>*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
  <dispatcher>FORWARD</dispatcher>
 </filter-mapping>
 <!-- [ End JPS Integration ] -->

 <filter>
  <filter-name>IdcFilter</filter-name>
  <filter-class>idcservlet.IdcFilter</filter-class>
  <init-param>
   <param-name>UseRedirectedAuthPrompt</param-name>
   <param-value>1</param-value>
  </init-param>
  <init-param>
   <param-name>IdcServerType</param-name>
   <param-value>server</param-value>
  </init-param>
  <init-param>
   <param-name>IdcProductName</param-name>
   <param-value>idccs</param-value>
  </init-param>
  <init-param>
   <param-name>IdcSessionKey</param-name>
   <param-value>UCMJSESSIONID</param-value>
  </init-param>
 </filter>

 <filter-mapping>
  <filter-name>IdcFilter</filter-name>
  <url-pattern>*</url-pattern>
  <dispatcher>FORWARD</dispatcher>
  <dispatcher>INCLUDE</dispatcher>
  <dispatcher>REQUEST</dispatcher>
 </filter-mapping>


 <servlet>
  <servlet-name>
   adfAuthentication
  </servlet-name>
  <servlet-class>
   oracle.adf.share.security.authentication.AuthenticationServlet
  </servlet-class>
  <init-param>
   <param-name>allow_success_url_param_overwrite</param-name>
   <param-value>true</param-value>
  </init-param>
  <init-param>
   <param-name>allow_logout_url_param_overwrite</param-name>
   <param-value>true</param-value>
  </init-param>
  <init-param>
   <param-name>IdcSessionKey</param-name>
   <param-value>UCMJSESSIONID</param-value>
  </init-param>
 </servlet>


After modifiying this files, you can package them into the .war and the war into the .ear.

Copy the new "cs.ear" file to your system replacing the old one.

Now stop the app and re-deploy it with weblogic console, and reboot the node to take the changes.



Appendix


Modify your Apache .conf file to setup the new cookie name.

I think that is not necessary 100% but I also added to my instance this configuracion under each "<location>" on my apache configuration file.

<Location /cs>
   SetHandler weblogic-handler
   WebLogicCluster server1:16200,server2:16200
   WLCookieName UCMJSESSIONID
</Location>
<Location /idc>
   SetHandler weblogic-handler
   WebLogicCluster server1:16200,server2:16200
   WLCookieName UCMJSESSIONID
</Location>
<Location /adfAuthentication>
   SetHandler weblogic-handler
   WebLogicCluster server1:16200,server2:16200
   WLCookieName UCMJSESSIONID
</Location>

This is all, my next step will be to add this modifications with a deployment plan file, this will make unnecessary to modify "cs.ear" file on the filesystem of our installation.


31 oct 2014

NullPointerException on GET_SEARCH_RESULTS

I've just fixed a issue that was getting me crazy, this time we couln't search on our WebCenter Content with OracleTextSearch as indexer.

This is the stacktrace that appears on every search:

>services/3     10.31 13:15:07.970      IdcServer-7     !csUserEventMessage,admin.intranet,10.0.3.21:16200!$ intradoc.common.ServiceException: !csUnableToRetrieveSearchResults!csUnableToExecMethod,getSearchResults
 services/3     10.31 13:15:07.970      IdcServer-7     *ScriptStack GET_SEARCH_RESULTS
 services/3     10.31 13:15:07.970      IdcServer-7     3:getSearchResults,**no captured values**
 services/3     10.31 13:15:07.970      IdcServer-7             at intradoc.server.ServiceRequestImplementor.buildServiceException(ServiceRequestImplementor.java:2176)
 ...
 ...
 services/3     10.31 13:15:07.970      IdcServer-7             ... 36 more
 services/3     10.31 13:15:07.970      IdcServer-7     Caused by: java.lang.NullPointerException
 services/3     10.31 13:15:07.970      IdcServer-7             at java.util.Hashtable.put(Hashtable.java:396)
 ...
 ...
 services/3     10.31 13:15:07.970      IdcServer-7             at intradoc.common.ClassHelperUtils.executeMethod(ClassHelperUtils.java:295)


We think that the issue was regarding the data base or the indexer packages needed, but as trace shows, no communication is done between WCC and DB.

Before our surrender and reinstall all the system, I've decompiled some sources (Oracle don't read this) and found the problem.

The line that launches our NPE was this:

props.put("IntradocServerHostName", SharedObjects.getEnvironmentValue("HttpServerAddress"));

After checking my "config.cfg" file I've found that the HttpServerAddress was commented...

Solution now is simple, uncomment the variable and restart the system... et voila! my search works again.

3 ene 2014

Synchronizing users with ACL metadata boxes

Using WebCenter Content with Access Control List (ACL) enabled. Allow users to setup their custom security based on users and groups that they know.

This is how ACL's looks like under the new WCC UI.


The box of users have an "auto-complete" behavior that helps the search of the user that you want to share your content.

The main problem is that WCC only shows users that already have sign-in or "logged" under the product. This means, that only "active" users will be shown.

To solve this, we can perform a "preload" of all users from our LDAP to the internal DB of WCC. After this loading the auto-complete box will show all the available users of our company.

We need to perform this steps:

Configuring the jps-config.xml

This file has the information relative to our LDAP. In my case Im using ActiveDirectory from Microsoft, by default jps file is configured for Oracle LDAP (OID), that means that will search for "uid" attribute in the person objetc. As most of you know, ActiveDirectory uses the attribute "sAMAccountName" as user id.

You need to modify your WCC domain jps-config.xml file, in my case was under this path:
/opt/oracle/domains/domwc/config/fmwconfig/jps-config.xml

<serviceInstance name="idstore.ldap" provider="idstore.ldap.provider">
    <description>LDAP Identity Store Service Instance</description>
    <property name="idstore.config.provider" value="oracle.security.jps.wls.internal.idstore.WlsLdapIdStoreConfigProvider"/>
    <property name="CONNECTION_POOL_CLASS" value="oracle.security.idm.providers.stdldap.JNDIPool"/>
    <property name="username.attr" value="sAMAccountName"/>
    <property name="user.login.attr" value="sAMAccountName"/>
</serviceInstance>

I've included two properties username.attr and user.login.attr, this properties should be added only if your LDAP does not use the "uid" attribute.

Sync users from LDAP with WCC

For sync the users, I've created a small Java program that connects with LDAP to read all available users, and later performs a call to the service "CHECK_USER_CREDENTIALS" via RIDC. That service will force a connect with the LDAP within UCM, and all the information will be added to the local database of the content server.

The Java process needs the following parameters:
  • LDAP IP or Host
  • LDAP Admin user DN
  • LDAP Admin user password
  • Base DN for user search
The sample JDev project has a RIDC connection setup that points to the RIDC ip & port of your content server, be sure to setup this connection along with the parameters needed of the LDAP server.

After the execution of the program, you can search all your users under ACL boxes ;-)


Documentation

Downloads

10 oct 2013

View SiteStudio Dynamic List on WebCenter Portal application

Last week my coworker Daniel wanted to view the results of a Dynamic List on a WebCenter Portal Content Presenter Template. After a few test we saw that this feature is not suppported.

Under a Content Presenter Template (CPT) you can show any field of the DataFile, simple text, WYSWYG, static list of elements, but seems that the Dynamic List was missing by WebCenter developers ;-)

To solve this issue we created a custom TaskFlow that is capable of listing the elements of a Dynamic List (Element Definition).

First I've created a new Element Definition (ED) of type "Dynamic List", this ED will perform this query:

dExtension <matches> `docx`

This will retrieve all Word documents of the WebCenter Content (WCC).

Next, I've created a Region Definition (RD) with two fields, one of type "Single Text" and another with the DynamicList (ED) just created.


After that, I've created a DataFile based on that Region Definition, this is the resulting XML content:


<wcm:root version="8.0.0.0" xmlns:wcm="http://www.stellent.com/wcm-data/ns/8.0.0">
  <wcm:element name="text">This is a simple text</wcm:element>
</wcm:root>

As you see, there is not track about the ED with the DynamicList, but if you edit that DataFile on WCC interface this is how it looks


So, where is the information of the "Documents" section stored? In the Element Definition called "ED-DYNLIST".

This is the content of the ED file:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementDefinition xmlns="http://www.oracle.com/sitestudio/Element/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.oracle.com/sitestudio/Element/ http://www.oracle.com/sitestudio/ss_element_definition.xsd">
    <property value="3" name="type"/>
    <property value="" name="description"/>
    <complexProperty name="flags">
  ...
  ...
    </complexProperty>
    <property value="" name="height"/>
    <complexProperty name="dynlistaddregioncontent">
  ...
  ...
    </complexProperty>
    <dataProperty name="querytext">dExtension <matches> `docx`</dataProperty>
    <property value="dDocTitle" name="sortfield"/>
    <property value="asc" name="sortorder"/>
    <property value="20" name="resultcount"/>
    <property value="false" name="limitscope"/>
    <property value="" name="targetnodeid"/>
</elementDefinition>


As you see the query is stored on <dataProperty> TAG.

Now that we have all the needed information, we can create the TaskFlow that parses the WCC query stored on the ED file, and show the results of that query under a Content Presenter.

Diagram of our TaskFlow


This is how it looks like at the end



Download Links

Documentation

19 feb 2013

Using CMIS query with boolean metadata

Often we create boolean type metadata on WebCenter Content. This type of metadata in fact is an integer type metadata, but uses a system internal view called "YesNoView".

Check screenshots above to see the default configuration of this kind of metadata.



If we check the standard "Check-in" page, the metadata is represented with a "combo-box" input.





You can use this metatada to perform searchs over UCM and retrive the contents that are checked as "hidden" (in this example).


Since WebCenter PS3 was released, you can show content on WebCenter Portal/Spaces with "Content-Presenter (CP)" taskflow. This component shows contents stored at content server (UCM).

CP allows the user to define a query that searchs on content-server the items that matches your query. This is done over CMIS standard instead UCM query syntax.

Now, we try to add a content-presenter on a page, and query filtering with the new metadata (Hidden content). This is the CP wizard screenshot.


Remember to check that the new metadata is in "Filters" section. And save/close the wizard...

The system will show some error stacktrace, this is a summary

Caused by: oracle.webcenter.content.integration.RepositoryException: 19-feb-2013 17:00:46 oracle.webcenter.content.integration.spi.ucm.search.SearchService search
GRAVE: Se ha producido un error al buscar el repositorio ucm. Se ha recibido el código de estado -1 al llamar al servicio GET_SEARCH_RESULTS, como usuario weblogic y registro de hora 19/02/13 17:00. La búsqueda es Search[repositoryId=ucm, max to return=5, useFullTextSearch=true, useCache=true, sort="toProperty('dDocTitle') ASC", fullText="
 Metadata criteria((cm_contentType equals IDC:GlobalProfile)AND(xHiddenContent [any] equals true))
 isOr=false"] y la asignación de parámetros es {ResultCount=5, FolderPathInSearchResults=1, SortField=dDocTitle, IdcService=GET_SEARCH_RESULTS, SortOrder=ASC, vcrAppendObjectClassInfo=1, StartRow=1, QueryText=(xHiddenContent  `true`), vcrContentType=IDC:GlobalProfile}.


If you have installed WebCenter Spaces, we can try the Web-interface to test the CMIS queries. In my case I tried the following URLs:
  • http://owc:8888/rest/api/cmis/query/q/ucm?q=SELECT * FROM ora:t:IDC:GlobalProfile WHERE ora:p:xTuiHiddenContent = TRUE
  • http://owc:8888/rest/api/cmis/query/q/ucm?q=SELECT * FROM ora:t:IDC:GlobalProfile WHERE ora:p:xTuiHiddenContent = 1

And the following errors were launched

oracle.webcenter.content.integration.cmis.query.ParseException: Feb 19, 2013 5:19:27 PM oracle.webcenter.content.integration.cmis.query.VcrExpressionSearchDelegate fixLiteral
SEVERE: Comparing boolean property [xHiddenContent] to non-Boolean literal [1]


oracle.webcenter.content.integration.RepositoryException: Feb 19, 2013 5:19:33 PM oracle.webcenter.content.integration.spi.ucm.search.SearchService search
SEVERE: An error occurred when searching repository ucm.  When calling service GET_SEARCH_RESULTS, as user anonymous, at timestamp 2/19/13 5:19 PM, received status code -1.   The search was Search[repositoryId=ucm, max to return=26, useFullTextSearch=false, useCache=true, expr="(toProperty('xHiddenContent') == true && toProperty('cm_contentType') == 'IDC:GlobalProfile')"] and the parameter map was {ResultCount=26, FolderPathInSearchResults=1, SortField=dInDate, IdcService=GET_SEARCH_RESULTS, SortOrder=Desc, vcrAppendObjectClassInfo=1, StartRow=1, QueryText=(xHiddenContent  `1`), vcrContentType=IDC:GlobalProfile}.

To solve this, there is a workaround that we can do, without affecting the content already stored at UCM.

First create a table in UCM (using ConfigurationManager Applet), this table should have a structure similar to this one:



After that, we create a view that uses that table, similar to this one:



Next you should add the values for true/false.


And finally, attach the new view created to the metadata, replacing the system "YesNoView" with the "YesNoCustomView" just created.


Now, restart WebCenter Spaces and try with this URL:

  • http://owc:8888/rest/api/cmis/query/q/ucm?q=SELECT * FROM ora:t:IDC:GlobalProfile WHERE ora:p:xHiddenContent = 1
Now the query is correctly performed over CMIS standard. And if you try CP Wizard now also works without problems.

I hope this information helps on your project.

Related Information 



12 feb 2013

NullPointerException in VCR_GET_CONTENT_TYPE service

Recently I was debugging an error in WebCenter Portal, that didn't allow the user to search over a content-server instance with a Content-Presenter TaskFlow.

In this case, we had 2 instances of UCM connected to WebCenter Portal application, the first one works without problems, but when we attached the second one, and you try to query over it, the page is refreshed and the content-presenter wizard is closed.



The Portal log shows this error:

Caused By: oracle.stellent.ridc.protocol.ServiceException: Could not load information about VCR content type. Unable to execute service method 'vcrGetContentTypeInfo'. The error was caused by an internally generated issue. The error has been logged.
 at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:135)
 at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:107)



And looking at UCM log this error is shown:

services/3 02.07 15:22:14.039 IdcServer-89 !csUserEventMessage,sysadmin,CIS!$ intradoc.common.ServiceException: !csVcrCouldNotLoadContentType!csUnableToExecMethod,vcrGetContentTypeInfo
 services/3 02.07 15:22:14.039 IdcServer-89 *ScriptStack VCR_GET_CONTENT_TYPE
 services/3 02.07 15:22:14.039 IdcServer-89 3:vcrGetContentTypeInfo,**no captured values**
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceRequestImplementor.buildServiceException(ServiceRequestImplementor.java:2115)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.buildServiceException(Service.java:2260)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.createServiceExceptionEx(Service.java:2254)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.createServiceException(Service.java:2249)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:102)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.doCodeEx(Service.java:533)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.doCode(Service.java:505)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1643)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.doAction(Service.java:477)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1458)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.doActions(Service.java:472)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1391)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.executeActions(Service.java:458)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:737)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.doRequest(Service.java:1890)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceManager.processCommand(ServiceManager.java:435)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.IdcServerThread.processRequest(IdcServerThread.java:265)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.IdcServerThread.run(IdcServerThread.java:160)
 services/3 02.07 15:22:14.039 IdcServer-89         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
 services/3 02.07 15:22:14.039 IdcServer-89         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
 services/3 02.07 15:22:14.039 IdcServer-89         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
 services/3 02.07 15:22:14.039 IdcServer-89 Caused by: java.lang.NullPointerException
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.vcr.VcrServiceHandler.addPropertyChoicesForFieldAndView(VcrServiceHandler.java:514)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.vcr.VcrServiceHandler.vcrGetContentTypeInfo(VcrServiceHandler.java:464)
 services/3 02.07 15:22:14.039 IdcServer-89         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 services/3 02.07 15:22:14.039 IdcServer-89         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 services/3 02.07 15:22:14.039 IdcServer-89         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 services/3 02.07 15:22:14.039 IdcServer-89         at java.lang.reflect.Method.invoke(Method.java:597)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.common.ClassHelperUtils.executeMethodReportStatus(ClassHelperUtils.java:324)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:79)
 services/3 02.07 15:22:14.039 IdcServer-89         ... 16 more



After seeing that the problem resides at UCM service execution we see that the status-code returned is -32. (Any status-code lower than 0 means service execution error).

Looking at the dDocTypes all appears correctly, but after accessing to the "Check-in" form, some errors can give us an idea of the problem. When I access to check-in form, some alerts are showed to the user indicating that some of the metadata "views" seems corrupted.




To find out wich metadata is the one that uses that view, I've opened Firebug and look for that view on JS files.


The metadata called "xIsEditable" is using YesNoList view, its recommended to perform more search and see how many metadata fields are using that view.

The problem in this case was that the view was empty and didn't have any value, this causes the NPE (NullPointerException) in the execution of the service VCR_GET_CONTENT_TYPE.

After adding values to the view, and going back to check-in page, no more "alert" of view errors were shown.

Now the UCM is ready to be used again with content-presenter, and the problem solved.

26 oct 2012

Validate check-in form fields with Javascript

At one of my current projects we faced the problem that the dDocName field was filled with no common characters by the user.

For example they insert spaces and letters (like áéíóú). This kind of contentID was breaking the indexer process of UCM.

Most of you will tell me to use the AUTO_NUMBER property of content server, but on some type of content, the user have to insert a specified dDocName for our SSXA Web project.

To prevent contentID like "BIOGRAFÍA CATALÁN", we developed a custom component that performs a JS validation before check-in process.

For the validation I've created a REGEX expresion that allows only letters, numbers and underscore.

This is the code inserted in the custom-component. As you see, this will "include" all system validations with the <$include super.custom_schema_validation_script_post$> sentence.
After that, starts our custom validation, we only have to return "false" if we want to cancel the check-in process.

<@dynamichtml custom_schema_validation_script_post@>
<$include super.custom_schema_validation_script_post$>
<$if ((dpAction like "CheckinSel" or dpAction like "CheckinNew" or dpAction like "Update"))$>
if (document.Checkin != null && document.Checkin.dDocName != null)
{
var name = document.Checkin.dDocName.value;
if(name != null && name != '' && name.length > 0)
{
 var rgx_docname = /^[A-Za-z0-9_]{1,30}$/;
 
 if (rgx_docname.test(name))
 {
  vstatus = "Ok";
 }
 else
 {
  vstatus = "Error";
  alert("Error: You cannot use non-ASCII characters for ContentID");
  return false;
 }
}
}
<$endif$>   
<@end@>

Download here the custom-component for your customization and use.

14 mar 2012

Add SecurityGroup from parent folder in a profile check-in

Using folders component in WebCenter Content, let you to add default or inherit metadata to the contents that are under the parent folder.

Imagine that you have 3 different folders for a "news" content, two of them with "Public" SecurityGroup but the last one with "Secure" SecurityGroup.

Usually you will create only one profile, so users will select the folder during check-in process (if they can see them) and depending of the folder, the metadata dSecurityGroup will be filled.


Here are the steps to achieve this:

Modify "Folders" View

  1. Log into Configuration Manager Applet

  2. Go to "Tables" tab, and select "Collections" table.

  3. Click on "Edit Table", if you cannot see the columns, click on "syncrhonize definition" close again the windows and try again (sometimes it tooks a while until the columns information appears)

  4. Now move to "View" Tab and Edit the "Folders" View.

  5. Edit it and select the "Change Columns" to include the dSecurityGroup



  6. Move to the "Security" Tab and check the option "Publish view data".


Creating the Rule

  1. Create a new rule and check it as "global"

  2. Go to fields, and add "Security Group"



  3. Edit "Derived field information" and in custom tab add this code:




<$nuevoValor=getViewValue("Folders",#active.xCollectionID,"dSecurityGroup")$>
<$if nuevoValor$>
<$dpPromote("dSecurityGroup",nuevoValor)$>
<$endif$>


Few things to remember

If the metadata from the parent that you want to "derive" is custom (like xDepartment) you should create a view from table "COLMETA" with the columns dCollectionID and xDepartment, for more info check on metalink this note: 780979.1