I havent found any mention in Orchard documentation about IdentityPart despite it being used in some main modules like Comments. I took a look at some relevant sources, but it didn't help me to fully understand it's purpose.
So what's it for and when should I use it?
Thanks in advance!
This is part of the import/export feature. In order to be able to move contents around servers reliably and in a repeatable way that takes into account updated and new items, we need a way to identify content items that's not just a simple id. Some contents have a path but not all types do (widgets, users, etc.). The export/import hooks for any part can participate in building the id of the item and in recognizing it on import. The routable part for example implements the use of path. But for those types that do not have routable, you can add the IdentityPart to fulfill that role. The id that gets exported in the end is a composite of all contributed ids.
Makes sense?
Related
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.
I took a look at Serilog.Sinks.EventLog at Github and noticed there doesn't seem to be a way to set the Event ID of the logged event (example IDs here).
Would there exist a way to modify the sink so that it'd be possible? Perhaps with some kind of specially formatted message? I don't know if I should put this here or on Github, I'll try here first. :)
There isn't a mechanism currently for this - designing one seems tricky (but ultimately it'd be a great addition to the project!)
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.
Has anybody ever used blogpost contenttype and extended it and added some column to it. I know we can add columns to it using the GUI (List Setting).
Can we do this declaratively and add it to the portal using feature, so that we can create a deployable solution.
Paddy
I have not tried this, but I don't see any reason why you couldn't. The only thing that gives me pause is that Blogs are a little different than most lists because the List Definition is not in a Feature but is rather part of the Site Definition. You could create a Feature with your custom Content Type and staple it to BLOG#1. However, you will still need something (probably a Feature Receiver) that will modify the instance of the Posts lists by adding your custom columns and associating your custom Content Type.
I'm trying to figure out what the best way to show a list of members (users) that aren't a collection (group).
/users
is my route for listing all of the users in the account
/group/:id/members
is my route for listing all of the users in the group
/users?not_in_group=:id
is my current option for showing a list of users NOT in the group. Is there a more RESTFul way of displaying this?
/group/:id/non_members
seems sort of odd…
Either query parameters or paths can be used to get at the representation you want. But I'd follow Pete's advice and make sure your API is hypertext-driven. Not doing so introduces coupling between client and server that REST was intended to prevent.
The best answer to your question might depend on your application. For example, if your system is small enough, it may suffice to only support a representation consisting of a list of users and their respective groups (the resource found at /users). Then let the client sort out what they want to do with the information. If your system has lots of groups and lots of users, each of which belongs to only a couple of groups, your available_users representation for any group is likely to be only slightly smaller than the entire list of users anyway.
Creative design of media types can go a long way to solving problems like this.
Spoke with my partner. He suggested:
/group/:id/available_members
Seems much more positive.
The main precept of REST is "hypertext as the engine of application state". The form of the URI is irrelevant, what matters is that it is navigable from the representation returned at the application's entry point.