Monday, August 12, 2013

Images in XML Publisher

  1. Insert a dummy image in your template.
      In Microsoft Word's Format Picture dialog box select the Web tab. Enter the
      following syntax in the Alternative text region to reference the OA_MEDIA directory:
    url:{'${OA_MEDIA}/image name'}
    For example, enter:
    url:{'${OA_MEDIA}/ORACLE_LOGO.gif'} 
  2. Picture properties from Word 2003.
  3. Ensure that the image file is in OA_MEDIA
  4. Then, from the XML Publisher Administrator resp, upload the edited template into the Template record.

    Also see Dynamic Images in XML Publisher

Friday, August 9, 2013

Some useful Unix commands for shell scripting


IF-ELSE

if [ "$value" -eq "0" ] || [ "$value" -ge "2" ]; then
    echo "condition met"
else
    echo "condition not met"
fi

Comparisons:
-eq
equal to
-ne
not equal to
-lt
less than
-le
less than or equal to
-gt
greater than
-ge
greater than or equal to


Exit Host concurrent program with Error

exit 2;

 Linux Find and Move Archive files older than N days

find $frompath -type f -mtime +$age -exec mv {} $archive \;

Obtain value from string

echo $value | cut -f1 -d"."

Command will return the value starting to until “.” is found.
Test.txt will return Test

Using SUBSTR in Unix

echo $name | awk '{ print substr( $0, 0, length($0)-4 ) }'

Command will return name starting from 0 to (lengthofstring)-4
Test.txt will return Test