dpillot 2005/11/15 18:13:55 CET
Modified files:
core/src/java/org/jahia/data/beans ContainerBean.java
Log:
cosmetic pickers/picked
Revision Changes Path
1.22 +50 -40
jahia/core/src/java/org/jahia/data/beans/ContainerBean.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/data/beans/ContainerBean.java.diff?r1=1.21&r2=1.22&f=h
Index: ContainerBean.java
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/java/org/jahia/data/beans/ContainerBean.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ContainerBean.java 15 Nov 2005 15:17:46 -0000 1.21
+++ ContainerBean.java 15 Nov 2005 17:13:54 -0000 1.22
@@ -37,7 +37,7 @@
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: Jahia Ltd</p>
* @author Serge Huber, Xavier Lawrence
- * @version $Id: ContainerBean.java,v 1.21 2005/11/15 15:17:46 dpillot Exp $
+ * @version $Id: ContainerBean.java,v 1.22 2005/11/15 17:13:54 dpillot Exp $
*/
public class ContainerBean extends ContentBean implements
PropertiesInterface {
@@ -430,9 +430,49 @@
try {
final ContentContainer theContainer =
jahiaContainer.getContentContainer();
- String curURL = guiBean.drawUpdateContainerUrl(theContainer);
- String curLauncherURI =
htmlToolBox.drawUpdateContainerLauncher(theContainer);
- ActionURIBean curActionURIBean = new ActionURIBean("update",
curURL, curLauncherURI);
+ String curURL;
+ String curLauncherURI;
+ ActionURIBean curActionURIBean;
+
+ // action menu item to see the source of linked copy
+ if(isPicker){
+
+ ContentObject pickedObject;// the source of the linked copy(the
picked)
+ ContentContainer pickedContainer;
+ //String pickedID="";
+ String pickedpageID="";
+ try {
+
+ pickedObject = theContainer.getPickedObject();
+
pickedContainer=ContentContainer.getContainer(pickedObject.getID());
+ //pickedID = "" + pickedObject.getID();
+ pickedpageID=""+pickedContainer.getPageID();
+ List l=(pickedContainer.getChilds(null,
EntryLoadRequest.STAGED,null));
+ for (Iterator iterator1 = l.iterator();
iterator1.hasNext();) {
+ Object o=iterator1.next();
+ if(!(o instanceof ContentPageField)) continue;
+ pickedpageID=""+((ContentPageField)
o).getPage(processingContext, processingContext.getEntryLoadRequest()).getID();
+ logger.debug("found contentpagefield:"+pickedpageID);
+ break;
+ }
+ curURL="document.location='"
+ + Jahia.getContextPath()
+ + Jahia.getServletPath()
+ + "/op/edit/pid/"
+ + pickedpageID
+ +"'";
+ curActionURIBean = new ActionURIBean("picker", "", curURL);
+ actionURIs.put(curActionURIBean.getName(),curActionURIBean);
+
+ } catch (JahiaException e) {
+ logger.error(e);
+ }
+ }
+
+ // update action
+ curURL = guiBean.drawUpdateContainerUrl(theContainer);
+ curLauncherURI =
htmlToolBox.drawUpdateContainerLauncher(theContainer);
+ curActionURIBean = new ActionURIBean("update", curURL,
curLauncherURI);
final LockService lockRegistry =
ServicesRegistry.getInstance().getLockService();
LockKey lockKey =
LockKey.composeLockKey(LockKey.UPDATE_CONTAINER_TYPE, jahiaContainer.getID(),
jahiaContainer.getPageID());
ObjectKey objectKey =
jahiaContainer.getContentContainer().getObjectKey();
@@ -477,52 +517,19 @@
}
}
+ // copy action menu
curActionURIBean = new ActionURIBean("copy", "",
"clipboard('"+((ParamBean)processingContext).getRequest().getContextPath()+"','"+jahiaContainer.getContentContainer().getObjectKey()+"','copy',"
+ processingContext.getPageID()+")");
actionURIs.put(curActionURIBean.getName(),curActionURIBean);
// curActionURIBean = new ActionURIBean("cut", "",
"clipboard('"+((ParamBean)processingContext).getRequest().getContextPath()+"','"+jahiaContainer.getContentContainer().getObjectKey()+"','cut',"
+ processingContext.getPageID()+")");
// actionURIs.put(curActionURIBean.getName(),curActionURIBean);
- // to display the action menu item to see the source
- if(isPicker){
-
- ContentObject pickedObject;// the source of the linked copy(the
picked)
- ContentContainer pickedContainer;
- //String pickedID="";
- String pickedpageID="";
- try {
-
- pickedObject = theContainer.getPickedObject();
-
pickedContainer=ContentContainer.getContainer(pickedObject.getID());
- //pickedID = "" + pickedObject.getID();
- pickedpageID=""+pickedContainer.getPageID();
- List l=(pickedContainer.getChilds(null,
EntryLoadRequest.STAGED,null));
- for (Iterator iterator1 = l.iterator();
iterator1.hasNext();) {
- Object o=iterator1.next();
- if(!(o instanceof ContentPageField)) continue;
- pickedpageID=""+((ContentPageField)
o).getPage(processingContext, processingContext.getEntryLoadRequest()).getID();
- logger.debug("found contentpagefield:"+pickedpageID);
- break;
- }
- curURL="document.location='"
- + Jahia.getContextPath()
- + Jahia.getServletPath()
- + "/op/edit/pid/"
- + pickedpageID
- +"'";
- curActionURIBean = new ActionURIBean("picker", "", curURL);
- actionURIs.put(curActionURIBean.getName(),curActionURIBean);
-
- } catch (JahiaException e) {
- logger.error(e);
- }
- }
- // to display the action menu item to see the pickers
+ // action menu to see the pickers
if(theContainer.getPickerObjects().size()>0){
curURL="displayPickers('"
+ theContainer.getID()
+"')";
- curActionURIBean = new ActionURIBean("pickedlist", "",
curURL);
+ curActionURIBean = new ActionURIBean("picked", "", curURL);
actionURIs.put(curActionURIBean.getName(),curActionURIBean);
}
@@ -568,6 +575,9 @@
}
/**
* $Log: ContainerBean.java,v $
+ * Revision 1.22 2005/11/15 17:13:54 dpillot
+ * cosmetic pickers/picked
+ *
* Revision 1.21 2005/11/15 15:17:46 dpillot
* action icon pickerlist
*