If it is already not available please consider support for multiple sites integration.
Consider a publisher with multiple sites in the network. A.domain.com, B.domain.com, blogs.domain.com, xyz.domain.com each generating their own activity. It would be nice to create the domain myactivity.domain.com to see all activity in one place. Offcourse those sites will need to share database tables. But using drupal's multisite magic, they all can share activity log tables. But the table would need somehow to specify where the activity came from.
another example would be activities on drupal.org , groups.drupal.org, API.drupal.org and it would nice to have a place where all my activities on those sites available on one place.
Even if you can't provide the support now, atleast provide the database structure now so the UI can be added in Future.
Comments
Comment #1
icecreamyou commentedWhat exactly are you hoping for that doesn't already exist? There are a lot of different ways you can do what you're asking for.
Comment #2
ajayg commentedOk. I am looking at schema and you have actividy ID (aid) as primary key. Now in a multisite network a.domain.com and b.domain.com may only share users and sessions table but not necessarily the sequences table. So if they share the activity table, you will get collision of activity ids. This can be easily avoided by adding a new column "siteid" or "sitename" and this column along with aid becomes the primary key. This way you can have records like "siteA,23456" and "siteB, 23456" in the activity table.
The above scenario is not hypothetical. It very much exists in d.o and groups.d.o which do not have same sequences table. (and some of my network of sites). So if we want to aggregate activities of a user at one place for both d.o and groups.d.o currently not possible.
Or Instead of one huge drupal commons installation, for better scalability I may partition with groups.domain.com (where only groups are enabled) , blogs.domain.com (where only blogs are enabled) with seperate drupal commons installations but share same user, profile tables.
Although this module was originally designed for aggregating activity on a single site, its utlity several magitude increases if it can support multiple sites aggregation. End user won't need to go to each site to see what is happening on all those network sites.
If you know some tricks how to achive this, please let us know.
Comment #3
icecreamyou commentedSure, but how exactly are you implementing this multisite situation? I'm not going to make a change based on speculation that it might be helpful to somebody one day, only to find out that it doesn't actually solve any useful problems. I need to know specifically how you hope to implement a multisite situation and exactly what it is that doesn't work / what the fix would be and why that fix works for that situation. For example you could be using the Domain Access module and you need a Views filter to filter content by site. I am also not likely to make this a short-term priority unless there is actually a demonstrated rather than speculative need.
Comment #4
ajayg commentedI am not using domain access module. Rather trying to keep it as generic as possible to avoid future conflicts and dependencies. These are in actual production and not speculative need.
One beauty of above solution is you get single sign on out of box as long as all are subdomains.
As you notice A.domain/node/1234 will be different than B.domain/node/1234 So if A.domain/node/1234 creates Activity record in M1, its sequence will be from sequence table in A.domain say 7890. Now the sequence table in B.domain is completely independent so it can still create record in M1 as 7890 (but it will fail).
A simple future proof generic solution would be add the extra column for site id when you create Activity record.
Another solution would keep activity log only on M1 (not shared) but A and B call service on M1 to create a record. Since only the sequence from M1 used, there is no chance of collision.
Does this provide enough info?
Comment #5
icecreamyou commentedYeah. Hmm. I don't know if that is feasible with the current architecture. Problem is you have 3 situations:
You can get around these problems in two ways:
Bottom line is that I'm not going to be writing patches for the kind of multisite you're using any time soon. Domain Access I can see supporting because it's designed to solve the kind of problems that I've raised above by using a single DB. But I just don't have the time/knowledge/experience/interest/motivation to dig into the multi-database stuff.
Comment #6
ajayg commentedI think you summed it nicely and I can understand your reasons.
Some activity is shared across subdomains, and some is subdomain-specific.
I think this use case will not be needed as this goes against the reason activity log exists (aggregation of activity in one place).
All activity is shared across all subdomains
This would the most required case.
I can see why you made this important architecture choice but it may limit the success of this module. I see this module has far bigger possibilities.
Would you just consider allowing 1) static messages as additional type? and 2) Creating feed of activities (this should be free if you are using views) These could be just html link from other network sites. Then we can write another separate bridge module which can take say certain feed from another subdomain and add to the activity log. So user gets consolidated activity view from multiple sites. or in other words allow activity type messages which are shown as it is and not loaded with actual content. For example this bridge module can import activity feed from facebook and show user everything in one place.
(I am not suggesting replace dynamic messages as you have currently. This is another type of message added to activity log when displayed shows as it is. )
Comment #7
icecreamyou commentedThat decision is a critical reason this module exists. If you want something different, there are alternatives.
As far as "limiting the success of the module" goes, I think that your use case is the exception, not the rule.
That's not feasible. Messages are cached, so you could show cached messages -- but it goes a lot deeper than that. You need unique IDs for everything involved -- so for example if you post a blog post in an Organic Group the module records the node ID, but on a different subsite that ID would represent a different node. So dynamic display aside, you need either unique IDs (meaning one database) or the ability to query multiple databases.
Comment #8
ajayg commentedExactly. That is why I originally proposed a "siteid" column which combined with activity id or node id will be always unique. So primary key will be composite (siteid, aId) instead of only (aid)
And combining node id with site id will open the path to query the right subsite.
I completely understand if you think this usecase is not frequent. And I don't expect you to provide all the coding required. But atleast a structural change of siteid support, opens up possibilities for others to build on that. For normal case the siteid will always have just one value of site where it runs.
Comment #9
icecreamyou commentedThat's not what I mean. Once you're talking about different databases, you can't just do a node_load() or user_load() or facebook_status_load() any more. You have to manually do every query and it has to be aware of which database it's querying. The only alternative is to have everything in one database.
Comment #10
ajayg commentedYou can have services module on those multiple subdomains. So here is what is possible
Each subdomain has own database and services module. And the subdomain which aggregates activity will act as services client to pull content.
I know it is not trivial and automatic. But atleast identifying and recording the source site id is starting point. Other processing can be build on the top.
Comment #11
icecreamyou commentedSounds a lot more complicated than just letting Domain Access take care of everything. Even if you do it that way you will only be able to see activity on the subdomain where activity is aggregated, and there might be problems with syncing changes (i.e. if a node is deleted). But -- okay, I will consider it as a submodule.