Xml string passed as parameter to xsql
I am trying to pass xml string as parameter to xsql.But having problems with the < and > .I tried to escape
those chars but but i am not getting desired output.Could you please suggest how to pass the xml string .
<xsql:include-xsql href="order.xsql?neworder='{@neworder}'
i trying to pass neworder parameter as xml string which contains data to update 2-3 table .
u can't post a parameter valued by a xml string,because of the xml string must be
has xml element with attributes. as follows:
<row num="1">
the "=" will make the web container got error
when parsing http request parameters's name and value pair.
solution:
1. use "post" method submit your parameter
2. use microsoft xml http compoment post your param as a parameter
of it's "send" method, and set the request contentType header "text/xml"
in xsql file:
<xsql:set-page-param name="param1" xpath="/parameters/neworder"/>
try it :->
Similar Messages
-
How to process a large XML string passed to a LONG variable?
I am attempting to extract and loop through some XML that is stored in a variable (v_xml_string) that is defined as LONG data type. However, I am receiving an ORA-01460: unimplemented or unreasonable conversion requested when the string value exceeds 20 records in the XML layout below. When I performed a LENGHTB on a sample XML string containing 19 records (just below the threshold of erroring), I get 3895, which I'm assuming is in BYTES...this is not near the 32,760 byte limit of PL/SQL variables defined as LONG. I suppose my other alternative is that I use CLOB datatype instead of LONG.
XML layout:
<?xml version="1.0"?>
<DocumentElement>
<tblElections>
<EmpID>872G4</EmpID>
<MgrNTID>JohnDoe</MgrNTID>
<Entity>050595</Entity>
<AddlAmt>1000</AddlAmt>
<CheckedForSave>Y</CheckedForSave>
</tblElections>
</DocumentElement>sample of code where error appers to be occurring:
DECLARE
v_xml_string LONG;
BEGIN
FOR v_xml_rec IN (SELECT t.COLUMN_VALUE.extract('/tblElections/EmpID/text()') .getStringVal() EmpID,
t.COLUMN_VALUE.extract('/tblElections/MgrNTID/text()') .getStringVal() MgrNTID,
t.COLUMN_VALUE.extract('/tblElections/FAEntity/text()') .getStringVal() FAEntity,
t.COLUMN_VALUE.extract('/tblElections/AddlSLEAAmt/text()') .getStringVal() AddlSLEAAmt,
t.COLUMN_VALUE.extract('/tblElections/CheckedForSave/text()') .getStringVal() CheckedForSave
FROM TABLE(xmlsequence(XMLTYPE(v_xml_string) .extract('/DocumentElement/tblElections'))) t)
LOOP
... <do some stuff here>
END LOOP;
END;Strings in SQL are limited to 4000 in length, the long variable will work up to 32K as long as it is not used in SQL, if it goes over 4000 you will get the error.
SQL> declare
2 l long;
3 begin
4 l := rpad('x',32000,'x');
5 dbms_output.put_line('length is : ' || to_char(length(l)));
6 end;
7 /
length is : 32000
PL/SQL procedure successfully completed.
SQL> edi
Wrote file afiedt.sql
1 declare
2 l long;
3 n number;
4 begin
5 l := rpad('x',32000,'x');
6 select length(l) into n from dual;
7 dbms_output.put_line('length is : ' || to_char(n));
8* end;
SQL> /
declare
ERROR at line 1:
ORA-01460: unimplemented or unreasonable conversion requested
ORA-06512: at line 6
SQL> edi
Wrote file afiedt.sql
1 declare
2 l long;
3 n number;
4 begin
5 l := rpad('x',4000,'x');
6 select length(l) into n from dual;
7 dbms_output.put_line('length is : ' || to_char(n));
8* end;
SQL> /
length is : 4000
PL/SQL procedure successfully completed.
SQL> edi
Wrote file afiedt.sql
1 declare
2 l long;
3 n number;
4 begin
5 l := rpad('x',4001,'x');
6 select length(l) into n from dual;
7 dbms_output.put_line('length is : ' || to_char(n));
8* end;
SQL> /
declare
ERROR at line 1:
ORA-01460: unimplemented or unreasonable conversion requested
ORA-06512: at line 6
SQL> -
Why not passing only one XML String parameter to Axis Web Service interface
Hi,
I am a newbie of axis and this is the first post in SUN site.
I am writing a web service. I am considering this question after trying some examples in Axis:
Why not defined parameters of our service interface (Service method.) as a XML String? -We can provide a XML Schema to Client, client fill all required information to a XML according to XML Schema. Seem that it is more straightforward than passing some complex objects.
Your answer will be high appreciated!
Thanks,
-HutDid you find a solution for that? Even im trying the same...
-
Performance problem submitting big XML string parameter to the web service
We deployed a web service on the OC4J via oracle.j2ee.ws.StatelessJavaRpcWebService . This web service takes one string as a parameter. The string contains XML. Evrything works great UNLESS input XML string reaches 5Mb in size. When it happens OC4J does something with it for about 10 minutes (yes, minutes) before it calls the web service method. At this time java.exe consumes 100% of CPU.
WE tried to increase JVM heap size, stack size, etc, - no effect.
Please, help!
Thank you in advance,
Vlad.Hi Sheldon,
What i feel is that it's not been handled in your webservice if the parameter is null or "" <blank> space
i just you to take care in webservice that if the parameter is null or "" pass the parameter null to the stored proc
Regards
Pavan -
Passing XML String via HTTP Sender
Hello everyone,
currently we try to find a solution on the following requirement - maybe you have useful advice for us:
8 different business documents can be sent via a web-interface to SAP XI via the http sender adapter. We already have a customized JCo Class that takes only one input parameter (containining the XML string of the business document).
I think the easiest way would be to receive the XML string from the web-interface and pass it directly on to the JCo-Class in a Java Mapping.
Is it possible to create a generic message type for all 8 types of XML documents that contains just one element holding the XML as string? By doing so we could use the same URL for all 8 different XML types and pass it directly on as input paramenter to the JCo Class.
Do you have any idea how to do this?
Thank you very much.Does the HttpURLConnection conn send the string along with the headerYes.
-
Passing / parsing XML String IN / OUT from PL / SQL package
Hello, People !
I am wondering where can I find exact info (with code sample) about following :
We use Oracle 8.1.6 and 8.1.7. I need to pass an XML String (could be from VARCHAR2 to CLOB) from VB 6.0 to PL/SQL package. Then I need to use built in PL/SQL XML parser to parse given string (could be large hierarchy of nodes)
and the return some kind of cursor thru I can loop and insert data into
different db Tables. (The return value may have complex parent/child data relationship - so I am not sure If this should be a cursor)
I looked online many site for related info - can't find what I am looking
for - seems like should be a common question.
Thanx a lot !Hello, People !
I am wondering where can I find exact info (with code sample) about following :
We use Oracle 8.1.6 and 8.1.7. I need to pass an XML String (could be from VARCHAR2 to CLOB) from VB 6.0 to PL/SQL package. Then I need to use built in PL/SQL XML parser to parse given string (could be large hierarchy of nodes)
and the return some kind of cursor thru I can loop and insert data into
different db Tables. (The return value may have complex parent/child data relationship - so I am not sure If this should be a cursor)
I looked online many site for related info - can't find what I am looking
for - seems like should be a common question.
Thanx a lot ! -
How to pass a string as a parameter after it has been generated on console
This is wat i want to do...when a sentence has been generated on console(using Bingo.startConversation())..i want to pass this sentence(which is ofcourse string) as a parameter into another method Bingo.reply(???)..wat shud i use in the place of ???
this is my code
public static void main(String[] args) {
Conversation conversation=new Conversation();
Bingo bingo=new Bingo ();
System.out.println("Start");
System.out.println(">>");
System.out.println(Bingo.startConversation());//this line generates a sentence on console//
System.out.println(Bingo.reply(???));-> this is my code
Still didn't use the "Code" tags like you've been asked to do in other postings.
So, still no help. -
How do I pass a parameter to a portlet on the URL?
I have a portlet on one tab that searches for parts. (This portlet is written and maintained by someone else.) When a user clicks on a part number in the result set on this portlet they need to be taken to another tab (different portlet on the same page) with that part number as a parameter. The second portlet then dynamically writes an
<iframe src="http://someurl?partnumber=xyz" />
to call an external application passing the part number as a URL parameter to the external application.
Writing the <iframe /> dynamically is no problem. The problem is passing the part number from one portlet to another. We planned to do this by using hrefs in the part search portal using URLs like
http://hostname:port/pls/portal/url/page/test1/portlet2?partnumber=xyz
for each part number. The problem is that the URL parameter doesn't get passed to the second portlet. Here is the code in the second portlet:
<%
PortletRenderRequest portletRenderRequest =
(PortletRenderRequest)request.getAttribute("oracle.portal.PortletRenderRequest");
String partnumber = portletRenderRequest.getQualifiedParameter("partnumber");
%>
It always sees null for the partnumber parameter.
I also have <passAllUrlParams>true</passAllUrlParams> in provider.xml.
I've tried checking this by calling the URL of the second portlet directly from a browser. The portlet sees the partnumber parameter as null, but the URL window in the browser returns the modified URL from the portal with the partnumber parameter set properly. Portal is seeing the parameter but not passing it to the portlet.
I haven't tried actually setting the in the first portlet and seeing if it all works when called from inside the portal, but I don't see why it shouldn't work by calling the second portlet URL directly with a parameter.
Am I missing some step in order to pass a parameter from one portlet to another? The parameters I have to pass are dynamic, based on the result set returned by a search in the first portlet.My second to last paragraph should have been:
"I haven't tried actually setting the hrefs in the first portlet and seeing if it all works when called from inside the portal, but I don't see why it shouldn't work by calling the second portlet URL directly with a parameter." -
Passing a parameter to a method in the dataTable's value attribute
Hi,
I'm brand new to JSF, so I might be overlooking something really simple. I'm trying to use a dataTable to display data from a database. It works fine until I try to pass a parameter to "#{customer.all}". My backer bean is ready (or so I believe) and is included after the jsp code snippet. What do I need to do to the jsp/jsf code in order to pass this parameter?
jsp code:
<html>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>
<head>
<link href="styles.css" rel="stylesheet" type="text/css"/>
<title>
<h:outputText value="#{msgs.pageTitle}"/>
</title>
</head>
<body>
<h:form>
<h:dataTable value="#{customer.all}" var="customer"
styleClass="customers"
headerClass="customersHeader" columnClasses="custid,name">
<h:column>
<f:facet name="header">
<h:outputText value="#{msgs.customerIdHeader}"/>
</f:facet>
<h:outputText value="#{customer.Cust_ID}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{msgs.nameHeader}"/>
</f:facet>
<h:outputText value="#{customer.Name}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{msgs.phoneHeader}"/>
</f:facet>
<h:outputText value="#{customer.Phone_Number}"/>
</h:column>
</h:dataTable>
</h:form>
</body>
</f:view>
</html>backer bean:
package com.corejsf;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.jsp.jstl.sql.Result;
import javax.servlet.jsp.jstl.sql.ResultSupport;
import javax.sql.DataSource;
public class CustomerBean {
private Connection conn;
public void open() throws SQLException, NamingException {
if (conn != null) return;
Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/mydb");
conn = ds.getConnection();
public Result getAll(sName) throws SQLException, NamingException {
try {
open();
Statement stmt = conn.createStatement();
ResultSet result = stmt.executeQuery("SELECT * FROM Customers where Name = '" + sName + "'");
return ResultSupport.toResult(result);
} finally {
close();
public void close() throws SQLException {
if (conn == null) return;
conn.close();
conn = null;
}Thanks,
DaveMogambo,
Thanks for the response. Let me see if I understand. Let's say I have a login.jsp page, and after the user logs in I want to display all of his orders in a dataTable in summary.jsp. You're saying I should actually run the query in LoginBean.java after doing the submit, something like this right?
login.jsp:
<html>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>
<head>
<title>A Simple JavaServer Faces Application</title>
</head>
<body>
<h:form>
<h3>Please enter your name and password.</h3>
<table>
<tr>
<td>Name:</td>
<td>
<h:inputText value="#{login.name}"/>
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<h:inputSecret value="#{login.password}"/>
</td>
</tr>
</table>
<p>
<h:commandButton value="Login"
action="#{login.doLogin}"/>
</p>
</h:form>
</body>
</f:view>
</html>
LoginBean.java:
public class LoginBean {
private String name;
private String password;
private ResultSet results;
// PROPERTY: name
public String getName() { return name; }
public void setName(String newValue) { name = newValue; }
// PROPERTY: password
public String getPassword() { return password; }
public void setPassword(String newValue) { password = newValue; }
// PROPERTY: results
public ResultSet getResults() { return results; }
public void setResults(String newValue) { results = newValue; }
public String doLogin(){
Integer liUserID = null;
// authenticate user and return user's internal ID
liUserID = authenticateUser(name, password);
if ( liUserID == null){
return "failure";
else{
results = getUserOrders(liUserID);
return "success";
faces-config.xml:
<?xml version="1.0"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
<navigation-rule>
<from-view-id>/login.jsp</from-view-id>
<navigation-case>
<from-outcome>login</from-outcome>
<to-view-id>/summary.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>login</managed-bean-name>
<managed-bean-class>LoginBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/login.jsp</from-view-id>
<navigation-case>
<from-action>#{login.doLogin}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/summary.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-action>#{login.doLogin}</from-action>
<from-outcome>failure</from-outcome>
<to-view-id>/login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>And then I assume that my summary.jsp would look like this, using login.results as my value for the dataTable?
<html>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>
<head>
<link href="styles.css" rel="stylesheet" type="text/css"/>
<title>
<h:outputText value="#{msgs.pageTitle}"/>
</title>
</head>
<body>
<h:form>
<h:dataTable value="#{login.results}" var="order"
styleClass="orders"
headerClass="ordersHeader" columnClasses="orderid,name">
<h:column>
<f:facet name="header">
<h:outputText value="#{msgs.orderIDHeader}"/>
</f:facet>
<h:outputText value="#{order.Order_ID}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{msgs.nameHeader}"/>
</f:facet>
<h:outputText value="#{order.Name}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{msgs.phoneHeader}"/>
</f:facet>
<h:outputText value="#{order.Phone_Number}"/>
</h:column>
</h:dataTable>
</h:form>
</body>
</f:view>
</html>Does this look reasonable?
Thanks,
Dave -
How to query WCF webservice and pass a parameter
I am using SQL Server 2012, and I have use SSRS quite extensively to query SQL Server and Oracle data, but I am currently trying to query a new WCF web service, call a method and pass a parameter. The XML query language is something I know very little
about.
So far all I have is the URL to the web service like so: http://webserv-01:8025/Tst_DataService.svc
When I browse to that url and access the wsdl: http://webserv-01:8025/Tst_DataService.svc?singleWsdl
I get a bunch of info like this on the page:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:wsa10="http://www.w3.org/2005/08/addressing"xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" name="CSS_DataService" targetNamespace="http://tempuri.org/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<xs:element name="GetAddress">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="accountNumber" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetAddressResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="GetAddressResult" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<wsdl:message name="ICSS_DataService_GetAddress_InputMessage">
<wsdl:part name="parameters" element="tns:GetAddress"/>
</wsdl:message>
<wsdl:message name="ICSS_DataService_GetAddress_OutputMessage">
<wsdl:part name="parameters" element="tns:GetAddressResponse"/>
</wsdl:message>
<wsdl:operation name="GetAddress">
<wsdl:input wsaw:Action="http://tempuri.org/ICSS_DataService/GetAddress" message="tns:ICSS_DataService_GetAddress_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/ICSS_DataService/GetAddressResponse" message="tns:ICSS_DataService_GetAddress_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="GetAddress">
<soap:operation soapAction="http://tempuri.org/ICSS_DataService/GetAddress" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
I am trying to access the GetAddress method which takes one param (accountNumber) and return data for that account number so I can display the individual fields from that method on the report.
fyi-
The XML returned from the webservice will look like this:
<AddressRec xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<ACCOUNTNUMBER>2070257842</ACCOUNTNUMBER>
<MY_BILL_ACCT>2070257842</DPL_BILL_ACCT>
<SA_LINE_1>ABCDEFT </SA_LINE_1>
<SA_LINE_2>8101 SMITHVILLE PKE </SA_LINE_2>
<SA_LINE_3>MIAMI, FL 78342 </SA_LINE_3>
<SA_LINE_4> </SA_LINE_4>
<MA_LINE_1>ABCDEFT </MA_LINE_1>
<MA_LINE_2>C/O FACILITY IQ - MS1253 SITE#0604 </MA_LINE_2>
<MA_LINE_3>P O BOX 9942 </MA_LINE_3>
<MA_LINE_4>SPOKANE WA 99210 </MA_LINE_4>
<PREM_PHONE>817-454-7150</PREM_PHONE>
<CD_METER_BILL_UNIT> 4</CD_METER_BILL_UNIT>
<FL_BILL_BB>N</FL_BILL_BB>
<FL_NET_METER>N</FL_NET_METER>
<FL_PIPP>N</FL_PIPP>
<CapStatus>GENT_PLUS_DMD</CapStatus>
</AddressRec>
Any help/guidance is greatly appreciated as I am a bit lost at the moment!This is just about the only support I have found on any MS site for this, but so far have been unable to resolve my issue. Very frustrated as I have found a total 3 relevant articles via Google, they all mention each other as there seems to be no support
for this dating back to around 2008 and the first few lines of the most helpful article that I have found (http://weblogs.asp.net/jezell/using-wcf-endpoints-with-sql-reporting-services)
says this:
Consuming WCF endpointpoints with SQL Reporting Services can be difficult. Most of this difficulty is for two reasons:
1) SQL Reporting Services XML and web services support is slightly better than a piece of crap.
2) Documentation for the XML query provider in SQL Reporting Services blows. -
How to pass Cascading Parameter in SSRS using Java
How to pass Cascading Parameter in SSRS using Java---
We are having a problem with dependent parameters.There are three drop down--
1.first dropdown is of Country.When we select a country--Accordingly next dropdown(State)will populate
2.Second dropdown is of State. When we select a state--Accordingly next dropdown(City)will populate.
I have three data sources are
CountryList-
SELECT CountryRegionCode, Name
FROM Person.CountryRegion
ORDER BY Name
StateList
SELECT StateProvinceID, StateProvinceCode, CountryRegionCode
FROM Person.StateProvince
WHERE CountryRegionCode = @CountryRegionCode
ORDER BY StateProvinceCode
CityList
SELECT StateProvinceID, City
FROM Person.Address
GROUP BY StateProvinceID, City
HAVING (StateProvinceID = @StateProvinceID)
ORDER BY City
Ihave to show report that has been deployed on server on the besis of these parameters
I am using ReportViewer in JSP Page through url--
http://192.168.90.149/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project1%2fCascading_Parameters&rs:Command=Render&rs:parameter=true&Country="+Country+"&State="+State;
But it is not accepting parameter if they are cascaded.It is working fine if Both parameters are independent.
Edited by: kaushlee on May 11, 2010 9:22 PMTake a look at set_custom_property:
public static final ID SETTEXT = ID.registerProperty("SETTEXT");
public boolean setProperty(ID pid, Object value)
if (pid == SETTEXT)
String text = value.toString();
and in forms
set_custom_property('beans.bean_item', 1, 'SETTEXT', 'some text');
cheers -
Passing a parameter from one class to another class in the same package
Hi.
I am trying to pass a parameter from one class to another class with in a package.And i am Getting the variable as null every time.In the code there is two classes.
i. BugWatcherAction.java
ii.BugWatcherRefreshAction.Java.
We have implemented caching in the front-end level.But according to the business logic we need to clear the cache and again have to access the database after some actions are happened.There are another class file called BugwatcherPortletContent.java.
So, we are dealing with three java files.The database interaction is taken care by the portletContent.java file.Below I am giving the code for the perticular function in the bugwatcherPortletContent.java:
==============================================================
public Object loadContent() throws Exception {
Hashtable htStore = new Hashtable();
JetspeedRunData rundata = this.getInputData();
String pId = this.getPorletId();
PortalLogger.logDebug(" in the portlet content: "+pId);
pId1=pId;//done by sraha
htStore.put("PortletId", pId);
htStore.put("BW_HOME_URL",CommonUtil.getMessage("BW.Home.Url"));
htStore.put("BW_BUGVIEW_URL",CommonUtil.getMessage("BW.BugView.Url"));
HttpServletRequest request = rundata.getRequest();
PortalLogger.logDebug(
"BugWatcherPortletContent:: build normal context");
HttpSession session = null;
int bugProfileId = 0;
Hashtable bugProfiles = null;
Hashtable bugData = null;
boolean fetchProfiles = false;
try {
session = request.getSession(true);
// Attempting to get the profiles from the session.
//If the profiles are not present in the session, then they would have to be
// obtained from the database.
bugProfiles = (Hashtable) session.getAttribute("Profiles");
//Getting the selected bug profile id.
String bugProfileIdObj = request.getParameter("bugProfile" + pId);
// Getting the logged in user
String userId = request.getRemoteUser();
if (bugProfiles == null) {
fetchProfiles = true;
if (bugProfileIdObj == null) {
// setting the bugprofile id as -1 indicates "all profiles" is selected
bugProfileIdObj =(String) session.getAttribute("bugProfileId" + pId);
if (bugProfileIdObj == null) {
bugProfileId = -1;
else {
bugProfileId = Integer.parseInt(bugProfileIdObj);
else {
bugProfileId = Integer.parseInt(bugProfileIdObj);
session.setAttribute(
("bugProfileId" + pId),
Integer.toString(bugProfileId));
//fetching the bug list
bugData =BugWatcherAPI.getbugList(userId, bugProfileId, fetchProfiles);
PortalLogger.logDebug("BugWatcherPortletContent:: got bug data");
if (bugData != null) {
Hashtable htProfiles = (Hashtable) bugData.get("Profiles");
} else {
htStore.put("NoProfiles", "Y");
} catch (CodedPortalException e) {
htStore.put("Error", CommonUtil.getErrMessage(e.getMessage()));
PortalLogger.logException
("BugWatcherPortletContent:: CodedPortalException!!",e);
} catch (Exception e) {
PortalLogger.logException(
"BugWatcherPortletContent::Generic Exception!!",e);
htStore.put( "Error",CommonUtil.getErrMessage(ErrorConstantsI.GET_BUGLIST_FAILED));
if (fetchProfiles) {
bugProfiles = (Hashtable) bugData.get("Profiles");
session.setAttribute("Profiles", bugProfiles);
// putting the stuff in the context
htStore.put("Profiles", bugProfiles);
htStore.put("SelectedProfile", new Integer(bugProfileId));
htStore.put("bugs", (ArrayList) bugData.get("Bugs"));
return htStore;
=============================================================
And I am trying to call this function as it can capable of fetching the data from the database by "getbugProfiles".
In the new class bugWatcherRefreshAction.java I have coded a part of code which actually clears the caching.Below I am giving the required part of the code:
=============================================================
public void doPerform(RunData rundata, Context context,String str) throws Exception {
JetspeedRunData data = (JetspeedRunData) rundata;
HttpServletRequest request = null;
//PortletConfig pc = portlet.getPortletConfig();
//String userId = request.getRemoteUser();
/*String userId = ((JetspeedUser)rundata.getUser()).getUserName();//sraha on 1/4/05
String pId = request.getParameter("PortletId");
PortalLogger.logDebug("just after pId " +pId); */
//Calling the variable holding the value of portlet id from BugWatcherAction.java
//We are getting the portlet id here , through a variable from BugWatcherAction.java
/*BugWatcherPortletContent bgAct = new BugWatcherPortletContent();
String portletID = bgAct.pId1;
PortalLogger.logDebug("got the portlet ID in bugwatcherRefreshAction:---sraha"+portletID);*/
// updating the bug groups
Hashtable result = new Hashtable();
try {
request = data.getRequest();
String userId = ((JetspeedUser)data.getUser()).getUserName();//sraha on 1/4/05
//String pId = (String)request.getParameter("portletId");
//String pId = pc.getPorletId();
PortalLogger.logDebug("just after pId " +pId);
PortalLogger.logDebug("after getting the pId-----sraha");
result =BugWatcherAPI.getbugList(profileId, userId);
PortalLogger.logDebug("select the new bug groups:: select is done ");
context.put("SelectedbugGroups", profileId);
//start clearing the cache
ContentCacheContext cacheContext = getCacheContext(rundata);
PortalLogger.logDebug("listBugWatcher Caching - removing markup content - before removecontent");
// remove the markup content from cache.
PortletContentCache.removeContent(cacheContext);
PortalLogger.logDebug("listBugWatcher Caching-removing markup content - after removecontent");
//remove the backend content from cache
CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(((JetspeedUser)data.getUser()).getUserName()));
PortalLogger.logDebug("listBugWatcher Caching User: " +((JetspeedUser)data.getUser()).getUserName());
PortalLogger.logDebug("listBugWatcher Caching pId: " +pId);
if (pdata != null)
// User's data found in cache!
PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null");
pdata.removeObject(PortletCacheHelper.getUserPortletHandle(((JetspeedUser)data.getUser()).getUserName(),pId));
PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null- after removeObject");
PortalLogger.logDebug("listBugWatcher Caching -finish calling the remove content code");
//end clearing the cache
// after clearing the caching calling the data from the database taking a fn from the portletContent.java
PortalLogger.logDebug("after clearing cache---sraha");
BugWatcherPortletContent bugwatchportcont = new BugWatcherPortletContent();
Hashtable httable= new Hashtable();
httable=(Hashtable)bugwatchportcont.loadContent();
PortalLogger.logDebug("after making the type casting-----sraha");
Set storeKeySet = httable.keySet();
Iterator itr = storeKeySet.iterator();
while (itr.hasNext()) {
String paramName = (String) itr.next();
context.put(paramName, httable.get(paramName));
PortalLogger.logDebug("after calling the databs data from hashtable---sraha");
} catch (CodedPortalException e) {
PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
context.put("Error", CommonUtil.getErrMessage(e.getMessage()));
catch (Exception e) {
PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
context.put( "Error",CommonUtil.getErrMessage(ErrorConstantsI.EXCEPTION_CODE));
try {
((JetspeedRunData) data).setCustomized(null);
if (((JetspeedRunData) data).getCustomized() == null)
ActionLoader.getInstance().exec(data,"controls.EndCustomize");
catch (Exception e)
PortalLogger.logException("bugwatcherRefreshAction", e);
===============================================================
In the bugwatcher Action there is another function called PostLoadContent.java
here though i have found the portlet Id but unable to fetch that in the bugWatcherRefreshAction.java . I am also giving the code of that function under the bugWatcherAction.Java
================================================
// Get the PortletData object from intermediate store.
CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(
//rundata.getRequest().getRemoteUser()));
((JetspeedUser)rundata.getUser()).getUserName()));
pId1 = (String)portlet.getID();
PortalLogger.logDebug("in the bugwatcher action:"+pId1);
try {
Hashtable htStore = null;
// if PortletData is available in store, get current portlet's data from it.
if (pdata != null) {
htStore =(Hashtable) pdata.getObject( PortletCacheHelper.getUserPortletHandle(
((JetspeedUser)rundata.getUser()).getUserName(),portlet.getID()));
//Loop through the hashtable and put its elements in context
Set storeKeySet = htStore.keySet();
Iterator itr = storeKeySet.iterator();
while (itr.hasNext()) {
String paramName = (String) itr.next();
context.put(paramName, htStore.get(paramName));
bugwatcherRefreshAction bRefAc = new bugwatcherRefreshAction();
bRefAc.doPerform(pdata,context,pId1);
=============================================================
So this is the total scenario for the fetching the data , after clearing the cache and display that in the portal.I am unable to do that.Presently it is still fetching the data from the cache and it is not going to the database.Even the portlet Id is returning as null.
I am unable to implement that thing.
If you have any insight about this thing, that would be great .As it is very urgent a promt response will highly appreciated.Please send me any pointers or any issues for this I am unable to do that.
Please let me know as early as possible.
Thanks and regards,
Santanu Raha.Have you run it in a debugger? That will show you exactly what is happening and why.
-
How do I Pass a parameter to a SQL Component Task where the source SQL statement is also a variable
Hi,
I have been tasked with making a complex package more generic.
To achieve this I need to pass a parameter to a SQL Component Task where the source SQL statement is also a variable.
So to help articulate my question further I have create a package and database as follows; -
USE [KWPlay]
GO
/****** Object: Table [dbo].[tblTest] Script Date: 05/14/2014 17:08:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblTest](
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[Description] [nvarchar](50) NULL,
CONSTRAINT [PK_tblTest] PRIMARY KEY CLUSTERED
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
I populated this table with a single record.
I unit tested the SQL within SSMS as follows;
SELECT * FROM dbo.tblTest
Result; -
ID
Description
1
Happy
DECLARE @myParam NVARCHAR(100)
SET @myParam = 'Sad'
UPDATE dbo.tblTest SET [Description] = @myParam FROM dbo.tblTest WHERE ID = 1
SELECT * FROM dbo.tblTest
Result; -
ID
Description
1
Sad
Within the package I created two variables as follows; -
Name: strSQL
Scope: Package
Data Type: String
Value: UPDATE dbo.tblTest SET [Description] = @myParam FROM dbo.tblTest WHERE ID = 1
Name: strStatus
Scope: Package
Data Type: String
Value: Happy
I then created a single ‘Execute SQL Task’ component within the control flow as follows; -
However when I run the above package I get the following error; -
SSIS package "Package.dtsx" starting.
Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "UPDATE dbo.tblTest SET [Description] = @myParam FR..." failed with the following error:
"Parameter name is unrecognized.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Task failed: Execute SQL Task
Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.
The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the
errors.
SSIS package "Package.dtsx" finished: Failure.
I also tried; -
Name: strSQL
Scope: Package
Data Type: String
Value: UPDATE dbo.tblTest SET [Description] = ? FROM dbo.tblTest WHERE ID = 1
However I received the error; -
SSIS package "Package.dtsx" starting.
Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "UPDATE dbo.tblTest SET [Description] = ? FROM dbo...." failed with the following error: "Parameter name is unrecognized.". Possible failure reasons: Problems with
the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Task failed: Execute SQL Task
Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches
the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "Package.dtsx" finished: Failure.
Kind Regards,
Kieran.
Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/Tried; -
Name: strSQL
Scope: Package
Data Type: String
Value: UPDATE dbo.tblTest SET [Description] = ? FROM dbo.tblTest WHERE ID = 1
and; -
Result; -
SSIS package "Package.dtsx" starting.
SSIS package "Package.dtsx" finished: Success.
Therefore the answer was to put the parameter number rather than the parameter name under the parameter mapping tab-> parameter name column.
Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/ -
[Web Dynpro ABAP] - Passing a parameter between 2 windows
Hi!
I'm trying to do a web dynpro application that displays in a popup the result of a research.
Thus, I have:
- main_view embedded to main_window
- popup_view embedded to popup_window
In main_view, I have an input field where the user can enter a string. After clicking on the "search" button, the popup has to appear showing all matches corresponding to the user research.
In need to pass the parameter of the input field from main_view to popup_view but don't know how to do it.
Thanks for any help you can provide.
C.
Edited by: Cristina CHEN MA on May 18, 2009 1:24 PMThank you both for your time.
TO: Radhika Vadher
I tried your solution but I get an error message when using
lo_el_tresult->get_static_attributes_table
=> method unknown, protected or private
I used the wizard to get the node's attributes:
DATA : lo_nd_tresult TYPE REF TO if_wd_context_node,
lo_el_tresult TYPE REF TO if_wd_context_element,
ls_tresult TYPE wd_this->element_tresult.
* navigate from <CONTEXT> to <TRESULT> via lead selection
lo_nd_tresult = wd_context->get_child_node( name =
wd_this->wdctx_tresult ).
* get element via lead selection
lo_el_tresult = lo_nd_tresult->get_element( ).
* get all declared attributes
lo_el_tresult->get_static_attributes(
IMPORTING
static_attributes = ls_tresult ).
But I still have an error message:
ls_tresult is not an internal table "OCCURS n" specification is missing
Thanks again for any help you can provide =)
C. -
Passing a parameter to Web Dynpro from an external system
Hi All,
I want to pass a parameter to a Web Dynpro Application from an external browser.
I have developed a simple application with an input "ServiceOrder".
In the Portal I have created an Iview for the Web Dynpro application and have set an Application Parameter (ServiceOrder="000003000012"). Just for testing.
In web Dynpro Controller I have created an attribute in the Context and write tje code below in the wdDoInit.
String SO = WDProtcolAdapter.getProtoclAdapter().getRequestParameter("ServiceOrder");
wdContext.currentContextElement.setServiceOrder(SO);
My problem is that the String SO is empty.
Please help.
Regards,
RidouanHi R. Taibi,
try this.
IWDProtocolAdapter protocolAdapter = WDProtocolAdapter.getProtocolAdapter();
IWDRequest request = protocolAdapter.getRequestObject();
wdContext.currentContextElement().setServiceOrder(request.getParameter("ServiceOrder"));
regards
Gunter
Maybe you are looking for
-
Access to Oracle Database by a specific user from a client system.
Hi All, I need to restrict a particular client system to access the database only by a specific user credentials. I mean system A(hostname) can only connect the database PQR only and only by user U123. Any help is sincerely appreciated. Regards Swapa
-
Using Garageband files with IDVD
I am posting this question again hoping someone can answer. I posted my question in the idvd forum and got zero responses. I used imovie08 and successfully edited a 58 minute movie and published it as a medium sized movie. I then used garageband to a
-
BDoc Generated Message Structure
Hi All, When I am creating a custom BDoc( Messaging), the message structure which system has generated do not have the namespace. For example I am creating a messaging BDoc ZCOUNTR_MSG and assigning it to package ZCMG. In the 'BDoc overview tab' unde
-
I need to merge to clouds. A work cloud and a personal cloud togther.
I have two clouds. One i set up for work and one my original cloud when I got first Iphone. How do I merge them both?
-
How can I open raw CRF files with CS4
I have just purchased the olympus M1 and I have always used photoshop CS4. I found that the raw files are CRF files and I cannot open them in photoshop Do I have to download a plug in for CRF or is there another way sandy