mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
. WCM UI
- Summary information for a staging area based on the AVMStoreDescriptor - More work on the Modified Files list - Framework and components for actions against AVM content and folders git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3855 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -579,11 +579,16 @@ public class CheckinCheckoutBean
|
||||
// navigate to appropriate screen
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
this.navigator.setupDispatchContext(node);
|
||||
String s = (MimetypeMap.MIMETYPE_XML.equals(mimetype)
|
||||
? "dialog:editXmlInline"
|
||||
: "dialog:editTextInline");
|
||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, s);
|
||||
|
||||
String outcome;
|
||||
if (MimetypeMap.MIMETYPE_XML.equals(mimetype))
|
||||
{
|
||||
outcome = "dialog:editXmlInline";
|
||||
}
|
||||
else
|
||||
{
|
||||
outcome = "dialog:editTextInline";
|
||||
}
|
||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, outcome);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -19,8 +19,10 @@ package org.alfresco.web.bean.wcm;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.event.ActionEvent;
|
||||
@@ -30,6 +32,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avm.AVMStoreDescriptor;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
@@ -62,6 +65,9 @@ public class AVMBrowseBean implements IContextListener
|
||||
|
||||
private static final String MSG_SANDBOXTITLE = "sandbox_title";
|
||||
private static final String MSG_SANDBOXSTAGING = "sandbox_staging";
|
||||
private static final String MSG_CREATED_ON = "store_created_on";
|
||||
private static final String MSG_CREATED_BY = "store_created_by";
|
||||
private static final String MSG_WORKING_USERS = "store_working_users";
|
||||
|
||||
private String sandbox;
|
||||
private String username;
|
||||
@@ -104,8 +110,6 @@ public class AVMBrowseBean implements IContextListener
|
||||
public AVMBrowseBean()
|
||||
{
|
||||
UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this);
|
||||
|
||||
//initFromClientConfig();
|
||||
}
|
||||
|
||||
|
||||
@@ -170,20 +174,46 @@ public class AVMBrowseBean implements IContextListener
|
||||
this.navigator = navigator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Summary text for the staging store:
|
||||
* Created On: xx/yy/zz
|
||||
* Created By: username
|
||||
* There are N user(s) working on this website.
|
||||
*
|
||||
* @return summary text
|
||||
*/
|
||||
public String getStagingSummary()
|
||||
{
|
||||
StringBuilder summary = new StringBuilder(128);
|
||||
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
ResourceBundle msg = Application.getBundle(fc);
|
||||
Node websiteNode = this.navigator.getCurrentNode();
|
||||
String storeRoot = (String)websiteNode.getProperties().get(ContentModel.PROP_AVMSTORE);
|
||||
String stagingStore = AVMConstants.buildAVMStagingStoreName(storeRoot);
|
||||
AVMStoreDescriptor store = this.avmService.getAVMStore(stagingStore);
|
||||
if (store != null)
|
||||
{
|
||||
// TODO: count user stores!
|
||||
int users = 1;
|
||||
summary.append(msg.getString(MSG_CREATED_ON)).append(": ")
|
||||
.append(Utils.getDateFormat(fc).format(new Date(store.getCreateDate())))
|
||||
.append("<p>");
|
||||
summary.append(msg.getString(MSG_CREATED_BY)).append(": ")
|
||||
.append(store.getCreator())
|
||||
.append("<p>");
|
||||
summary.append(MessageFormat.format(msg.getString(MSG_WORKING_USERS), users));
|
||||
}
|
||||
|
||||
return summary.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param foldersRichList The foldersRichList to set.
|
||||
*/
|
||||
public void setFoldersRichList(UIRichList foldersRichList)
|
||||
{
|
||||
this.foldersRichList = foldersRichList;
|
||||
/*if (this.foldersRichList != null)
|
||||
{
|
||||
// set the initial sort column and direction
|
||||
this.foldersRichList.setInitialSortColumn(
|
||||
this.viewsConfig.getDefaultSortColumn(PAGE_NAME_FORUMS));
|
||||
this.foldersRichList.setInitialSortDescending(
|
||||
this.viewsConfig.hasDescendingSort(PAGE_NAME_FORUMS));
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,11 +308,17 @@ public class AVMBrowseBean implements IContextListener
|
||||
return this.username == null ? WebResources.IMAGE_SANDBOX_32 : WebResources.IMAGE_USERSANDBOX_32;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return website node the view is currently within
|
||||
*/
|
||||
public Node getWebsite()
|
||||
{
|
||||
return this.navigator.getCurrentNode();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Map of avm node objects representing the folders with the current website space
|
||||
*/
|
||||
public List<Map> getFolders()
|
||||
{
|
||||
if (this.folders == null)
|
||||
@@ -292,6 +328,9 @@ public class AVMBrowseBean implements IContextListener
|
||||
return this.folders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Map of avm node objects representing the files with the current website space
|
||||
*/
|
||||
public List<Map> getFiles()
|
||||
{
|
||||
if (this.files == null)
|
||||
@@ -301,6 +340,9 @@ public class AVMBrowseBean implements IContextListener
|
||||
return this.files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the lists of files and folders within the current browsing path in a website space
|
||||
*/
|
||||
private void getNodes()
|
||||
{
|
||||
UserTransaction tx = null;
|
||||
@@ -348,6 +390,9 @@ public class AVMBrowseBean implements IContextListener
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the UI after a folder click action in the website browsing screens
|
||||
*/
|
||||
public void clickFolder(ActionEvent event)
|
||||
{
|
||||
UIActionLink link = (UIActionLink)event.getComponent();
|
||||
|
204
source/java/org/alfresco/web/bean/wcm/AVMEditBean.java
Normal file
204
source/java/org/alfresco/web/bean/wcm/AVMEditBean.java
Normal file
@@ -0,0 +1,204 @@
|
||||
/*
|
||||
* Copyright (C) 2005 Alfresco, Inc.
|
||||
*
|
||||
* Licensed under the Mozilla Public License version 1.1
|
||||
* with a permitted attribution clause. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.alfresco.org/legal/license.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*/
|
||||
package org.alfresco.web.bean.wcm;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.event.ActionEvent;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
|
||||
/**
|
||||
* Bean backing the edit pages for a AVM node content.
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class AVMEditBean
|
||||
{
|
||||
/** Current AVM Node context*/
|
||||
private AVMNodeDescriptor avmNode = null;
|
||||
|
||||
private String documentContent = null;
|
||||
|
||||
private String editorOutput = null;
|
||||
|
||||
/** AVM service bean reference */
|
||||
protected AVMService avmService;
|
||||
|
||||
/** The ContentService bean reference */
|
||||
protected ContentService contentService;
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean property getters and setters
|
||||
|
||||
/**
|
||||
* @param avmService The AVMService to set.
|
||||
*/
|
||||
public void setAvmService(AVMService avmService)
|
||||
{
|
||||
this.avmService = avmService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param contentService The ContentService to set.
|
||||
*/
|
||||
public void setContentService(ContentService contentService)
|
||||
{
|
||||
this.contentService = contentService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the current AVM node context.
|
||||
*/
|
||||
public AVMNodeDescriptor getAVMNode()
|
||||
{
|
||||
return this.avmNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param avmNode The AVM node context to set.
|
||||
*/
|
||||
public void setAVMNode(AVMNodeDescriptor avmNode)
|
||||
{
|
||||
this.avmNode = avmNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the document content used for HTML in-line editing.
|
||||
*/
|
||||
public String getDocumentContent()
|
||||
{
|
||||
return this.documentContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param documentContent The document content for HTML in-line editing.
|
||||
*/
|
||||
public void setDocumentContent(String documentContent)
|
||||
{
|
||||
this.documentContent = documentContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns output from the in-line editor page.
|
||||
*/
|
||||
public String getEditorOutput()
|
||||
{
|
||||
return this.editorOutput;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param editorOutput The output from the in-line editor page
|
||||
*/
|
||||
public void setEditorOutput(String editorOutput)
|
||||
{
|
||||
this.editorOutput = editorOutput;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Action event handlers
|
||||
|
||||
/**
|
||||
* Action event called by all actions that need to setup a Content node context on the
|
||||
* before an action page/wizard is called. The context will be an AVMNodeDescriptor in
|
||||
* setAVMNode() which can be retrieved on action pages via getAVMNode().
|
||||
*
|
||||
* @param event ActionEvent
|
||||
*/
|
||||
public void setupContentAction(ActionEvent event)
|
||||
{
|
||||
UIActionLink link = (UIActionLink)event.getComponent();
|
||||
Map<String, String> params = link.getParameterMap();
|
||||
String path = params.get("id");
|
||||
if (path != null && path.length() != 0)
|
||||
{
|
||||
setAVMNode(avmService.lookup(-1, path));
|
||||
}
|
||||
else
|
||||
{
|
||||
setAVMNode(null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Action handler called to calculate which editing screen to display based on the mimetype
|
||||
* of a document. If appropriate, the in-line editing screen will be shown.
|
||||
*/
|
||||
public void setupEditAction(ActionEvent event)
|
||||
{
|
||||
setupContentAction(event);
|
||||
|
||||
// retrieve the content reader for this node
|
||||
NodeRef avmRef = AVMNodeConverter.ToNodeRef(-1, getAVMNode().getPath());
|
||||
ContentReader reader = contentService.getReader(avmRef, ContentModel.PROP_CONTENT);
|
||||
if (reader != null)
|
||||
{
|
||||
String mimetype = reader.getMimetype();
|
||||
|
||||
// calculate which editor screen to display
|
||||
if (MimetypeMap.MIMETYPE_TEXT_PLAIN.equals(mimetype) ||
|
||||
MimetypeMap.MIMETYPE_XML.equals(mimetype) ||
|
||||
MimetypeMap.MIMETYPE_TEXT_CSS.equals(mimetype) ||
|
||||
MimetypeMap.MIMETYPE_JAVASCRIPT.equals(mimetype))
|
||||
{
|
||||
// make content available to the editing screen
|
||||
setEditorOutput(reader.getContentString());
|
||||
|
||||
// navigate to appropriate screen
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
String outcome;
|
||||
if (MimetypeMap.MIMETYPE_XML.equals(mimetype))
|
||||
{
|
||||
outcome = "dialog:editAvmXmlInline";
|
||||
}
|
||||
else
|
||||
{
|
||||
outcome = "dialog:editAvmTextInline";
|
||||
}
|
||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, outcome);
|
||||
}
|
||||
else if (MimetypeMap.MIMETYPE_HTML.equals(mimetype))
|
||||
{
|
||||
// make content available to the editing screen
|
||||
setDocumentContent(reader.getContentString());
|
||||
setEditorOutput(null);
|
||||
|
||||
// navigate to appropriate screen
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:editAvmHtmlInline");
|
||||
}
|
||||
else
|
||||
{
|
||||
// normal downloadable document
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:editAvmFile");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -51,11 +51,21 @@ public class AVMNode implements Map<String, Object>
|
||||
public AVMNode(AVMNodeDescriptor avmRef)
|
||||
{
|
||||
this.avmRef = avmRef;
|
||||
this.version = -1; // TODO: why does avmNode.getVersionID() return 1?
|
||||
this.version = -1; // TODO: always 1 for now...
|
||||
this.path = avmRef.getPath();
|
||||
|
||||
getProperties();
|
||||
}
|
||||
|
||||
public String getPath()
|
||||
{
|
||||
return this.path;
|
||||
}
|
||||
|
||||
public int getVersion()
|
||||
{
|
||||
return this.version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return All the properties known about this node.
|
||||
|
@@ -33,7 +33,6 @@ import org.alfresco.config.Config;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.config.ActionsConfigElement;
|
||||
import org.alfresco.web.config.ActionsConfigElement.ActionDefinition;
|
||||
import org.alfresco.web.config.ActionsConfigElement.ActionGroup;
|
||||
@@ -503,27 +502,27 @@ public class UIActions extends SelfRenderingComponent
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Node that forms the context object for this group of actions
|
||||
* Get the object that forms the context for this group of actions
|
||||
*
|
||||
* @return the context
|
||||
*/
|
||||
public Node getContext()
|
||||
public Object getContext()
|
||||
{
|
||||
ValueBinding vb = getValueBinding("context");
|
||||
if (vb != null)
|
||||
{
|
||||
this.context = (Node)vb.getValue(getFacesContext());
|
||||
this.context = vb.getValue(getFacesContext());
|
||||
}
|
||||
|
||||
return this.context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the the Node that forms the context object for this group of actions
|
||||
* Set the the object that forms the context for this group of actions
|
||||
*
|
||||
* @param context the context
|
||||
*/
|
||||
public void setContext(Node context)
|
||||
public void setContext(Object context)
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
@@ -609,8 +608,8 @@ public class UIActions extends SelfRenderingComponent
|
||||
/** For this component the value is the ID of an Action Group config block */
|
||||
private String value = null;
|
||||
|
||||
/** The context Node for the action group */
|
||||
private Node context = null;
|
||||
/** The context object for the action group */
|
||||
private Object context = null;
|
||||
|
||||
/** Vertical layout spacing */
|
||||
private Integer verticalSpacing = null;
|
||||
|
@@ -17,15 +17,14 @@
|
||||
package org.alfresco.web.ui.wcm.component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.faces.component.NamingContainer;
|
||||
import javax.faces.component.UIComponent;
|
||||
import javax.faces.component.UIParameter;
|
||||
import javax.faces.context.FacesContext;
|
||||
@@ -37,17 +36,16 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avm.AVMStoreDescriptor;
|
||||
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.app.servlet.DownloadContentServlet;
|
||||
import org.alfresco.web.bean.BrowseBean;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.bean.wcm.AVMConstants;
|
||||
import org.alfresco.web.bean.wcm.AVMNode;
|
||||
import org.alfresco.web.ui.common.ComponentConstants;
|
||||
import org.alfresco.web.ui.common.ConstantMethodBinding;
|
||||
import org.alfresco.web.ui.common.PanelGenerator;
|
||||
@@ -55,21 +53,20 @@ import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.common.component.SelfRenderingComponent;
|
||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
import org.alfresco.web.ui.common.converter.ByteSizeConverter;
|
||||
import org.alfresco.web.ui.common.converter.XMLDateConverter;
|
||||
import org.alfresco.web.ui.repo.component.UIActions;
|
||||
import org.alfresco.web.ui.wcm.WebResources;
|
||||
import org.apache.myfaces.taglib.UIComponentTagUtils;
|
||||
import org.springframework.web.jsf.FacesContextUtils;
|
||||
|
||||
import sun.swing.UIAction;
|
||||
|
||||
/**
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class UIUserSandboxes extends SelfRenderingComponent
|
||||
{
|
||||
private static final String ACTIONS_FILE = "avm_file_modified";
|
||||
|
||||
private static final String COMPONENT_ACTIONS = "org.alfresco.faces.Actions";
|
||||
|
||||
private static final String MSG_MODIFIED_ITEMS = "modified_items";
|
||||
private static final String MSG_DATETIME_PATTERN = "date_time_pattern";
|
||||
private static final String MSG_SIZE = "size";
|
||||
private static final String MSG_CREATED = "created_date";
|
||||
private static final String MSG_USERNAME = "username";
|
||||
@@ -84,7 +81,6 @@ public class UIUserSandboxes extends SelfRenderingComponent
|
||||
private NodeRef value;
|
||||
|
||||
private ByteSizeConverter sizeConverter = null;
|
||||
private XMLDateConverter dateConverter = null;
|
||||
|
||||
private Set<String> expandedPanels = new HashSet<String>();
|
||||
|
||||
@@ -253,7 +249,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
|
||||
if (this.expandedPanels.contains(username))
|
||||
{
|
||||
out.write("<div style='padding:2px'></div>");
|
||||
out.write("<table cellspacing=2 cellpadding=2 border=0 width=100%>");
|
||||
out.write("<table class='modifiedItemsList' cellspacing=2 cellpadding=2 border=0 width=100%>");
|
||||
|
||||
// header row
|
||||
out.write("<tr align=left><th width=16></th><th>");
|
||||
@@ -313,11 +309,15 @@ public class UIUserSandboxes extends SelfRenderingComponent
|
||||
{
|
||||
AVMSyncService avmSyncService = getAVMSyncService(fc);
|
||||
AVMService avmService = getAVMService(fc);
|
||||
DateFormat df = Utils.getDateTimeFormat(fc);
|
||||
|
||||
// build the paths to the stores to compare
|
||||
String userStore = AVMConstants.buildAVMUserMainStoreName(storeRoot, username) + ":/";
|
||||
String stagingStore = AVMConstants.buildAVMStagingStoreName(storeRoot) + ":/";
|
||||
|
||||
// get the UIActions component responsible for rendering context related user actions
|
||||
UIActions uiFileActions = aquireUIActions(ACTIONS_FILE);
|
||||
|
||||
// use the sync service to get the list of diffs between the stores
|
||||
List<AVMDifference> diffs = avmSyncService.compare(-1, userStore, -1, stagingStore);
|
||||
for (AVMDifference diff : diffs)
|
||||
@@ -353,10 +353,10 @@ public class UIUserSandboxes extends SelfRenderingComponent
|
||||
}
|
||||
out.write("</td><td>");
|
||||
// created date
|
||||
out.write(getDateConverter().getAsString(fc, this, node.getCreateDate()));
|
||||
out.write(df.format(new Date(node.getCreateDate())));
|
||||
out.write("</td><td>");
|
||||
// modified date
|
||||
out.write(getDateConverter().getAsString(fc, this, node.getModDate()));
|
||||
out.write(df.format(new Date(node.getModDate())));
|
||||
out.write("</td><td>");
|
||||
if (node.isFile())
|
||||
{
|
||||
@@ -364,8 +364,9 @@ public class UIUserSandboxes extends SelfRenderingComponent
|
||||
out.write(getSizeConverter().getAsString(fc, this, node.getLength()));
|
||||
}
|
||||
out.write("</td><td>");
|
||||
// TODO: add UI actions for this item
|
||||
out.write("(P) (E) (T) (D)");
|
||||
// add UI actions for this item
|
||||
uiFileActions.setContext(new AVMNode(node));
|
||||
Utils.encodeRecursive(fc, uiFileActions);
|
||||
out.write("</td></tr>");
|
||||
}
|
||||
//}
|
||||
@@ -384,18 +385,29 @@ public class UIUserSandboxes extends SelfRenderingComponent
|
||||
return this.sizeConverter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Date format converter
|
||||
*/
|
||||
private XMLDateConverter getDateConverter()
|
||||
private UIActions aquireUIActions(String id)
|
||||
{
|
||||
if (this.dateConverter == null)
|
||||
UIActions uiActions = null;
|
||||
for (UIComponent component : (List<UIComponent>)getChildren())
|
||||
{
|
||||
this.dateConverter = new XMLDateConverter();
|
||||
this.dateConverter.setPattern(
|
||||
Application.getMessage(FacesContext.getCurrentInstance(), MSG_DATETIME_PATTERN));
|
||||
if (id.equals(component.getId()))
|
||||
{
|
||||
uiActions = (UIActions)component;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this.dateConverter;
|
||||
if (uiActions == null)
|
||||
{
|
||||
javax.faces.application.Application facesApp = FacesContext.getCurrentInstance().getApplication();
|
||||
uiActions = (UIActions)facesApp.createComponent(COMPONENT_ACTIONS);
|
||||
uiActions.setShowLink(false);
|
||||
uiActions.setId(id);
|
||||
uiActions.setParent(this);
|
||||
uiActions.setValue(id);
|
||||
|
||||
this.getChildren().add(uiActions);
|
||||
}
|
||||
return uiActions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user