Sitemap

Saturday, April 11, 2015

UCM: Create a resultset and store it in HDA file

SCENARIO: I will create a custom resultset and save it in the form of HDA file in a particular location. I can later access the table and retrieve the data. I hope the code is self-explainable.


public class CreateHDAFile extends Service {

    public static final String HDAFILENAME = "hdafile.hda";
    public static final String CUSTOMRESULTSET = "CustomResultSet";
    public static final String CLASS_NAME = "CreateHDAFile";
    public static final String DIRECTORY = DirectoryLocator.getAppDataDirectory() + "test/";

    public void createHDAFile() throws ServiceException, DataException {
        String query = "SELECT r.did, r.ddocname, R.DDOCTITLE FROM revisions r, docmeta d WHERE r.did = d.did";
        ResultSet resultSet = m_workspace.createResultSetSQL(query);
        DataResultSet dataResultSet = new DataResultSet();
        dataResultSet.copy(resultSet);
        m_binder.addResultSet("InputDataHDAFile", dataResultSet);
        saveDataResultSet(m_binder);
    }

    public static void saveDataResultSet(DataBinder data) throws ServiceException {
        trace(DIRECTORY);
        FileUtils.checkOrCreateDirectoryEx(DIRECTORY, 0, true);
        FileUtils.reserveDirectory(DIRECTORY);
        try {
            ResourceUtils.serializeDataBinder(DIRECTORY, HDAFILENAME, data, true, true);
        } finally {
            FileUtils.releaseDirectory(DIRECTORY);
        }
        DataResultSet drset = (DataResultSet) data.getResultSet("InputDataHDAFile");
        SharedObjects.putTable(CUSTOMRESULTSET, drset);
    }
}

These are the contents of the HDA file:

@ResultSet InputDataHDAFile
3
dID 3 38
dDocName 6 30
dDocTitle 6 255
1
LTSCHAUDHARYHY000001
Test
201
HELLO
HELLO
202
SMILEY
SMILEY
@end

Now to access the contents of the HDA file:

DataBinder binder = new DataBinder();
binder = ResourceUtils.readDataBinder(DIRECTORY, HDAFILENAME);
DataResultSet savedMap = (DataResultSet) binder.getResultSet("InputDataHDAFile");

UCM: Custom Service Class

A custom service class extends the content server’s core intradoc.server.Service.

The Service super class does not contain any methods that should be called directly. It mainly has support functions for
• Running service actions in the correct order
• Initializing a user’s security
• Running database queries
• Creating the context for the request

Key Service Class Objects
Variable Class Description
m_workspace intradoc.data.Workspace The database connection
m_binder intradoc.data.DataBinder The request and response data
m_currentAction intradoc.data.Action The current service action
m_serviceData intradoc.data.ServiceData The current service’s definition
m_userData intradoc.data.UserData The user running the service
m_service intradoc.data.Service A reference to the parent service object

The predefined Service class object m_binder has the same functionality as &IsJava=1

This is how a service class or service handler can access a parameter being passed from the service action:
String param = m_current_action.getParamAt(0);

This will get the first parameter.

Service class methods that are called from a service have a required signature: public void myMethod() throws DataException, ServiceException;
public class AcmeMailService extends Service {

    public void sendMail() throws DataException, ServiceException {
        String str = m_binder.getLocal("acmeEmailAddresses");
    }
}


Service classes:
• Service classes require minimal registration inside the server.
• Methods of a service class can only be used as actions in a service associated with that service class.
• Methods of a custom service class cannot be used as actions when extending standard services.

Service handlers
• Service handlers require additional registration inside the server.
• Methods of a service handler can be used as actions in services associated with different service classes.
• Methods of a custom service handler can be used as actions when extending standard services.

UCM: Integration with Oracle SES

Follow the steps mentioned in the link below:
http://www.ateam-oracle.com/cookbook-ses-and-ucm-setup/

These are the screenshots that I have taken when I integrated SES in my local system

1. Configure SESCrawlerExport screen

2. To check if the correct configuration was done, please access the following URL:
http://localhost:16200/cs/idcplg?IdcService=SES_CRAWLER_DOWNLOAD_CONFIG&source=default

3. Identity Management Setup Page

4. Create User-Defined Source : Step 1 : Parameters

5. Create User-Defined Source : Step 2 : Authorization

There is a tutorial for Oracle SES:
http://download.oracle.com/oll/tutorials/SESAdminTutorial/index.htm

and a video on Defining a Stellent Source:
http://download.oracle.com/oll/tutorials/SESAdminTutorial/html/stellentshowme.htm

Documentation:
http://docs.oracle.com/cd/E29542_01/doc.1111/e26692/searchtools.htm#CIHCHJEI

UCM: Read HDA Files

Tuesday, April 7, 2015

UCM: Scheduled Job Administration

This page can be accessed by choosing Administration, then Scheduled Job Administration from the Main menu. Choose Active Scheduled Jobs.

You can also create your own scheduled job and make it display here. You can administer the same scheduled job, whether you want to run on a daily basis or weekly or monthly. In the screenshot below, I have created an ABCScheduledJob job which daily runs and executes any service defined in the resource file.


Under Actions, click on Edit to change the interval of the execution of the service, whether you want to run it hourly or weekly. The Interval field is editable.


Download the ABCScheduledJob.zip file from the Downloads.

Sunday, April 5, 2015

UCM: Tips and Tricks

To ensure that the two metadata fields Security Group and Type do not contain any default values upon check-in:
ForceDocTypeChoice=1
ForceSecurityGroupChoice=1


When set to TRUE, resource files defined in components will be refreshed only when the content server is restarted which will increase CS performance. Definitely set this to TRUE in your production environments.
DisableSharedCacheChecking=true


To restrict users with read only permissions to download a copy of the content (you might have to search within the <cs> directory and text search for GetCopyAccess. Edit the files that contain GetCopyAccess=true and set the parameter to false. Restart the server). For more information, check Doc ID 1260914.1.
GetCopyAccess=false


Custom or standard services used for file uploads now require additional configuration parameters below
ForcePermissionCheckforAllowedUploadServices=true (if user permissions are used, it will require validation)
AppendToAllowedUploadServices=<ServiceName1>,<ServiceName2>,<ServiceName3>


Incoming Socket Connection Address Security Filter
SocketHostAddressSecurityFilter=127.0.0.1|10.111.19.15


When batchloading content from the command line, the user specified in the BatchLoaderUserName configuration entry must have administrative rights to the security group to which the content is being checked in.
BatchLoaderUserName=sysadmin


To turn off all content profiles and disable all global rules
DisableContentProfiles=true


To increase the size of the memo field beyond 255. This will only apply to newly created fields.
MemoFieldSize=3000


To enable the error logging for BatchLoader when running it from the command line
EnableErrorFile=true


To set the maximum number of search connections that are open simultaneously. For example, if MaxSearchConnections=5, and six search requests are made at the same time, the sixth request goes into a queue until one of the first five requests is completed.
MaxSearchConnections=5


This can be used to support a high ingestion rate when transferring content items from an external repository into Content Server storage, bypassing Inbound Refinery, workflow, and indexing.
DirectReleaseNewCheckinDoc=1


Disable a particular query form view. Possible values we can set are "standard" which is the default, and "queryBuilder".
DisabledSearchFormTypes=queryBuilder


To create tables based on external database views.
EBRIncludeViewsInTableList=true


Disable the authorization check
DisableAuthorizationTokenCheck=true


To speed up the scheduled execution time of the scheduled events to run every minute for scheduled events that normally run every hour
DoDebugFastScheduledEvents=true


Get the post install screen after the installation of UCM
ForceInitialPostInstallConfiguration=true


Searching all revisions of a content (Refer https://community.oracle.com/thread/3718985)
SearchEngineName=DATABASE.METADATA.ALLDOCS


While importing contents using archiver, if the user gets the csCheckinReleaseDateError, add the first 2 entries in the source and target UCM instances. If this doesn't work, then add the third entry and restart
UseRevisionCreateDate=true       //Preserves the release date
AllowMatchesInDateCheck=true     //Allows two content items to share the same time interval
SystemDateFormat=M/d/yyyy {h:mm[:ss] {aa}[zzz]}!mAM,PM


OracleTextSearch
SearchIndexerEngineName=OracleTextSearch
IndexerDatabaseProviderName=SystemDatabase   //Name of the Database Provider used to store the search index.
AdditionalEscapeChars=_:#

SOA Demo Community Seeding Utility

1. Download workflow-001-DemoCommunitySeedApp.zip from the link below:
https://java.net/projects/oraclesoasuite11g/downloads/directory/HumanWorkflow

2. Extract it. Deploy the “SOATestDemoApp.ear” file in the Weblogic server console. Choose Admin and SOA_SERVER1 servers as targets. Restart the Weblogic Admin and SOA_SERVER1 servers.

3. Access the deployed application using
http://localhost:8001/integration/SOADemoCommunity/DemoCommunitySeedServlet

4. Click "Submit" button to create the sample Users and Groups in Weblogic Server.

Check Oracle Apps/EBS version

Execute the following query:

SELECT release_name FROM apps.fnd_product_groups;


Now in case you want to create extensions to EBS OAF pages, refer to Doc ID 416708.1 to download the proper version of Oracle JDeveloper.

UCM: Component to reinitialize UCM components without restarting UCM

Created a helper component to reload the component's glue file, the query file, resource files, and template definition files, so that there is no need of restarting the UCM server while developing the components in development environment.

This component MUST NOT be deployed to customer's instance, and MUST NOT be included in the installation package.

public class UcmHelperService
  extends Service
{
  public static final String STATUS_CODE = "StatusCode";
  public static final String STATUS_MESSAGE = "StatusMessage";
  public static final String STATUS_SUCCESS = "0";
  public static final String STATUS_ERROR = "-1";
  protected static ComponentPackager m_componentPackager;
  
  public void reinitComponents()
  {
    try
    {
      String componentName = this.m_binder.getActiveAllowMissing("ComponentName");
      ComponentLoader.reset();
      ComponentLoader.initDefaults();
      
      ComponentLoader.load();
      IdcSystemLoader.loadComponentData();
      IdcSystemLoader.loadResources();
      if ((null != componentName) && (componentName.trim().length() > 0)) {
        reinitServices(componentName);
      } else {
        IdcSystemLoader.loadServiceData();
      }
      reinitQueries(componentName);
      this.m_binder.putLocal("StatusCode", "0");
    }
    catch (Exception e)
    {
      this.m_binder.putLocal("StatusCode", "-1");
      this.m_binder.putLocal("StatusMessage", e.getLocalizedMessage());
    }
  }
  
  protected static void trace(String message)
  {
    Report.trace("UcmHelperService", message, null);
  }
  
  protected static void traceBinder(DataBinder dataBinder)
  {
    if (dataBinder.getLocalData().isEmpty())
    {
      trace("binder.getLocalData is empty");
    }
    else
    {
      trace("(Sniffer) binder.getLocalData output");
      Iterator it = dataBinder.getLocalData().keySet().iterator();
      while (it.hasNext())
      {
        String key = it.next().toString();
        trace(key + " = " + dataBinder.getLocal(key));
      }
    }
  }
  
  private void reinitServices(String componentName)
    throws ServiceException, DataException
  {
    ServiceManager serviceManager = new ServiceManager();
    ResourceTrace.msg("!csComponentLoadServices");
    ResourceContainer resourcecontainer = new ResourceContainer();
    Vector vector = ComponentLoader.m_services;
    int i = vector.size();
    for (int j = 0; j < i; j++)
    {
      ComponentData componentdata = (ComponentData)vector.elementAt(j);
      if (componentdata.m_componentName.equalsIgnoreCase(componentName)) {
        reinitService(serviceManager, resourcecontainer, componentdata);
      }
    }
  }
  
  private void reinitService(ServiceManager serviceManager, ResourceContainer resourceContainer, ComponentData componentData)
    throws DataException, ServiceException
  {
    String s = componentData.m_file;
    String s1 = "!csComponentLoadSystemServices";
    if (!componentData.m_componentName.equalsIgnoreCase("default")) {
      s1 = LocaleUtils.encodeMessage("csComponentLoadName", null, componentData.m_componentName);
    }
    ResourceTrace.msg(s1);
    ResourceLoader.loadResourceFile(resourceContainer, s);
    Vector vector1 = componentData.m_tables;
    int k = vector1.size();
    for (int l = 0; l < k; l++) {
      serviceManager.addTable(resourceContainer, (String)vector1.elementAt(l), componentData);
    }
  }
  
  private void reinitQueries(String componentName)
    throws DataException, ServiceException
  {
    ResourceContainer resourcecontainer = new ResourceContainer();
    ResourceTrace.msg("!csComponentLoadQueries");
    Vector vector = ComponentLoader.m_queries;
    int j = vector.size();
    for (int k = 0; k < j; k++)
    {
      ComponentData componentdata = (ComponentData)vector.elementAt(k);
      String s9 = componentdata.m_file;
      boolean flag3 = true;
      String s10 = "!csComponentLoadSystemQuery";
      if (!componentdata.m_componentName.equalsIgnoreCase("default")) {
        s10 = LocaleUtils.encodeMessage("csComponentLoadName", null, componentdata.m_componentName);
      }
      if ((componentName == null) || (componentName.trim().equalsIgnoreCase(componentdata.m_componentName)))
      {
        ResourceTrace.msg(s10);
        DataLoader.cacheResourceFile(resourcecontainer, s9);
        Vector vector1 = componentdata.m_tables;
        int l = vector1.size();
        for (int i1 = 0; i1 < l; i1++) {
          QueryUtils.addQueryTable(this.m_workspace, resourcecontainer, (String)vector1.elementAt(i1), flag3, componentdata.m_componentName);
        }
      }
    }
  }

UCM: Customizing the Profiles Menu with Idoc Script

SCENARIO: 
Secure the Profiles navigation entries. Only the user with role admin will be able to see the HRResumes profile.

1. Under Profiles tab, select HRResumes profile. Verify that the Enabled check box is selected for “Restrict personalization links."



2. Select the “Has script for the check-in link” check box. Click Edit.



3. Click the Custom tab. Verify that the Custom check box is selected.


UCM: Handling SQL Queries in UCM service

In case a query have been defined in a query resource definition:

DataBinder db = new DataBinder();
db.putLocal("searchKey", searchKeyword);
db.putLocal("thName", THESAURUS_NAME);
db.putLocal("level", LEVEL);

ResultSet rs = m_workspace.createResultSet("CBIThesaurusSearch", db);
DataResultSet dataContainer = new DataResultSet();
dataContainer.copy(rs);
for (dataContainer.first(); dataContainer.isRowPresent(); dataContainer.next()) {
    System.out.println(dataContainer.getStringValueByName("THEVALUES"));
}


In case we are defining a query in the Java class itself:

String searchKeyword = m_binder.getLocal("ssUserText").toUpperCase().trim();

String maxCountRecord =
    "SELECT * FROM TABLE WHERE X_KEY = '" + key + "' AND X_ASSET_TYPE IS NOT NULL";

ResultSet resultSet = m_workspace.createResultSetSQL(maxCountRecord);
DataResultSet dataResultSet = new DataResultSet();
dataResultSet.copy(resultSet);
m_binder.addResultSet("RelatedSearchNavigation", dataResultSet);

UCM: Execute a PL/SQL Procedure from a service

This is my query resource definition
 name: (ORACLE.CALLABLE)searchQuery
 queryStr: {call RELEVANCY_SEARCH_PKG.RELEVANCY_SEARCH_COUNT (?,?,?,?)}
 parameters: p_ddocname varchar
             p_search_keyword varchar
             p_asset_type varchar
             p_message out:varchar


This is the Java method:
import intradoc.common.ServiceException;
import intradoc.common.SystemUtils;

import intradoc.data.CallableResults;
import intradoc.data.DataBinder;
import intradoc.data.DataException;
import intradoc.data.ResultSet;
import intradoc.data.ResultSetUtils;

import intradoc.server.Service;

import java.util.Properties;


public class AutoRelevancy extends Service {

    private static final String COMPONENT_DEBUG = "AutoRelevancy";

    public void calculateRelevancy() throws ServiceException, DataException {
        String searchKeyword = m_binder.getLocal("searchKeyword");

        try {
            if (m_binder.getLocal("dDocName") != null && (searchKeyword != null)) {

                String dDocName = m_binder.getLocal("dDocName");

                DataBinder db = new DataBinder();
                db.putLocal("dDocName", dDocName);
                ResultSet docInfoRS = m_workspace.createResultSet("QlatestDocInfoByName", db);

                Properties currentRowProp = ResultSetUtils.getCurrentRowProps(docInfoRS);

                final DataBinder binder = new DataBinder();

                binder.putLocal("p_ddocname", currentRowProp.getProperty("dDocName"));
                binder.putLocal("p_search_keyword", searchKeyword.toUpperCase().trim());
                binder.putLocal("p_asset_type", currentRowProp.getProperty("xasset_type"));

                CallableResults resultSql = this.m_workspace.executeCallable("searchQuery", binder);

                String v_message = resultSql.getString("p_message");
            }
        } catch (DataException d) {
            SystemUtils.trace(COMPONENT_DEBUG, "Exception" + d.getMessage());
        } catch (Exception e) {
            SystemUtils.trace(COMPONENT_DEBUG, "Exception" + e.getMessage());
        } finally {
            m_workspace.releaseConnection();
        }
    }
}

UCM: Customizing a Page's Action Menu

Here we will try to customize the interface of UCM to include an option to delete all revisions of a particular content.


We will develop a custom component like below:



This is the script written in the custom component:

<@dynamichtml custom_docinfo_menus_setup@>
 <!--c:include all other previous instances using super.-->
 <$include super.custom_docinfo_menus_setup$>
 <$if isFalse(dIsCheckedOut)$>
 <$exec rsAppendNewRow("PageMenusData")$>
 <$PageMenusData.nodeId = "DELETE_ALL_REVISIONS"$>
 <$PageMenusData.parentId = "CONTENT_ACTIONS"$>
 <$PageMenusData.label = "Delete All Revisions"$>
 <$PageMenusData.type = "item"$>
 <$PageMenusData.href = "javascript:deleteAllRevisions();"$>
 <$PageMenusData.loadOrder = 100$>
 <$endif$>
<@end@>

<@dynamichtml std_info_html_head_declarations@>
 <$include super.std_info_html_head_declarations$>
 <$if isFalse(dIsCheckedOut)$>
 <script type="text/javascript">
  function deleteAllRevisions() {
   var response = confirm("Are you sure you want to delete this content item and all revisions?");
   if (response) {
    window.location = "<$HttpCgiPath & "?IdcService=DELETE_DOC&dID=" & dID & "&dDocName=" & urlEscape7Bit(dDocName) & "&idcToken=" & idcToken$>"
   }
  }
 </script>
 <$endif$>
<@end@>


UCM: Computing Derived Metadata Values with Idoc Script

SCENARIO:
Compute the value of the Comments metadata dynamically during the check-in process. The Idoc Script code will put into the Comments metadata the number of empty metadata.

1. In the Edit Rule Field xComments window, verify that the Is derived field check box is selected. Click Edit.



2. The Edit Derived Value window appears. Click the Custom tab. Verify that the Custom check box is selected. Write the code below:

<$emptyFieldsCount = 0$>
<$emptyFieldsNames = ""$>
<$count = 0$>
[[%Get the list of custom and components metadata%]]
<$executeService("GET_METADEFS")$>

[[%Parse all custom and components metadata%]]
<$loopwhile rsNumFields("MetaFieldInfo")-1 >= count$>
     [[%Get the metadata field number: count%]]
     <$metadataName = rsFieldByIndex("MetaFieldInfo",count)$>
     [[%Get the value of the metadata number: count. The value is in the "#active" ResultSet%]]
     <$metadataValue = getValue("#active",metadataName)$>
     [[%Check if the value is empty%]]
     <$if strEquals(metadataValue,"")$>
          <$emptyFieldsCount = emptyFieldsCount + 1$>
          <$emptyFieldsNames = metadataName & " " & emptyFieldsNames$>
     <$endif$>
     [[%Increase counter to parse next metadata field%]]
     <$count = count + 1$>
<$endloop$>

[[%Force the derived value of the xComments metadata using the keyword "dprDerivedValue"%]]
<$dprDerivedValue = "User : <b>" & dDocAuthor & " </b> did not enter values for the following <b>" & emptyFieldsCount & "</b> custom and components metadata: " & emptyFieldsNames & "."$>

UCM: Group Metadata Fields using Global Rules

SCENARIO: Group the date fields of Release Date and Expiration date.

1. Create a new rule in Configuration Manager applet.




2. Click the Fields tab.



3. Repeat the above step for Expiration Date. Navigate to Check In Page to see the results.


UCM: Execute a service

From a Java filter:
CompInstallUtils.executeService(ws, "ADD_WORKFLOW", binder);


From a Service Handler
    private void executeService(final DataBinder serviceBinder, final String serviceName) throws ServiceException {
        try {
            trace("Calling service " + serviceName + ": " + serviceBinder.getLocalData().toString());
            m_service.getRequestImplementor().executeServiceTopLevelSimple(serviceBinder, serviceName, m_service.getUserData());
            trace("Finished calling service");
        } catch (final DataException e) {
            e.printStackTrace(System.out);
            throw new ServiceException(serviceName, e);
        }
    }


From a Service class:
Use the one provided in the book of Bex Huff.

UCM: Image Conversion Using DAM with ImageMagick

When a digital asset is checked in to Content Server, Digital Asset Manager creates multiple renditions of that asset. For images, the criteria for each rendition is defined in one of two files. The default renditions set is defined in the damconverter_basedefinitions.hda file and should not be modified.

Custom rendition sets can be added to a component resource file called extraRendition_definitions.hda. This file can be created with a standard text editor and must be located in a new directory named dam in the refinery IntradocDir/data/configuration/ directory. The full file path should be:

C:\Oracle\Middleware\user_projects\domains\base_domain\ucm\ibr\data\configuration\dam\extraRendition_definitions.hda

@Properties LocalData
ImageMagick=C:/ImageMagick/convert.exe
Imagemagick_Resize=-resize
Imagemagick_Thumbnail=-resize 80x80
Imagemagick_Preview=-resize 250x250
Imagemagick_Watermark=-resize 400x300 -font impact -weight bold -pointsize 32 -draw
@end

@ResultSet packedConversion
2
pcName
pcDescription
Training
Digital Photos at various sizes
@end

@ResultSet Training
6
extRenditionName
extEngine
extType
extSourceFile
extParameters
extDescription
Web
<$ImageMagick$>
web
<$InFilePath$>
<$Imagemagick_Watermark$> "gravity northwest fill white text 10,12 '<$dDocTitle$>'" "<$inFile$>" "<$outFile$>.jpg"
A 72 dpi JPEG no wider than 400 pixels and no higher than 300 pixels
Thumbnail
<$ImageMagick$>
thumbnail
<$InFilePath$>
<$Imagemagick_Thumbnail$> "<$inFile$>" "<$outFile$>.jpg"
A 72 dpi JPEG no wider or higher than 80 pixels
Preview
<$ImageMagick$>
preview
<$InFilePath$>
<$Imagemagick_Preview$> "<$inFile$>" "<$outFile$>.jpg"
A 72 dpi JPEG no wider or higher than 250 pixels
@end


@ResultSet ExtensionFormatMap
2
extension
format
jpg
image/jpeg
jpeg
image/jpeg
gif
image/gif
png
image/png
tif
image/tiff
tiff
image/tiff
bmp
image/bmp
@end

After a rendition set is added to the extraRendition_definitions.hda file, it must be made available as an option in the Image Rendition Set field on the Content Check In Form, using Configuration Manager.
To add the name of the rendition set as an option in Configuration Manager, perform these steps:
1. In the Configuration Manager applet, select the PackagedConversions information field and click Edit. The Edit Custom Info screen is displayed.
2. Add the name of the new result set as it is listed in the extraRendition_definitions.hda file's packedConversion result set. In this case, add "Training".

Now upload a new image in Content Server. In the “Image Rendition Set” option, select “Training”. Click on the Check In button. Once it is uploaded successfully, you will see the below screen



Click on the Rendition Information Tab.


Check this link for watermarking image using Imagemagick:
https://community.oracle.com/thread/3729733

UCM: Migration of contents into UCM using SQL* Loader and UTL_FILE

SCENARIO: The client have provided a CSV file which contains the metadata fields of the files that needs to be migrated into UCM. For this, you need to create a batch loader file which will be used by Batch Loader of UCM.

Creation of batch loader file involves 2 steps:
1. Moving data from external  files into a temporary table(here PNC_DATA) using SQL* Loader
2. Creation of UCM batch load file using UTL_FILE package

SQL* Loader:
It accepts the 2 source files:
1. Data CSV file, which will be provided by the client
2. CTL control file. It describes the task that the SQL*Loader is to carry out. The SQL*Loader control file contains information that describes how the data will be loaded. It contains the table name, column data types, field delimiters, etc.

1. Use the below SQL script to create the PNC_DATA table.
CREATE TABLE PNC_DATA
(
  ID             NUMBER,
  DOCTITLE       VARCHAR2(100 BYTE),
  DOCAUTHOR      VARCHAR2(100 BYTE),
  INVOICENUMBER  VARCHAR2(100 BYTE),
  INVOICEDATE    DATE,
  INVOICEAMOUNT  NUMBER,
  VENDORNAME     VARCHAR2(100 BYTE),
  SHIPTONAME     VARCHAR2(100 BYTE),
  ADDRESS        VARCHAR2(100 BYTE),
  ZIP            VARCHAR2(100 BYTE),
  PRIMARYFILE    VARCHAR2(100 BYTE),
  STATUS         VARCHAR2(100 BYTE),
  ERROR_MESSAGE  VARCHAR2(4000 BYTE)
)


ALTER TABLE PNC_DATA ADD (
  CONSTRAINT PNC_DATA_PK PRIMARY KEY (ID));


CREATE SEQUENCE PNC_DATA_SEQ
  MINVALUE 1
  START WITH 1
  INCREMENT BY 1
  CACHE 20;
  
  
CREATE OR REPLACE TRIGGER PNC_DATA_BIR 
BEFORE INSERT ON PNC_DATA 
FOR EACH ROW

BEGIN
  SELECT PNC_DATA_SEQ.NEXTVAL
  INTO   :NEW.ID
  FROM   DUAL;
END;
/

2. Create a control (CTL) file for SQL* Loader.
OPTIONS (SKIP=1)
LOAD DATA 
INFILE 'C:\PNC\mydata.csv'
APPEND
INTO TABLE PNC_DATA
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
 (DOCTITLE, DOCAUTHOR, INVOICENUMBER, INVOICEDATE DATE "MM/DD/YYYY", INVOICEAMOUNT, VENDORNAME, SHIPTONAME, ADDRESS, ZIP, PRIMARYFILE)

3. Get the CSV file from the client. A sample CSV file is attached with this document.
DocTitle|DocAuthor|InvoiceNumber|InvoiceDate|InvoiceAmount|vendorName|ShipToName|Address|Zip|PrimaryFile,,
0000024F|sysadmin|196328182|12/26/2002|2038.66|DELL|JIM MACDONALD|PO 20026306, IRVINE, CA|92618|G:/Projects/PNC/Sample invoice/0000024F.TIF
0000025A|sysadmin|292487395|3/18/2003|11124.15|DELL||16245 Laguna cannyon RD, IRVINE, CA|92618|G:/Projects/PNC/Sample invoice/0000025A.TIF
0000025B|sysadmin|237596557|2/14/2003|1095.22|DELL|JIM MACDONALD|16245  Laguna cannyon RD, IRVINE, CA|92618|G:/Projects/PNC/Sample invoice/0000025B.TIF
0000025C|sysadmin|224533134|1/27/2003|1084|DELL|RECEIVING|16245  Laguna cannyon RD, IRVINE, CA|92618|G:/Projects/PNC/Sample invoice/0000025C.TIF
0000025D|sysadmin|226712637|1/28/2003|20644.92|DELL|RECEIVING|16246  Laguna cannyon RD, IRVINE, CA|92619|G:/Projects/PNC/Sample invoice/0000025D.TIF
0000025E|sysadmin|223872293|1/29/2003|1166.62|DELL|JIM MACDONALD|16247  Laguna cannyon RD, IRVINE, CA|92620|G:/Projects/PNC/Sample invoice/0000025E.TIF

4. Put the CSV data and the CTL file in one directory, and run the sqlldr command from the command prompt (in Windows), under the user which owns the table created above.
sqlldr hr/hr control=C:\import.ctl

Log files will be created, import.log and import.bad. Verify these to make sure any rows were skipped. Otherwise the data should be added into the PNC_DATA table.


UTL_FILE package
1. First we must define a directory object which points to an existing filesystem directory on the server. We must grant the necessary access privilege on the directory object to the user who will perform the extract.
CONNECT / AS SYSDBA
CREATE OR REPLACE DIRECTORY EXTRACT_DIR AS 'C:\Extract';
GRANT READ, WRITE ON DIRECTORY EXTRACT_DIR TO HR;
GRANT EXECUTE ON UTL_FILE TO HR;

2. Compile the PL/SQL specification and then the body of PNC_KA_POC_PKG package. The sample is attached with this document.
CREATE OR REPLACE PACKAGE PNC_KA_POC_PKG
AS
   PROCEDURE MIGRATION_TEXTFILE;
END;
/

CREATE OR REPLACE PACKAGE BODY PNC_KA_POC_PKG
AS
   PROCEDURE PNC_VALIDATE_DATA
   AS
   BEGIN
      UPDATE PNC_DATA
         SET STATUS = 'E',
             ERROR_MESSAGE = ERROR_MESSAGE || ' - SHIPTONAME cannot be NULL'
       WHERE SHIPTONAME IS NULL;

      UPDATE PNC_DATA X
         SET STATUS = 'E',
             ERROR_MESSAGE =
                ERROR_MESSAGE || ' - INVOICENUMBER should be Unique'
       WHERE EXISTS
                (  SELECT COUNT (INVOICENUMBER)
                     FROM PNC_DATA
                 GROUP BY INVOICENUMBER
                   HAVING     INVOICENUMBER LIKE X.INVOICENUMBER
                          AND COUNT (INVOICENUMBER) > 1);

      UPDATE PNC_DATA
         SET STATUS = 'E',
             ERROR_MESSAGE =
                ERROR_MESSAGE || ' - SHIPTONAME format is not correct'
       WHERE INSTR (INVOICENUMBER, ' ') != 0;

      UPDATE PNC_DATA
         SET STATUS = 'E',
             ERROR_MESSAGE = ERROR_MESSAGE || ' - ZIP should be NUMBER'
       WHERE LENGTH (TRANSLATE (ZIP, '0123456789', '')) IS NOT NULL;

      COMMIT;
   END;

   PROCEDURE MIGRATION_TEXTFILE
   AS
      v_file     UTL_FILE.FILE_TYPE;
      cur_date   VARCHAR (30);

      CURSOR CSR_STAGING
      IS
         SELECT *
           FROM PNC_DATA
          WHERE STATUS IS NULL;
   BEGIN
      PNC_VALIDATE_DATA ();

      v_file :=
         UTL_FILE.FOPEN (location       => 'EXTRACT_DIR',
                         filename       => 'pncdata.txt',
                         open_mode      => 'w',
                         max_linesize   => 32767);

      cur_date := TO_CHAR (SYSDATE, 'MM/DD/YY HH12:MI AM');

      FOR cur_rec IN CSR_STAGING
      LOOP
         UTL_FILE.PUT_LINE (v_file, 'dDocTitle=' || cur_rec.DOCTITLE);
         UTL_FILE.PUT_LINE (v_file, 'dDocAuthor=' || cur_rec.DOCAUTHOR);
         UTL_FILE.PUT_LINE (v_file, 'dSecurityGroup=' || 'Public');
         UTL_FILE.PUT_LINE (v_file, 'dDocType=' || 'Invoice');
         UTL_FILE.PUT_LINE (v_file, 'xInvoiceNumber=' || cur_rec.INVOICENUMBER);
         UTL_FILE.PUT_LINE (v_file, 'xInvoiceDate=' || TO_CHAR (cur_rec.INVOICEDATE, 'MM/DD/YY'));
         UTL_FILE.PUT_LINE (v_file, 'xInvoiceAmount=' || cur_rec.INVOICEAMOUNT);
         UTL_FILE.PUT_LINE (v_file, 'xvendorName=' || cur_rec.VENDORNAME);
         UTL_FILE.PUT_LINE (v_file, 'xShipToName=' || cur_rec.SHIPTONAME);
         UTL_FILE.PUT_LINE (v_file, 'xAddress=' || cur_rec.ADDRESS);
         UTL_FILE.PUT_LINE (v_file, 'xZip=' || cur_rec.ZIP);
         UTL_FILE.PUT_LINE (v_file, 'dInDate=' || cur_date);
         UTL_FILE.PUT_LINE (v_file, 'primaryFile=' || cur_rec.PRIMARYFILE);
         UTL_FILE.PUT_LINE (v_file, '<>');
      END LOOP;

      UTL_FILE.FCLOSE (v_file);
   EXCEPTION
      WHEN OTHERS
      THEN
         UTL_FILE.FCLOSE (v_file);
         RAISE;
   END;
END PNC_KA_POC_PKG;
/

The purpose of writing PNC_VALIDATE_DATA method is to validate the data that is present in the table. Sometimes a particular column should contain a unique value, like INVOICENUMBER, while some data might not be in a proper format. For such rows, the status is marked as E (stands for error). Only the validated rows are processed further and are written in the batch loadfile.

3. Execute the PL/SQL Procedure using the below syntax to create the final UCM batch load file (pncdata.txt) in C:\Extract directory.
BEGIN
 PNC_KA_POC_PKG.MIGRATION_TEXTFILE;
END;

UCM: Validating file extension

1. Enter "IsDpSubmitErrorFatal=true" in the general configuration, and restart the server.
2. Create a global rule, with the activation conditions of "OnSubmit" for "Check In New" and "Check In Selected".
3. In the rule's "Side Effect" section, add the following code.

<$trace("#all", "#console")$>
<$strFileName=strReplace(primaryFile,".",",")$>
<$trace(strFileName, "#console")$>
<$exec rsMakeFromString("rsTempFile",strFileName,"ext")$>
<$exec rsSetRow("rsTempFile", rsTempFile.#numRows-1)$>

<$if strTrimWs(rsTempFile.ext) like "exe"$>
   <$abortToErrorPage("\n\nEXE files are not allowed.")$>
<$endif$>

Now using this way, we won't be able to restrict checking in exe files using DIS. For this, you have to change the idocScript code in the custom tab.

Before:
 ( (dpEvent like "OnSubmit") and
 (dpAction like "CheckinSel" or dpAction like "CheckinNew"))

After:
 ( (dpEvent like "OnSubmit" or dpEvent like "OnImport") and
 (dpAction like "CheckinSel" or dpAction like "CheckinNew" or dpAction like "NoAction"))

UCM: Archive only the folder structure

1. Enable the FolderStructureArchive component.

2. Define a new folder archive in Folder Archive Configuration page.

3. Open Archiver. Define the below custom query expression in the Export Query:
(Revisions.dDocName = '' OR Revisions.dDocName IS NULL)

Get the password of a User in Oracle Apps R12

1. Create a package get_pwd as follows:

--Package Specification
CREATE OR REPLACE PACKAGE get_pwd
AS
   FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
      RETURN VARCHAR2;
END get_pwd;
/

--Package Body
CREATE OR REPLACE PACKAGE BODY get_pwd
AS
   FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
      RETURN VARCHAR2
   AS
      LANGUAGE JAVA
      NAME 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String';
END get_pwd;
/

2. Run the below query:

SELECT usr.user_name,
       get_pwd.decrypt
          ((SELECT (SELECT get_pwd.decrypt
                              (fnd_web_sec.get_guest_username_pwd,
                               usertable.encrypted_foundation_password
                              )
                      FROM DUAL) AS apps_password
              FROM fnd_user usertable
             WHERE usertable.user_name =
                      (SELECT SUBSTR
                                  (fnd_web_sec.get_guest_username_pwd,
                                   1,
                                     INSTR
                                          (fnd_web_sec.get_guest_username_pwd,
                                           '/'
                                          )
                                   - 1
                                  )
                         FROM DUAL)),
           usr.encrypted_user_password
          ) PASSWORD
  FROM fnd_user usr
 WHERE usr.user_name = 'SYSADMIN';
/


RIDC: Download files in ZIP format

    public static void main(String[] args) throws IOException {
        IdcClientManager manager = new IdcClientManager();
        try {
            IdcClient idcClient = manager.createClient("idc://localhost:4444");
            IdcContext userContext = new IdcContext("weblogic");

            DataBinder dataBinder = idcClient.createBinder();
            dataBinder.putLocal("IdcService", "GET_ZIP_BUNDLE");
            dataBinder.putLocal("pkg:dDocName1", "HY000227");
            dataBinder.putLocal("pkg:dDocName0", "HY000001");
//            dataBinder.putLocal("pkg:Rendition1", "Primary");
//            dataBinder.putLocal("pkg:Rendition0", "Web");
            dataBinder.putLocal("bundleKeys", "pkg:dDocName,pkg:Rendition");
            ServiceResponse response = idcClient.sendRequest(userContext, dataBinder);
            InputStream is = response.getResponseStream();
            FileOutputStream fos = new FileOutputStream("bundle.zip");
            int read = 0;
            byte[] bytes = new byte[1024];
            while ((read = is.read(bytes)) != -1) {
                fos.write(bytes, 0, read);
            }
        } catch (IdcClientException ice) {
            ice.printStackTrace();
        }
    }


UCM: Limit check-in size and extension of the file

SCENARIO: We want to restrict the user to upload a file whose extension is .exe and whose size is more than 5 MB.

IMPLEMENTATION: To check the file extension, write a filter on postValidateCheckinData event. To check the file size, write a filter on validateStandard event.

postValidateCheckinData
Executed at the end of the action validateCheckinData and after the filter validateCheckinData. This is a good place for last-minute alterations of the metadata prior to a check-in.

validateStandard
Executed during update or check-in. This runs before the core validates the metadata fields, such as dReleaseState, dDocName, dRevClassID, dDocTitle, primaryFile, alternateFile, dCreateDate, dInDate, and dOutDate.

    private void checkFileExtension(DataBinder binder) throws ServiceException {
        String dExtension = binder.getLocal("dExtension");
        trace("dExtension: " + dExtension);
        String ExtensionsToControl = "";
        if (SharedObjects.getEnvironmentValue("ExtensionsToControl") != null) {
            ExtensionsToControl = SharedObjects.getEnvironmentValue("ExtensionsToControl");
        }
        trace("ExtensionsToControl: " + ExtensionsToControl);
        if (ExtensionsToControl.indexOf(dExtension) >= 0) {
            String msg = LocaleUtils.encodeMessage("csExtensionsToControl", null, dExtension);
            throw new ServiceException(msg);
        }
    }

    private void checkFileSize(DataBinder binder) throws ServiceException {
        //trace(binder.m_tempFiles.toString());
        String primaryFilePath = binder.getLocal("primaryFile:path");
        trace("primaryFilePath: " + primaryFilePath);
        File file = new File(primaryFilePath);
        long fileSize = file.length();
        trace("fileSize: " + fileSize);
        if (fileSize >= 5 * 1024 * 1024) {
            throw new ServiceException("This document is too large.");
        }
    }

Create an environment file as well:
ExtensionsToControl=exe,rar

I had also created a string resource file to display the error message in case the file extension matches with the one provided in the environment file:
<@csExtensionsToControl=Files of extension {1} cannot be uploaded.@>


NOTES
1. A better approach is provided in the link below:
http://sonaloraclewebcenter.blogspot.in/2015/04/ucm-validating-file-extension.html

2. If you want to check the mime type of the file and not the extension, use Apache Tika 1.7. 

UCM: Troubleshooting Cached Pages

When working with metadata, profiles and rules your browser may cache option list values and configurations.  You may experience making changes but not seeing those changes reflected in the page.  Follow these steps to attempt to resolve this.  The steps assume the use of Chrome as the browser.

  1. Open the Developer Tools (Press Ctrl+Shift+J)
  2. Select the tab labeled Network
  3. Right click in the white space
  4. Click Clear Browser Cache
  5. Click OK
  6. Close the Developer Tools

UCM: Troubleshooting Performance Issues

The most important tracing options that will help initially identify the problem are
system,systemdatabase,requestaudit,searchquery

Standard Weblogic UCM server logs in 11g are stored in the locations below:

D:\Oracle\user_projects\domains\ecm_domain\servers\UCM_server\logs\UCM_server.log
D:\Oracle\user_projects\domains\ecm_domain\servers\UCM_server\logs\UCM_server-diagnostic.log

Daily content server log files are stored in:
D:\Oracle\user_projects\domains\ecm_domain\ucm\cs\weblayout\groups\secure\logs\*.htm

Location of system audit information logs
D:\Oracle\user_projects\domains\ecm_domain\ucm\cs\data\trace \*.log

This value is set in the configuration variable TraceDirectory .

Environment Packages:
1. Login to UCM.
2. Go to Administration -> Environment Packager.
3. Click "Start packaging." This creates a zip file for uploading. Once the zip is created, it will go to the following directory:
$MW_HOME/user_projects/domains/<domain>/ucm/cs/weblayout/groups/secure/logs/env

UCM Integration with Flipfactory

Refer the following link: http://docs.oracle.com/cd/E29542_01/doc.1111/e26693/ibr_dam.htm#BABBHJEI

1. Enable the relevant components

2. Installing Digital Asset Manager Video Plug-ins

3. Sharing Directories with FlipFactory


4. Setting the Conversion Engine Shared Directory Path

VideoStagingDir=C:\\Video_Staging\\
#VideoStagingDirFactoryContext=C:\\Video_Staging\\
RefineryFlipFactoryWatchRootDir=C:\\Video_Watch\\
#RefineryFlipFactoryWatchRootDirFactoryContext=C:\\Video_Watch\\
DefaultMediaPhysicalRoot-L237653P1416200=D:/Oracle/user_projects/domains/base_domain/ucm/cs/weblayout/



5. Select Manage Factories

6. Right click on Factories and select a new Factory.

7. Add Monitor => Oracle IBR Monitor

8. The "in" directory of the Watch Folder. Here the factory looks back regularly whether a conversion job is pending or not.

9. Process/Analyze => Video Analysis

10. Right click on Products and select a new Product. I selected Quicktime.

11. Add Destinations => Oracle IBR Transport

12. Give a Rendition Name

13. Save the configurations.

14. Upload a video file. Once the conversion is over, the rendition information page looks like below:

UCM: Retrieve the vault and weblayout path of a content


public class RetrievePaths extends ServiceHandler {

    public static final String CLASS_NAME = "CreateHDAFile";
    public static final String DDOCNAME = "LTSCHAUDHARYHY000208";

    public void retrievePathFiles() throws ServiceException, DataException, IOException {
        m_binder.clearResultSets();
        m_binder.putLocal("dDocName", DDOCNAME);
        executeService(m_binder, "DOC_INFO_BY_NAME");
        FileStoreProviderHelper utils = this.m_service.m_fileUtils;
        String webViewableFilePath =
            utils.computeRenditionPath(m_binder, "webViewableFile", utils.m_context);
        String primaryFilePath =
            utils.computeRenditionPath(m_binder, "primaryFile", utils.m_context);
    }
}

Thanks to Ryan for this tip. More details in the link below: https://groups.yahoo.com/neo/groups/intradoc_users/conversations/topics/25937

UPDATE: Use the service GET_FS_DOC_INFO to get both the vault and weblayout path of a content. From the localdata, access the keys primaryFile and webViewableFile of the binder.

Oracle SES not certified on Windows 7

While installing Oracle SES on my Windows 7, I got the following error on Prerequisites Check page.

Checking operating system requirements ...
Expected result: One of 5.0,5.1,5.2,6.0
Actual Result: 6.1
Check complete. The overall result of this check is: Failed <<<<
Problem: Oracle Database 11g is not certified on the current operating system.
Recommendation: Make sure you are installing the software on the correct platform.

To solve this problem I modified the definition for Windows 7 in the refhost.xml file, setting the version value as 6.1 instead of 6.0.

This file’s location on my system is:
C:\Users\sonal\AppData\Local\Temp\OraInstall2014-04-01_10-09-26PM\db

    <!--Microsoft Windows Vista-->
    <OPERATING_SYSTEM>
      <VERSION VALUE="6.1"/>
    </OPERATING_SYSTEM>
  </CERTIFIED_SYSTEMS>

After modifying the line in the xml file, I clicked the Retry button on installation window. It worked!

UCM: Common and Useful Filters

addFiles
• During checkin, executed immediately before the uploaded files are placed into the vault folder

checkScheduledEvents
• Executed after checking if it is time to run scheduled events, such as the compaction of the database or the removal of the cache, which is performed every few hours. The check itself is executed every five minutes.
• A good place to add scheduled actions.

alterUserCredentials
• Executed at the end of retrieveUserDatabaseProfileData to enable temporary alteration of user credentials over the scope of a single request for any purpose

validateStandard
• During update or checkin, executed before validating some of the data, such as dReleaseState, dDocName, dRevClassID, dDocTitle, primaryFile, alternateFile, dCreateDate, dInDate, and dOutDate
• Example use case: append the current date to the title of a document after checkin

extraBeforeCacheLoadInit
• Executed during server initialization, after database connections have been established, but before the data in the database has been cached
• A good place for database table manipulation

postValidateCheckinData
• Executed at the end of the action validateCheckinData after the filter validateCheckinData and the content profiles have been evaluated
• This is a good hook for last-chance metadata validation for checkins.

postWebfileCreation
• Executed after the file is placed in the weblayout directory

prepareHttpResponseHeader
• Executed before the HTTP response is created for every service call

preComputeDocName
• Used to adjust dDocName during a checkin after the AutoNumberPrefix (if any) is applied, but before validation is done

validateCheckinData
• During checkin or update, executed before validating some of the data, such as account name, revision label, and field lengths and the custom document information

evaluateGlobalRulesAndProfile
• Executed before content profiles are evaluated; can be used to set flags to trigger profile specific behavior, such as :defaultValue and :isExcluded.

UCM: Content Folios


UCM: Delete a folder and all the contents inside it

Use COLLECTION_DELETE_LOT service.
NOTE: This service works for Folders_G and not for Framework Folders component.

DataBinder serviceBinder = idcClient.createBinder();

serviceBinder.putLocal("IdcService", "COLLECTION_DELETE_LOT");
serviceBinder.putLocal("collectionselect0", "true");
serviceBinder.putLocal("fromCollectionisLink0", "0");
serviceBinder.putLocal("fromdCollectionID0", "814720879757000011");//child folder which we want to delete
serviceBinder.putLocal("fromhasCollectionID0", "1");

ServiceResponse response = idcClient.sendRequest(userContext, serviceBinder);
DataBinder responseBinder = response.getResponseAsBinder();

Few Unix Commands

To zip setup directory, enter:
zip -r backup.zip setup


To decompress a zip file in Unix, enter:
unzip filename.zip


To transfer a file from one unixbox to another:
scp -r filename user@hostname:targetdirectorylocation
e.g.:
scp -r backup.zip oracle@adprvdev11.corp.com:/u01/app/oracle/admin/prod_wc_domain/ucm_cluster_files/ucm/cs/archives


To check logs in weblogic server:
cd /apps/Oracle/Middleware/user_projects/domains/partnernet_prod/servers/reporting_App2_1/logs
ls -latr
tail -f reporting_App2_1.log

UCM: Maximum Search Results Using ORACLETEXTSEARCH limited to 2048 in UCM10g

There is a database patch that addresses this OracleTextSearch issue. Please download and apply patch 12582138 from the link below:

https://updates.oracle.com/Orion/SimpleSearch/process_form?search_type=patch&patch_number=12582138&plat_lang=226P&display_type=&search_style=8&orderby=&direction=&old_type_list=&gobuttonpressed=&sortcolpressed=&tab_number=&c_release_parent=product&c_product_child=release

NOTE: Upgrading to Oracle Database 11.2.0.4 or higher has the patch included.


UPDATE: The value of (ORACLETEXTSEARCH)MaxResultCount is set as 2048 in SearchEngineRules table. So you can also override this limit by creating a custom component.

UCM: !csJdbcGenericError

As the error name indicates, this is a general exception related to database access (JDBC stands for Java Database Connectivity). To get more data about the underlying error, try the following:

  1. In the Administration menu, choose System Audit and enable systemdatabase tracing. Click the Full Verbose checkbox for maximum detail, and the Save checkbox to preserve this change across server restarts.
  2. Edit your config.cfg file and set SecureDataAllowedIntoStatusMessage=true. Reboot the server. 

Repeat the operation that causes the error, and review the trace and UCM diagnostic logs to get more information on the error.


NOTE: First check the trace to find the issue. Use "requestaudit, searchquery, indexer, systemdatabase".
If not resolved, then update the config file with above configuration, and then update the parameters in the trace with "searchquery, systemdatabase".

UCM: Customizing "Quick Search" to search specified metadata fields

Add the QuickSearchFields settings in the config.cfg file.
QuickSearchFields=dDocName|dDocTitle|xComments|dDocFullText

In order to make the above setting work with the full text search solutions (DATABASE.FULLTEXT and OracleTextSearch) as well as DATABASE.METADATA, the above setting will need to be paired with the setting listed below in the config.cfg file:
QuickSearchOperators=hasAsSubstring,hasAsWord,hasAsWord,fullText

*** The default operator for Quick Search is "hasAsWord".***

To emulate the same search in idoc:
dDocName <SUBSTRING> `xxx` <AND> dDocTitle <CONTAINS> `xxx` <AND> xComments <CONTAINS> `xxx` <AND> <ftx>xxx<ftx>

For more info:
https://blogs.oracle.com/kyle/entry/adding_fields_to_quick_search
http://www.redstonecontentsolutions.com/technical-blog/adding-fields-to-quicksearch

Installation of Webcenter Sites on Weblogic

Changes in startWebLogic.cmd
set JAVA_OPTIONS=-Djava.io.tmpdir=D:\Oracle\Middleware\user_projects\domains\sites_domain\servers\AdminServer\tmp -Dfile.encoding=UTF-8 -Dnet.sf.ehcache.enableShutdownHook=true -Djava.net.preferIPv4Stack=true -Duser.timezone=UTC %SAVE_JAVA_OPTIONS%

set SAVE_JAVA_OPTIONS=

set CLASSPATH=D:\Sites\bin;%SAVE_CLASSPATH%

set SAVE_CLASSPATH=


Changes in setDomainEnv.cmd
call "%WL_HOME%\common\bin\commEnv.cmd"

set WLS_HOME=%WL_HOME%\server

set PRE_CLASSPATH=D:\Oracle\Middleware\user_projects\domains\sites_domain\CS\WEB-INF\lib\jstl-api-1.2.jar;D:\Oracle\Middleware\user_projects\domains\sites_domain\CS\WEB-INF\lib\log4j-1.2.16.jar;D:\Oracle\Middleware\user_projects\domains\sites_domain\CS\WEB-INF\lib\MSXML.jar;D:\Oracle\Middleware\user_projects\domains\sites_domain\CS\WEB-INF\lib\commons-lang-2.4.jar;%PRE_CLASSPATH%

if "%JAVA_VENDOR%"=="Sun" (
 set WLS_MEM_ARGS_64BIT=-Xms512m -Xmx2048m
 set WLS_MEM_ARGS_32BIT=-Xms512m -Xmx2048m
) else (
 set WLS_MEM_ARGS_64BIT=-Xms512m -Xmx2048m
 set WLS_MEM_ARGS_32BIT=-Xms512m -Xmx2048m
)

Self-Study Learning Series for Oracle WebCenter Enterprise Capture

The following learning videos are available:
  • WebCenter Enterprise Capture Overview: This self-paced course provides an overview to WebCenter Enterprise Capture.
  • WebCenter Enterprise Capture Installation and Configuration: This self-paced tutorial walks you through the installation and configuration of WebCenter Enterprise Capture.
  • Configuring WebCenter Enterprise Capture Security: This self-paced tutorial covers how to assign permission to users for both the Workspace Console and the Client applications.
  • WebCenter Enterprise Capture Client Application Tour: This self-paced course provides a tour of the WebCenter Enterprise Capture Client application.
  • Configuring WebCenter Enterprise Capture for Processing Expense Reports: This self-paced tutorial walks you through how to configure WebCenter Enterprise Capture for the automatic processing of expense reports.
Link: https://apex.oracle.com/pls/apex/f?p=44785:24:109501904362886::NO:24:P24_CONTENT_ID%2CP24_PREV_PAGE:10004%2C16

Source: https://blogs.oracle.com/webcenteralerts/entry/self_study_learning_series_for


For step-by step instructions, follow the use case explained for processing expenses as provided in the link below:
http://docs.oracle.com/cd/E29542_01/doc.1111/e37898/expenses.htm#sthref128

Webcenter Capture: View printIn statements in Java Console

For developing and incorporating scripts, Capture uses the JavaScript script engine included with the Java Runtime Environment. The scripts also writes out a line (printIn) to the java console for each script event, for verification or debugging purposes.

importClass(java.awt.event.KeyEvent);

function ScriptStart() {
   println("ScriptStart");
}

function BatchScanBegin(event) { // BatchScanEvent
   println("BatchScanBegin");
}
...
...
...

To view the printIn statements, go to Control Panel. Click Java --> Advanced tab. Under Java Console, set the property as Show Console. Apply and OK.


UCM: CHECKIN_NEW service using RIDC to upload a file

SCENARIO: This is an ADF application where the user will enter metadata fields about the content file, upload the content in UCM. The application will call the CHECKIN_NEW service using RIDC. On successful upload, it will display a message.

PREREQUISITES: Set IntradocServerPort=4444 in the intradoc.cfg file, if it is not present.
Append *.*.*.* to SocketHostAddressSecurityFilter parameter in config.cfg file, to enable connection via RIDC API remote connection.

This sample application was created using JDev 11.1.1.7. This is the main code:

    public void onFileUpload(ActionEvent actionEvent) {
        try {
            IdcClientManager manager = new IdcClientManager();
            IdcClient idcClient =
                manager.createClient("idc://192.168.2.8:4444");
            IdcContext userContext = new IdcContext("sysadmin");

            UploadedFile uploadedFile = (UploadedFile)file.getValue();

            DataBinder serviceBinder = idcClient.createBinder();
            serviceBinder.putLocal("IdcService", "CHECKIN_NEW"); //CHECKIN_UNIVERSAL
            serviceBinder.putLocal("dDocType", dDocType);
            serviceBinder.putLocal("dDocTitle", dDocTitle);
            serviceBinder.putLocal("dDocAuthor",
                                   ADFContext.getCurrent().getSecurityContext().getUserName());
            serviceBinder.putLocal("dSecurityGroup", "Public");
            try {
                serviceBinder.addFile("primaryFile",
                                      new TransferFile(uploadedFile.getInputStream(),
                                                       uploadedFile.getFilename(),
                                                       uploadedFile.getLength()));
            } catch (IOException e) {
                throw new UCMException("Primary File Error: " +
                                       e.getMessage());
            }

            ServiceResponse response =
                idcClient.sendRequest(userContext, serviceBinder);
            DataBinder responseBinder = response.getResponseAsBinder();
            System.out.println(responseBinder);
            DataObject localData = responseBinder.getLocalData();

            if (localData.get("StatusCode").equals("0")) {
                addFacesMessage(FacesMessage.SEVERITY_INFO,
                                localData.get("StatusMessage"));
            }
        } catch (IdcClientException e) {
            e.printStackTrace();
        } catch (NullPointerException e) {
            e.printStackTrace();
        }
    }

Download RIDCCheckin.rar, the sample application from the file cabinet.

Saturday, April 4, 2015

UCM: Creating a Top Level Folder with No Parent Folder

Out of the box two folders are created and they are Contribution Folder and Library Folders. If you want to create another top level folder you can use the IDC Service COLLECTION_ADD. You can call this service through HTTP by executing the following command in a browser window:

http://HOST_NAME/cs/idcplg?IdcService=COLLECTION_ADD&hasParentCollectionID=true&dParentCollectionID=-1&dCollectionName=FOLDER_NAME&force=1&idcToken=IDC_TOKEN

where
HOST_NAME is your Content Server’s host/cluster name
FOLDER_NAME is the Name of the Parent Folder you want to create
IDC_TOKEN is your environments unique token. You can find this by performing the following:
Click on Browse Content > Contribution Folders > View source in Browser > Click Edit > Find: idcToken