I want to activate a page through code. Here is my code:
#Reference
Replicator replicator ;
replicator.replicate(session, ReplicationActionType.ACTIVATE, pagePath);
I am getting replicator as null. Can you please tell what needs to be done?
If your replicator is null maybe is not injected properly.
Try to check if you're using any Annotation to inject/reference it. In older versions #Reference should work, also in new versions I guess #OsgiService can work too.
I'll let you here an example of how Adobe use it.
Adobe solution in GitHub.
Regards,
Related
I am currently working on with a solution that would be able to clone/copy/backup my existing rep:policy. 'Cause when we do some jobs it accidentally removed. I am trying to apply this kind of fix, but am failing to. It says it is an invalid path.
javax.jcr.security.AccessControlException: OakAccessControl0006: Isolated policy node. Parent is not of type [rep:AccessControllable]
final Workspace ws = session.getWorkspace();
ws.copy("/etc/commerce/products/abccompany/TvPackChannelMap/rep:policy","/tmp/nxt/TvPackChannelMap/rep:policy");
Are there other ways that I can be able to take the rep:policy thru code?
You need to make sure that your job does not touch the permissions or the rep:policy, this is the best way forward for you.
The exception could be because of /etc/commerce/products/abccompany/TvPackChannelMap/rep:policy does not exist or the user whose session you are using does not have read access to the node.
Make sure the path is correct, copy paste it to your CRX/DE to make sure it exists.
I have tried to use your code to copy a rep:policy from one node to another, works fine. But I would not* recommend copying permissions that way. The best practice is to use the Access Control Management API for all things permissions.
You can check, install and use the access control tool from netcentric. It offers a jmx interface for exporting AC entries and maybe also some APIs you could use to implement your custom solution.
The Other approach is to retrieve the ACL permissions through the query language.
For example, SELECT * FROM [rep:ACL] or SELECT * FROM [rep:ACE] where [rep:principalName] is not null should give you the results.
For more information, I would recommend you to check the ACS commons ACL Packager Implementation which is available on GitHub.
Reference Link - https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/main/java/com/adobe/acs/commons/packaging/impl/ACLPackagerServletImpl.java
First off, I'd like to thank anyone who replies in advance--
I am using vBulletin 3.7 (old, I know...), and I am trying to add a plugin that includes the variable $post['postid']. However, it doesn't seem to work. The hook location is 'postbit_display_start'.
I see no need to post more information; the problem is very small, and hopefully very simple.
Try to use postbit_display_complete as the hook location.
And use this plugin code on your local installation
echo '<pre>';print_r($post);echo '</pre>';
To see what are within $post.
Could anybody help me to understand this issue?The problem is:
I have a two versions of my application that work in parallel. This means that I have sessions already started in one application that I should use in another app.
First version uses PHP sessions ($_SESSION with custom handlers) and second version of application built on Zend Framework and it should use Zend_Session.
So when I try to create new Zend_Session_Namespace("default") instance I get an error that session was already started and it's true.
So the question is — can I initialize Zend_Session object with the data already stored in PHP $_SESSION?
I had similar problem, and figured it out form zend site,
This worked for me:
in .htaccess file do:
php_value session.auto_start 0
For ref check: http://framework.zend.com/manual/en/zend.session.advanced_usage.html
Hope it helps
Ok, I solved this issue, and in case of me the solution is:
In old version I push member's ID into cookie
In new version I fetch that ID and use different sessions system with own handler.
The one thing that may up security and may help avoid collisions it's check member's email using pubcookie.
Hope my solution helps someone.
I just wrote my first nodejs program using the node-mongodb-native driver. I used the documentation code from the github page, i.e.:
var mongodb = require("mongodb"),
mongoserver = new mongodb.Server('localhost', 6574),
dbConnector = new mongodb.Db('test', mongoserver);
dbConnector.open(function(err, db){
if(err)
console.log('oh shit! connector.open error!');
else{
...
However, upon looking at some example code on the github page, I discovered that the set up code looks very different from what I used. Does anybody know if there's any real difference between the different methods? I'm completely new to all this stuff and can't really tell if there's any reason to use one over the other. The code I wrote seems to run fine, but if the creator of the driver is using different code, I figured it would be worth checking if there are any reasons for that.
Thanks in advance for any replies!
Sami
Hi I'm the creator and no there is no particular reason you can't use your style. As when it comes to docs I usually tell people to start with the integration tests as there are many examples on how to do stuff. Unfortunately due to having a fulltime job the docs are not kept up to date at the pace I would like to.
I'm hoping to do something with that come late september but right now I'm trying to just get the driver up to the expected features of mongodb including making it work with 1.9.X and higher.
I'll accept any docs pull requests happily as the more the community help me the more it helps itself :)
In lib\RT\CustomFieldValues\ there is the groups.pm file which is supposed to be an example of how to get data into a custom field, but how do I actually use that once I have written it? Does anyone have any documentation or a sample of this?
I have finally figured it out, to use the Groups.pm module you need to go to /opt/rt3/etc and edit the RT_SiteConfig.pm and add the line
Set(#CustomFieldValuesSources, "RT::CustomFieldValues::Groups");
Restart Apache and it will be available as a new field source.
I have written a blog post on doing this which also includes details on how to build your own module in case anyone is interested in doing this: AD Lookup Control in Request Tracker