Express VI & VI Scripting
All,
Is it possible to drop a custom express VI in a new VI using VI scripting?
Thanks,
Saranya
Wayne,
While express VIs may be frowned upon here, they do have their uses, and meet their intended goals quite well.Theyre great for people trying to do relatively simple tasks which arent very process intensive, like taking some thermocouple data and writing it to a file. They can greatly speed up design and built time, which saves money as LV developer time can get very expensive. They also take off a good chunk of the learning curve for new users, while still giving more functionality than something like SignalExpress.
For an experienced programmer, there absolutely can be more efficient and flexible solutions created, but there is also typically a higher development cost.
This is a community of labview developers, so of course there will be some bias to the more rigorous, higher performance way of doing things. That being said, a huge number of people in industry use express VIs on a daily basis because of the simplicity they offer.
Regards,
Kyle Mozdzyn
Applications Engineering
National Instruments
Regards,
Kyle M.
Applications Engineering
National Instruments
Similar Messages
-
How can I use firefox to access Oracle's 10g Express Edition Database script editor?
I have installed Oracle's 10g Express Edition (xe) Database in my computer, which is running Ubuntu 10.04 64-bit. I can access the database through the command line and by using the web interface on Firefox. However, the script editor doesn't work with Firefox. The scripts are not shown and I'm unable to edit them.
I have installed Oracle's 10g Express Edition (xe) Database in my computer, which is running Ubuntu 10.04 64-bit. I can access the database through the command line and by using the web interface on Firefox. However, the script editor doesn't work with Firefox. The scripts are not shown and I'm unable to edit them.
-
Regular Expression in Apple script
Hi,
I need to test whether the text "I w'd like to give feedback" is available in UI or not, somehow my framework right now does not read quote( ' : between the characters w and d), so i want to use regular expression to search for the text in the UI, something like below.
tell application "System Events"
tell process "Process name"
activate
if (exists (checkbox "I w(*)d like to give feedback " of (first window whose description is equal to "alert"))) then
copy true to stdout
else
copy false to stdout
end if
end tell
end tell
Any help would really be great.One could also employ Ruby Regular Expressions. One can control whether the RE match is returned as a list item, or by value.
Here is the Ruby syntax, followed by the AppleScript to invoke it.
return_type, my_string, my_regex = ARGV
# cannot manipulate frozen variable. The dup method unlocks this state.
dupe_myregex = my_regex.dup
# remove \ escape chars so regex will work
dupe_myregex.gsub!(/\//, "")
# force string class to regexp class. Trailing slash can be followed by i to ignore case.
aregex = /#{dupe_myregex}/
if return_type.include? "L"
aregex.match(my_string) {|m| p m.captures}
else
aregex.match(my_string) {|m| puts m.captures}
end
Now the AppleScript to use this code. Unfortunately, when compiling in AppleScript Editor, it goes wild with newlines and tabs, which badly clutters the Ruby code. Certain Ruby characters will need AppleScript escapes to work. Despite the unsightly control characters inserted by AppleScript, the code works.
set my_string to "See Spot run. See Jane shoot Spot."
set my_re to "/.?(Spot).+(Jane).?/"
-- return a list containing matches
set return_type to "L"
-- return match values
-- set return_type to "V"
display dialog get_match(return_type, my_string, my_re)
on get_match(return_type, my_string, my_re)
set rb to ¬
"return_type,my_string, my_regex = ARGV\n
dupe_regex = my_regex.dup\n
dupe_regex.gsub!(/\\//, \"\")\n
aregex = /#{dupe_regex}/\n
if return_type.include? \"L\"\n
aregex.match(my_string) {|m| p m.captures}\n
else\n
aregex.match(my_string) {|m| puts m.captures}\n
end"
do shell script "/usr/bin/ruby -e " & rb's quoted form & space & ¬
return_type's quoted form & space & my_string's quoted form & space & my_re's quoted form
end get_match
The above code using the "L" return_type will display ["Spot", "Jane"]. With the "V" option, it returns Spot\nJane. -
How to use or call component in custom script expression
i want to use component in custom script expression .(custom script expression is located at :
when yow will click on one of the steps in criteria workflow
1)there is a tag named as event on clicking the event tag,there are two buttons named edit and clear on clicking edit.there is a screen having custom as a tag,on clicking that tag there is written custom script expression, here i hav to write a code to include a component).you can define code in a component (a service or an IDOC Include) that you can then call from the workflow "custom" tab.
So if your component has an include like this:
<@dynamichtml myInclude@>
<$do Some Stuff$>
<@end@>
Then in your workflow step event "custom" tab you can write:
<$include myInclude$>
The workflow event will then execute the <$do Some Stuff$> line.
With a service, you would define the service in your component then call <$executeService("MYService")$> in the step event custom code.
You cannot define includes or services in the custom script tab for workflow. -
Regular expression and Script component in SSIS 2008
Could you please help me to write regular expression so that it can be used in script component to fetch the data from fixed width file so that the file format can be validated and loaded accordingly.
IR-TYPE PIC X.
IR-JOB PIC X(4).
IR-PHASE PIC X(2).
IR-CO-ID.
IR-LVL1 PIC X(2).
IR-LVL2 PIC X(2).
IR-EMP-NBR PIC X(10).
IR-CK-NBR PIC 9(9).
IR-CK-DATE PIC X(6).
IR-CK-AMT PIC S9(7)V99.
FILLER PIC X(35).
The above schema definition will be stored in regualar expression and through script component each column will be fetched and validate to verify the file format.I am quiet new I can provide the file layout .
1819001HB01002582016 03009291810050200013399I
1712001HB01004688418 03009007210050200021143I
1712001HB01004688418 03009007310050200005950{
Schema definition of the file
IR-TYPE PIC X.
IR-JOB PIC X(4).
IR-PHASE PIC X(2).
IR-CO-ID.
IR-LVL1 PIC X(2).
IR-LVL2 PIC X(2).
IR-EMP-NBR PIC X(10).
IR-CK-NBR PIC 9(9).
IR-CK-DATE PIC X(6).
IR-CK-AMT PIC S9(7)V99.
FILLER PIC X(35). -
Impossible to create script with event expression ?!
Hi All,
I have noticed that the use of the event expression in the script properties make its creation impossible with the RWE: an error message popup saying "JCS-00127: extra characters at end" although nothing is wrong:
- the same script without this parameter can be saved
- there is no syntax or others kind of errors in the expression in itself
Here is an example of expression:
israised("SYSJCS"."TEST_1") OR israised("SYSJCS"."TEST_2") AND israised("SYSJCS"."TEST_3")
But it can be done with the RS using pl/sql with the waitfor expression, here an example :
create or replace script "SYSJCS"."TEST_2"
application "SYSJCS"."TEST"
format "SYSJCS"."ASCII"
scripttype "SYSJCS"."KSH"
no verify
waitfor (israised("SYSJCS"."TEST_1") OR israised("SYSJCS"."TEST_2") OR israised("SYSJCS"."TEST_3"))
event "SYSJCS"."TEST_1"
, "SYSJCS"."TEST_2"
, "SYSJCS"."TEST_3"
rwscript
echo Hello world
endrwscript
Is this a bug? Have you any idea of how it is possible to make it work though RWE ?
Thanks for your help.
Regards,
Yi JiangYes. But no more success. Same error:
ORA-20800: JCS-00127: extra characters at end
ERROR at line 1:
ALTER SCRIPT "SYSJCS"."TEST_2" VERSION 4 DESCRIPTION NULL APPLICATION "SYSJCS"."TEST" comment NULL NEEDS NULL QUEUE NULL FORMAT "SYSJCS"."ASCII" SCRIPTTYPE "SYSJCS"."KSH" FOR PARALLEL EXECUTION ENABLED DURING NULL NO OVERDUE COMPILE PRIORITY UNLIMITED MAXPRIO UNLIMITED USE DIRECTORY DEFAULTS FROM SCRIPT NO VERIFY NO LIGHTWEIGHT RESTART OSUSER NULL USING USER ACCOUNT KEEP NOFORCE UNLIMITED UNTIL UNLIMITED FOR NULL STATUS ON SUBMIT SCHEDULED WAITFOR (israised("SYSJCS"."TEST_1") OR israised("SYSJCS"."TEST_2") OR israised("SYSJCS"."TEST_3")) RESUBMIT NULL RETURNCODE MAP '' TO COMPLETED NO PIN TO PARENT ALLOW DESTINATION ALLOW TRIGGERS ALLOW STATISTICS ALLOW WAIT
ORA-06512: at "SYSJCS.JCS_ODF", line 349
ORA-06512: at line 2
Regards,
Yi Jiang -
Grouping of multiple criterias as expression
Dear all
I want to do a grouping of multiple criterias as expression .
Single grouping is possible , but when group within a group comes things doesnt work for me.
User would define the comibination
For example i have 4 criterias
C1
C2
C3
C4
Basic grouping works for example :
(C1&C2) | (C3&C4)
Complicated grouping i have no idea how to implement it.
(((C1&C2) | (C3&C4))&(C1&C2) )
I need validate if the expression is correct and need to pick up all the groups and do the AND or OR.
Any help woul dbe appriciated
Regards
pacsfiveohg wrote:
Complicated grouping i have no idea how to implement it.
(((C1&C2) | (C3&C4))&(C1&C2) )
I need validate if the expression is correct and need to pick up all the groups and do the AND or OR.As already suggested: you could write your own grammar and let a parser-generator create a lexer/parser for you.
Another option is to use some scripting engine and bind your C-variables before evaluating your expression:
import javax.script.*;
public class Foo {
public static void main(String[] args) throws Exception {
String expression = "(((C1 && C2) || (C3 && C4)) && (C1 && C2))";
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("js");
engine.put("C1", true);
engine.put("C2", true);
engine.put("C3", false);
engine.put("C4", true);
System.out.println(engine.eval(expression));
}Note that you cannot user '|' and '&', in that case.
The JavaScript (Rhino) engine is built-in in Java 6, but there are more that can be imported: [https://scripting.dev.java.net/] -
Jython scripting and ODI variables
Hi,
I've had a look through the documentation but wans't able to find the answer to this, apologies if it's in there.
Some ETL tools that we've used previously have their own scripting language embedded within the tool. This allows us to populate, refresh and evaluate variables within scripts. The values of the variables can then be used with queries as mapping or restrictions in the where clause.
The question I've got is - can ODI variables be used within Jython scripts in a similar way? Can they be passed in, values assigned, returned and used within the project? If not, can this only be achieved through the SQL query that is part of the variable definition.
Hope this question makes sense, it's really a comparison with the scripting language and variables that we use in another tool.
ThanksHello,
I see what you are trying to achieve, and I believe you got it all right.
Variables can be retrieved using the #VARIABLE_NAME expression in Jython scripts, mappings, filters, or anywhere else.
They can be set only
- Through a set variable step to a constant value.
- In a refresh variable step to the (mono-field, mono-record) result of a SELECT statement.
You cannot do in some Jython code something like: #VARIABLE_NAME = myJythonVariable
You'd need to insert the values of your variables in a temporary table (in the Jython script), then refresh the variable from the content of this temporary table.
Regards,
-FX -
How to pass expression to .js file
Hello Techies,
I am trying to an expression to java script function.
Here is my code
<script language="javascript">
<!--
document.write('<script type="text/javascript" language="javascript" src="<%=Context%>/htmls/js/Set.js">');
//-->
</script>
onClick="JavaScript:doSubmit('<%= sss %>')"In set.js file I had written the code like the following
function doSubmit(requestType) {
alert(document.xxxForm.<%=xyz%>.value);
I had placed this set .js file in separate folder named as JS.
I had placed the .jsp files in one folder named as jsp.
How to call the doSubmit() in the set.js file from the jsp file.
Thanks,
KrishnaWhat i am trying is I am having a combo box in which any item is selected and clicked add button the request must send to the server else we will get one alert msg that "Plz check the evalution".
<script language="javascript">
<!--
document.write('<script type="text/javascript" language="javascript" src="<%=Context%>/htmls/js/set.js">');
//-->
</script>
some code
<input
type="button"
name="submitButton"
value="Save"
onClick="JavaScript:doSubmit('<%= Request.add %>')"
/>The set.js file is
var current = location.toString();
var noProtocol = current.split('//')[1];
var context = noProtocol.split('/')[1];
function doSubmit(requestType) {
alter("inside doSubmit");
var evalutionValue = document.setForm.<%=request.EVALUATION%>.value;
if( evalutionValue == '' || evalutionValue == null)
alert("plz select the Evalution ");
return false;
document.forms["setForm"].elements["<%= request.REQUEST_TYPE %>"].value = requestType;
document.forms["ruleSetForm"].submit();
}How can I do this one -
How to create a script-?
Guys I need help. I have been dreaming of becoming a contact center express specialist for a while now. But each time I go online to find out about books and study material I get a lot of discouragement. After my ccna, most of my studies have been self-study but I can’t seem to find a Cisco self-study book for contact center.
I think my greatest concern is related to creating scripts. This is my greatest fear and problem. Whiles I was studying unity I did try to understand scripting but I ended up being able to apply scripts that were already prepared by Cisco. I need to learn how to build a script from ground up. Most importantly, I need to understand how to understand some of the characters and expressions used in scripting.
Refer me to books, websites, papers etc. any information is great. I am really ready to go anywhere and everywhere. However, I’m a bit short of cash.
ThanksThe most important thing to understand about CCX is that the scripts are Java. Sure there is a GUI that abstracts a lot of this from you; however, it is still an IDE and you are writing Java code. The prebuilt Java beans [steps] can only take you so far. I find myself adding raw Java code into my scripts more often than not to make them do what I want. If you are not a programmer already, you will struggle to flourish with CCX scripting. You would do yourself a huge favor by taking a few semesters of programming classes at your local community college first.
As for study materials: There are no published books at present that walk you through CCX soup-to-nuts. Your only options are the Cisco Learning courses UCCXD and UCCXA or the product documentation. The documentation is great for those who understand the product but it can be a little bit of challange to get your head around the product based solely on the documentation.
My suggestion is to start with the getting started guide, release notes and SRND document. The UCCXD and UCCXA classes are really great, especially if you have a good instructor who knows the product. If you can get your employer to pay for them, they are the way to go.
Lastly, there are a few scripts available publically that you can use as a reference in the Cisco Contact Center Express Script Repository. -
Help constructing SOM Expression
Hi,
I've puzzled over this for many hours and decided I definitely am a fish out of whater. Could you please help?
My problem: I need a way to substitue a string for the SOM Expression of certain fields without always having to write out the whole expression. Basically, I am trying to figure out if I know the location, can I pass a variable with that location's string into a function, and then have the function process several instructions, using the passed string as the SOM Expression?
For example, if the SOM Expression for 2 fields are:
Form1.Subform1.FieldA
Form1.Subform2.FieldB
If I know the string which is the exact location of FieldA and FieldB, can I somehow pass those strings into a script object so the same function can work with multiple fields. E.g. if I wanted to change the font size, bold the font, and font color of each field, could I pass the string of the SOM Expression into a script object method which would process these 3 properties, and then pass the string for the second field's location into the same function to process that field? The reason I want to do this is my form has about 50 such fields which have about 15 processes which are used for each form.
I'm sorry if this isn't clear. I'd really appreciate any help someone might have to offer.
Thanks,
JeffYou can pass the object itself by using the somExpression. You do not need to pass a string in. So calling the script would be:
ScriptObject.FunctionName(Form1.Subform1.FieldA)
and in ths script object to recieve the object you would use:
var myObj = Form1.Subform1.FieldA.nodes
Or you can pass subform nodes and search the subform for fields. if you post your email I will send you a sample that shows how. -
The following grep search works fine from within Indesign (finds all prices that don't have the "€" symbol at the end): ((\d+)?(\.?))+(\d{1,3}),(-)?(\d+)?(?!(.*)?(€)) If I try to translate the same search expression into a script, it doesn't work anymore: ((\\d+)?(\\.?))+(\\d{1,3}),(-)?(\\d+)?(?!(.*)?(€)) How could this be possible? Am I doing something wrong or is it a bug of the software? Any suggestions would be much appreciated Thanks in advance
CS 5.5 win7
works here!? perhaps a mistake in scriptimplementation?
app.findGrepPreferences=app.changeGrepPreferences=null;
app.findGrepPreferences.findWhat="((\\d+)?(\\.?))+(\\d{1,3}),(-)?(\\d+)?(?!(.*)?(€))";
toFind = app.activeDocument.findGrep();
alert(toFind.length) -
I recently downloaded a shell script that runs an embedded python script.
The first few lines looks like this:
<pre>
#!/bin/sh
exec python $0 ${1+"$@"}
</pre>
I know what #!/bin/sh does, and I know what "exec python" does, but what do the
<pre>
</pre>
and
<pre>
$0 ${1+"$@"}
</pre>
mean???
(The actual python script follows these lines.) I assume the gist of it is that it runs sh, captures any command line arguments given after the name of the shell script executable, and then turns this all over to python as if the python code that follows had been invoked from the command line with those arguments following.
But I'd like to understand it on the level of the actual syntax....Daniel's post explains almost everything; I just want to add some minor points (and one question).
For /bin/sh, the first line
is equivalent to
which is do-nothing built-in command of sh.
(If the first line is
or
then sh will try to find a command "" and results in 'command not found'.)
Then the second line is executed by sh, and the process is replaced by python. The third line
is illegal (or incomplete) as a shell script, but it's not a problem because sh does not read the line.
Now python reads the script from the beginning again.
In python, """ starts a multi-line string. The string starts just after """, so the string is
:"<newline>exec python $0 ${1+"$@"}
This is not a comment for python, but python ignores any simple expression in a script anyway. For example
#!/usr/bin/python
a = "foo"
a
"bar"
is a legal python script. The second and third lines (a and "bar") are simple expressions and do nothing.
One of the reason for using this trick is portability. The main problem is that python may be installed in /usr/bin, /usr/local/bin, /sw/bin, or anywhere else, depending on the system. So if a python script starts with
#!/usr/bin/python
then it does not run if python is installed in other places. A trick often used is
#!/usr/bin/env python
which will search python in the user's PATH. But this trick works only if /usr/bin/env exists.
Now a (minor) question:
What is the difference between ${1+"$@"} and "$@"? The former is more portable than the latter? If so, why?
/bin/sh may be a pure (true) Bourne-shell, bash or ksh (or any other?) depending on the system. I tried both bash and ksh, but ${1+"$@"} and "$@" seem to give the same results.
PowerMac G4 Mac OS X (10.4.5) -
Need help on Modifying Jsp Code to establish relationships in iStore.
I am currently working on iStore an internet enabled product
from Oracle.
In iStore one can establish relationships between products like
cross sell , complimentary, substitute, conflict etc. However at
the moment only one relationship works i.e: Related. This is
because this is a bug in iStore. Only the relationship Related
is defined in the jsp. We have been asked to modify the jsp
ibeCCtdItemDetail.jsp
Please find pasted below the jsp which only had the arrays for
related i.e: relitems and service i.e service have added the
array complimentary to establish such a relationship and pasted
the relitems code once again and changed relitems to
complimentary. I am stuck up on this since the past 2 weeks i
would appreciate if anybody could help.
<%@include file="jtfincl.jsp" %>
<!-- $Header: ibeCCtdItemDetail.jsp 115.24 2001/06/16 15:21:05
pkm ship $ -->
<%--
=================================================================
========
| Copyright (c)2000 Oracle Corporation, Redwood Shores, CA
| All rights reserved.
+================================================================
===========
|
| FILE
| ibeCCtdItemDetail.jsp - Item Detail display
|
| DESCRIPTION
| Displays Item Detail page. Item's description, long
description, large
| image, flexfields, available services, and related items
are displayed.
| The list price and best price (selling price) for each of
the Item's
| available units of measure is displayed. Displays Add to
Cart,
| Express Checkout, Configure buttons (if appropriate).
|
| PARAMETERS (SOURCE)
| party Id IN (RequestCtx) - user's party
id
| account Id IN (RequestCtx) - user's
account id
| currency code IN (RequestCtx) - currency code
| item IN (URL) - Item ID
| section IN (URL) - section ID of
section we are
| coming from
(optional)
| item IN (pageContext) - Item ID
| section IN (pageContext) - Section ID
| qty IN (pageContext) - Quantity
entered by user
| uom IN (pageContext) - UOM selected
by user
| errorMsg IN (pageContext) - error message
from buy
| routing page
| * pageContext attributes for "item" and "section" are used
when the URL
| does not contain valid values for "item" and "section"
(such as when an
| error occurred in the buy routing page and the request is
forwarded
| back to this page)
|
| oneclick_obj OUT (pageContext) - OneClick
object containing
| user's
Express Checkout
| preferences
| postingID OUT (pageContext) - Integer
posting Id, for
| iMarketing
integration
| itemIDs OUT (pageContext) - int[] itemIDs
on the page
| (for use by
postings)
| numRequested OUT (pageContext) - Integer
number of postings,
| for
iMarketing integration
| random OUT (pageContext) - Boolean
whether to randomize
| posting
retrieved, for
| iMarketing
integration
| type OUT (HTML form) - "single" (1
item)
| item OUT (HTML form) - Item ID
| refpage OUT (HTML form) -
"ibeCCtdItemDetail.jsp" plus any
| parameters
needed to return
| to this page
in case of error.
| uom OUT (HTML form) - UOM code
selected by user
| qty OUT (HTML form) - quantity
entered by user
| Add to Cart.x OUT (HTML form) - user clicks
Add to Cart
| 1-Click.x OUT (HTML form) - user clicks
Express Checkout
| Configure.x OUT (HTML form) - user clicks
Configure
|
| OBJECTS REFERENCED
| oracle.apps.ibe.catalog.Item
| oracle.apps.ibe.order.OneClick
|
| APIs REFERENCED
| Item.getItemID() - get Item ID
| Item.getDescription() - get item description
| Item.getLongDescription() - get item long description
| Item.isConfigurable() - whether item has
configuration UI set up
| Item.getFlexfields() - get Item flexfield
prompts and values
| Item.getRelatedItems() - get related items and
service items
| Item.getMediaFileName() - get media based on
display context
| OneClick.loadSettingFrDB() - load Express Checkout
settings for
| current user
|
| JSPs REFERENCED
| ibeCCtpPostingI.jsp - set iMarketing
parameters (include)
| ibeCCtpSetItem.jsp - retreive and set item
information (include)
| ibeCCtpItmDspRte.jsp - Item display routing
page (link)
| ibeCCtpBuyRoute.jsp - Buy routing
page (form POST)
| ibeCCtdSctPath.jsp - Path Traversed
Display (include)
| ibeCXpdShowTag.jsp - Express Checkout Tag
Area (include)
| ibapstng.jsp - iMarketing integration
page (include)
|
| ADDITIONAL NOTES
| iMarketing posting ID can be changed by editing file
ibeCCtpPostingI.jsp
|
| HISTORY
| 08/01/2000 auyu Created.
| 04/09/2001 auyu Added compile-time include for retrieving
item
| information
|
+================================================================
=======--%>
<%@page import="oracle.apps.ibe.order.*" %>
<%@page import="oracle.apps.ibe.catalog.*" %>
<%@page import="oracle.apps.ibe.store.*" %>
<%@page import="oracle.apps.jtf.displaymanager.*" %>
<%@page import="oracle.apps.jtf.base.Logger" %>
<%@page import="oracle.apps.jtf.minisites.*" %>
<%@include file="ibeCZzpHeader.jsp" %>
<%@page import="oracle.jdbc.driver.*" %>
<%@page import="java.sql.*" %>
<%-- declaration --%>
<%!
/* Retrieve parent section ids for a given item.
* int itemId - Item whose parent section ids will be retrieved
int getParentSectionId(int itemId)
int parentSectionId = -1;
Connection conn = null;
OraclePreparedStatement stmt = null;
ResultSet rs = null;
try {
BigDecimal minisiteId = RequestCtx.getMinisiteId();
conn = TransactionScope.getConnection();
StringBuffer sql = new StringBuffer(400);
sql.append("select jdsi.section_id ");
sql.append("from jtf_dsp_section_items jdsi, ");
sql.append("jtf_dsp_msite_sct_items jdmsi ");
sql.append("where jdsi.inventory_item_id = ? ");
sql.append("and jdsi.section_item_id =
jdmsi.section_item_id ");
sql.append("and jdmsi.mini_site_id = ? ");
sql.append("and nvl(jdsi.start_date_active, sysdate) <=
sysdate ");
sql.append("and nvl(jdsi.end_date_active, sysdate) >=
sysdate ");
sql.append("and nvl(jdmsi.start_date_active, sysdate) <=
sysdate ");
sql.append("and nvl(jdmsi.end_date_active, sysdate) >=
sysdate");
stmt = (OraclePreparedStatement)conn.prepareStatement
(sql.toString());
stmt.setInt(1, itemId);
stmt.setInt(2, minisiteId.intValue());
stmt.defineColumnType(1, Types.INTEGER);
rs = stmt.executeQuery();
if (rs.next())
parentSectionId = rs.getInt(1);
} catch (Exception e1) {
parentSectionId = -1;
IBEUtil.log("ibeCCtdItemDetail.jsp",
"Caught exception while retrieving parent
section id");
IBEUtil.log("ibeCCtdItemDetail.jsp", e1.getMessage());
} finally
try { if (rs != null) rs.close(); } catch (Exception e2) {}
try { if (stmt != null) stmt.close(); } catch (Exception
e2) {}
try {
if (conn != null) TransactionScope.releaseConnection
(conn);
} catch (Exception e2) {}
return parentSectionId;
%>
<%-- end declaration --%>
<%@include file="ibeCCtpSetItem.jsp"%>
<%
The compile-time inclusion of ibeCCtpSetItem.jsp will declare
and set
the following variables:
boolean bItemLoaded - whether section was
loaded
Item lItem - Item
boolean bItemCanBeOrdered - whether item can be
ordered
String[] uomCodes - Item's UOM Codes
Vector itemSellPriceDisplayVec - vector containing
item's selling
prices in formatted
strings
Vector itemListPriceDisplayVec - vector containing
item's list
prices in formatted
strings
int nPriceDefined - number of prices
defined for the item
Perform the following actions:
Set "itemIds" in the PageContext.REQUEST_SCOPE
Set "item" in PageContext.REQUEST_SCOPE
Set "section" in PageContext.REQUEST_SCOPE
MessageManagerInter lMsgMgr =
Architecture.getMessageManagerInstance();
pageContext.setAttribute("_pageTitle",
lMsgMgr.getMessage
("IBE_PRMT_CT_PRODUCT_DETAILS"),
PageContext.REQUEST_SCOPE);
%>
<%@ include file="ibeCCtpPostingI.jsp" %>
<%@ include file="ibeCZzdTop.jsp" %>
<%@ include file="ibeCZzdMenu.jsp" %>
<%
if (bItemLoaded)
OneClick lOneClickObj;
String xprTagArea = "", confirmXpr = "";
String lBuyRoutePage;
String lSectionPathPage = "";
int sectid = 0;
Item[] services = new Item[0];
Item[] relItems = new Item[0];
Item[] complimentary = new Item[0];
ItemFlexfield[] itemFlexfields = new ItemFlexfield[0];
String lItemImage = "", lItemAddtlInfoFile = "";
StringBuffer lRef = new StringBuffer("ibeCCtdItemDetail.jsp?
item=");
String qty = "", userSelUOM = "";
String errorMsg = "";
//--------------- load express checkout preferences ---------
if (IBEUtil.useFeature("IBE_USE_ONE_CLICK"))
xprTagArea = DisplayManager.getTemplate
("STORE_XPR_TAG_AREA").getFileName();
if (xprTagArea == null)
xprTagArea = "";
confirmXpr = lMsgMgr.getMessage("IBE_PRMT_EXPR_CONFIRM");
if (RequestCtx.userIsLoggedIn()) {
//initialize OneClick if user is logged in
BigDecimal partyId = RequestCtx.getPartyId();
BigDecimal accountId = RequestCtx.getAccountId();
lOneClickObj = new OneClick();
lOneClickObj.loadSettingsFrDB(partyId, accountId);
} // end user express checkout
//------------ set "section", lSectionPathPage --------------
String lSectionId = IBEUtil.nonNull(request.getParameter
("section"));
if (lSectionId.equals(""))
lSectionId =
IBEUtil.nonNull((String)pageContext.getAttribute
("section", PageContext.REQUEST_SCOPE));
if(IBEUtil.useFeature("IBE_USE_SECTION_PATH"))
lSectionPathPage = DisplayManager.getTemplate
("STORE_CTLG_SCT_PATH").getFileName();
try {
sectid = Integer.parseInt(lSectionId);
pageContext.setAttribute("section", String.valueOf
(sectid), PageContext.REQUEST_SCOPE);
} catch (NumberFormatException e) { }
if(lSectionPathPage == null)
lSectionPathPage = "";
lBuyRoutePage = DisplayManager.getTemplate
("STORE_CTLG_BUY_PROCESS_ROUTE").getFileName();
/* if error and forwarded back to this page, get values
selected by user */
qty = IBEUtil.nonNull((String)pageContext.getAttribute
("qty", PageContext.REQUEST_SCOPE));
if (qty.equals(""))
qty = "1";
userSelUOM = IBEUtil.nonNull((String)pageContext.getAttribute
("uom", PageContext.REQUEST_SCOPE));
errorMsg = IBEUtil.nonNull((String) pageContext.getAttribute
("errorMsg", PageContext.REQUEST_SCOPE));
//set ref for returning to this page in case of error
lRef.append(lItem.getItemID());
if (sectid > 0)
lRef.append("§ion=");
lRef.append(sectid);
/* Get Bin Open and Bin Close Images */
String binOpenImg = "", binCloseImg = "";
try {
Media binOpenMedia = DisplayManager.getMedia
("STORE_BIN_OPEN_IMAGE", true);
if (binOpenMedia != null)
binOpenImg = binOpenMedia.getFileName();
} catch (MediaNotFoundException mnfe) {}
if (binOpenImg == null)
binOpenImg = "";
try {
Media binCloseMedia = DisplayManager.getMedia
("STORE_BIN_CLOSE_IMAGE", true);
if (binCloseMedia != null)
binCloseImg = binCloseMedia.getFileName();
} catch (MediaNotFoundException mnfe) {}
if (binCloseImg == null)
binCloseImg = "";
/* Get images, additional info, flexfields, related items,
service items */
lItemImage = lItem.getMediaFileName
("STORE_PRODUCT_LARGE_IMAGE");
lItemAddtlInfoFile = lItem.getMediaFileName
("STORE_PRODUCT_ADDTL_INFO");
// check for defaulting
String defaultFromSection = "Y";
if ("Y".equals(defaultFromSection))
if (lItemImage == null || lItemAddtlInfoFile == null)
try {
int parentSectionId = getParentSectionId
(lItem.getItemID());
Section parentSection = Section.load(parentSectionId);
if (lItemImage == null)
lItemImage = parentSection.getMediaFileName
("STORE_SECTION_SMALL_IMAGE");
if (lItemAddtlInfoFile == null)
lItemAddtlInfoFile = parentSection.getMediaFileName
("STORE_SECTION_ADDTL_INFO");
} catch (Exception e) {}
itemFlexfields = lItem.getFlexfields();
try {
services = lItem.getRelatedItems("SERVICE");
} catch (ItemNotFoundException e) {}
try {
relItems = lItem.getRelatedItems("RELATED");
} catch (ItemNotFoundException e) {}
try {
complimentary = lItem.getRelatedItems("COMPLIMENTARY");
} catch (ItemNotFoundException e) {}
%>
<!-- body section -----------------------------------------------
------------->
<table border="0" width="100%">
<%
if (IBEUtil.showPosting()) {
%>
<!--------- iMarketing integration ----------------->
<tr><td colspan="4" align="center">
<% try {
%>
<jsp:include page="ibapstng.jsp" flush="true" />
<% } catch (Throwable e) {
IBEUtil.log("ibeCCtdItemDetail.jsp", "iMarketing error",
Logger.ERROR);
%>
</td></tr>
<% } //end iMarketing installed
%>
<tr><td> </td>
<%
if(!lSectionPathPage.equals(""))
%>
<td colspan="4" class="smallLink">
<jsp:include page="<%=lSectionPathPage%>" flush="true" />
</td>
<% }
%>
</tr>
<tr><td valign="top"> </td>
<!-- center column ------------------------------------------
------------->
<td valign="top" width="70%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="3">
<span class="pageTitle"><%=lItem.getDescription()%
</span></td></tr>
<tr>
<% if (lItemImage != null) {
%>
<td valign="TOP"><img src="<%=lItemImage%>"></td>
<td valign="TOP" colspan="2"><%
=lItem.getLongDescription()%></td>
<% } else {
%>
<td valign="TOP" colspan="3"><%
=lItem.getLongDescription()%></td>
<% }
%>
</tr>
<% if (lItemAddtlInfoFile != null) {
%>
<tr><td colspan="3"><br>
<jsp:include page="<%=lItemAddtlInfoFile%>"
flush="true" />
</td></tr>
<% }
%>
<tr><td colspan="3"><br></td></tr>
<%
for (int i=0; i < itemFlexfields.length; i++)
String prompt = itemFlexfields.getPrompt();
String value = itemFlexfields[i].getValue();
if (value != null && !value.equals(""))
%>
<tr>
<td align="LEFT" width="20%">
<span class="sectionHeader2"><%=prompt%
</span></td>
<td align="LEFT" colspan="2" width="80%"><%=value%
</td></tr>
<% }
if (services.length > 0)
%>
<tr><td colspan="3"><br></td></tr>
<tr><td align="RIGHT" class="sectionHeader1" width="20%">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_WARRANTIES")%>
</td>
<td colspan="2" align="left" class="sectionHeaderBlack"
width="80%"><hr>
</td></tr>
<%
for(int i=0; i < services.length; i++)
%>
<tr>
<td valign="TOP" class="sectionHeaderBlack"
width="20%"> </td>
<td align="left" colspan="2" valign="TOP" width="80%">
<span class="sectionHeaderBlack">
<A HREF="<%= DisplayManager.getURL
(STORE_CTLG_ITM_ROUTE", "item=" + services[i.getItemID()) %>">
<%=services.getDescription()%></A>
</span>
<%=services[i].getLongDescription()%>
</td>
</tr>
<tr>
<td colspan="3" class="sectionHeaderBlack"> </td>
</tr>
<% } //end loop through services
} // end if services.length > 0
if (relItems.length > 0) {
%>
<tr><td colspan="3"><br></td></tr>
<tr>
<td align="RIGHT" class="sectionHeader1" width="20%">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_REL_PRODUCTS")%>
</td>
<td align="left" colspan="2" class="sectionHeaderBlack"
width="80%"><hr></td>
</tr>
<%
for(int i=0; i < relItems.length; i++)
%>
<tr>
<td valign="TOP" class="sectionHeaderBlack"
width="20%"> </td>
<td colspan="2" align="left" valign="TOP"
width="80%">
<span class="sectionHeaderBlack">
<A HREF="<%= DisplayManager.getURL
("STORE_CTLG_ITM_ROUTE", "item=" + relItems[i].getItemID()) %>">
<%=relItems[i].getDescription()%></A>
</span>
<%=relItems[i].getLongDescription()%>
</td>
</tr>
<tr>
<td colspan="3" align="RIGHT"
class="sectionHeaderBlack"> </td>
</tr>
<% } // end loop through related items
} // end if relItems.length > 0
%>
</table>
</td>
<%if (complimentary.length > 0) {
%>
<tr><td colspan="3"><br></td></tr>
<tr>
<td align="RIGHT" class="sectionHeader1" width="20%">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_REL_PRODUCTS")%>
</td>
<td align="left" colspan="2" class="sectionHeaderBlack"
width="80%"><hr></td>
</tr>
<%
for(int i=0; i < complimentary.length; i++)
%>
<tr>
<td valign="TOP" class="sectionHeaderBlack"
width="20%"> </td>
<td colspan="2" align="left" valign="TOP"
width="80%">
<span class="sectionHeaderBlack">
<A HREF="<%= DisplayManager.getURL
("STORE_CTLG_ITM_ROUTE", "item=" + complimentary[i].getItemID())
%>">
<%=complimentary[i].getDescription()%></A>
</span>
<%=complimentary[i].getLongDescription()%>
</td>
</tr>
<tr>
<td colspan="3" align="RIGHT"
class="sectionHeaderBlack"> </td>
</tr>
<% } // end loop through related items
} // end if complimentary.length > 0
%>
</table>
</td>
<!-- right column -------------------------------------------
------------->
<td valign="top" width="20%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<% if (! binOpenImg.equals("")) {
%>
<td><img src="<%=binOpenImg%>"></td>
<% }
%>
<td nowrap class="binHeaderCell" width="100%">
<%
if (!lItem.isConfigurable()) {
%>
<%=lMsgMgr.getMessage("IBE_PRMT_CT_2_WAYS_TO_SHOP")%>
<% } else {
%>
<%=lMsgMgr.getMessage("IBE_PRMT_CT_CONFIG_PRODUCT")%>
<% }
%>
</td>
<% if (! binCloseImg.equals("")) {
%>
<td><img src="<%=binCloseImg%>"></td>
<% }
%>
</tr>
</table>
</td></tr>
<tr><td class="binColumnHeaderCell">
<table border="0" cellspacing="1" width="100%">
<tr><td class="binContentCell" align="CENTER">
<% /////////////////////////////// error
messages //////////////////////////////
if (!errorMsg.equals("")) {
%>
<table><tr><td align="center" class="errorMessage">
<%=errorMsg%>
</td></tr></table>
<% }
/////////////////////////////// display
form //////////////////////////////////%>
<!--Javascript for express checkout confirmation-->
<script language="JavaScript">
function get_confirmation(form)
if (confirm("<%=confirmXpr%>" ) ) {
form.tmpx.name = '1-Click.x';
form.tmpy.name = '1-Click.y';
form.submit();
return true;
else
return false;
</script>
<form method=POST action="<%=lBuyRoutePage%>">
<input type=hidden name="type" value="single">
<input type=hidden name="item" value="<%=lItem.getItemID()%
"><input type=hidden name="refpage" value="<%=lRef.toString
()%>">
<INPUT TYPE="HIDDEN" NAME="tmpx" VALUE="100">
<INPUT TYPE="HIDDEN" NAME="tmpy" VALUE="100">
<%= RequestCtx.getSessionInfoAsHiddenParam() %>
<%
if ( ! lItem.isConfigurable())
{ // display prices
%>
<table>
<tr><td align ="left" nowrap>
<span class="sectionHeaderBlack">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_LIST_PRICE_COLON")%>
</span>
</td>
<%
for (int i=0; i < uomCodes.length && i <
itemListPriceDisplayVec.size(); i++)
if (uomCodes[i] != null && uomCodes[i].equals
(lItem.getPrimaryUOMCode()))
if (itemListPriceDisplayVec.elementAt(i) != null &&
!itemListPriceDisplayVec.elementAt(i).equals(""))
%>
<td align="right">
<%=itemListPriceDisplayVec.elementAt(i)%
<%=lItem.getPrimaryUOM()%></td>
<% } else {
%>
<td> </td>
<% }
break;
} // end primary uomcode
} // end loop through uoms and list price
%>
</tr>
<tr><td align="left" nowrap>
<span class="sectionHeaderBlack">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_YOUR_PRICE_COLON")%>
</span>
</td>
<td>
<% // display selling price for each uom
if (nPriceDefined > 1) {
//prices defined for multiple UOMs for the item
%>
<select name = "uom">
<%
//--------- loop through uoms and prices ------------------
for (int i=0; i < itemSellPriceDisplayVec.size() && i <
uomCodes.length; i++)
if (itemSellPriceDisplayVec.elementAt(i) != null &&
!itemSellPriceDisplayVec.elementAt(i).equals(""))
boolean bSelectUom = false;
if (uomCodes[i] != null && uomCodes[i].equals
(lItem.getPrimaryUOMCode()))
bSelectUom = true;
if (bSelectUom)
%>
<option value="<%=uomCodes[i]%>" SELECTED>
<% } else {
%>
<option value="<%=uomCodes[i]%>">
<% }
%>
<%=itemSellPriceDisplayVec.elementAt(i)%
<%=IBEUtil.nonNull(lItem.getUOM(uomCodes))%
<%
} // end current uom has price
} //end loop i through uoms and prices
%>
</select>
<% //end more than 1 UOM with price defined for the item
} else {
if (nPriceDefined == 0) { //multiple UOMs, none with
price defined
%>
<input type=hidden name="uom" value="<%
=lItem.getPrimaryUOMCode()%>">
<% } else { // 1 UOM with price defined
String formatSellPrice = "";
String uomWithPrice = "";
for (int i=0; i < uomCodes.length && i <
itemSellPriceDisplayVec.size(); i++)
if (itemSellPriceDisplayVec.elementAt(i) != null &&
!itemSellPriceDisplayVec.elementAt(i).equals(""))
formatSellPrice = (String)
itemSellPriceDisplayVec.elementAt(i);
uomWithPrice = uomCodes;
break;
%>
<input type=hidden name="uom" value="<%=uomWithPrice%>">
<%=formatSellPrice%> <%=IBEUtil.nonNull
(lItem.getUOM(uomWithPrice))%>
<% } //end 1 UOM with price defined
} // end display selling prices
%>
</td></tr></table> <%-- end table for the price --%>
<% } // end non-configurable item
if (bItemCanBeOrdered)
// show quantity and buttons only if item can be ordered
%>
<p><%=lMsgMgr.getMessage("IBE_PRMT_CT_QUANTITY")%>
<input type="TEXT" name="qty" size="3" maxlength="20"
value="<%=qty%>">
</p>
<% if (lItem.isConfigurable()) {
%>
<p>
<input type=hidden name="uom" value="<%
=lItem.getPrimaryUOMCode()%>">
<input type=submit name="Configure.x"
value="<%=lMsgMgr.getMessage("IBE_PRMT_CT_CONFIGURE")%
"></p>
<% } else {
%>
<p>
<input type=submit name="Add to Cart.x"
value="<%=lMsgMgr.getMessage
("IBE_PRMT_ADD_TO_CART_PRMT_G")%>">
</p>
<%
if (!xprTagArea.equals(""))
%>
<p><%=lMsgMgr.getMessage("IBE_PRMT_CT_OR")%></p>
<p><jsp:include page="<%=xprTagArea%>"
flush="true" /></p>
<% }
} // end item can be ordered
%>
<br>
</form>
</td></tr></table> <%-- end table for bin content and
header --%>
</td></tr></table>
<p> </p>
<p> </p>
</td></tr></table> <%-- end page table --%>
<% } // end item loaded
%>
<%@ include file="ibeCZzdBottom.jsp" %>
<!-- ibeCCtdItemDetail.jsp end -->my bad...didnt think anyone was gonna come in ...lol......nothing populates in the second drop down...I was thinking of making a separate page and just pass the parameter in, bu i never used jsp include.....any suggestions on how to get this thing working??
-
I have this powershell script I have been running for some time that I have had to update to include functionality. It runs on a 2003x64 Server, but last time I updated it, it was done on XP machine, now I am updating on a Win7 box. The script works fine
on my Win7 v3-v4 Powershell, where as it fails on v1 on the ForEach ($Array in <<<<<
It's a pretty simple script, and I have tried modifying it to exhaustion to get it to work correctly, but can't seem to get it right. Is there a way around this, or do I have the syntax wrong for v1 that I can easily change? The below works fine in v3-v4.
I am afraid if it is failing on this ForEach, and I can't resolve, it may fall on others further in the script...
#JCBIII Kill Process and Send Email Details
#Ver1 06212009 JCBIII - Find Process running "x" minutes email and kill
#Ver2 09022014 JCBIII - Match PID with Commandline, kill, email and restart
#Setting Up Mailer
$emailSmtpServer = "smtpmail.domain.com"
$emailMessage = New-Object System.Net.Mail.MailMessage
$emailMessage.From = "[email protected]"
$emailMessage.To.Add( "[email protected]" )
$emailMessage.Subject = "Notepad - Kill/Restart Script..."
$emailmessage.IsBodyHTML = $true
#Process Age
$startTimeLimit = (get-date) - (new-timespan -minutes 5)
#Finding defined process using Age as requirement
$processes_to_kill = get-process | where {$_.StartTime -lt $startTimeLimit -and ($_.path -like "*notepad.exe") }
$PIDs = get-process | where {$_.StartTime -lt $startTimeLimit -and ($_.path -like "*notepad.exe") } | select Id -ExpandProperty Id
$Commands1 = ForEach ($PIDArray in $PIDs) {get-WmiObject Win32_Process -Filter "name = 'notepad.exe'" | where {$_.ProcessId -like $PIDArray} | select CommandLine -ExpandProperty CommandLine }
#Function to email
if ($processes_to_kill -ne $null)
ForEach ($Commands in $Commands1)
$emailMessage.Body = "<b>Notepad Process Restarted: </b><BR>" + $Commands + "`r`n"
$SMTPClient = New-Object System.Net.Mail.SmtpClient( $emailSmtpServer)
$SMTPClient.Send( $emailMessage )
#Function to match process with Commandline, kill and restart
if ($processes_to_kill -ne $null)
$processes_to_kill | foreach { $_.Kill()}
ForEach ($Commandx in $Commands1)
Invoke-Expression "& $Commandx"
The script fails in the finding defined process piece:
#Finding defined process using Age as requirement
$Commands1 = ForEach ($PIDArray in $PIDs) {get-WmiObject Win32_Process -Filter "name = 'notepad.exe'" | where {$_.ProcessId -like $PIDArray} | select CommandLine -ExpandProperty CommandLine }
Error received is similar to this:
Unexpected token 'in' in expression or statement.
At line:x char:xx
Any help with this is appreciated. (Of course the process names were changed, and email information, but it is all valid for notepad.exe process as well.)You are right. I am biased in favor of a world of intelligent people who can think. Americans have gotten lazy. They need social media and forums to solve the crisis of the
new technology. They fail to understand the basics.
I just gave you a perfect example of that.
I gave a general method for solving a problem that was being solved by pasting code together that made little sense. In that I used a V2 generalization.
There was push-back. I countered with a perfect pattern that challenges the intelligence of the reader. Can you evaluate the generalization and provide a current and acceptable solution?
You failed to do so.
The solution is to supply a parallel function so the script will work in all versions and be most flexible.
SOLUTION:
Create a Send-MailMessage function and provide it as a global function in the V2 profile.
Now I realize that this is technically way beyond the average desktop tech. Solving this may make you a better tech and get you a raise. Assuming you accept the challenge.
(Mission Impossible)
Cheers…
¯\_(ツ)_/¯
Maybe you are looking for
-
The bar right under the tabs is empty and just taking up screen real estate. It isn't so bad on my desktop monitor, but when I'm just using the laptop screen it is a lot of lost screen space. I have only noticed it over the past couple of days, and I
-
I downloaded new songs and now it wont let me put them on my ipod unless i erase all of the songs and just put the ones in my library. I think there are something like 140 or less songs in the library and there are almost 300 on my ipod. What gives?
-
How do I change the font and graphic size when using Firefox
I have recently switched from Windows to Mac. When resizing the window in Mac the font and graphic size do not follow -- they stay the same size and only more "white space" is created by increasing the window size. How do I get the graphics and fonts
-
Weird tracking numbers in character palette in Photoshop CC
Hi all, Have Adobe changed the way tracking values are interpreted in Photoshop CC? Just that if I select a line of text like normal and then set the tracking to eg. -50 when the change of tracking is made to the text this -50 value then turns into -
-
Hi, Can anyone help me out how to do reporting in master data for example I have an infoobject IO_MATNO, I have loaded attribute, text and transaction data ,noe I went to the cube and right clicked on it & selected the option insert characterstic as