Friday, April 10, 2015

TCC: Changing Entity Tree Depth

 

While working with the Taleo Connect Client, sometimes you will need to work with complex hierarchy levels in the Entity tree. I am talking of this tree structure on the right side of your TCC Designer:           Cleartext.blogspot.com

tmp8CB9

If you start opening up the levels in the entity, you can go down to four levels. That is the default setting after installation. To go further down, you will need to increase the depth of this entity tree. This is done via Window-> Preferences   Cleartext.blogspot.com

tmp6FA9

Try increasing the value of Depth , under the Client -> Design option. And restart the TCC exe. But do be careful, entering large values can cause your TCC client to crash.  When I entered a value of 10 and restarted, the exe would not open up. And it started throwing java heap related errors. The change you make is global , and will reflect in all the products in the Installation Pack.

This article first appeared on Cleartext.blogspot.com

Wednesday, April 8, 2015

TCC - Exporting Attachments

 

This is something I struggled a lot with, and I am posting this in the hope that the next person struggling with this will find it helpful.

Taleo Enterprise Edition has a complex data model, and this becomes a problem when it comes to mass updates/exports. They provide a windows tool called the Taleo Connect Client (TCC) for this purpose. But the tool does not provide any out-of-box option to export/import files and attachments. For this purpose, consultants were using a custom library called TCCCustomSteps. But there is very little documentation around the subject area, and automating it requires bat files.

cleartext.blogspot.com

1:First, download the TCCCustomSteps library. This used to be hosted on Taleo's knowledge exchange forum, but the links no longer work. You can download a copy from here.

2:Extract the jar files into the \extensions\exernaljars\ folder under your TCC installation.

image

3. There is a product defect in current releases of TCC, you will get jar files when you try to use the TCCCustomsteps library. The fix is to replace commons-lang-2.0.jar with commons-lang-2.6.jar [TCC installation folder]\lib\endorsed.

4. Restart your TCC client.

5. Set up your TCC export and configuration files. Choose XML as the output type in both the files, CSV won't do. In the Projections tab of the export file, map the filename and file contents fields.

image

image

6. Create your TCC config file now, you can choose to create it from the  export file created in the previous step. In the projections tab, remove the StripSoap step, and add an XSL transformation step. cleartext.blogspot.com

image

The XSL step is to filter out only the tags required for the ExtractFile step. Here is the contents of the XSL file:

--------------------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
    xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
    xmlns:to="http://www.taleo.com/ws/integration/toolkit/2005/07"
    xmlns:util="http://www.mavixconsulting.com/2013/XSL/transform"
    exclude-result-prefixes="to util">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>

<xsl:template match="to:record">
<xsl:element name="file">
    <xsl:attribute name="path">
        <xsl:value-of select="./to:field[@name='FirstName']"/><xsl:value-of select="./to:field[@name='LastName']"/>_<xsl:value-of select="./to:field[@name='AttachedFiles,FileName']"/>
    </xsl:attribute>
    <xsl:element name="content">
        <xsl:value-of select="./to:field[@name='AttachedFiles,FileContent']"/>
    </xsl:element>
</xsl:element>

</xsl:template>
</xsl:stylesheet>

---------------------------------------------------------------------------------------------------------------------------------------

Here is the content of the XML file: cleartext.blogspot.com

---------------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<files>
[RECORD_OUTPUT]
</files>

---------------------------------------------------------------------------------------------------------------------------------------

7. Add the TCCCustom Step in the config file. For this, add one more "Custom Step" in the "Post-Processing" tab, and select Custom step and "Default custom step" as options.

image

8. For Java Class, enter "com.taleo.integration.client.customstep.xml.ExtractAttachedFilePostStep". Add the remaining values are below:

image

9. Save the config file and run it. The first time you run the export, you might want to change the filter to select a single record and text the export. When the run completes, the file attached will be exported into the output folder.

cleartext.blogspot.com

And that is all. There are other classes in the JAR which can be used to change filters , convert to PDF, and further manipulate the xml file.

 

This article first appeared on cleartext.blogspot.com

Sunday, April 5, 2015

TBE: CSS fix for login area in CWS

 

Ok, a little expansion first. This is a CSS fix for the login area of the Career Website using Taleo Business Edition (TBE). The Careers Web Site (CWS), is Taleo's portal to get job-searching candidates to register and enter their information. TBE provides options to set up multiple CWS pages for different job types, but they will all inherit styles from TBE's cloud service. The login area is one such place in the page which cannot be customized. Due to an existing product defect, the text in the login area is misplaced and misaligned.

cleartext.blogspot.com

Eg: this is from one of many TBE CareerSites.

tmp25F8

Some other examples:

tmp3738

tmpA26A

tmp3A94

 

tmp739F

tmp3BEF

 

and so on…..cleartext.blogspot.com

Do you see the pattern ? In all of these sites, the text "Re-type new password" appears misaligned. The placement of this text cannot be controlled from within TBE, the login id and password fields are always together.  This is because this form layout is downloaded from TBE's public web servers, like most cloud applications, and thus the layout will be similar for any TBE user. Only minor UI enhancements like font type and size is inherited from the base parent website.

Now for the fix:

This simple form issue can be fixed with a minor CSS tweak into the CWS header itself. Just insert the following into the header enclosed inside text/css sections:

tmp376D

Save the header and try the CWS again, you should see the login area move into place something like this:

tmpD63D

Now the labels all appear in alignment on the left side, and the gap above the third field is removed.

To see a complete Career Web Site designed by me, see here.

 

 

 

 

This article first appeared on cleartext.blogspot.com

Saturday, April 4, 2015

BIP Logs

 

A quick roundup on how to set up the log levels on a BIP setup.

On the BIP Desktop Addon:

Here is how to increase Log levels on your windows machine, running the BIP Destop addon

cleartext.blogspot.com

1.Find out the Java folder your Word add on is using.
In side your Word's Addin Tab, go to BIPublisher -> Tools -> Options -> Preview

tmp2EF8

2. In this java folder, go to /lib/ folder, and create a file named xdodebug.cfg

3. Add these two lines the xdodebug.cfg file:

LogLevel=STATEMENT
LogDir=C:\xdo_logs

4.Create a folder named xdo_logs under C:\  Next time you preview a report on your addon, BIP will create logs in the folder.

This article first appeared on cleartext.blogspot.com

Alternate: TemplateViewer

If you want a quick method to get logs without making these changes, you could simply use the TemplateViewer jar file. It will be under the TemplateViewer folder under the BIP addon installation. For me, it was under :

C:\Program Files (x86)\Oracle\BI Publisher\BI Publisher Desktop\TemplateViewer\tmplviewer.jar

1: Just run the jar file in Windows.

tmp841B

 

2:Use the browse button to go a folder where you have your RTF template & XML data file.

3:In the left pane, select the XML file, and in the right pane, select the RTF file you need to test.

tmpACC2

4. Before you run the report, go to the Settings tab, and select log leve as Maximum.

tmp8B31

5. Click on the Start Processing button, to see the logs getting generated and the preview being generated.

On a BIP Server:

Here are the steps to change your BI Publisher Enterprise Server to be in a debug mode:

  1. Login to BIP as Administrator
  2. Select Admin -> System Maintenance -> Server Configuration
  3. Change Debug Level to ‘Debug’ under General Properties
    clip_image001
  4. Click on the ‘Apply’ button and restart the server.

 

When set to maximum log level, BIP will generate the logs, and in addition, create a .xml file, .xsl file, and a .fo file. The XML file will contain the dataset used to generate the report. The .fo file contains the final output, and can be renamed to PDF or whatever output you had chosen and it will open up in its viewer.

 

Happy BIP ! and Happy Easter !

This article first appeared on cleartext.blogspot.com

 

This article first appeared on cleartext.blogspot.com

Thursday, April 2, 2015

java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.defaultIfEmpty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String

 

While using the Taleo Connect Client (TCC) for some advanced configurations , for instance for attachments, you might run into some weird java related errors.

 

java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.defaultIfEmpty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    at com.taleo.integration.client.customstep.BaseCustomStep.init(BaseCustomStep.java:120)
    at com.taleo.integration.client.customstep.xml.ExtractAttachedFilePostStep.init(ExtractAttachedFilePostStep.java:424)
    at com.taleo.integration.client.step.BaseCustomStep.init(BaseCustomStep.java:58)
    at com.taleo.integration.client.step.CustomStepWrapper.init(CustomStepWrapper.java:111)
    at com.taleo.integration.client.workflow.WorkflowManager.addSteps(WorkflowManager.java:1006)
    at com.taleo.integration.client.workflow.WorkflowManager.addPostProcessSteps(WorkflowManager.java:977)
    at com.taleo.integration.client.workflow.WorkflowManager.createWorkflow(WorkflowManager.java:172)
    at com.taleo.integration.client.workflow.WorkflowManager.execute(WorkflowManager.java:328)
    at com.taleo.integration.client.rcp.job.ConfigurationExecutionJob.run(ConfigurationExecutionJob.java:109)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)

 

 

It turns out that the issue was with the TCC installer itself. The fix is to replace commons-lang-2.0.jar with commons-lang-2.6.jar [TCC installation folder]\lib\endorsed

Oracle Sucks !

Wednesday, March 18, 2015

Understanding SQL's Null

 

Tony Hoare invented the null reference in 1965, and he considers it his "billion-dollar mistake" for the amount of trouble it has caused. Even today, SQL's null value is the cause of several common mistakes.

Let’s go over the most egregious.

Equals Null

These two queries return the exact same result on a users table with many rows:

select * from users where deleted_at = null;
-- result: 0 rows

select * from users where deleted_at != null;
-- result: 0 rows

How can that be? It's because null represents an "unknown" type. This means it doesn't make sense to compare null to anything else with normal conditional operators. Null isn't even equal to itself:

select null > 0;
-- result: null

select null < 0;
-- result: null

select null = 0;
-- result: null

select null = null;
-- result: null

The right way to compare values with null is with the is, and is not operators:

select * from users 
where deleted_at is null;
-- result: all non-deleted users

select * from users
where deleted_at is not null;
-- result: all deleted users

If you want to check if two columns are different, you can use is distinct from:

select * from users
where has_address is distinct from has_photo
-- result: users with an address or
-- photo, but not both

Not in Null

One handy way to filter rows is with a subselect. For example, if you wanted the userswho did not have any packages, you could write a query like this:

select * from users 
where id not in (select user_id from packages)

But if one of the rows in packages has a null user_id, this query will return no results! To understand why this happens we need to factor the query like the SQL compiler does. Here's a simpler example:

select * from users 
where id not in (1, 2, null)

Which translates to:

select * from users 
where id != 1 and id != 2 and id != null

As we now know, id != null is an unknown value, null. Using and on any value withnull becomes null, so all of the other and conditions fall away. No rows match the resulting query since null is not equal to true.

If the condition is inverted, the query works fine. This time we'll look for users withpackages.

select * from users 
where id in (select user_id from packages)

Which we can simplify for the example:

select * from users 
where id in (1, 2, null)

This query translates to:

select * from users 
where id = 1 or id = 2 or id = null

Since the where clause is a list of or conditions, it doesn't matter that one of them is null. That condition is simply ignored because non-true values do not change the evaluation of the rest of the clause.

Sorting Nulls

When it comes to sorting, nulls are considered the largest possible value. This can lead to some frustrating queries when trying to sort values descending, since all the nulls will be on top.

This query is meant to show the users ranked by their points, but it's putting users without any points first!

select name, points
from users
order by 2 desc;
-- null points sort above
-- any number of points!

There are two ways to deal with this. The easiest way is to get rid of those nulls in the output or the comparison using coalesce:

-- treat nulls as 0 in output
select name, coalesce(points, 0)
from users
order by 2 desc;

-- keep nulls in output, but sort as 0
select name, points
from users
order by coalesce(points, 0) desc;

And if your database supports it, you can instead tell it where to put nulls when sorting with nulls first or nulls last:

select name, coalesce(points, 0)
from users
order by 2 desc nulls last;

Of course, nulls can also be used to prevent errors. One great use of nulls is in dealing with divide by zero errors.

Divide by Zero

Divide by zero errors are especially painful. Queries that ran fine yesterday all of a sudden are failing with divide by zero errors. One common solution is to check if the denominator is 0 before dividing with a case statement:

select case when num_users = 0 then 0 
else total_sales/num_users end;

The case statement approach is verbose and duplicates the denominator. That's OK if the denominator is simple, but if it's an expression, you're likely to get more bugs if you change the query later.

Here we can use null to our advantage. Use nullif on the denominator to make the denominator null instead of zero. Rather than failing, the query will return null on days where num_users = 0.

select total_sales/nullif(num_users, 0);

If you prefer the result to be 0 or anything else instead of null, use coalesce on the previous query:

select coalesce(total_sales/nullif(num_users, 0), 0);
-- nulls results become 0

Conclusion

Tony Hoare may regret his mistake, but at least it’s easy to work around the issues that null presents. Now go forth with your new knowledge and keep null from nullifying your future query results!

Monday, March 2, 2015

TBE: Enabling General Application in Career Web Site

 

Taleo Business Edition (TBE) is Oracle's recruiting application offering for small to mid-sized companies. It does not have the full feature set available in Tale Enterprise Edition, and the system is deliberately watered down to allow quick setup and faster go-live. The system is also not well documented, and sometimes you have to hunt across the application to implement the simplest settings.

Like when we tried to turn on General Application in the Career Web Site.

1: Go to Administration -> Customize Recruit. Click on "Careers Website Pages"

tmpDE81 2:  Edit the Job Search Pages.

tmpE97A

3: In the next page, just unhide the two entries for "General Application" and its header section.

tmp723A

 

This is weird, because we expected some kind of global parameter which can be set to turn on such features. Instead, this configuration change is the only way to turn this on.