Can we extend the node type in a relay backend? - relayjs

the spec says that the Node type has only an ID field, but can we easily add a metadataobject to it? Will it be supported by the relay framework?

I don't see a reason it wouldn't work.
RelayJS requires you to have a Node interface, with an ID field on it, and that doesn't say anything about other fields.
I think you totally can.
You totally should.
Do it.
Just do it.
*This message was sponsored by Nike Programming

Related

How to find out team name from BPM instance id

Is there a way to get the team an instance is assigned to from the instance id in BPM 8.5.6 version? before a user from the team claims the task I need to auto select some fields on the coach. Is there a way I know which team an instance or a task is assigned to? IS there a way other than REST API.
It doesn't appear in the API documentation, but the TWTask appears to have an attribute "displayName". So the following seems to work -
tw.system.findTaskByID(68507).assignedTo.displayName
That gave me the expected value, where as "name" gives the internal name which has a GUID on it. Mine was assigned to "All Users". YMMV depending on if it is assigned to a Team, a Role, or a Participant Group.
As it isn't in the JS-API documentation you might want to get an official support statement from IBM. I've seen working items like this stop working, and when you file an issue they point out that the item was not documented, so the fact that it broke is not technically a regression.
There is a REST API available, under REST interface for BPD-related resources --> Process Instance Resource --> Current State. This api will provide all the details for the instance including the vairable, tasks (open & closed).
https://www.ibm.com/support/knowledgecenter/SSV2LR/com.ibm.wbpm.ref.doc/rest/bpmrest/rest_bpm_wle_v1_process_instanceid.htm

Should we use the Neo4J internal id?

We are currently working with a Neo4j database, and we need some kind of id to identify nodes.
For example we have functions like CurrentUserHasAccess(NodeId)
On other Stackoverflow posts I read that it's a bad idea to use the internal neo4j-identifier, because it can change over time. However I think that's not an issue when we do not use this id to link data.
However I cannot seem to find any official sources about this topic.
I would like to use this ID because then we do not need to worry about uniqueness, and more importantly indexing.
You are right that it is generally not recommended to use the internal Neo4j node IDs. This is mainly because if a node gets deleted, its original internal ID may get recycled/reused. If you're looking for a quick and elegant solution to this, have a look at the UUID module of the GraphAware Framework here https://github.com/graphaware/neo4j-uuid and let us know if it works for you.

How to setup custom id-field in DB4O

I've read the documentation and samples multiple times and can't find out how to do this.,
I'm trying to wire up DB4O to use my own custom Id field. based on the documentation you can define your own IDs but as far as I can tell they won't replace Db4o's internal IDs, As in it won't actually use those Ids to identify the objects.
Basically all the examples do are tell Db4o to generate some sort of unique id and index it, I don't see anywhere on how to tell it that this is the ID that you should use.
Is it possible to have our own IDs on our model replace the internal IDs used to keep track of the relationships?
we need to have our own Ids since our system relies heavily on REST.
There no direct support for this. You need to create your own mechanism.
Simplest way: Use Guid on .NET. Or use a UUID in Java. In Java: Add UUID-Support: configuration.common().add(new UuidSupport());
Use callback to create new id's. Doesn't not work in TCP client/server.
See also this page.
Side note: You build a REST app. How many request does it need to handle? db4o is internally inherently single threaded. It can only handle a very limited load.

Globalizing dynamic values which are coming from DB in asp.net MVC

I have few values that are DB driven/or coming from other system which i dont have control of, So how to apply globalization in this case? I really dont trust on translation service apis that are provided from google or microsoft as i dont want any mistranslation happening anywhere in application leading to great embarassment to user.
So what is the best solution to tackle this schenario?
Thanks in advance.
Don't expect miracles and don't look for a function in .NET called string Translate(string input, string inputLanguage, string outputLanguage). If you don't want to use third party translation services because you don't trust them and you have no control over the data publisher so that it provide you with translations of the content on different languages there's really not much you could do. If it's simple words you could keep a dictionary in order to perform the translation on the fly but that will be impractical for whole sentences.
I have encountered this in one of my products and what I did was to allow in the database design room for A)"native"/"original" + B)zero-ormany translations/localiazations of each such value. I've got in place a back end interface that allows for translating these values. That could be purely human-driven, or a combination of automatic translation with human verification.

Is it OK to include an ID inside the URL?

Well, my question is simple.
Does the ID affect the position of a webpage on Google ?
I have links like this
http://example.com/news/title-slug/15/
and people say to me that I should remove the ID from the URL.
And I belive that is not true. By my logic, you can't depend on the title's slug. I know it should work perfectly fine if there aren't two pages that have the same title, but why should I remove the ID if there is no harm when it's there.
Yes, leave it there.
Google has no business trying to second-guess what each element of a URL represents and changing its index based on that.
URLs by their nature can map to any resource, and I'm pretty sure Google recognises that. All you should do is ensure that multiple URLs don't have the same content by using redirects. So, for example, http://example.com/news/wrong-title-slug/15/ should redirect back to http://example.com/news/title-slug/15/ rather than just echo back the same page. Google doesn't really like duplicate content.
It's fine.
But I would not put that behind the title-slug though. Some url might get more confusing than the others.
http://example.com/entry/how-to-solve-question-45/15
a better one would be :
http://example.com/entry/15/how-to-solve-question-45
Besides, you can't really rely on just the title-slug, because changing the title of an entry means breaking user's bookmark. Not to mention that it is faster to retrieve an entry from the database by an integer ID instead of an url-slug.
The problem here is not whether Google will accept it, but whether or not doing so is user-friendly.
A common reason for keeping the ID in a URL is to ensure that the URL is unique. For example, if two people on here were to create a question named "Jon Skeet Facts" we'd have a problem, whereas with the ID the users are aware that they are two different questions with the same title. This is the same as with relational databases where a unique identifier is required.
In essence, why care what Google thinks? The whole Search Engine Optimisation industry is a farce, and this is coming from someone who has been paid more than once as a SEO Consultant. Why follow what Google wants when you can map Google's intentions by making your website perfect for the user? If you make a good website Google will reward you. The ID has a reason to be there, so keep it in.
I think your fine leaving it in. Seems to make sense as you get the element for identification and the element for being descriptive. It is done on here after all.
Zeus won't strike you down for it. I prefer not to have meaningless numbers in there because it's not very attractive or semantic.
Having the id will NOT hurt your SEO rankings. Having the slug there ensures that the page's main keywords will be indexed so it's all good.

Resources