Constructer
how can return a variable value from constructer to another main class's method
how can return a variable value from constructer to
another main class's method"constructer " can return only instance of that class you are creating.
Similar Messages
-
How to pop up "save" and "open" window - Help with construct xml
In my report there is a column link which is pointing to another HTML page that has xml data displayed in a textarea field. So when user clicks on the column link, he gets to directed to the page that have the xml data in text format.
My question is, how can i make the xml data display as a file, so when the user clicks on the column link, a window with "save" and "open" will pop up so the user can save the xml data as a file?
Has anyone done something similar like this? any help is appreciated!
Regards,
gina
Message was edited by:
ginaThank you Tine, I tried to use the 'Export XML' report template and tried to do the following query:
SELECT XMLElement("oai_dc:dc",
XMLAttributes('http://www.openarchives.org/OAI/2.0/oai_dc/' AS "xmlns:oai_dc",
'http://purl.org/dc/elements/1.1/' AS "xmlns:dc",
'http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi",
'http://www.loc.gov/mods/v3' AS "xmlns:mods"
XMLForest(
dctitle AS "dc:title",
dccreator AS "dc:creator",
dcsubject AS "dc:subject",
dcdescription AS "dc:description",
dccontributor AS "dc:contributor",
dcdiscovery AS "dc:discovery",
dctype AS "dc:type",
dcformat AS "dc:format",
LOWER('ksl:posters-' || dcidentifier) AS "dc:identifier",
dcsource AS "dc:source",
dclanguage AS "dc:language",
dcrelation AS "dc:relation",
dccoverage AS "dc:coverage",
dcrights AS "dc:rights")) AS "RESULT"
FROM table_name
and here is what returned in the “save as" file:
<?xml version="1.0" encoding="utf-8" ?>
- <XMLREPORTREGION>
- <ROW ROWNUM="1">
<RESULT>[datatype]</RESULT>
</ROW>
</XMLREPORTREGION>
How can i construct the query so that it returns the data in xml format like the following?:
oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:title>Rose</dc:title>
<dc:creator>Smith Black</dc:creator>
<dc:contributor>Smith Black</dc:contributor>
<dc:type>Stencil</dc:type>
<dc:format>image/tiff</dc:format>
<dc:format>image/jp2</dc:format>
<dc:description>13 3/4" X 9 1/2"</dc:description>
<dc:relation>Some collection</dc:relation>
<dc:date>1987</dc:date>
<dc:subject type="LCSH">Art Project</dc:subject>
<dc:subject type="LCSH">........</dc:subject>
<dc:subject type="LCSH">.........</dc:subject>
<dc:language>eng</dc:language>
<dc:rights>......<dc:rights>
<dc:identifier>.....</dc:identifier>
</oai_dc:dc>
I don't know much about xml, any help would be really appreciated.
Thanks,
gina
Message was edited by:
gina -
Can we use sap bw in a construction company
Hi
can v use sap bw in a construction company....... If so, what kind of project can we do?
can anyone explain me?
plz give me any links which may help me to understand the projects or where v can find any sample projects of bw
Thank you
Deepthi matturiHi,
I think we can use Contract management for these types of industry.
You can use the standard BI contents for contract management.
Pls chk this link for more info:
http://help.sap.com/saphelp_nw70/helpdata/en/94/c3f252a2ce374d98c27ff66625a765/frameset.htm
Hope this helps.
thanks,
rahul -
How to Dynamically construct the conditional IF statement in java
Is there a way to dynamically construct a conditional IF statement in java?
For example:
Suppose i have a 2D array like:
Array[the actual values to search for][the column number in the table to perform the search on].
e.g.
Array {
{"x"} , {1},
{"y"} , {2},
{"z"} , {3},
}How can i construct the if statement like:
Looping over table rows (tableRow) {
Looping over array {
IF ( {"x"}. equals( tableModel.getValueAt( tableRow, {1}) &&
{"y"}. equals( tableModel.getValueAt( tableRow, {2}) &&
{"z"}. equals( tableModel.getValueAt( tableRow, {3}) )
return true;
}The array can grow or shrink based on the values in it so therefore IF statement will grow or shrink. How can i achieve it?
If not then how can i achieve this?My understanding (feeble at best) is that a sieries of && elements will be evaluated in order until the first false value is encountered. So, in an "if a && b && c" statement where b is false c will never be evaluated and the conditional executable will not run. Is that what you mean?
Yes, logical expressions will not evaluate unnecessary operands. So you can safely write the following, for instance, without getting an error,
if ((anArray != null) && (anArray.length > 0)) { ... }because the second operand of the '&&' will never be evaluated if 'anArray' is null.
Also, is there a difference between & and &&?
& is a bitwise operator, && is a boolean operator. -
How to construct checkbox in rtf document using iText?
Hi fiends
I am developing a rtf document usng iText api ,I am facing problem when i want to draw a check box in the document so is there any way using iText only to draw a checkbox in rtf document?Or iText doesn't allow construct checkbox?please suggest.An example will be appreciated.Thanks in advance.
Regards soumyanilFor your kind information this is a site that provides support for JAVA programming and JAVA Servlets related questions.
You need some information regarding a third party API, so please dont hesitate to contact your vendor.
The vendor URL: http://itextdocs.lowagie.com/
The tutorial you need to learn before starting iText is http://itextdocs.lowagie.com/tutorial/
All the best! -
Help needed in constructing a tree
Help needed in constructing a tree. I was wondering if some one can suggest me how to add messages in the second column for both the parent node and child elements.
I was able to create a tree succefully, but want to add some description in the second column for the first column elements, for both parent and child elements.
Please suggest me how to add the arrays to second column for parent and child nodes.
Solved!
Go to Solution.
Attachments:
Tree_fix.vi 15 KBThe Child Text parameter is the one you are searching for. It accepts a 1D string array for the following columns.
hope this helps,
Norbert
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it. -
How do you construct a web form using coldfusion??
How do you construct a web form using coldfusion?? any
examples?
thanks in adv.A sample Form:
<cfform action="CCARProc.cfm"
enctype="multipart/form-data" method="post" name="CCAR"
onsubmit="return verify()">
<table width="730" border="0" cellpadding="2"
cellspacing="1" align="center" class="unnamed1">
<!--DWLayoutTable-->
<tr valign="top">
<td colspan="3" bgcolor="#F2F2F2">Name Of
Requester(<font color="red">*</font>)</td>
<td width="402" bgcolor="#F2F2F2"><cfinput
type="text" name="Requestor_Name" size="15" value="#REQNAME#"
maxlength="25" >
MTABT Email(<font
color="red">*</font>)
<cfinput name="Req_Email" type="text" size="8"
maxlength="20" value="#ReqEmail#"
>@mtabt.org</td></tr>
<tr>
<td colspan="3">Requester Telephone #(<font
color="red">*</font>) </td>
<td><cfinput type="text" VALUE="#REQPHONE#"
name="RPhone" size="12" maxlength="12" message="Requester Phone
cannot be blank / Invalid Entry!" required="yes"
validate="telephone"> [e.g. xxx xxx xxxx or
xxx-xxx-xxxx]</td>
</tr>
<tr>
<td colspan="3" bgcolor="#F2F2F2">Facility(<font
color="red">*</font>)</td>
<td bgcolor="#F2F2F2">
<cfselect name="Facil">
<option value="2B">2B </option>
<option value="BBT">BBT </option>
<option value="BW">BW </option>
<option value="CB">CB </option>
<option value="HH">HH </option>
<option value="MP">MP </option>
<option value="QMT">QMT </option>
<option value="RI">RI </option>
<option value="TM">TM </option>
<option value="TB">TB </option>
<option value="TN">TN </option>
<option value="VN">VN </option>
</cfselect>
</td>
</tr>
<tr>
<td colspan="3">Department(<font
color="red">*</font>)</td>
<td><cfselect name="Dept">
<option value="Contracts">Contracts </option>
<option value="Engineering">Engineering
</option>
<option value="Executive Office">Executive
Office</option>
<option value="Finance">Finance </option>
<option value="General Counsel">General Counsel
</option>
<option value="HS">HS </option>
<option value="HR">HR </option>
<option value="ISD">ISD</option>
<option value="Legal">Legal </option>
<option value="Labor Relations">Labor Relations
</option>
<option value="Operations">Operations </option>
<option value="Payroll">Payroll </option>
<option value="Planning & Budget">Planning &
Budget </option>
<option value="Procurement & Mtrl">Procurement
& Mtrl </option>
<option value="Purchasing">Purchasing </option>
<option value="Revenue Management">Revenue Management
</option>
<option value="Staff Services">Staff Services
</option>
<option value="SD">SD</option>
<option value="Technology">Technology</option>
</cfselect></td>
</tr>
<tr>
<td colspan="3" bgcolor="#F2F2F2">Division(<font
color="red">*</font>)</td>
<td bgcolor="#F2F2F2"><cfinput name="Div"
type="text" size="20" maxlength="25" VALUE=""></td>
</tr>
<tr valign="top">
<td height="27" colspan="3" >Justification(<font
color="red">*</font>)</td>
<td bgcolor=""><textarea name="Justi" cols="50"
rows="3" wrap="VIRTUAL" ></textarea> </td>
</tr>
<tr>
<td colspan="3" bgcolor="#F2F2F2">VP Approval
By (<font color="red">*</font>)</td>
<td bgcolor="#F2F2F2"><cfinput name="VPAppFName"
type="text" size="20" maxlength="25" VALUE="#VPFName#">
MTABT
Email(<font color="red">*</font>)
<cfinput name="VPE" type="text" size="8" maxlength="20"
value="#VPEmail#" >@mtabt.org</td>
</tr>
<tr>
<td colspan="3" valign="top"
bgcolor="#F2F2F2"></td>
<td colspan="2" rowspan="2" valign="top"
bgcolor="#F2F2F2"><div align="left">
<input name="Submit" type="submit" value="SubmitTheForm"
class="button"
style="font-size='10pt';color='#663399';font-face='Arial,
Helvetica, sans-serif';" >
<input name="Reset" type="reset" value="ReSetTheForm"
class="button"
style="font-size='10pt';color='#663399';font-face='Arial,
Helvetica, sans-serif';">
</div></td>
<td width="90" valign="top"
bgcolor="#F2F2F2"></td>
</tr>
</table>
<div align="right"><span class="style4">Revised(
01.28.05 )</span>
<input name="submitDate" type="hidden"
value="<cfoutput>#DateFormat(Now(),'mm/dd/yy')#</cfoutput>">
</div>
</cfform> -
How to construct the component tree in my custom component?Help!
Hi, i am writing a custom component like this:
public class HtmlCategory extends HtmlPanelGrid
public void processRestoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
setColumns(1);
HtmlCommandLink link=new HtmlCommandLink();
link.setValue("Let's Bingo");
MyUtil.setActionListener(context,link,"#{temp.mytest}");
UIParameter param=new UIParameter();
param.setName("name");
param.setValue("Robin!");
link.getChildren().add(param);
param.setParent(link);
getChildren().add(link);
link.setParent(this);
super.processRestoreState(context,state);
} you see, i want to construct the compont tree at Restore View phase this way,because the structure of the component tree will always be the same, so i don't the user to write extra code.
But the children of the component are not rendered,the renderer of the HtmlCategory component just extends the HtmlGridRenderer(myfaces) directly,and always calls the "super" methods in the encode methods of the renderer.
I got a message from the console:
Wrong columns attribute for PanelGrid id0:id4: -2147483648
but i have set the columns attribute in the code above, so what's happening? or please give some advice about how to render the component tree by myself in Restore View with the tree constructing code in the custom component class code,just lke the code above.
Best Regards:)
RobinWell, i don't know if i have got my question clear.
usually, according to the tags you use in the jsf page, a component tree will be created at the Restore View phase,for example:
<f:form>
<h:panelGrid ...........>
<h:dataTable ................>
</h:dataTable>
</h:panelGrid>
</f:form>but because i am writing a component for my web app, all the child components and their attributes are not likely to change. so i want to reduce the tags into one custom tag, and construct the component tree internally by myself.But it is not the case of backing bean.So i wrote the the code in the method:
public void processRestoreState(javax.faces.context.FacesContext context,java.lang.Object state)as it is shown in my orginal message.But it seems that it is not right way to construct my component tree.So where should i put the code that construct the component tree?Overriding the method :
public void processRestoreState(javax.faces.context.FacesContext context,java.lang.Object state)is not the right way?
Best Regards:)
Robin -
Settlement of WBS element down payments to an asset under constructions
The down payment (of the transactions tcode F-47 and tcode F-110), are
always settlement wbs element (tcode CJ88), we do not want to post down
payments to the receiving asset under construction (transaction type
180 or 181).
In the down payments are always taken into account in the settlement to
an asset. The settlement of the down payment is the actual reason for
the previous update of down payments in FI (Transaction type group
15). Furthermore, the settlement of down payments to assets should
not be capitalize.When you search on this forum try to put Date range "ALL" to get more results. Please read below threads and you will get the solution.
MIRO:Transaction in area 15 contradicts the net book value rule
Transaction in area 01 contradicts the NBV
Looks like you have a negative balance in your WBS which you are trying to settle to FA. -
How to construct a sql query when field having single quote
Hi all,
I have been working on web application , here is my requirement:
I'm constructing sql statement dynamically from dynamic user input (form data). In one of the field having single quote.
while executing the query it is getting problem because of single quote .. so how do i resolve my problem.
single quote should be there. (I'm using Ms-Access as my database).
Thanks in advance
abelUse PreparedStatement. Always. It not only eases setting Java objects in a SQL query, but also protects you against SQL injections.
Prepare yourself: [http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html]. -
How to construct a faces request from a http request?
I wonder how FacesServlet.service determines whether it should be calling LifecycleImpl.execute in oppose to calling LifecycleImpl.render?
Basically, I'm trying to construct a http request that would go through the decode method of my UIComponent. However, it seems that my request has always been treated as a non-faces request, where it goes to the render face directly.
Does anyone know how do I need to construct my http request so that it'll be recgonized as a faces request?
Anyone knows where i can download the source code for FacesServlet?
thanks!Sorry, are you saying that FacesServlet ALWAYS call execute before render even if it's the first request?
What I experienced is that for the first request, execute isn't called, and it goes directly to render.
And if I use the html form submit on the 2nd request, it does go to execute, then render.
However, if i construct another http request, it'll act like a first request, where it doesn't go through the execute, but striaght to render.
This is what I set in web.xml:
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
I call my jsp using http://server:8080/faces/my.jsp, and I'm using tomcat 5. Any help would be appreciated. -
How do I deal with problems during business object construction?
Hi Everyone.
I'm wondering about best practices for program control flow when business objects can't be constructed properly.
In my servlet I want to create a new Transaction business object based on the parameters of the HttpServletRequest.
transaction = new Transaction( request );The Transaction, in turn, has a Customer business object representing the Customer doing the transaction. The Customer is also constructed based on request parameters. So I have in the Transaction constructor,
public Transaction( HttpServletRequest request ) {
customer = new Customer( request );
}In the Customer constructor I want to do some validation. For example, I want to check that the requested Customer exists in the database.
If the validation fails, should I throw an exception, which could then eventually be caught by the Servlet which would send back an "Invalid Customer" message to the end user?
But it seems to me like this violates the "never use exceptions for flow control" rule (as described for example at http://onjava.com/pub/a/onjava/2003/11/19/exceptions.html?page=2).
It is a normal function of my application to deny a transaction to a non-valid customer... so it seems like I shouldn't need to bring in the exception handling overhead for this normal business process.
OK, so I guess put "is_valid" flags in the business objects and set them on constructor errors then check them??
public Transaction( HttpServletRequest request ) {
customer = new Customer( request ); // customer.is_valid flagged false
if ( !customer.get_is_valid( ) ) {
this.is_valid = false; // transaction.is_valid is also false now because its Customer is not valid
} else { // customer is valid
// finish the rest of the Transaction construction business logic
// of course this will turn into a mess of deeply nested "else valid" clauses
// if there are many validation checks...
}...and then in the servlet...
transaction = new Transaction( request );
if ( !transaction.get_is_valid( ) ) {
// Send back error message to user.
} else {
// Finally do some business logic. Maybe after another mess of nested "else valid" clauses.
}This gets so hard to read it seems like the throwing Exceptions as part of normal control flow option is preferble.
Is there third option I am missing?
What are your opinions?
Thanks,
BishopBuild your Transaction and Customer objects based on the data in the request. Then validate the customer, since an invalid customer is "normal" for you.
I'd consider using some sort of factory-like method for creating these objects from the request, since you're tying (sort of) your business stuff to the fact you're currently using a webby (servlet-based) front end...but that's more an aside.
So, in pseudo-ish code:
Transaction t = createTransaction(request);
if (t.validCustomer()) do work;
else return to wherever;This is only a first-pass idea, and other requirements might knock it for six, but it's a startpoint. -
Can we have a for loop/ the loop control construct in an etext template?
Hi All,
Can we have a loop control construct in etext templates?
I have to print a remittance advice of only 11 invoices per page only. How can I do this?
Your help in this regard is really appreciated.
Rgds,
Kiran PanditiHi Ravi,
Do you use SharePoint Designer 2007?
Have you tried to use sequence approval workflow with participants in serial order?
http://office.microsoft.com/en-001/sharepoint-designer-help/understand-approval-workflows-in-sharepoint-2010-HA101857172.aspx
If you use SharePoint Designer 2013, there is an "loop" operation available you can take a look.
http://prasadtechtactics.blogspot.in/2012/07/sharepoint-designer-2013-workflows-part_24.html
Thanks
Daniel Yang
TechNet Community Support -
How can I construct Group contact files of email addresses?
How can I construct 'Group' files of email addresses, i.e. the equivalent of files of multiple email addresses that are easily constructed in Outlook Express for sending an email to multiple people by simply entering the name of the file containing the email addresses to which one wishes to send a given email?
Unfortunately, you can't do that in the contacts app or in the mail app on the iPad. There are a couple of third party apps that I know that will do that for you. MailShot and Group Email With Attachments.
https://itunes.apple.com/us/app/mailshot-group-email-done/id410279354?mt=8
https://itunes.apple.com/us/app/group-email!-mail-client-attachments/id380690305 ?mt=8 -
How to construct a formula for this logic.
Hi,
I have a requirement like, i need to derive a column with a calculation.
Here is the psedocode,
count of occurance (deptno=10)/count (deptno=10)
Desired result:
If the deptno =10 occurs 3 times in the table then at the fist time the calcuation should be,
1/3, second time 2/3, third time 3/3 and so on.
How can i construct this in a formula/report/rpd design. Please help.
Any help will be appreciated with points.
Thanks.The running aggregate will help you do this, i.e. RCOUNT, RSUM
This should work:
RSUM( CASE WHEN deptno = 10 THEN 1 ELSE 0 END )
to give you the running count of the rows where deptno = 10
Then you can divide ths by
SUM( CASE WHEN deptno = 10 THEN 1 ELSE 0 END )
not sure if that will work 100% or not but try the first statement so you can see the running aggregate working, then try the division to see if it works:
RSUM( CASE WHEN deptno = 10 THEN 1 ELSE 0 END ) / SUM( CASE WHEN deptno = 10 THEN 1 ELSE 0 END ) -
How to construct the where clause for a nested xml target file
Post Author: jlpete72
CA Forum: Data Integration
I'm having some problems getting the desired results creating a multi-level nested xml file. Specifically, it does not seem that the where clause in the child schemas respects values from parent schemas. I'm sure I'm constructing something incorrectly, but am running out of ideas.
I am working with the classic company/order/line hierarchy and there are three levels of output schemas in my target xml file, one for company, order header and order line information.
For testing, I have hardcoded a restriction at the order header line to deal with only one order. But unless I hardcode values into the where clause at the order line level of the schema, all values are returned for orders belonging to the company defined in the company level.
I'm trying a where clause at the order line level similar to:
order_line.customer = order_header.customer and order_line.order_num = order_header.order_num
If the customer has more than one order in the data file, then all orders for that customer are placed in the detail for the order header. Only if I hard code the order number in the where clause do I get only the lines for the order specified in the header section. Not very practical.
What am I missing?An External Parsed Entity could be used to reference a schema.
In your DTD:
<!ENTITY datamodules SYSTEM "file:///c:/Datamodules/Datamodules.xsd">
Refer the external entity in xml document:
<datamodules>&datamodules;</datamodules>
Maybe you are looking for
-
One music album fragments into many. How to prevent?
(This is a problem that happens when I use my preferred method of viewing albums, "show items in a list, grid or with cover flow) When I import a single album which is a 2 or 3 CD set onto i-tunes, it shows each CD as a separate album, even though th
-
How do I print a pdf file that is printing too light to read??
I have a pdf that I must print to buy a home. It will not print as is. I shot screen shots, brought them into Photoshop, made them jpgs and adjusted the gamma to make them very black and white. It helped but the pages cannot be read. There is plent
-
5800 wlan problem after update
After my 5800 update, if i try to connect it on internet by wlan, a message appears in which there's written: full memory, close open applications. I checked the device, but the only active tasks are the menu and the main screen. No other program is
-
How to include a key value, per employee, in payslip print program output?
Employee payslips are printed externally. The output file has to include a 3 char value, per employee, to determine the logo that will be printed on to the payslip. What is the best way to include this 3 char value in the output file? I assume the be
-
Do not show the Mac menu bar and the Dock in full-screen mode option not available
"Remote Desktop Connection" for mac has an option to hide the menu bar in full screen mode. I am unable to locate this option in the new Microsoft Remote Desktop. Without this option the remote desktop connection bar becomes completely inaccessible