question

Upvotes
Accepted
13 6 8 9

headline body

Dear Support,

I would like to ask for your help regarding the News pluggin. I am using App Studio web Sdk.

I managed to fetch the headlines, as per the example given in Top&Basket documentation of Jet pluggin. However, I would also like to get the stories behind the headlines (to be able to open the headlines and see the body of the story). If that is possible, how can I achieve it?

I did notice that to open a news you do :

		JET.navigate

		({name:"News",
		entities:[{NewsQuery: query
		}]})

but I was not able to use that in the News object (jet.News.create()).

I would also like to ask, what the "A" means from the following expression: .newsExpression("A"). Are there any other expressions that can be used apart from "A" or rics? I read something about N2_UBMS, but that's I think that is not working anymore.

When creating a subscription, I saw that this is used: JET.News.create("myID"); Could you please explain me how this works? From what I understood, when you do JET.News.create("myID") then you need to use an input field with your query(like in the given example). This is called subscription. The other option is to do .newsExpression("A") and this will run the headlines "automatically", without user input. Did I get it right ?

Sorry for so many questions, let me know please if you need more information.

many thanks in advance.

raluca

eikonnewseikon-app-studio
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@t.amis Could you please provide assistance on JET API?

Upvote
Accepted
78.9k 250 52 74

Yes, you need to use JET.navigate to see the story.

JET.navigate( { name: "News", entities: [{ NewsQuery: urn }] });

You can get the urn field from the returned news object.

For the newsExpression, please refer to this thread. I assumes that 'A' means "All News".

To start a subscription, a news expression should be specified. In the sample code, it creates a news object and sets the callback methods after JET was loaded.

JET.onLoad(initApp);

JET.init({
    ID: "JETSample"
});

function initApp() {
    // Creating a subscription with custom ID.
    JET.News
        .create('MyID')
        .onAppend(onAppend)
        .onInsert(onInsert)
        .onDelete(onDelete);
...
}

Then, it gets the news object, sets the news expression and then calls restart() to start the subscription.

 JET.News
        .get('MyID')
        .newsExpression($('#input').val())
        .restart();
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
13 6 8 9

Thank you. it worked with the urn.

Best regards,

Raluca

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.