IBM Jazz Team Server: Getting Changes from Changeset using OSLC - java

I am using the following query to retrieve the Changeset.
OSCL Query:
https://ibm.com:9443/ccm/resource/itemOid/com.ibm.team.scm.ChangeSet/_HFxrmiEbEeS7m-qENunxUw?_mediaType=text/xml
Getting the following response:
<scm:ChangeSet itemId="_HFxrmiEbEeS7m-qENunxUw"
properties="">
<stateId>_W8aNECEbEeS7m-qENunxUw</stateId>
<immutable>true</immutable>
<contextId>_Dp6kMdwTEd2jUupDpQV1Rw</contextId>
<modified>2014-08-11T05:50:11.568Z</modified>
<mergePredecessor xsi:nil="true" />
<predecessor>_RaxwgCEbEeS7m-qENunxUw</predecessor>
<active>false</active>
<comment>Test</comment>
<lastUpdatedDate>2014-08-11T05:50:11.225Z</lastUpdatedDate>
<modifiedBy itemId="_FAv8gA4GEeSsZdvBzERdWQ" />
<changes>
<internalId>_HUW6IiEbEeS7m-qENunxUw</internalId>
<kind>2</kind>
<before>_nDuHQBhzEeS88s3Rov8pNA</before>
<after>_HUNJJSEbEeS7m-qENunxUw</after>
<item itemId="_k5S2oBhzEeSht4FX-gq3Zg" xsi:type="filesystem:FileItemHandle" />
</changes>
<component itemId="_RvxoEBhzEeS88s3Rov8pNA" />
<owner itemId="_FAv8gA4GEeSsZdvBzERdWQ" />
<xComponentLink xsi:nil="true" />
I would like to get the Changes detail. It would be great if someone shares the OSLC
query to retrieve Changes details.

#user2530633, try the below query, it is not oslc query
.com/ccm/service/com.ibm.team.filesystem.common.internal.rest.IFilesystemRestService2/changeSetPlus?knownTextContentTypePrefixes=text%2F&knownTextContentTypeStrings=application%2Fxml&knownTextContentTypeStrings=application%2Fjavascript&knownTextContentTypeStrings=application%2Fecmascript&knownTextContentTypeStrings=application%2Fx-javascript&changeSetPath=workspaceId%2F_Dh7kMAHIEeSZzL8CZgHcOQ%2FchangeSetId%2F_quVzDljgEeSiBMylK1kVWg&maxChanges=500"
here just replace your workspaceid and changesetid you can find the changes with the content

Related

Connect Cordova 9 mobile app to Java Web Service using Ajax call

I am very new to Cordova, I have installed Cordova version 9 which I am developing on android studio.
I have a simple ajax call to my web service layer which is written in Java. For some reason I am not able to connect to my web service from my mobile app, it returns 404 status. The same url is connected from emulator's browser but not from the application developed. I have white-listed my url in config.xml. Below is the config.xml and ajax code.
Config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.example.hello" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HelloWorld</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev#cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<preferance name="android-usesCleartextTraffic" value="true" />
<access origin="*" subdomains="true"/>
<access origin="http://192.168.0.111:8091" subdomains="true"/>
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="data:*" />
<allow-navigation href="http://192.168.0.111:8091/*" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="http://192.168.0.111:8091/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" />
</edit-config>
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
</widget>
Ajax code:
document.getElementById("btnLogin").addEventListener("click", onClickOfLogin);
function onClickOfLogin(){
$.ajax({
type: "GET",
dataType: "jsonp",
url: "http://192.168.0.111:8091/ZeOMSWS/AppLogin",
crossDomain: true,
success: function(resultObj) {
navigator.notification.alert(
'Registration request has been sent for HR approval. You will receive an email once approved and then you can proceed with Login.',
onSuccessDismissOfAlert,
'Info',
'OK');
},
error: function(request, status, error) {
console.log("Error status " + status);
console.log("Error request status text: " + request.statusText);
console.log("Error request status: " + request.status);
console.log("Error request response text: " + request.responseText);
console.log("Error response header: " + request.getAllResponseHeaders());
navigator.notification.alert(
'Error Occured.' + error,
onErrorDismissOfAlert,
'Info',
'OK');
}
});
}
As I mentioned earlier I am using Cordova 9 with SDK version 29 and emulator is on Android 10.
I have been stuck with this for more than 2 days. I have tried so many solutions on google, I yet don't understand where I am going wrong. Please help me know what is that I am missing.
Any help will be appreciated.
Thank you
The problem is that in Android SDK version 29 permit ajax calls to https services by default.
HTTP requests cannot be sent.
Simply change the URLs in your app and server responses from http:// to https://
Otherwise:
add widget in config.xml:
<widget xmlns:android="http://schemas.android.com/apk/res/android">
edit platform android in config.xml:
<platform name="android">
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" />
</edit-config>
</platform>
Hope useful
Protecting users with TLS by default in Android P1
Android高版本http网络请求失败的Cordova配置处理

java XML parsing using jaxb or dom?

I have a following xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<Abc version="3" xmlns="urn:Abc-v3">
<Ele1>
<SubElement name ="name" description="DO">
<Node version="C" siteURL="https://example.com" />
<Client>
<ClientId>1</ClientId>
<ClientSecret>Yes</ClientSecret>
</Client>
</SubElement>
<SubElement name ="SharePointOLDev1" description="DEV1">
<Node version="C" siteURL="https://example.com" />
<Local>
<LocalId>id</LocalId>
<Password>password</Password>
</Local>
</SubElement>
<SubElement name="AS" description="wow">
<DB connection="connection" />
</SubElement>
</Ele1>
<Ele2>
<Content ID="A" co="LD">
<Description>Simple Docs</Description>
<Serve
Lib1="TEST"
Lib2="yes"
Lib3="yes"
Lib4="no"
Lib5="no"
Lib6="name">
<Hole enabled="false" count="200" />
<Fol enabled="false" count="100" />
<Role enabled="No" validate="false" />
<FetchFilenameAttribute connection="SAP-AS" delay="3" />
</Serve>
</Content>
<Content ID="B" co="OL">
<Description>Simple Docs </Description>
<Serve
Lib1="TEST"
Lib2="yes"
Lib3="yes"
Lib4="no"
Lib5="no"
Lib6="name"">
<Hole enabled="false" count="200" />
<Fol enabled="false" count="100" />
<Role enabled="No" validate="false" />
</Serve>
</Content>
</Ele2>
<Ele3>
<CNode attr="hai" attr1="bye" />
</Ele3>
</Abc>
I need to parse this XML file and assign values to its corresponding class objects.Which is the best option to parse such an xml file.
JAXB sounds good to me but the POJOs were already written by someone and now i will have to rewrite and deploy them.ALso teh xml file has some errors while running xjc command.
DOM approach seems to be very cumbersome n error prone.
Please suggest.
PS:Kindly excuse my beginner level knowledge.
the JDK project comes with SAX(Simple API for XML) accessible by importing org.xml.sax.*.
You may take a look at this https://www.tutorialspoint.com/java_xml/java_sax_parse_document.htm for an introduction to the subject.

How to create a package in Cognos - SDK?

I have been trying to create a package for Cognos via the sdk.
So far so good. I can created a package but I cannot add a datasource to that package. So basicly it does not do anything.
I am getting:
ANS-MES-0003 A server error occurred. Unable to complete the action.
when launching the package with the analysis studio.
If you are using IIS, you may not be getting the underlying issue because IIS will intercept the error. The error may be bad permissions or corrupt user data, but the error code returned seems to be an umbrella for specifics.
As outlined in this troubleshooting page, you can see the original error by setting httpErrors to PassThough. Replace:
<httpErrors lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
<error statusCode="401" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="401.htm" />
<error statusCode="403" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="403.htm" />
<error statusCode="404" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="404.htm" />
<error statusCode="405" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="405.htm" />
<error statusCode="406" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="406.htm" />
<error statusCode="412" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="412.htm" />
<error statusCode="500" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="500.htm" />
<error statusCode="501" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="501.htm" />
<error statusCode="502" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="502.htm" />
</httpErrors>
with:
<httpErrors existingResponse="PassThrough" />
in you IIS config file.
OR
List item
Stop IIS
Open the IIS config file
Search for <section name="httpErrors" overrideModeDefault="Deny" /> and change Deny to Allow.
Look for <httpErrors> in <system.webserver>. If it has lockAllAttributesExcept="errorMode", remove the attribute and value.
In command, run %windir%\system32\inetsrv\appcmd.exe set config "<Your Website>/<Your virtual directory>" -section:system.webServer/httpErrors - existingResponse:PassThrough
Start IIS.

Stored procedure to retrieve the query result as XML

Is it possible to retrieve the stored procedure result in XML format? I am using Java to call the stored procedure and Microsoft SQL Server management studio to test my stored procedures. Could someone provide a sample code?
Found something like this
SELECT
CustomerID AS '#CustomerID',
CustName AS '#Name',
(SELECT ProductName AS '#productname'
FROM dbo.Products p
WHERE p.CustomerID = c.CustomerID
FOR XML PATH('Product'), TYPE) AS 'Products',
(SELECT HobbyName AS '#hobbyname'
FROM dbo.Hobbies h
WHERE h.CUstomerID = c.CustomerID
FOR XML PATH('Hobby'), TYPE) AS 'Hobbies'
FROM
dbo.Customers c
FOR XML PATH('Customer'), ROOT('Customers')
Gives following output
<Customers>
<Customer CustomerID="1" Name="Fred">
<Products>
<Product productname="Table" />
<Product productname="Wardrobe" />
<Product productname="Chair" />
</Products>
<Hobbies>
<Hobby hobbyname="Golf" />
<Hobby hobbyname="Swimming" />
</Hobbies>
</Customer>
<Customer CustomerID="2" Name="Sue">
<Products>
<Product productname="CD Player" />
<Product productname="Picture frame" />
</Products>
<Hobbies>
<Hobby hobbyname="Dancing" />
<Hobby hobbyname="Gardening" />
<Hobby hobbyname="Reading" />
</Hobbies>
</Customer>
</Customers>
Is this correct?

406 Not acceptable while performing post on ODATA4j

Am a newbie in odata4j concepts.
Using odata4j Library odata4j-0.5-nojpabundle.jar launched producer on tomcat using link
http://code.google.com/p/odata4j/wiki/Tomcat.
My producer is modified to give an large list of integers as an entity-set called "Integers"
I could retreive the serviceDoc,collection and can apply filters.
Now trying to perform post on this service doc[trying to add one more entry with same schema ].
Doing post for http://localhost:8080/OData/example.svc/Integers
with post body :
<?xml version="1.0" encoding="utf-8" ?> <edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <entry> <id>http://localhost:8080/OData/example.svc/Integers(100)</id>
<title type="text" />
<updated>2011-12-29T10:50:33Z</updated>
<author> <name /> </author>
<link rel="edit" title="Integers" href="Integers(100)" />
<category term="example.Integers" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:EntityId m:type="Edm.Int32">100</d:EntityId> </m:properties>
</content>
</entry>
am getting 406 not Acceptable Unknown content type application/xml;charset=UTF-8.
Int collection content type is application/xml. Still not able to find out why is this response is obtained.
Does anyone know what i am missing here.
Thanks in Advance.
Use application/atom+xml as the Content-Type
Entry should be the document element (your xml above is not well-formed)
See: http://www.odata.org/developers/protocols/operations#CreatingnewEntries
Hope that helps,
- john

Categories