Setting Multiple values in property set using java API
Hello All,
I want to set the properties of a profile in a property set using java API provided
in package p13n. The property can have multiple values. When I try to add the
property using ProfileManager.setProperty() method. But every time I do it this
way, it replaces the earlier value of property and not added. This, I can achieve
using portalTools but I want to use the API for user registration on the site.
I hope the query is clear.
Waiting for a response,
Thanks in advance,
Shrinivas
You need to use java.util.ArrayList.
First cast the existing value into ArrayList using getProperty method,
change values in the ArrayList and then put them back with setProperty
method.
Regards,
Michael Goldverg
"Shrinivas Rao" <[email protected]> wrote in message
news:3d64e7d9$[email protected]..
>
Hello All,
I want to set the properties of a profile in a property set using java APIprovided
in package p13n. The property can have multiple values. When I try to addthe
property using ProfileManager.setProperty() method. But every time I do itthis
way, it replaces the earlier value of property and not added. This, I canachieve
using portalTools but I want to use the API for user registration on thesite.
I hope the query is clear.
Waiting for a response,
Thanks in advance,
Shrinivas
Similar Messages
-
How do you set multiple values in "Internal-Properties" in XSLT
Hi All,
I'm running SOA 11g with the Oracle B2B Adapter.
I have a need to dynamically set the InterchangeReceiverID, InterchangeSenderID, GroupSenderID, and GroupReceiverID from within SOA prior to passing the xml to the B2B Adapter. When using the Transform Activity, I don't understand how to set multiple values at the Interchange/Group levels. I am able to set ONE value at each level using the structure below, but have not been able to determine the proper way to set more than one value at each level.
Any help would be appreciated.
thanks,
bw
<ns4:Internal-Properties>
<ns4:Data-Structure>
<xsl:attribute name="Name">
<xsl:text disable-output-escaping="no">Interchange</xsl:text>
</xsl:attribute>
<ns4:Lookup>
<xsl:attribute name="Name">
<xsl:text disable-output-escaping="no">InterchangeSenderID</xsl:text>
</xsl:attribute>
<xsl:text disable-output-escaping="no">1234</xsl:text>
</ns4:Lookup>
<ns4:Data-Structure>
<xsl:attribute name="Name">
<xsl:text disable-output-escaping="no">Group</xsl:text>
</xsl:attribute>
<ns4:Lookup>
<xsl:attribute name="Name">
<xsl:text disable-output-escaping="no">GroupSenderID</xsl:text>
</xsl:attribute>
<xsl:text disable-output-escaping="no">5678</xsl:text>
</ns4:Lookup>
<ns4:Data-Structure>
<xsl:attribute name="Name">
<xsl:text disable-output-escaping="no">Transaction</xsl:text>
</xsl:attribute>
<ns4:Lookup>
<xsl:attribute name="Name">
<xsl:text disable-output-escaping="no">TransactionID</xsl:text>
</xsl:attribute>
<xsl:text disable-output-escaping="no">856</xsl:text>
</ns4:Lookup>
</ns4:Data-Structure>
</ns4:Data-Structure>
</ns4:Data-Structure>
</ns4:Internal-Properties>Hi Anuj,
Thanks for taking time to consider this. I think I did not explain my problem clearly. I'm not trying to assign more than one value to any one property. My issue is that I cannot figure out the proper syntax within the XSLT to assign a value to more than one property at the Interchange level. For instance, do you have an example of how I would assign one value to the InterchangeSenderID and another value to the InterchangeReceiverID? Constant values (rather than dynamic ones) would be fine for an example. Thanks again for your time.
thanks,
bw -
How to set multiple values in one context-attribute
Hi all,
Anybody knows a possibility to set multiple Values to a context-attribute?
I know it how to get it with the following code:
String break[]= request.getParameterValues("break");
Now I want to do something like:
request.setParameterValues(break[no]);
where no is a counter in a loop.
With the Method setAttribute(), I overwrite the previous inserted value.
Thanx
RobertI have not explizit declared break as an array.
It is the Context- Attribute I want to send. I thaught that I can use it as an array in the same way I can do it when I send Data from an HTML- Form (with multiple values) to an servlet.
I don't know how to declare the Attribute explizit as an array.
that it is you wanted to know?
I think my main problem is to get an array from the servlet to the jsp. Is there an other possibility (other than via Context-Attributes) to do that?
thanx
robert -
Updating/setting multiple values in lookup field through powershell
I'm trying to set multiple values to lookup column. I can get it to set one value but multiple values don't work
see below
[Microsoft.SharePoint.SPFieldLookupValueCollection] $itemValues = New-Object Microsoft.SharePoint.SPFieldLookupValueCollection
[Microsoft.SharePoint.SPFieldLookupValue] $lookupvalue = New-Object Microsoft.SharePoint.SPFieldLookupValue
$lookupvalue.LookupId = 1
$lookupvalue.LookupId = 2
$itemValues.Add($lookupvalue)
$CMRSItems["Event Type"] = $itemValues
$CMRSItems.Update()
I was expecting the LookupID 1 and 2 to update but it doesn't. When i specify LookupId = 1 it works
What am i doing wrong.
Thanks in AdvanceHi Patrick,
In your script above you're using the same object to set both ID's on. Setting the ID of $lookupvalue, then adding it to the lookupvaluecollection, before changing the ID value to 2, then adding that to the collection.
I wrote an article on setting fields using PowerShell, but it doesn't include multiple lookup values. It does contain multiple choice and taxonomy values though, which is a similar concept. It's here if you want to take a look: http://social.technet.microsoft.com/wiki/contents/articles/20831.sharepoint-a-complete-guide-to-getting-and-setting-fields-using-powershell.aspx
Regards, Matthew
MCPD | MCITP
My Blog
View
Matthew Yarlett's profile
See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here:
Upload and Crop User Profile Photos -
How to set default value of a table using sequence number
Dear all,
Does any body know that how to set default value of a table
using sequence number.
But I don't want to use trigger to do that.
Please help!!!!
EldonAndrew is essentially correct. You can get around the trigger,
but not the sequence, if (and this may be a very big if) you can
guarantee that every time an insert is done into the table, from
whatever source, the statement looks something like
INSERT INTO tbl VALUES (sequence.nextval,other_columns_values) -
How to find bpel instance in 11g based on the index values using Java APIs
Hi ,
In SOA10G we had option to find the instances based on the index value using Java APIs like below.
WhereCondition criteria= new WhereCondition(SQLDefs.CX_index_1 + " = ?");
criteria.setString(1, "indexValue");
Locator mLoc = getLocator();
IInstanceHandle[] foundInstances = mLoc.listInstancesByIndex(criteria);
Please tell me how to achieve the same functionality in SOA 11G using Java APIs
Regards,
SabaI have multiple bpel in my composite. I checked in ci_indexes table and it shows the instance number of the bpel process. But the em console is showing only the composite instance number. when I opened composite instance, I could see all the bpel process with instance number in the audit trail. How can I find the the actual composite instance number that I should search for in the em console ???
-
Set rating settings in Sharepoint library using JSOM api.
Is it possible to set rating settings in Sharepoint library using JSOM api/ Client side?
Ashish Baranwal || To know what you know and what you do not know, that is true knowledgeHI,
Please check the below url for reference.
https://social.msdn.microsoft.com/Forums/office/en-US/5069c9b8-7427-4749-bd98-cfc0f492c3a2/how-to-enable-ratings-on-sharepoint-list-using-client-object-model-for-office-365-sharepoint-site?forum=sharepointdevelopment
https://samlman.wordpress.com/2015/03/02/how-to-use-csom-with-ratings-in-sharepoint-2013/
Don't forget to mark it as an Answer if it resolves your issue and Vote Me as helpful if it useful.
Mahesh -
Search for a Multilingual value in MDM using JAVA API
Good day,
Could you kindly assist.
I am trying to search for a field in MDM, from Portal using JAVA API. I do retrieve the value in English, but the problem is when I am trying to retrieve it in other languages. Please see sample code:
private Search getSearch(MDMConnection mdmconnection,String value, TableId tableid){
Search search =null;
FieldSearchDimension fielddimension=null;
TextSearchConstraint textcontrain=null;
RepositorySchema reposchema =mdmconnection.reposchema;
if(value!=null)
search= new Search(tableid);
fielddimension=new FieldSearchDimension(reposchema.getFieldId("ATTR_VAL_ABBR","TEXT_VALUE"));
textcontrain=new TextSearchConstraint(value,TextSearchConstraint.EQUALS);
search.addSearchItem(fielddimension,textcontrain);
search.setComparisonOperator(Search.AND_OPERATOR);
return search;
Thank you in advance.
Regards,
SimniHi ,
Mdm- Multilingual value in MDM using JAVA API:
you can check the first point as its reagrdign youisue related pdf and soloutions for your question.
1. http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0e8aedc-cdfe-2c10-6d90-bea2994455c5?QuickLink=index&overridelayout=true
2. http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0e8aedc-cdfe-2c10-6d90-bea2994455c5?QuickLink=index&overridelayout=true
Hope this information helps you in solving the issue!!
Thanks&Regards
AswinChandraGirmaji -
Need Sample Code for Vendor creation using JAVA API
Hi,
I have a scenario like Vendor creation using <b>Java API</b>.
1.I have Vendors (Main) Table.
2.I have <b>look up</b> tables like Account Group.
3.Also <b>Qualifier table</b>(Phone numbers) too.
Could you please give me the sample code which helps me to create Vendor records using Java API?
<b>I need Code samples which should cover all of the above scenario.</b>
<b>Marks will be given for the relevent answers.</b>
Best Regards
PK DevarajHi Devraj,
I hope the below code might solve all your problem:-
//Adding Qualified field
//Creating empty record in Qualifed table
//Adding No Qualifiers
Record qualified_record = RecordFactory.createEmptyRecord(new TableId(<TableId>));
try {
qualified_record.setFieldValue(new FieldId(<fieldId of NoQualifier), new StringValue(<StringValue>));//Adding No Qualifier
catch (IllegalArgumentException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
catch (MdmValueTypeException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
//Creating Record in Qualified table
CreateRecordCommand create_command = new CreateRecordCommand(connections);
create_command.setSession(sessionId);
create_command.setRecord(qualified_record);
try
create_command.execute();
catch(Exception e)
System.out.println(e.toString());
RecordId record_id = create_command.getRecord().getId();
//Adding the new record to Qualifed Lookup value and setting the Yes Qualifiers
QualifiedLookupValue lookup_value = new QualifiedLookupValue();
int link = lookup_value.createQualifiedLink(new QualifiedLinkValue(record_id));
//Adding Yes Qualifiers
lookup_value.setQualifierFieldValue(0 , new FieldId(<FieldID of Yes Qualifier>) , new StringValue(<StringValue>));
//Now adding LookUP values
//Fetch the RecordID of the value selected by user using the following function
public RecordId getRecordID(ConnectionPool connections , String sessionID , String value , String Fieldid , String tableid)
ResultDefinition rsd = new ResultDefinition(new TableId(tableid));
rsd.addSelectField(new FieldId(Fieldid));
StringValue [] val = new StringValue[1];
val[0] = new StringValue(value);
RetrieveRecordsByValueCommand val_command = new RetrieveRecordsByValueCommand(connections);
val_command.setSession(sessionID);
val_command.setResultDefinition(rsd);
val_command.setFieldId(new FieldId(Fieldid));
val_command.setFieldValues(val);
try
val_command.execute();
catch(Exception e)
RecordResultSet result_set = val_command.getRecords();
RecordId id = null;
if(result_set.getCount()>0)
for(int i = 0 ; i < result_set.getCount() ; i++)
id = result_set.getRecord(i).getId();
return id;
//Finally creating the record in Main table
com.sap.mdm.data.Record empty_record = RecordFactory.createEmptyRecord(new TableId("T1"));
try {
empty_record.setFieldValue(new FieldId(<FieldId of text field in Main table>),new StringValue(<StringValue>));
empty_record.setFieldValue(new FieldId(<FieldId of lookup field in Main table>), new LookupValue(<RecordID of the value retrieved using the above getRecordID function>));
empty_record.setFieldValue(new FieldId(<FieldId of Qualified field in Main table>), new QualifiedLookupValue(<lookup_value>));//QualifiedLookUp value Retrieved above
} catch (IllegalArgumentException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (MdmValueTypeException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
//Actually creating the record in Main table
CreateRecordCommand create_main_command = new CreateRecordCommand(connections);
create_main_command.setSession(sessionId);
create_main_command.setRecord(empty_record);
try
create_main_command.execute();
catch(Exception e)
System.out.println(e.toString());
Thanks
Namrata -
Image not displayed in pdf generated using Java API for Forms service
Hi,
I am creating a pdf document using Java API for Forms Service.
I am able to generate the pdf but the images are not visible in the generated pdf.
The image relative path is coming in the xml as defined below. The images are stored dynamically in the Livecycle repository each time a request is fired with unique name before the xml is generated.
<imageURI xfa:contentType="image/png" href="../Images/logo.png"></imageURI>
Not sure if I need to specify specify specific URI values that are required to render a form with image.
The same thing is working when I generate pdf document using Java API for Output Service.
As, I need to generate interactive form, I have to use Forms service to generate pdfs.
Any help will be highly appreciated.
Thanks.Below is the code snippet:
//Create a FormsServiceClient object
FormsServiceClient formsClient = new FormsServiceClient(myFactory);
//Specify URI values that are required to render a form
URLSpec uriValues = new URLSpec();
// Template location contains the whole rpository path for the form
uriValues.setContentRootURI(templateLocation);
// The base URL where form resources such as images and scripts are located. Whole Image path is passed in BaseUrl in the http format.
String baseLocation = repositoryPath.concat(serviceName).concat(imagesPath);
uriValues.setBaseURL(baseLocation);
// Set run-time options using a PDFFormRenderSpec instance
PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();
pdfFormRenderSpec.setCacheEnabled(new Boolean(true));
pdfFormRenderSpec.setAcrobatVersion(com.adobe.livecycle.formsservice.client.AcrobatVersio n.Acrobat_8);
//Invoke the renderPDFForm method and write the
//results to a client web browser
String tempTemplateName =templateName;
FormsResult formOut = formsClient.renderPDFForm(tempTemplateName,
inXMDataTransformed,pdfFormRenderSpec,uriValues,null);
//Create a Document object that stores form data
Document outputDocument = formOut.getOutputContent();
InputStream inputStream = outputDocument.getInputStream(); -
How to upload Image to MDM 5.5 SP3 using Java APIs
Hi,
I am trying to upload Image to Images table in MDM 5.5 using JAVA API for MDM. But. I'm not able to find particular field in Images table where I need to set the Blob object ( Image data ).
I'm not aware of the method to set the Blob, there is one for getting the Image data.
I have gone through I am not able to add images into Catalog thru java API forums posts and tried the code. But with no luck....
I think this code is for some other MDM version as the fields mentioned are not present in the Images table e.g. DataObject - this field is used in the above posts to set the Blob data but this field does not exist in Images table in MDM 5.5
Can anyone suggest the solution?
Thanks and Regards,
MausamHi Mausam,
Please try the following:
// adding to a image table
// get the bytes for the image
byte[] imageBuf = readFile("C:\pic.bmp");
// setup A2iFields
fields = new A2iFields();
fields.Add(new A2iField("DataObject", new
Value(imageBuf))); // the image binary (required)
fields.Add(new A2iField("Name", new Value("pic.bmp")));
// a name for the image
fields.Add(new A2iField("OrigName", new
Value("pic.bmp"))); // the original image file name
(required)
fields.Add(new A2iField("DataGroupId", new Value(888)));
// the data group to add to (required)
fields.Add(new A2iField("OrigLocationId", new
Value(999))); // the data location of the image
(required)
fields.Add(new A2iField("Description", new Value("a
short description"))); // a short description here
// add the image
String imageTable = "Images";
catalog.AddRecord(imageTable, fields, -1, -1);
It's taken out of the API guide for SP3 (the example for method AddRecord.
Best regards,
Amit -
GetSelectedFields() for time stamp and user stamp using java api
using Java API's
getSelectedFields() returns NULL value if values presented also, for Time stamp and User stamp
properties in Flat tables , is there any other alternative way to get the SelectedFields values ?
Edited by: Vijaya Sekhar Reddy Alla on Mar 19, 2008 3:16 PMWell, I can't say I solved the problem, because I got another one afterwards.
As usually I created a GetFieldListCommand, set its needed attributes and executed it. Then I read all the field properties out:
FieldProperties[] fieldProp = getFieldListCommand.getFields();
Afterwards it is possible to do what you want. Using a for-loop.
for (FieldProperties fp : fieldProperties) {
UserStampFieldProperties usfp = (UserStampFieldProperties) fp; // <= Cast error
FieldId[] fieldIDs = usfp.getSelectedFields();
And this is what I get now:
Exception in thread "main" java.lang.ClassCastException: com.sap.mdm.schema.fields.FixedWidthTextFieldProperties cannot be cast to com.sap.mdm.schema.fields.UserStampFieldProperties
Why this happens, I don't know. But it should somehow be solveable. -
IllegalStateException while invoking livecycle formserver using java api
I am new to livecycle formserver.when i am trying to invoke formserver using java api ,it is giving illegal state exception.My servlet application to invoke formserver is deployed in tomcat 5.o in one system and jboss with formserver is in anohter system.
I am using the following properties to connect formserver in another system.
Properties ConnectionProps = new Properties();
ConnectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "jnp://172.21.49.116:JBoss:1099");
ConnectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");
ConnectionProps.setProperty("DSC_SERVER_TYPE", "JBoss");
ConnectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "administrator");
ConnectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "password");
And i am confusing in setting the following paths using UrlSpec object.
URLSpec urlspec = new URLSpec();
urlspec.setApplicationWebRoot("http://JBOSS:8080/FormServer");
out.println("after webroot");
urlspec.setContentRootURI("http://localhost:8080/srvapp");
out.println("after contentroot");
urlspec.setTargetURL("http://localhost:8080/srvapp/HandleData");
My .xdp file is in my localsystem where my tomcat is running.and renderToHtml method is like this:
FormsResult formOut = Fsc.renderHTMLForm(formName, TransformTo.AUTO,oInputData,htmlRenderSpec,"",urlspec,null);
i am passing the path of the .xdp file in my local system to formName parameter.
with this code i am facing problem.Is there anything wrong in my code?or is there any settings to change in formserver?
please help me with this problem,i am trying to sort out this problem.
Any help?
Thanks in AdvanceIf you are invoking LiveCycle ES2 on JBoss compile with JDK 1.6 and run against JRE 6.
Steve -
How to build a small application using Java API
Hai expertise,
I want to retreive MDM repository info using JAVA API, i am following these blogs:
/people/andreas.seifried/blog/2006/03/26/performing-free-form-searches-with-mdm-java-api
/people/udi.katz/blog/2005/08/21/retrieving-data-from-mdm-server-using-the-mdm-java-api
/people/udi.katz/blog/2005/07/17/mdm-connectivity-to-java-application
<b>where to get the jar and sda files to build the application??
In Developer Studio.. Windows -> Preferences -> Java -> Classpath variables. Is this the only place where we need to give the jar file path??
Are there any other configurations to do(except setting container variable to MDM4J jar file) to connect my java application to MDM repository???</b>
Regards,
Chand.Hi Govada,
(1)You need to add the MDM4j and other JAR files at:-
right click on project -> Java Build Path -> Libraries -> Add External JARs
(2)If the project is Web Dynpro project one
then right click on project -> Web Dynpro Reference -> Library Reference -> and add sap.com/com.sap.mdm.tech.mdm4j
Are you using JAVA API 1 or 2???
Thanking you
Namrata Dixit -
Hi,
I need to change the Crystal Reports setting 'Default Servers To Use For Viewing And Modification' to a particular server.this i need to do using java api.
could you pls provide me the sample code for this.
Regards
SrinivasThe IReport interface extends IViewingServerGroupInfo interface, that allows you to specify the server group.
The choice selection for that interface is as follows: 0 = first available, 1 = prefer the selected server group, and 2 = only use the selected server group.
The server group selection is by the SI_ID for that server group InfoObject.
Sincerely,
Ted Ueda - Developer Support
Maybe you are looking for
-
Unable to connect to XL Reporter. Error! Server communication failed!
Hi Experts, I am receiving the following error when starting XL Report in SAP The VB Application identified by the event source logged this Application XL Reporter: Thread ID: 4232 ,Logged: Server sap01 The connect information provided in MetaInfo.xm
-
In my control panel, I have two java icons. One is a simple java one with two wisps of flame and it just says Java underneath, the second is a more complex java icon with more flames and Java plug-in 1.3.1_09 underneath. If I right click the first on
-
How can i buy lion software? do they still sell it
how can i buy lion software? do they still sell it
-
Replicat abends with "not a valid month" error
Here is what i see in the log: 2015-04-16 14:02:21 ERROR OGG-00665 OCI Error Flushing database inbound server, 'OGG$REP02' (status = 26815-ORA-26815: Error from Apply Network Receiver for Apply "OGG$REP02" and Capture "replicat". ORA-01843: not a
-
Hi, I am looking for an implementation of a graph in ABAP OO. Could you give me some hints where I can find a standard implementation? Best regards, Fabian