SlideShare a Scribd company logo
Idoc Script Syntax
 Idoc Script Tags
Idoc Script commands begin with <$ and end with $> delimiters. For example:
<$dDocTitle$>
<$if UseGuiWinLook and isTrue(UseGuiWinLook)$>
Idoc Script Comments
You can use standard HTML comments or Idoc Script comments in Idoc Script code. An Idoc Script comment
begins with [[% and closes with %]] delimiters. For example:
<!-- HTML Comment -->
[[%My Comment%]]
----------------------------------------------------------------------------------------------------
Variables
A variable enables you to define and substitute variable values.
 A value can be assigned to a variable using the structure:
 <$variable=value$>
For example, <$i=0$> assigns the value of 0 to the variable i.
 Variable values can also be defined in an environment resource (CFG) file using the following
name/value pair format:
variable=value
Idoc Script supports multiple clauses separated by commas in one script block.
For example, you can use <$a=1,b=2$> rather than two separate statements: <$a=1$> and <$b=2$>.
Referencing a Variable in a Conditional
The following structure can be used to evaluate the existence of a variable:
<$if variable_name$>
If the variable is defined, this conditional is evaluated as TRUE. If the variable is not defined or it is defined as an
empty (null) string, it is evaluated as FALSE.
--------------------------------------------------------------------------------------------------------
Functions
Idoc Script has many built-in global functions. Functions perform actions, including string comparison and
manipulation routines, date formatting, and ResultSet manipulation. Some functions also return results, such as
the results of calculations or comparisons.
Information is passed to functions by enclosing the information in parentheses after the name of the function.
Pieces of information that are passed to a function are called parameters. Some functions do not take
parameters; some functions take one parameter; some take several. There are also functions for which the
number of parameters depends on how the function is being used.
Personalization functions refer to user properties that are defined in personalization files, also called user topic
files. Each user's User Profile settings, personal links in the left navigation bar, and workflow in queue information
are all defined in user topic files, which are HDA files located in
the WC_CONTENT_ORACLE_HOME/data/users/profiles/us/username/ directories.
The following global functions reference user topic files:
 "utGetValue"
 "utLoad"
 "utLoadResultSet"
For example, the Portal Design link in a user's left navigation bar is generated from the following code in
the pne_nav_userprofile_links include (located in
the WC_CONTENT_ORACLE_HOME/shared/config/resources/std_page.htm resource file). If
the portalDesignLink property in
the WC_CONTENT_ORACLE_HOME/data/users/profiles/us/username/pne_portal.hda file is TRUE, the link is
displayed:
<$if utGetValue("pne_portal", "portalDesignLink") == 1$>
<$hasUserProfileLinks=1$>
<tr>
<td colspan=2 nowrap align="left">
<a class=pneLink
href="<$HttpCgiPath$>?IdcService=GET_PORTAL_PAGE&Action=GetTemplatePage&Page=PNE_PO
RTAL_DESIGN_PAGE">
<$lc("wwPortalDesign")$></a>
<td>
</tr>
<$endif$>
---------------------------------------------------------------------------------------------------------------
Conditionals
A conditional enables you to use if and else clauses to include or exclude code from an assembled page.
 Use the following Idoc Script keywords to evaluate conditions:
o <$if condition$>
o <$else$>
o <$elseif condition$>
o <$endif$>
 Conditional clauses use this general structure:
 <$if conditionA$>
 <!--Code if conditionA is true-->
 <$elseif conditionB$>
 <!--Code if conditionB is true-->
 <$else$>
 <!--Code if neither conditionA nor conditionB are true-->
 <$endif$>
 A condition expression can be any Idoc Script function or variable.
For more information, see Section 2.3.2.5, "Referencing a Variable in a Conditional."
 Boolean Operators can be used to combine conditional clauses. For example, you can use
the and operator as follows:
 <$if UseBellevueLook and isTrue(UseBellevueLook)$>
 If the condition expression is the name of a ResultSet available for inclusion in the HTML page, the
conditional clause returns true if the ResultSet has at least one row. This ensures that a template page
presents information for a ResultSet only if there are rows in the ResultSet.
 A conditional clause that does not trigger special computation is evaluated using
the XXXXXXXXXXXX_cannot_cross-reference to a marker on a para in
a bable_XXXXXXXXXXXXXX prefix. The result is true if the value is not null and is either a nonempty
string or a nonzero integer.
For an example of conditional code, see Section 2.3.4.1, "Conditional Example."
2.3.4.1 Conditional Example
In this example, a table cell <td> is defined depending on the value of the variable xDepartment:
<$if xDepartment$>
<td><$xDepartment$></td>
<$else$>
<td>Department is not defined.</td>
<$endif$>
<$xDepartment=""$>
 If the value of xDepartment is defined, then the table cell contains the value of xDepartment.
 If the value of xDepartment is not defined or is an empty (null) string, a message is written as the
content of the table cell.
 The last line of code clears the xDepartment variable by resetting it to an empty string.
Looping
Loop structures allow you to execute the same code a variable number of times. Looping can be accomplished in
two ways with Idoc Script:
ResultSet Looping
ResultSet looping repeats a set of code for each row in a ResultSet that is returned from a query. The name of
the ResultSet to be looped is specified as a variable using the following syntax:
<$loop ResultSet_name$>
code
<$endloop$>
 The code between the <$loop$> and <$endloop$> tags is repeated once for each row in the
ResultSet.
 When inside a ResultSet loop, you can retrieve values from the ResultSet using the getValue function.
Substitution of values depends on which row is currently being accessed in the loop.
 When inside a ResultSet loop, that ResultSet becomes active and has priority over other ResultSets
when evaluating variables and conditional statements.
 You cannot use the <$loop$> tag to loop over a variable that points to a ResultSet. Instead you must
loop over the ResultSet manually using the rsFirst and rsNext functions.
For example, you cannot use the following code to loop over a ResultSet:
<$name="SearchResults"$>
<$loop name$>
<!--output code-->
<$endloop$>
Instead, you must use the following code:
<$name="SearchResults"$>
<$rsFirst(name)$>
<$loopwhile getValue(name, "#isRowPresent")$>
<!--output code-->
<$rsNext(name)$>
<$endloop$>
ResultSet Looping Example
In this example, a search results table is created by looping over the SearchResults ResultSet, which was
generated by the GET_SEARCH_RESULTS service.
<$QueryText="dDocType <matches> 'ADACCT'"$>
<$executeService("GET_SEARCH_RESULTS")$>
<table>
<tr>
<td>Title</td><td>Author</td>
</tr>
<$loop SearchResults$>
<tr>
<td><a href="<$SearchResults.URL$>"><$SearchResults.dDocTitle$></a></td>
<td><$SearchResults.dDocAuthor$></td>
</tr>
<$endloop$>
</table>
While Looping
While looping enables you to create a conditional loop. The syntax for a while loop is:
<$loopwhile condition$>
code
<$endloop$>
 If the result of the condition expression is true, the code between
the <$loopwhile$> and <$endloop$> tags is executed.
 After all of the code in the loop has been executed, control returns to the top of the loop, where
the condition expression is evaluated again.
o If the result is true, the code is executed again.
o If the code if the result is false, the loop is exited.
While Looping Example
In this example, a variable named abc is increased by 2 during each pass through the loop. On the sixth pass
(when abc equals 10), the condition expression is no longer true, so the loop is exited.
<$abc=0$>
<$loopwhile abc<10$>
<$abc=(abc+2)$>
<$endloop$>
Ending a Loop
There are two Idoc Script tags that will terminate a ResultSet loop or while loop:
 <$endloop$> returns control to the beginning of the loop for the next pass. All loops must be closed
with an <$endloop$> tag.
 <$break$> causes the innermost loop to be exited. Control resumes with the first statement following
the end of the loop.
Workflow Admin
In the Workflow Admin tool, you can use Idoc Script to define the following:
 step events
 jump messages
 extra exit conditions
 tokens
 custom effects for jumps
For example, the following step entry script sends documents in the Secure security group to the next step in
the workflow:
<$if dSecurityGroup like "Secure"$>
<$wfSet("wfJumpName", "New")$>
<$wfSet("wfJumpTargetStep", wfCurrentStep(1))$>
<$wfSet("wfJumpEntryNotifyOff", "0")$>
<$endif$>
--------------------------------------------------------------------------------------------------------------------------------------
#active <$#active.variable$> Retrieves the value of the specified variable from the DataBinder,
searching in the following default order:
1. Active ResultSets
2. Local data
3. All other ResultSets
4. Environment
Does not send an error report to the debug output if the variable is not
found.
#local <$#local.variable$> Retrieves the value of the specified variable from the local data. Does not
send an error report to the debug output if the variable is not found.
#env <$#env.variable$> Retrieves the value of the specified variable from the environment
settings. Does not send an error report to the debug output if the variable
is not found.
exec <$exec expression$> Executes an expression and suppresses the output (does not display the
expression on the page).
In earlier versions of Idoc Script, the exec keyword was required to
suppress the value of any variable from appearing in the output file. In
the current version, the exec keyword is needed only to suppress
an expression from appearing in the output file.
include <$include ResourceName$> Includes the code from the specified resource. For more information,
see Section 2.3.1, "Includes."
super <$include
super.<include>$>
Starts with the existing version of the include code. For more information,
see Section 2.3.1.2, "Super Tag."
- exec Keyword
The exec keyword executes an Idoc Script expression and suppresses the output (does not display the
expression on the page). It is primarily used to set variables without writing anything to the page.
In earlier versions of Idoc Script, the exec keyword was required to suppress the value of any variable from
appearing in the output file. In the current version, the exec keyword is needed only to suppress an expression
from appearing in the output.
For example, the first line below is equivalent to the last two lines:
<$varA="stringA", varB ="stringB"$>
<$exec varA="stringA"$>
<$exec varB="stringB"$>
eval Function
The eval function evaluates an expression as if it were actual Idoc Script.
In the following example, a variable named one is assigned the string Company Name, and a variable
named two is assigned a string that includes variable one.
<$one="Company Name"$>
<$two="Welcome to <$one$>"$>
<$one$><br>
<$two$><br>
<$eval(two)$>
In the page output, variable one presents the string Company Name, variable two presents the string Welcome
to <$one$>, and the function eval(two) presents the string Welcome to Company Name.
Note that the string to be evaluated must have the Idoc Script delimiters <$ $> around it, otherwise it will not be
evaluated as Idoc Script.
Also note that too much content generated dynamically in this manner can slow down page display. If
the eval function is used frequently on a page, it may be more efficient to put the code in an include and use
the inc Function in conjunction with the eval function.
Metadata Field Naming
Each metadata field has an internal field name, which is used in code. In addition, many fields have descriptive
captions which are shown on web pages.
 All internal metadata field names begin with either a d or an x:
o Predefined field names begin with a d. For example, dDocAuthor.
o Custom field names begin with an x. For example, xDepartment.
Workflow Functions
 wfSet
Sets a key with a particular value in the companion file.
Parameters
Takes two parameters:
 The first parameter is the key.
 The second parameter is the value.
Example
Sets the key wfJumpName to MyJump:
<$wfSet("wfJumpName", "MyJump")$>
--------------------------------------------------------------------------------------------------------------------------------------
 WfStart
Sends the revision to the first step in the current workflow. Note that this variable begins with an
uppercase W.
Example
Sets the target step for a jump to restart the workflow:
<$wfSet("wfJumpTargetStep",WfStart)$>
--------------------------------------------------------------------------------------------------------------------------------------
 wfCurrentSet
Sets the local state value of a key in the companion file.
Parameters
Takes two parameters:
 The first parameter is the key.
 The second parameter is the value.
Example
Sets the key <step_name>@<workflow_name>.myKey to myValue:
<$wfCurrentSet("myKey", "myValue")$>
wfCurrentGet
Retrieves a local state value from the companion file.
Parameters
The only parameter is the key.
Output
Returns the local state value from the companion file.
Example
Returns the value of the local key <step_name>@<workflow_name>.myKey:
<$wfCurrentGet("myKey")$>
--------------------------------------------------------------------------------------------------------------------------------------
wfAddUser
Adds a user, alias, or workflow token to the list of reviewers for a workflow step. This function can only be used
inside a token.
Parameters
Takes two parameters:
 The first parameter indicates the user name, alias, or token name.
 The second parameter indicates the type, either user or alias.
Example
Adds the user mjones as a reviewer:
<$wfAddUser("mjones", "user")$>
Adds the original author token and the hr alias as reviewers:
<$wfAddUser(dDocAuthor, "user")$>
<$wfAddUser("hr", "alias")$>
wfComputeStepUserList
Computes the list of users from the current step in the workflow.
Returns a comma-delimited list of users.
wfExit
Exits a workflow step. This function moves the revision to a particular step in a workflow according to the
function parameters and resets the parent list information. To completely exit a workflow,
use wfExit(100,100) or any parameters that ensure that the revision returns to the parent workflow and then
gets moved past the last step in that workflow.
Parameters
Takes two parameters:
 The first parameter indicates the number of jumps to rewind.
 The second parameter indicates the target step relative to the step determined by the first parameter.
Example
Exits to the parent step in the workflow:
<$wfExit(0,0)$>
Returns to the previous jump step:
<$wfExit(1,0)$>
Returns to the previous jump step and moves to the next step in that workflow:
<$wfExit(1,1)$>
--------------------------------------------------------------------------------------------------------------------------------------
wfGet
Retrieves a state value from the companion file.
Parameters
The only parameter is the state key.
Output
Returns the state value from the companion file.
Example
Returns the current jump name:
<$wfGet("wfJumpName")$>
--------------------------------------------------------------------------------------------------------------------------------------
WfStart
Sends the revision to the first step in the current workflow. Note that this variable begins with an uppercase W.
Example
Sets the target step for a jump to restart the workflow:
<$wfSet("wfJumpTargetStep",WfStart)$>
--------------------------------------------------------------------------------------------------------------------------------------
wfUpdateMetaData
Defines a metadata value for the current content item revision in a workflow.
The wfUpdateMetaData function can be used only for updating custom metadata fields. You cannot use this
function to update standard, predefined fields
Type and Usage
 Section 3.8.1.1, "Workflow Functions"
 Section 4.33, "Workflow"
Example
Defines "This is my comment." as the value of the Comments field:
<$wfUpdateMetaData("xComments", "This is my comment.")$>
--------------------------------------------------------------------------------------------------------------------------------------
wfNotify
Sends an e-mail message to a specified user, alias, or workflow token.
The wfMailSubject and wfMessage variables can be set to customize the notification message.
Parameters
Takes two parameters and an optional third parameter:
 The first parameter specifies the user name, alias, or token to be notified.
 The second parameter indicates the type, either user, alias or token.
 The optional third parameter specifies the name of the e-mail template to use for constructing the
message. (See the IdcHomeDir/resources/core/templates/templates.hda file for template definitions.)
Example
Notifies the original author:
<$wfNotify(dDocAuthor, "user")$>
Notifies all users in the myAlias alias, using the IdcHomeDir/resources/core/templates/reject_mail.htm file as a
template:
<$wfNotify("myAlias", "alias", "WF_REJECT_MAIL")$>

More Related Content

PPTX
Paparan Laporan Keuangan BUM Desa - Konut.pptx
PDF
Materiality in government auditing
PDF
Bahan Paparan Rtrw Dki 2010 2030 [Compatibility Mode]
PDF
PAPARAN KEMENTERIAN PUPR.pdf
PDF
Swachh Bharat Abhiyaan
PPTX
Standar Satuan Harga Kabupaten Bogor.pptx
PPTX
Paparan MPP Jateng_1912_rev2.pptx
PDF
Laporan Pansus Pertanggungjawaban APBD 2010
Paparan Laporan Keuangan BUM Desa - Konut.pptx
Materiality in government auditing
Bahan Paparan Rtrw Dki 2010 2030 [Compatibility Mode]
PAPARAN KEMENTERIAN PUPR.pdf
Swachh Bharat Abhiyaan
Standar Satuan Harga Kabupaten Bogor.pptx
Paparan MPP Jateng_1912_rev2.pptx
Laporan Pansus Pertanggungjawaban APBD 2010

What's hot (19)

PDF
Peraturan Presiden tentang Percepatan Penyediaan Air Minum dan Sanitasi
PDF
Rencana Induk Sistem Pengelolaan Air Limbah (SPAL) - Strategi Sanitasi Kabupa...
PPTX
BNPP - ARAH KEBIJAKAN PEMBANGUNAN KAWASAN PERBATASAN NEGARA BERBASIS TATA RUA...
PDF
Sambutan bupati wonosobo acara kunker wasev pjo tmmd
PDF
Paparan Kapolri Republik Indonesia pada Musrenbag Prov Jambi Tahun 2017
PPT
Sesi 5 yusuf rkp desa-new
PDF
Bahan Koordinator Perumahan Bappenas - Sosialisasi Teknis Peminatan DAK Integ...
PDF
Mekanisme Penyaluran DAK Fisik Tahun 2024
PDF
Substansi studio perencanaan wilayah
PPTX
Inventarisasi Aset Desa - Sugeng - Malming 03 April 2021
PPTX
Overview RJPP dan RKAP _ BimTek "Penyusunan Rencana Kerja dan Anggaran Perus...
PPT
Paparan RTRW 24.03.22.ppt
PDF
Bappeda kawasan peruntukan industri dalam rtrw provinsi lampung 5
PDF
1 laporan pendahuluan rtdr kp rengasdengklok
PPTX
阿里巴巴Serverless架构与深度实践(NBF) _qcon2019_资深技术专家_冯微峰
PPT
Road Map (Peta Jalan) Sanitasi Provinsi
PPTX
Presentasi pupr dispenda
PPTX
Lakes in pakistan
PPTX
PAPARAN PERENCANAAN DESA.pptx
Peraturan Presiden tentang Percepatan Penyediaan Air Minum dan Sanitasi
Rencana Induk Sistem Pengelolaan Air Limbah (SPAL) - Strategi Sanitasi Kabupa...
BNPP - ARAH KEBIJAKAN PEMBANGUNAN KAWASAN PERBATASAN NEGARA BERBASIS TATA RUA...
Sambutan bupati wonosobo acara kunker wasev pjo tmmd
Paparan Kapolri Republik Indonesia pada Musrenbag Prov Jambi Tahun 2017
Sesi 5 yusuf rkp desa-new
Bahan Koordinator Perumahan Bappenas - Sosialisasi Teknis Peminatan DAK Integ...
Mekanisme Penyaluran DAK Fisik Tahun 2024
Substansi studio perencanaan wilayah
Inventarisasi Aset Desa - Sugeng - Malming 03 April 2021
Overview RJPP dan RKAP _ BimTek "Penyusunan Rencana Kerja dan Anggaran Perus...
Paparan RTRW 24.03.22.ppt
Bappeda kawasan peruntukan industri dalam rtrw provinsi lampung 5
1 laporan pendahuluan rtdr kp rengasdengklok
阿里巴巴Serverless架构与深度实践(NBF) _qcon2019_资深技术专家_冯微峰
Road Map (Peta Jalan) Sanitasi Provinsi
Presentasi pupr dispenda
Lakes in pakistan
PAPARAN PERENCANAAN DESA.pptx
Ad

Viewers also liked (11)

KEY
Creating Next-Generation ADF Mobile Applications
PPT
Deep Dive: Oracle WebCenter Content Tips and Traps!
PPT
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
PPT
Integrating ADF Mobile with WebCenter
KEY
FatWire Tutorial For Site Studio Developers
PDF
Creating a Global E-Commerce Website With E-Business Suite and Fusion Middleware
PPT
Ale Idoc Edi
PPTX
SAP ALE Idoc
PDF
Integrating ECM (WebCenter Content) with your Enterprise! 5 Tips to Try, 5 Tr...
PDF
Ale edi i_doc.sapdb.info
PDF
I doc creation documentation
Creating Next-Generation ADF Mobile Applications
Deep Dive: Oracle WebCenter Content Tips and Traps!
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
Integrating ADF Mobile with WebCenter
FatWire Tutorial For Site Studio Developers
Creating a Global E-Commerce Website With E-Business Suite and Fusion Middleware
Ale Idoc Edi
SAP ALE Idoc
Integrating ECM (WebCenter Content) with your Enterprise! 5 Tips to Try, 5 Tr...
Ale edi i_doc.sapdb.info
I doc creation documentation
Ad

Similar to Idoc script beginner guide (20)

PPT
Fpga 06-data-types-system-tasks-compiler-directives
PDF
Broadleaf Presents Thymeleaf
DOCX
VPN Access Runbook
PDF
Twig Brief, Tips&Tricks
PDF
Vaadin Components @ Angular U
DOC
Pl sql using_xml
PPT
Module04
DOCX
Managing states
PDF
Alfredo-PUMEX
PDF
Alfredo-PUMEX
PDF
Alfredo-PUMEX
PDF
Alfredo-PUMEX
KEY
Geek Moot '09 -- Smarty 101
PPTX
Oracle APEX Performance
PPT
Synapse india complain sharing info about php chaptr 26
PDF
AEM Sightly Template Language
DOCX
Web-based application development part 31MINIMIZE .docx
PDF
Tt subtemplates-caching
ODP
Mysqlppt
PPSX
Javascript variables and datatypes
Fpga 06-data-types-system-tasks-compiler-directives
Broadleaf Presents Thymeleaf
VPN Access Runbook
Twig Brief, Tips&Tricks
Vaadin Components @ Angular U
Pl sql using_xml
Module04
Managing states
Alfredo-PUMEX
Alfredo-PUMEX
Alfredo-PUMEX
Alfredo-PUMEX
Geek Moot '09 -- Smarty 101
Oracle APEX Performance
Synapse india complain sharing info about php chaptr 26
AEM Sightly Template Language
Web-based application development part 31MINIMIZE .docx
Tt subtemplates-caching
Mysqlppt
Javascript variables and datatypes

More from Vinay Kumar (20)

PDF
Modernizing the monolithic architecture to container based architecture apaco...
PPTX
Kafka and event driven architecture -apacoug20
PPTX
Kafka and event driven architecture -og yatra20
PDF
Extend soa with api management Sangam18
PDF
Extend soa with api management Doag18
PDF
Roaring with elastic search sangam2018
PPTX
Extend soa with api management spoug- Madrid
PPTX
Expose your data as an api is with oracle rest data services -spoug Madrid
PPTX
Modern application development with oracle cloud sangam17
PDF
award-3b07c32b-b116-3a75-8974-d814d37026ca
PDF
award-3b07c32b-b116-3a75-8974-d814d37026ca
PPTX
Adf spotlight-webcenter task flow-customzation
PDF
Personalization in webcenter portal
PPTX
Custom audit rules in Jdeveloper extension
PDF
File upload in oracle adf mobile
PDF
Webcenter application performance tuning guide
PDF
Tuning and optimizing webcenter spaces application white paper
PDF
Oracle adf performance tips
PPTX
JSR 168 Portal - Overview
PPTX
Spring framework in depth
Modernizing the monolithic architecture to container based architecture apaco...
Kafka and event driven architecture -apacoug20
Kafka and event driven architecture -og yatra20
Extend soa with api management Sangam18
Extend soa with api management Doag18
Roaring with elastic search sangam2018
Extend soa with api management spoug- Madrid
Expose your data as an api is with oracle rest data services -spoug Madrid
Modern application development with oracle cloud sangam17
award-3b07c32b-b116-3a75-8974-d814d37026ca
award-3b07c32b-b116-3a75-8974-d814d37026ca
Adf spotlight-webcenter task flow-customzation
Personalization in webcenter portal
Custom audit rules in Jdeveloper extension
File upload in oracle adf mobile
Webcenter application performance tuning guide
Tuning and optimizing webcenter spaces application white paper
Oracle adf performance tips
JSR 168 Portal - Overview
Spring framework in depth

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Big Data Technologies - Introduction.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Machine learning based COVID-19 study performance prediction
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Approach and Philosophy of On baking technology
sap open course for s4hana steps from ECC to s4
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Per capita expenditure prediction using model stacking based on satellite ima...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Understanding_Digital_Forensics_Presentation.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Big Data Technologies - Introduction.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation theory and applications.pdf
Machine learning based COVID-19 study performance prediction
The AUB Centre for AI in Media Proposal.docx
Spectral efficient network and resource selection model in 5G networks
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

Idoc script beginner guide

  • 1. Idoc Script Syntax  Idoc Script Tags Idoc Script commands begin with <$ and end with $> delimiters. For example: <$dDocTitle$> <$if UseGuiWinLook and isTrue(UseGuiWinLook)$> Idoc Script Comments You can use standard HTML comments or Idoc Script comments in Idoc Script code. An Idoc Script comment begins with [[% and closes with %]] delimiters. For example: <!-- HTML Comment --> [[%My Comment%]] ---------------------------------------------------------------------------------------------------- Variables A variable enables you to define and substitute variable values.  A value can be assigned to a variable using the structure:  <$variable=value$> For example, <$i=0$> assigns the value of 0 to the variable i.  Variable values can also be defined in an environment resource (CFG) file using the following name/value pair format: variable=value Idoc Script supports multiple clauses separated by commas in one script block. For example, you can use <$a=1,b=2$> rather than two separate statements: <$a=1$> and <$b=2$>. Referencing a Variable in a Conditional The following structure can be used to evaluate the existence of a variable: <$if variable_name$> If the variable is defined, this conditional is evaluated as TRUE. If the variable is not defined or it is defined as an empty (null) string, it is evaluated as FALSE. -------------------------------------------------------------------------------------------------------- Functions Idoc Script has many built-in global functions. Functions perform actions, including string comparison and manipulation routines, date formatting, and ResultSet manipulation. Some functions also return results, such as the results of calculations or comparisons. Information is passed to functions by enclosing the information in parentheses after the name of the function. Pieces of information that are passed to a function are called parameters. Some functions do not take
  • 2. parameters; some functions take one parameter; some take several. There are also functions for which the number of parameters depends on how the function is being used. Personalization functions refer to user properties that are defined in personalization files, also called user topic files. Each user's User Profile settings, personal links in the left navigation bar, and workflow in queue information are all defined in user topic files, which are HDA files located in the WC_CONTENT_ORACLE_HOME/data/users/profiles/us/username/ directories. The following global functions reference user topic files:  "utGetValue"  "utLoad"  "utLoadResultSet" For example, the Portal Design link in a user's left navigation bar is generated from the following code in the pne_nav_userprofile_links include (located in the WC_CONTENT_ORACLE_HOME/shared/config/resources/std_page.htm resource file). If the portalDesignLink property in the WC_CONTENT_ORACLE_HOME/data/users/profiles/us/username/pne_portal.hda file is TRUE, the link is displayed: <$if utGetValue("pne_portal", "portalDesignLink") == 1$> <$hasUserProfileLinks=1$> <tr> <td colspan=2 nowrap align="left"> <a class=pneLink href="<$HttpCgiPath$>?IdcService=GET_PORTAL_PAGE&Action=GetTemplatePage&Page=PNE_PO RTAL_DESIGN_PAGE"> <$lc("wwPortalDesign")$></a> <td> </tr> <$endif$> --------------------------------------------------------------------------------------------------------------- Conditionals A conditional enables you to use if and else clauses to include or exclude code from an assembled page.  Use the following Idoc Script keywords to evaluate conditions: o <$if condition$> o <$else$> o <$elseif condition$> o <$endif$>  Conditional clauses use this general structure:  <$if conditionA$>  <!--Code if conditionA is true-->  <$elseif conditionB$>  <!--Code if conditionB is true-->  <$else$>  <!--Code if neither conditionA nor conditionB are true-->  <$endif$>
  • 3.  A condition expression can be any Idoc Script function or variable. For more information, see Section 2.3.2.5, "Referencing a Variable in a Conditional."  Boolean Operators can be used to combine conditional clauses. For example, you can use the and operator as follows:  <$if UseBellevueLook and isTrue(UseBellevueLook)$>  If the condition expression is the name of a ResultSet available for inclusion in the HTML page, the conditional clause returns true if the ResultSet has at least one row. This ensures that a template page presents information for a ResultSet only if there are rows in the ResultSet.  A conditional clause that does not trigger special computation is evaluated using the XXXXXXXXXXXX_cannot_cross-reference to a marker on a para in a bable_XXXXXXXXXXXXXX prefix. The result is true if the value is not null and is either a nonempty string or a nonzero integer. For an example of conditional code, see Section 2.3.4.1, "Conditional Example." 2.3.4.1 Conditional Example In this example, a table cell <td> is defined depending on the value of the variable xDepartment: <$if xDepartment$> <td><$xDepartment$></td> <$else$> <td>Department is not defined.</td> <$endif$> <$xDepartment=""$>  If the value of xDepartment is defined, then the table cell contains the value of xDepartment.  If the value of xDepartment is not defined or is an empty (null) string, a message is written as the content of the table cell.  The last line of code clears the xDepartment variable by resetting it to an empty string. Looping Loop structures allow you to execute the same code a variable number of times. Looping can be accomplished in two ways with Idoc Script: ResultSet Looping ResultSet looping repeats a set of code for each row in a ResultSet that is returned from a query. The name of the ResultSet to be looped is specified as a variable using the following syntax: <$loop ResultSet_name$> code <$endloop$>  The code between the <$loop$> and <$endloop$> tags is repeated once for each row in the ResultSet.  When inside a ResultSet loop, you can retrieve values from the ResultSet using the getValue function. Substitution of values depends on which row is currently being accessed in the loop.  When inside a ResultSet loop, that ResultSet becomes active and has priority over other ResultSets when evaluating variables and conditional statements.  You cannot use the <$loop$> tag to loop over a variable that points to a ResultSet. Instead you must loop over the ResultSet manually using the rsFirst and rsNext functions.
  • 4. For example, you cannot use the following code to loop over a ResultSet: <$name="SearchResults"$> <$loop name$> <!--output code--> <$endloop$> Instead, you must use the following code: <$name="SearchResults"$> <$rsFirst(name)$> <$loopwhile getValue(name, "#isRowPresent")$> <!--output code--> <$rsNext(name)$> <$endloop$> ResultSet Looping Example In this example, a search results table is created by looping over the SearchResults ResultSet, which was generated by the GET_SEARCH_RESULTS service. <$QueryText="dDocType <matches> 'ADACCT'"$> <$executeService("GET_SEARCH_RESULTS")$> <table> <tr> <td>Title</td><td>Author</td> </tr> <$loop SearchResults$> <tr> <td><a href="<$SearchResults.URL$>"><$SearchResults.dDocTitle$></a></td> <td><$SearchResults.dDocAuthor$></td> </tr> <$endloop$> </table> While Looping While looping enables you to create a conditional loop. The syntax for a while loop is: <$loopwhile condition$> code <$endloop$>  If the result of the condition expression is true, the code between the <$loopwhile$> and <$endloop$> tags is executed.  After all of the code in the loop has been executed, control returns to the top of the loop, where the condition expression is evaluated again. o If the result is true, the code is executed again. o If the code if the result is false, the loop is exited. While Looping Example In this example, a variable named abc is increased by 2 during each pass through the loop. On the sixth pass (when abc equals 10), the condition expression is no longer true, so the loop is exited. <$abc=0$> <$loopwhile abc<10$> <$abc=(abc+2)$> <$endloop$> Ending a Loop There are two Idoc Script tags that will terminate a ResultSet loop or while loop:
  • 5.  <$endloop$> returns control to the beginning of the loop for the next pass. All loops must be closed with an <$endloop$> tag.  <$break$> causes the innermost loop to be exited. Control resumes with the first statement following the end of the loop. Workflow Admin In the Workflow Admin tool, you can use Idoc Script to define the following:  step events  jump messages  extra exit conditions  tokens  custom effects for jumps For example, the following step entry script sends documents in the Secure security group to the next step in the workflow: <$if dSecurityGroup like "Secure"$> <$wfSet("wfJumpName", "New")$> <$wfSet("wfJumpTargetStep", wfCurrentStep(1))$> <$wfSet("wfJumpEntryNotifyOff", "0")$> <$endif$> -------------------------------------------------------------------------------------------------------------------------------------- #active <$#active.variable$> Retrieves the value of the specified variable from the DataBinder, searching in the following default order: 1. Active ResultSets 2. Local data 3. All other ResultSets 4. Environment Does not send an error report to the debug output if the variable is not found. #local <$#local.variable$> Retrieves the value of the specified variable from the local data. Does not send an error report to the debug output if the variable is not found. #env <$#env.variable$> Retrieves the value of the specified variable from the environment settings. Does not send an error report to the debug output if the variable is not found. exec <$exec expression$> Executes an expression and suppresses the output (does not display the expression on the page). In earlier versions of Idoc Script, the exec keyword was required to suppress the value of any variable from appearing in the output file. In the current version, the exec keyword is needed only to suppress an expression from appearing in the output file. include <$include ResourceName$> Includes the code from the specified resource. For more information, see Section 2.3.1, "Includes." super <$include super.<include>$> Starts with the existing version of the include code. For more information, see Section 2.3.1.2, "Super Tag."
  • 6. - exec Keyword The exec keyword executes an Idoc Script expression and suppresses the output (does not display the expression on the page). It is primarily used to set variables without writing anything to the page. In earlier versions of Idoc Script, the exec keyword was required to suppress the value of any variable from appearing in the output file. In the current version, the exec keyword is needed only to suppress an expression from appearing in the output. For example, the first line below is equivalent to the last two lines: <$varA="stringA", varB ="stringB"$> <$exec varA="stringA"$> <$exec varB="stringB"$> eval Function The eval function evaluates an expression as if it were actual Idoc Script. In the following example, a variable named one is assigned the string Company Name, and a variable named two is assigned a string that includes variable one. <$one="Company Name"$> <$two="Welcome to <$one$>"$> <$one$><br> <$two$><br> <$eval(two)$> In the page output, variable one presents the string Company Name, variable two presents the string Welcome to <$one$>, and the function eval(two) presents the string Welcome to Company Name. Note that the string to be evaluated must have the Idoc Script delimiters <$ $> around it, otherwise it will not be evaluated as Idoc Script. Also note that too much content generated dynamically in this manner can slow down page display. If the eval function is used frequently on a page, it may be more efficient to put the code in an include and use the inc Function in conjunction with the eval function. Metadata Field Naming Each metadata field has an internal field name, which is used in code. In addition, many fields have descriptive captions which are shown on web pages.  All internal metadata field names begin with either a d or an x: o Predefined field names begin with a d. For example, dDocAuthor. o Custom field names begin with an x. For example, xDepartment. Workflow Functions  wfSet Sets a key with a particular value in the companion file. Parameters Takes two parameters:
  • 7.  The first parameter is the key.  The second parameter is the value. Example Sets the key wfJumpName to MyJump: <$wfSet("wfJumpName", "MyJump")$> --------------------------------------------------------------------------------------------------------------------------------------  WfStart Sends the revision to the first step in the current workflow. Note that this variable begins with an uppercase W. Example Sets the target step for a jump to restart the workflow: <$wfSet("wfJumpTargetStep",WfStart)$> --------------------------------------------------------------------------------------------------------------------------------------  wfCurrentSet Sets the local state value of a key in the companion file. Parameters Takes two parameters:  The first parameter is the key.  The second parameter is the value. Example Sets the key <step_name>@<workflow_name>.myKey to myValue: <$wfCurrentSet("myKey", "myValue")$> wfCurrentGet Retrieves a local state value from the companion file. Parameters The only parameter is the key. Output Returns the local state value from the companion file. Example
  • 8. Returns the value of the local key <step_name>@<workflow_name>.myKey: <$wfCurrentGet("myKey")$> -------------------------------------------------------------------------------------------------------------------------------------- wfAddUser Adds a user, alias, or workflow token to the list of reviewers for a workflow step. This function can only be used inside a token. Parameters Takes two parameters:  The first parameter indicates the user name, alias, or token name.  The second parameter indicates the type, either user or alias. Example Adds the user mjones as a reviewer: <$wfAddUser("mjones", "user")$> Adds the original author token and the hr alias as reviewers: <$wfAddUser(dDocAuthor, "user")$> <$wfAddUser("hr", "alias")$> wfComputeStepUserList Computes the list of users from the current step in the workflow. Returns a comma-delimited list of users. wfExit Exits a workflow step. This function moves the revision to a particular step in a workflow according to the function parameters and resets the parent list information. To completely exit a workflow, use wfExit(100,100) or any parameters that ensure that the revision returns to the parent workflow and then gets moved past the last step in that workflow. Parameters Takes two parameters:  The first parameter indicates the number of jumps to rewind.
  • 9.  The second parameter indicates the target step relative to the step determined by the first parameter. Example Exits to the parent step in the workflow: <$wfExit(0,0)$> Returns to the previous jump step: <$wfExit(1,0)$> Returns to the previous jump step and moves to the next step in that workflow: <$wfExit(1,1)$> -------------------------------------------------------------------------------------------------------------------------------------- wfGet Retrieves a state value from the companion file. Parameters The only parameter is the state key. Output Returns the state value from the companion file. Example Returns the current jump name: <$wfGet("wfJumpName")$> -------------------------------------------------------------------------------------------------------------------------------------- WfStart Sends the revision to the first step in the current workflow. Note that this variable begins with an uppercase W. Example Sets the target step for a jump to restart the workflow: <$wfSet("wfJumpTargetStep",WfStart)$> -------------------------------------------------------------------------------------------------------------------------------------- wfUpdateMetaData Defines a metadata value for the current content item revision in a workflow.
  • 10. The wfUpdateMetaData function can be used only for updating custom metadata fields. You cannot use this function to update standard, predefined fields Type and Usage  Section 3.8.1.1, "Workflow Functions"  Section 4.33, "Workflow" Example Defines "This is my comment." as the value of the Comments field: <$wfUpdateMetaData("xComments", "This is my comment.")$> -------------------------------------------------------------------------------------------------------------------------------------- wfNotify Sends an e-mail message to a specified user, alias, or workflow token. The wfMailSubject and wfMessage variables can be set to customize the notification message. Parameters Takes two parameters and an optional third parameter:  The first parameter specifies the user name, alias, or token to be notified.  The second parameter indicates the type, either user, alias or token.  The optional third parameter specifies the name of the e-mail template to use for constructing the message. (See the IdcHomeDir/resources/core/templates/templates.hda file for template definitions.) Example Notifies the original author: <$wfNotify(dDocAuthor, "user")$> Notifies all users in the myAlias alias, using the IdcHomeDir/resources/core/templates/reject_mail.htm file as a template: <$wfNotify("myAlias", "alias", "WF_REJECT_MAIL")$>