Copy link to clipboard
Copied
Hi, everyone.
I have been digging this problem for almost 4 days. My cf-services were generated by Apptacular extension.
It gives me an easy way to enhance the development performance, but in generating Master-Detail form and appending Create and Update functions, I faced the below error message. It shows some security issues while accessing cfc remotely.
Especially, it shows eventHandler.cfc.
I have been googled all day. It's not worth.
Please help me as soon as possible.
Thanks in advance.
Copy link to clipboard
Copied
To be able to access a method remotely you need to... set its access to remote!
It might pay to have a read of the docs for <cffunction>:
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f5c.html
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0ac4a-7fd9.html
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0ac4a-7fd5.html
--
Adam
Copy link to clipboard
Copied
Hey, Adam! Thanks for your quick reply.
Actually, my eventHandler.cfc was generated by Appacluar, and the inside is as belows:
component implements="CFIDE.ORM.IEventHandler"{
/**
* @hint Event handler that fires after a delete operation.
*/
public void function postDelete(any entity ) {
}
/**
* @hint Event handler that fires after a insert operation.
*/
public void function postInsert(any entity ) {
}
/**
* @hint Event handler that fires after a load operation.
*/
publicvoid function postLoad(any entity ) {
}
/**
* @hint Event handler that fires after a update operation.
*/
public void function postUpdate(any entity ) {
}
/**
* @hint Event handler that fires before a delete operation.
*/
public void function preDelete(any entity ) {
}
/**
* @hint Event handler that fires before an insert operation. Ensures magic words get populated.
*/
public void function preInsert(any entity ) {
if (structKeyExists(entity, "setcreatedOn")){
entity.setcreatedOn(now());
}
if (structKeyExists(entity, "setupdatedOn")){
entity.setupdatedOn(now());
}
}
/**
* @hint Event handler that fires before a load operation.
*/
public void function preLoad(any entity ) {
}
/**
* @hint Event handler that fires before a update operation. Ensures magic words get populated.
*/
public void function preUpdate(any entity , struct oldData ) {
if (structKeyExists(entity, "setupdatedOn")){
entity.setupdatedOn(now());
}
}
}
The other things such as list, search, get, delete did absolutely work fine.
The only problem which I have been facing is the thing which concerned about Create and Update functionalities.
What is the issue? Can you figure it out more precisely?
Look forward to your reply.
Copy link to clipboard
Copied
Sorry, dunno what Appacluar is, and - really - how the CFC got created is irrelevant (because CF won't care, and that's what matters). If you want to call a method remotely, you need to flag it as remote. And you're calling preUpdate() remotely and it's set to PUBLIC, not REMOTE, hence the error.
If you cannot just change that CFC, then you'll need to create a facade which can be called remotely, which - internally - calls the public methods.
--
Adam
Copy link to clipboard
Copied
Thank you. I did.
Actually, I have just started the consideration of transferring a existing system which is based on IBM Websphere products into Coldfusion & LCDS.
Anyhow, this problem has been totally solved.
Thanks again, Adam.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more