AW: [opencms-dev] Steal Lock Problem

Klaassen, Klaas klaas.klaassen at entitec.de
Fri Apr 30 13:51:01 CEST 2004


Hi


You try to call a method in the jsp-page with ur codeline:

o = getContentDefinition(cms, cdClass, id);

That means that ur jsp should provide the named method.
Maybe you should call this method at the object u referenced earlier :-)

May it help you

-- 
Klaas Klaassen ___ Systemberater
ENTITEC AG
Deelbögenkamp 4c 22297 Hamburg
Fon: 0049-40-514841-84 / Fax -48
Klaas.Klaassen at entitec.de        

-----Ursprüngliche Nachricht-----
Von: Mohan Reddy [mailto:Mohan at Indosoft.stph.net] 
Gesendet: Freitag, 30. April 2004 13:23
An: opencms-dev at opencms.org
Betreff: [opencms-dev] Steal Lock Problem

Hi All, 

Please respond to this mail, its a critical one for me.

I am trying to call steal lock functionality using Opencms API. I have to
steal lock before publish a page created by some other user. can someone
please help to do this. 
here is the code : 
ArrayList SitemapTree= null;
SitemapTree = cms.getNavigation().getNavigationForFolder(resPath);
Iterator iter = SitemapTree.iterator(); while (iter.hasNext()) {
com.opencms.flex.jsp.CmsJspNavElement ne
=(com.opencms.flex.jsp.CmsJspNavElement)iter.next();
CmsResource res = cmsObject.readFileHeader(ne.getResourceName());
Class cdClass = getContentDefinitionClass(); Object o = null; String id=new
Integer(res.getResourceId()).toString();
o = getContentDefinition(cms, cdClass, id); if(res.isLocked()){ int
actUserId = cms.getRequestContext().currentUser().getId();
int lockedUserId=res.isLockedBy();
if(actUserId!=lockedUserId){
try {
((A_CmsContentDefinition)o).setLockstate(A_CmsBackoffice.C_NOT_LOCKED);
} catch (Exception e) {
A_OpenCms.log(A_OpenCms.C_OPENCMS_INFO, " Backoffice getContentLock: Method
setLockstate throwed an exception!"); } }

}
}
Errors: 
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\opencms\WEB-INF\jsp\offline\Cms_TOTDPublish_js
p_jsp.java:14: org.apache.jsp.Cms_TOTDPublish_jsp_jsp should be declared
abstract; it does not define getContentDefinitionClass() in
com.opencms.defaults.A_CmsBackoffice
public class Cms_TOTDPublish_jsp_jsp extends
com.opencms.defaults.A_CmsChannelBackoffice { ^ C:\Program Files\Apache
Group\Tomcat
4.1\work\Standalone\localhost\opencms\WEB-INF\jsp\offline\Cms_TOTDPublish_js
p_jsp.java:39:
getPageContext(javax.servlet.Servlet,javax.servlet.ServletRequest,javax.serv
let.ServletResponse,java.lang.String,boolean,int,boolean) in
javax.servlet.jsp.JspFactory cannot be applied to
(org.apache.jsp.Cms_TOTDPublish_jsp_jsp,javax.servlet.http.HttpServletReques
t,javax.servlet.http.HttpServletResponse,<*>,boolean,int,boolean)
pageContext = _jspxFactory.getPageContext(this, request, response, ^
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\opencms\WEB-INF\jsp\offline\Cms_TOTDPublish_js
p_jsp.java:88: cannot resolve symbol
symbol : method getContentDefinition
(com.opencms.flex.jsp.CmsJspActionElement,java.lang.Class,java.lang.String)
location: class org.apache.jsp.Cms_TOTDPublish_jsp_jsp
o = getContentDefinition(cms, cdClass, id); ^
3 errors
Awaiting for an early reply,
Thanks,
Mohan.

_______________________________________________
This mail is send to you from the opencms-dev mailing list To change your
list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev



More information about the opencms-dev mailing list