cancel
Showing results for 
Search instead for 
Did you mean: 

ws:primaryImage

chandras
Champ in-the-making
Champ in-the-making
Hi,

How can I get ws : primaryImage associated with a Document using Alfresco iOS SDK API.

Regards
Chandra
6 REPLIES 6

gavinc
Champ in-the-making
Champ in-the-making
Hi Chandra,

Creating nodes with particular aspects or adding aspects to nodes is not something officially supported via the SDK API at the moment.

In the meantime, it can be done but you'll need to use some strange looking syntax!

If you take a look at the "testUploadImage" test in AlfrescoDocumentFolderServiceTest.m you will see how a document can be created with specific aspects applied.

Similarly, if you take a look at the "testUpdateImageWithExifData" test in AlfrescoDocumentFolderServiceTest.m you will see an example of adding the "exif:exif" aspect to a document.

Making this easier to do is something we're looking at doing in a future SDK release.

Regards,

chandras
Champ in-the-making
Champ in-the-making
Thank You Gavin. Will try for alternatives as you suggested.

I have Web application and iPad App , which renders the same content from a site created using Alfresco Share. For content editors  I have created a Node Template with aspects like Classifiable, Effectivity, Summarizable. Editors use that template for creating contents. I may not be able to add a new aspect (Exif) to it.

In the UI , I need to show an article with the image associated with the article. The page layout is designed like that. Layout Almost similar to the iOS application and Web application.

For the web application, I take image like , <#assign image=article.relatedAssets['ws : primaryImage'][0]>

Now in the iOS SDK , since it is not supported to get the ws : primaryImage for an article, I’m thinking to expose my own REST service (since I have a web application hosted in an appserver, i could create a service within that web app) which returns the primaryImage propertiey associated with the article. 

But there will an overhead of extra service call from the iPad App.

Do you think that will be good approach ?

Thank You

gavinc
Champ in-the-making
Champ in-the-making
Apologies, I mis-understood you, I thought you were wanting to apply an aspect rather than retrieve existing information.

Is the "relatedAssets" an association? If so, you're right, it's not possible to retrieve them with the SDK right now.

If it is just a property though it should be possible with the SDK. The AlfrescoDocument object has a "properties" property which is an NSDictionary of AlfrescoProperty objects, inspect or log this object to see whether it contains the information you need.

If the information you need is not being returned by the SDK, yes, the approach you suggest certainly sounds plausible.

Regards,


chandras
Champ in-the-making
Champ in-the-making
Thanks Gavin.

AlfrescoDocument  has the below properties. I'm looking for ws : primaryImage property associated with a document/article, which seems missing.

Is this property omitted from the SDK or i'm going in a wrong direction ?

{ "alfcmis:nodeRef" = "<AlfrescoProperty: 0x91af240>";
    "app:editInline" = "<AlfrescoProperty: 0x91b0be0>";
    "cm:author" = "<AlfrescoProperty: 0x91b09f0>";
    "cm:description" = "<AlfrescoProperty: 0x91af860>";
    "cm:lastThumbnailModification" = "<AlfrescoProperty: 0x91ad010>";
    "cm:taggable" = "<AlfrescoProperty: 0x91ae450>";
    "cm:title" = "<AlfrescoProperty: 0x91b0280>";
    "cmis : baseTypeId" = "<AlfrescoProperty: 0x91b0dd0>";
    "cmis:changeToken" = "<AlfrescoProperty: 0x91ad800>";
    "cmis:checkinComment" = "<AlfrescoProperty: 0x91ae8f0>";
    "cmis:contentStreamFileName" = "<AlfrescoProperty: 0x91ae760>";
    "cmis:contentStreamId" = "<AlfrescoProperty: 0x91ae070>";
    "cmis:contentStreamLength" = "<AlfrescoProperty: 0x91b0610>";
    "cmis:contentStreamMimeType" = "<AlfrescoProperty: 0x91b0290>";
    "cmis:createdBy" = "<AlfrescoProperty: 0x91ae260>";
    "cmis:creationDate" = "<AlfrescoProperty: 0x91ab950>";
    "cmis:isImmutable" = "<AlfrescoProperty: 0x91aee60>";
    "cmis:isLatestMajorVersion" = "<AlfrescoProperty: 0x91ac9e0>";
    "cmis:isLatestVersion" = "<AlfrescoProperty: 0x91af670>";
    "cmis:isMajorVersion" = "<AlfrescoProperty: 0x91ac7a0>";
    "cmis:isVersionSeriesCheckedOut" = "<AlfrescoProperty: 0x91ade30>";
    "cmis:lastModificationDate" = "<AlfrescoProperty: 0x91afcb0>";
    "cmis:lastModifiedBy" = "<AlfrescoProperty: 0x91ad650>";
    "cmis:name" = "<AlfrescoProperty: 0x91af050>";
    "cmisSmiley SurprisedbjectId" = "<AlfrescoProperty: 0x91af430>";
    "cmisSmiley SurprisedbjectTypeId" = "<AlfrescoProperty: 0x91ac1e0>";
    "cmis : policyText" = "<AlfrescoProperty: 0x91ace00>";
    "cmis:versionLabel" = "<AlfrescoProperty: 0x91b0800>";
    "cmis:versionSeriesCheckedOutBy" = "<AlfrescoProperty: 0x91adc20>";
    "cmis:versionSeriesCheckedOutId" = "<AlfrescoProperty: 0x91afef0>";
    "cmis:versionSeriesId" = "<AlfrescoProperty: 0x91b1010>";
    "ws:ancestorSections" = "<AlfrescoProperty: 0x91abe60>";
    "ws:available" = "<AlfrescoProperty: 0x91acc10>";
    "ws:availableFromDate" = "<AlfrescoProperty: 0x91ada10>";
    "ws:availableToDate" = "<AlfrescoProperty: 0x91ac3d0>";
    "ws:derivedAverageRating" = "<AlfrescoProperty: 0x91ad410>";
    "ws:derivedCommentCount" = "<AlfrescoProperty: 0x91afaa0>";
    "ws : parentSections" = "<AlfrescoProperty: 0x91abe50>";
    "ws : publishedTime" = "<AlfrescoProperty: 0x91aeab0>";
    "ws:tags" = "<AlfrescoProperty: 0x91ad200>";
    "ws:templateName" = "<AlfrescoProperty: 0x91aeca0>";
}

Regards

gavinc
Champ in-the-making
Champ in-the-making
I looked up wsSmiley TonguerimaryImage in the model and it's defined as an association, not a property, it is therefore not going to show up via the SDK.

Your only option I'm afraid is to use the approach you first suggested and expose it via your own web service and call that service from your app.

I've added support for associations to the backlog for a future SDK release.

chandras
Champ in-the-making
Champ in-the-making
Thank you Gavin for the confirmation.

Regards
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.