HH Soap - EntityType
hello,
I used the soap API 6.7 on the old version of cascadeServer.
To use the soap API 6.10 I have to understand how the EntityType
attribute is now managed . It is completely removed and it makes my
code wrong.
How can I find this attribute from the new class
PublishableAsset?
If this is not possible is there a simple solution to implement
it?
Thx,
Nicolas
2 Posted by jenkshaw on 14 May, 2012 04:19 PM
Hello,
I will be away from the office until May 22nd. Please contact [email blocked] with any problems or questions.
Thanks,
Shawn
>>> "nicoesiea" <[email blocked]> 05/14/12 09:26 >>>
Support Staff 3 Posted by Bradley Wagner on 14 May, 2012 05:07 PM
Can you please include a sample of your script that you're having issues with?
4 Posted by nicoesiea on 15 May, 2012 07:18 AM
This is a very short sample :
List assets = ....
for (PublishableAsset asset : assets) {
if (asset.getEntityType().getName().equals(EntityTypeString.page)) {...
And here, the methode getEntityType does not exist since the new version API 6.10.
Is there a way to do this without getEntityType methdoe?
Support Staff 5 Posted by Bradley Wagner on 16 May, 2012 03:50 PM
Hi,
Given that you are using Java, you should be able to replace your type checks with an "instanceof" check like the following:
Can you tell me where you're getting the list of PublishableAssets? Most API operations that return collections of assets of mixed-types specify the explicit type of the assets being returned. I'd be curious to see where you were getting a set of PublishableAssets from.
Thanks!
Bradley Wagner closed this discussion on 16 May, 2012 11:48 PM.
nicoesiea re-opened this discussion on 21 May, 2012 08:28 AM
6 Posted by nicoesiea on 21 May, 2012 08:28 AM
Hello Bradley,
Use the instanceOf operator is great, thx.
In fact I find the PublishableAssets from :
The listFolder methode is in the CascadeServer class, it's :
Is it not a good solution ???
7 Posted by nicoesiea on 21 May, 2012 01:41 PM
But now, with 6.10.9 version I want try my Java code on the example but there are lot of errors.
On my listFolder method I have a new NullPointerException exception with the following code :
on my script I asked assets = cs1.listFolder("_compagny"); with the site : private String site = "example.com";
Can you explain to me the raison of my bug ??
Support Staff 8 Posted by Bradley Wagner on 22 May, 2012 03:04 PM
Your code to read the contents of a Folder and create a collection of all the Folder's children looks fine.
Your NullPointerException is likely happening around here:
You need to make sure that the
getAssetis notnullbefore trying to invokegetFolderon it. Can you include some actual values that you're using to build the Path object?