Morning merge.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2959 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-05-23 16:39:21 +00:00
parent 9189208bad
commit 77df6eb45d
22 changed files with 282 additions and 46 deletions

View File

@@ -68,11 +68,8 @@
<config evaluator="node-type" condition="my:sop"> <config evaluator="node-type" condition="my:sop">
<property-sheet> <property-sheet>
<show-property name="name" />
<show-property name="mimetype" display-label-id="content_type" <show-property name="mimetype" display-label-id="content_type"
component-generator="MimeTypeSelectorGenerator" /> component-generator="MimeTypeSelectorGenerator" />
<show-property name="title" />
<show-property name="description" />
<show-property name="size" display-label-id="size" <show-property name="size" display-label-id="size"
converter="org.alfresco.faces.ByteSizeConverter" converter="org.alfresco.faces.ByteSizeConverter"
show-in-edit-mode="false" /> show-in-edit-mode="false" />

View File

@@ -94,6 +94,7 @@ recent_spaces=Recent Spaces
shortcuts=Shortcuts shortcuts=Shortcuts
company_home=Company Home company_home=Company Home
my_home=My Home my_home=My Home
guest_home=Guest Home
new_search=New Search new_search=New Search
search_results=Search Results search_results=Search Results
search_detail=Search for \"{0}\" results shown below search_detail=Search for \"{0}\" results shown below
@@ -636,6 +637,7 @@ edit_rule_desc=This wizard helps you modify a rule.
edit_rule_finish_instruction=To update the rule click Finish. To review or change your selections click Back. edit_rule_finish_instruction=To update the rule click Finish. To review or change your selections click Back.
select_action=Select Action select_action=Select Action
select_an_action=Select an action... select_an_action=Select an action...
select_a_type=Select a type...
action=Action action=Action
action_settings=Action Settings action_settings=Action Settings
set_action_values=Set action values set_action_values=Set action values
@@ -802,10 +804,8 @@ delete_item_confirm=Are you sure you want to permanently delete \"{0}\" from the
recover_item=Recover Item recover_item=Recover Item
recover_item_info=Recover an item from the deleted file store recover_item_info=Recover an item from the deleted file store
recover_item_confirm=Are you sure you want to recover \"{0}\" from the deleted file store? recover_item_confirm=Are you sure you want to recover \"{0}\" from the deleted file store?
delete_all_items=Delete All Items
delete_all_items_info=Permanently delete all files and spaces from the deleted file store delete_all_items_info=Permanently delete all files and spaces from the deleted file store
delete_all_items_confirm=Are you sure you want to permanently delete all files and spaces from the deleted file store? The items cannot be recovered once this action has been performed. delete_all_items_confirm=Are you sure you want to permanently delete all files and spaces from the deleted file store? The items cannot be recovered once this action has been performed.
recover_all_items=Recover All Items
recover_all_items_info=Recover all files and spaces from the deleted file store recover_all_items_info=Recover all files and spaces from the deleted file store
recover_all_items_confirm=Are you sure you want to recover all the deleted files and spaces from the deleted file store? recover_all_items_confirm=Are you sure you want to recover all the deleted files and spaces from the deleted file store?
delete_listed_items=Delete Listed Items delete_listed_items=Delete Listed Items

View File

@@ -381,6 +381,7 @@
<permissions> <permissions>
<permission allow="true">TakeOwnership</permission> <permission allow="true">TakeOwnership</permission>
</permissions> </permissions>
<evaluator>org.alfresco.web.action.evaluator.TakeOwnershipDocEvaluator</evaluator>
<label-id>take_ownership</label-id> <label-id>take_ownership</label-id>
<image>/images/icons/take_ownership.gif</image> <image>/images/icons/take_ownership.gif</image>
<action-listener>#{DocumentDetailsBean.takeOwnership}</action-listener> <action-listener>#{DocumentDetailsBean.takeOwnership}</action-listener>
@@ -601,6 +602,7 @@
<action idref="delete_doc" /> <action idref="delete_doc" />
<action idref="take_ownership_doc" /> <action idref="take_ownership_doc" />
<action idref="manage_content_users" /> <action idref="manage_content_users" />
<action idref="run_action" />
</action-group> </action-group>
<!-- Actions Menu for Folder Link Details screen --> <!-- Actions Menu for Folder Link Details screen -->
@@ -610,6 +612,7 @@
<action idref="delete_doc" /> <action idref="delete_doc" />
<action idref="take_ownership_space" /> <action idref="take_ownership_space" />
<action idref="manage_content_users" /> <action idref="manage_content_users" />
<action idref="run_action" />
</action-group> </action-group>
<!-- Actions Menu for Manage Rules screen --> <!-- Actions Menu for Manage Rules screen -->

View File

@@ -5,21 +5,27 @@
<show-property name="name" /> <show-property name="name" />
<show-property name="mimetype" display-label-id="content_type" <show-property name="mimetype" display-label-id="content_type"
component-generator="MimeTypeSelectorGenerator" /> component-generator="MimeTypeSelectorGenerator" />
<!-- NOTE: The following 3 properties are defined here to cover -->
<!-- the scenario where content is added via CIFS or FTP -->
<!-- and so the properties are missing -->
<show-property name="title" display-label-id="title" <show-property name="title" display-label-id="title"
ignore-if-missing="false" /> ignore-if-missing="false" />
<show-property name="description" display-label-id="description" <show-property name="description" display-label-id="description"
ignore-if-missing="false" /> ignore-if-missing="false" />
<show-property name="author" display-label-id="author"
ignore-if-missing="false" />
<show-property name="size" display-label-id="size" <show-property name="size" display-label-id="size"
converter="org.alfresco.faces.ByteSizeConverter" converter="org.alfresco.faces.ByteSizeConverter"
show-in-edit-mode="false" /> show-in-edit-mode="false" />
<show-property name="author" display-label-id="author"
ignore-if-missing="false" />
</property-sheet> </property-sheet>
</config> </config>
<config evaluator="node-type" condition="folder"> <config evaluator="node-type" condition="folder">
<property-sheet> <property-sheet>
<show-property name="name"/> <show-property name="name"/>
<!-- NOTE: The following 3 properties are defined here to cover -->
<!-- the scenario where folders are created via CIFS or FTP -->
<!-- and so the properties are missing -->
<show-property name="title" display-label-id="title" <show-property name="title" display-label-id="title"
ignore-if-missing="false" /> ignore-if-missing="false" />
<show-property name="description" display-label-id="description" <show-property name="description" display-label-id="description"
@@ -87,6 +93,24 @@
</property-sheet> </property-sheet>
</config> </config>
<config evaluator="aspect-name" condition="titled">
<property-sheet>
<!-- The 'name' property isn't part of the titled aspect -->
<!-- but it's presence here will force it to the top of the -->
<!-- list when custom types are defined in -->
<!-- web-client-config-custom.xml -->
<show-property name="name" />
<show-property name="title" />
<show-property name="description" />
</property-sheet>
</config>
<config evaluator="aspect-name" condition="author">
<property-sheet>
<show-property name="author" />
</property-sheet>
</config>
<config evaluator="aspect-name" condition="complianceable"> <config evaluator="aspect-name" condition="complianceable">
<property-sheet> <property-sheet>
<show-property name="removeAfter"/> <show-property name="removeAfter"/>
@@ -138,12 +162,6 @@
</property-sheet> </property-sheet>
</config> </config>
<config evaluator="aspect-name" condition="author">
<property-sheet>
<show-property name="author" />
</property-sheet>
</config>
<config evaluator="aspect-name" condition="auditable"> <config evaluator="aspect-name" condition="auditable">
<property-sheet> <property-sheet>
<show-property name="creator" read-only="true" show-in-edit-mode="false" /> <show-property name="creator" read-only="true" show-in-edit-mode="false" />

View File

@@ -193,7 +193,7 @@
<type name="folder" display-label-id="space"/> <type name="folder" display-label-id="space"/>
<type name="content"/> <type name="content"/>
</subtypes> </subtypes>
<!-- The list of content types shown in the specialise-type action --> <!-- The list of content and/or folder types shown in the specialise-type action -->
<specialise-types> <specialise-types>
</specialise-types> </specialise-types>
<!-- The list of aspects to show in the add/remove features action --> <!-- The list of aspects to show in the add/remove features action -->

View File

@@ -0,0 +1,36 @@
/*
* 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.action.evaluator;
import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.bean.repository.Node;
/**
* UI Action Evaluator - Take ownership of a document.
*
* @author Kevin Roast
*/
public final class TakeOwnershipDocEvaluator implements ActionEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
return (node.isLocked() == false);
}
}

View File

@@ -72,6 +72,7 @@ public class Application
private static String emailTemplatesFolderName; private static String emailTemplatesFolderName;
private static String savedSearchesFolderName; private static String savedSearchesFolderName;
private static String scriptsFolderName; private static String scriptsFolderName;
private static String guestHomeFolderName;
/** /**
* Private constructor to prevent instantiation of this class * Private constructor to prevent instantiation of this class
@@ -380,7 +381,6 @@ public class Application
return getSavedSearchesFolderName(FacesContextUtils.getRequiredWebApplicationContext(context)); return getSavedSearchesFolderName(FacesContextUtils.getRequiredWebApplicationContext(context));
} }
/** /**
* @return Return the JavaScript scripts folder name * @return Return the JavaScript scripts folder name
*/ */
@@ -397,6 +397,22 @@ public class Application
return getScriptsFolderName(FacesContextUtils.getRequiredWebApplicationContext(context)); return getScriptsFolderName(FacesContextUtils.getRequiredWebApplicationContext(context));
} }
/**
* @return Return the Guest Home folder name
*/
public static String getGuestHomeFolderName(ServletContext context)
{
return getGuestHomeFolderName(WebApplicationContextUtils.getRequiredWebApplicationContext(context));
}
/**
* @return Return the Guest Home folder name
*/
public static String getGuestHomeFolderName(FacesContext context)
{
return getGuestHomeFolderName(FacesContextUtils.getRequiredWebApplicationContext(context));
}
/** /**
* Set the language locale for the current user context * Set the language locale for the current user context
* *
@@ -764,6 +780,24 @@ public class Application
return scriptsFolderName; return scriptsFolderName;
} }
/**
* Returns the Guest Home folder name name
*
* @param context The spring context
* @return The Guest Home folder name
*/
private static String getGuestHomeFolderName(WebApplicationContext context)
{
if (guestHomeFolderName == null)
{
ImporterBootstrap bootstrap = (ImporterBootstrap)context.getBean(BEAN_IMPORTER_BOOTSTRAP);
Properties configuration = bootstrap.getConfiguration();
guestHomeFolderName = configuration.getProperty("spaces.guest_home.childname");
}
return guestHomeFolderName;
}
/** /**
* Retrieves the configured error page for the application * Retrieves the configured error page for the application
* *

View File

@@ -105,7 +105,7 @@ public class NavigationBean
{ {
this.ruleService = ruleService; this.ruleService = ruleService;
} }
/** /**
* @param cifsServer The cifsServer to set. * @param cifsServer The cifsServer to set.
*/ */
@@ -129,6 +129,14 @@ public class NavigationBean
{ {
return Application.getCurrentUser(FacesContext.getCurrentInstance()); return Application.getCurrentUser(FacesContext.getCurrentInstance());
} }
/**
* @return true if the system is running within a JSR-168 portal container
*/
public boolean getInPortalServer()
{
return Application.inPortalServer();
}
/** /**
* Return the expanded state of the Shelf panel wrapper component * Return the expanded state of the Shelf panel wrapper component
@@ -476,6 +484,67 @@ public class NavigationBean
return this.dispatchContext; return this.dispatchContext;
} }
/**
* @return Node representing the Company Home folder
*/
public Node getCompanyHomeNode()
{
if (this.companyHomeNode == null)
{
NodeRef companyRootRef = new NodeRef(Repository.getStoreRef(), Application.getCompanyRootId());
this.companyHomeNode = new Node(companyRootRef);
}
return this.companyHomeNode;
}
/**
* @return Node representing the Guest Home Space folder
*/
public Node getGuestHomeNode()
{
if (this.guestHomeNode == null)
{
try
{
FacesContext fc = FacesContext.getCurrentInstance();
String xpath = Application.getRootPath(fc) + "/" + Application.getGuestHomeFolderName(fc);
List<NodeRef> guestHomeRefs = this.searchService.selectNodes(
this.nodeService.getRootNode(Repository.getStoreRef()),
xpath, null, this.namespaceService, false);
if (guestHomeRefs.size() == 1)
{
this.guestHomeNode = new Node(guestHomeRefs.get(0));
}
}
catch (InvalidNodeRefException err1)
{
// cannot continue if this occurs
}
catch (AccessDeniedException err2)
{
// cannot see node if this occurs
}
}
return this.guestHomeNode;
}
/**
* @return true if the Company home node is accessable to the current user
*/
public boolean getCompanyHomeVisible()
{
return getCompanyHomeNode().hasPermission(PermissionService.READ);
}
/**
* @return true if the Guest home node is accessable to the current user
*/
public boolean getGuestHomeVisible()
{
Node guestHome = getGuestHomeNode();
return guestHome != null && guestHome.hasPermission(PermissionService.READ);
}
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Navigation action event handlers // Navigation action event handlers
@@ -514,11 +583,10 @@ public class NavigationBean
if (LOCATION_COMPANY.equals(location)) if (LOCATION_COMPANY.equals(location))
{ {
List<IBreadcrumbHandler> elements = new ArrayList<IBreadcrumbHandler>(1); List<IBreadcrumbHandler> elements = new ArrayList<IBreadcrumbHandler>(1);
NodeRef companyRootRef = new NodeRef(Repository.getStoreRef(), Application.getCompanyRootId()); Node companyHome = getCompanyHomeNode();
String companySpaceName = Repository.getNameForNode(this.nodeService, companyRootRef); elements.add(new NavigationBreadcrumbHandler(companyHome.getNodeRef(), companyHome.getName()));
elements.add(new NavigationBreadcrumbHandler(companyRootRef, companySpaceName));
setLocation(elements); setLocation(elements);
setCurrentNodeId(companyRootRef.getId()); setCurrentNodeId(companyHome.getId());
} }
else if (LOCATION_HOME.equals(location)) else if (LOCATION_HOME.equals(location))
{ {
@@ -530,6 +598,14 @@ public class NavigationBean
setLocation(elements); setLocation(elements);
setCurrentNodeId(homeSpaceRef.getId()); setCurrentNodeId(homeSpaceRef.getId());
} }
else if (LOCATION_GUEST.equals(location))
{
List<IBreadcrumbHandler> elements = new ArrayList<IBreadcrumbHandler>(1);
Node guestHome = getGuestHomeNode();
elements.add(new NavigationBreadcrumbHandler(guestHome.getNodeRef(), guestHome.getName()));
setLocation(elements);
setCurrentNodeId(guestHome.getId());
}
// we need to force a navigation to refresh the browse screen breadcrumb // we need to force a navigation to refresh the browse screen breadcrumb
context.getApplication().getNavigationHandler().handleNavigation(context, null, "browse"); context.getApplication().getNavigationHandler().handleNavigation(context, null, "browse");
@@ -657,6 +733,7 @@ public class NavigationBean
/** constant values used by the toolbar location modelist control */ /** constant values used by the toolbar location modelist control */
private static final String LOCATION_COMPANY = "company"; private static final String LOCATION_COMPANY = "company";
private static final String LOCATION_HOME = "home"; private static final String LOCATION_HOME = "home";
private static final String LOCATION_GUEST = "guest";
private static final String ERROR_DELETED_FOLDER = "error_deleted_folder"; private static final String ERROR_DELETED_FOLDER = "error_deleted_folder";
@@ -693,6 +770,12 @@ public class NavigationBean
/** Node we are using for dispatching */ /** Node we are using for dispatching */
private Node dispatchContext = null; private Node dispatchContext = null;
/** Node representing the guest home */
private Node guestHomeNode = null;
/** Node representing the company home */
private Node companyHomeNode = null;
/** Current toolbar location */ /** Current toolbar location */
private String toolbarLocation = LOCATION_HOME; private String toolbarLocation = LOCATION_HOME;

View File

@@ -329,10 +329,8 @@ public abstract class BaseActionWizard extends BaseWizardBean
// add the well known object type to start with // add the well known object type to start with
this.objectTypes = new ArrayList<SelectItem>(5); this.objectTypes = new ArrayList<SelectItem>(5);
this.objectTypes.add(new SelectItem(ContentModel.TYPE_CONTENT.toString(),
Application.getMessage(context, "content")));
// add any configured content sub-types to the list // add any configured content or folder sub-types to the list
ConfigService svc = Application.getConfigService(FacesContext.getCurrentInstance()); ConfigService svc = Application.getConfigService(FacesContext.getCurrentInstance());
Config wizardCfg = svc.getConfig("Action Wizards"); Config wizardCfg = svc.getConfig("Action Wizards");
if (wizardCfg != null) if (wizardCfg != null)
@@ -345,8 +343,13 @@ public abstract class BaseActionWizard extends BaseWizardBean
QName idQName = Repository.resolveToQName(child.getAttribute("name")); QName idQName = Repository.resolveToQName(child.getAttribute("name"));
TypeDefinition typeDef = this.dictionaryService.getType(idQName); TypeDefinition typeDef = this.dictionaryService.getType(idQName);
// make sure the type is a subtype of content or folder but not
// the content or folder type itself
if (typeDef != null && if (typeDef != null &&
this.dictionaryService.isSubClass(typeDef.getName(), ContentModel.TYPE_CONTENT)) typeDef.getName().equals(ContentModel.TYPE_CONTENT) == false &&
typeDef.getName().equals(ContentModel.TYPE_FOLDER) == false &&
(this.dictionaryService.isSubClass(typeDef.getName(), ContentModel.TYPE_CONTENT) ||
this.dictionaryService.isSubClass(typeDef.getName(), ContentModel.TYPE_FOLDER)))
{ {
// try and get the display label from config // try and get the display label from config
String label = Utils.getDisplayLabel(context, child); String label = Utils.getDisplayLabel(context, child);
@@ -370,6 +373,10 @@ public abstract class BaseActionWizard extends BaseWizardBean
// make sure the list is sorted by the label // make sure the list is sorted by the label
QuickSort sorter = new QuickSort(this.objectTypes, "label", true, IDataContainer.SORT_CASEINSENSITIVE); QuickSort sorter = new QuickSort(this.objectTypes, "label", true, IDataContainer.SORT_CASEINSENSITIVE);
sorter.sort(); sorter.sort();
// add the select an action item at the start of the list
this.objectTypes.add(0, new SelectItem("null",
Application.getMessage(FacesContext.getCurrentInstance(), "select_a_type")));
} }
else else
{ {

View File

@@ -31,6 +31,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.model.FileExistsException; import org.alfresco.service.cmr.model.FileExistsException;
import org.alfresco.service.cmr.model.FileFolderService; import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.model.FileNotFoundException; import org.alfresco.service.cmr.model.FileNotFoundException;
import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.CopyService; import org.alfresco.service.cmr.repository.CopyService;
@@ -260,7 +261,7 @@ public class ClipboardBean
// we create a special Link Object node that has a property to reference the original // we create a special Link Object node that has a property to reference the original
// use FileFolderService to check if already exists as using nodeService directly here // use FileFolderService to check if already exists as using nodeService directly here
String linkTo = Application.getMessage(FacesContext.getCurrentInstance(), MSG_LINK_TO); String linkTo = Application.getMessage(FacesContext.getCurrentInstance(), MSG_LINK_TO);
// create the node using the nodeService (can only use FileFolderService for content) // create the node using the nodeService (can only use FileFolderService for content)
Map<QName, Serializable> props = new HashMap<QName, Serializable>(4, 1.0f); Map<QName, Serializable> props = new HashMap<QName, Serializable>(4, 1.0f);
@@ -357,8 +358,16 @@ public class ClipboardBean
} }
catch (FileExistsException fileExistsErr) catch (FileExistsException fileExistsErr)
{ {
String copyOf = Application.getMessage(FacesContext.getCurrentInstance(), MSG_COPY_OF); if (item.Mode == ClipboardStatus.COPY)
name = copyOf + ' ' + name; {
String copyOf = Application.getMessage(FacesContext.getCurrentInstance(), MSG_COPY_OF);
name = copyOf + ' ' + name;
}
else
{
// we should not rename an item when it is being moved
throw fileExistsErr;
}
} }
} }
} }

View File

@@ -227,6 +227,12 @@ public class EditContentPropertiesDialog extends BaseDialogBean
} }
} }
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Bean getters and setters // Bean getters and setters

View File

@@ -35,6 +35,7 @@ import org.alfresco.web.ui.repo.component.property.UIPropertySheet;
import org.alfresco.web.ui.repo.component.property.UIPropertySheet.ClientValidation; import org.alfresco.web.ui.repo.component.property.UIPropertySheet.ClientValidation;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.util.StringUtils;
import org.springframework.web.jsf.FacesContextUtils; import org.springframework.web.jsf.FacesContextUtils;
public abstract class BaseComponentGenerator implements IComponentGenerator public abstract class BaseComponentGenerator implements IComponentGenerator
@@ -398,7 +399,8 @@ public abstract class BaseComponentGenerator implements IComponentGenerator
// add the validation failed message to show (use the value of the // add the validation failed message to show (use the value of the
// label component of the given item) // label component of the given item)
String msg = Application.getMessage(context, "validation_mandatory"); String msg = Application.getMessage(context, "validation_mandatory");
params.add("'" + MessageFormat.format(msg, new Object[] {item.getResolvedDisplayLabel()}) + "'"); addStringConstraintParam(params,
MessageFormat.format(msg, new Object[] {item.getResolvedDisplayLabel()}));
// add the validation case to the property sheet // add the validation case to the property sheet
propertySheet.addClientValidation(new ClientValidation("validateMandatory", propertySheet.addClientValidation(new ClientValidation("validateMandatory",
@@ -504,12 +506,12 @@ public abstract class BaseComponentGenerator implements IComponentGenerator
try try
{ {
// encode the expression so it can be unescaped by JavaScript // encode the expression so it can be unescaped by JavaScript
params.add("'" + URLEncoder.encode(expression, "UTF-8") + "'"); addStringConstraintParam(params, URLEncoder.encode(expression, "UTF-8"));
} }
catch (UnsupportedEncodingException e) catch (UnsupportedEncodingException e)
{ {
// just add the expression as is // just add the expression as is
params.add("'" + expression + "'"); addStringConstraintParam(params, expression);
} }
// add the requiresMatch parameter // add the requiresMatch parameter
@@ -517,12 +519,12 @@ public abstract class BaseComponentGenerator implements IComponentGenerator
// add the validation failed messages // add the validation failed messages
String matchMsg = Application.getMessage(context, "validation_regex"); String matchMsg = Application.getMessage(context, "validation_regex");
params.add("'" + MessageFormat.format(matchMsg, new Object[] addStringConstraintParam(params,
{property.getResolvedDisplayLabel()}) + "'"); MessageFormat.format(matchMsg, new Object[] {property.getResolvedDisplayLabel()}));
String noMatchMsg = Application.getMessage(context, "validation_regex_not_match"); String noMatchMsg = Application.getMessage(context, "validation_regex_not_match");
params.add("'" + MessageFormat.format(noMatchMsg, new Object[] addStringConstraintParam(params,
{property.getResolvedDisplayLabel()}) + "'"); MessageFormat.format(noMatchMsg, new Object[] {property.getResolvedDisplayLabel()}));
// add the validation case to the property sheet // add the validation case to the property sheet
propertySheet.addClientValidation(new ClientValidation("validateRegex", propertySheet.addClientValidation(new ClientValidation("validateRegex",
@@ -562,8 +564,8 @@ public abstract class BaseComponentGenerator implements IComponentGenerator
// add the validation failed message to show // add the validation failed message to show
String msg = Application.getMessage(context, "validation_string_length"); String msg = Application.getMessage(context, "validation_string_length");
params.add("'" + MessageFormat.format(msg, new Object[] addStringConstraintParam(params,
{property.getResolvedDisplayLabel(), min, max}) + "'"); MessageFormat.format(msg, new Object[] {property.getResolvedDisplayLabel(), min, max}));
// add the validation case to the property sheet // add the validation case to the property sheet
propertySheet.addClientValidation(new ClientValidation("validateStringLength", propertySheet.addClientValidation(new ClientValidation("validateStringLength",
@@ -603,8 +605,8 @@ public abstract class BaseComponentGenerator implements IComponentGenerator
// add the validation failed message to show // add the validation failed message to show
String msg = Application.getMessage(context, "validation_numeric_range"); String msg = Application.getMessage(context, "validation_numeric_range");
params.add("'" + MessageFormat.format(msg, new Object[] addStringConstraintParam(params,
{property.getResolvedDisplayLabel(), min, max}) + "'"); MessageFormat.format(msg, new Object[] {property.getResolvedDisplayLabel(), min, max}));
// add the validation case to the property sheet // add the validation case to the property sheet
propertySheet.addClientValidation(new ClientValidation("validateNumberRange", propertySheet.addClientValidation(new ClientValidation("validateNumberRange",
@@ -695,6 +697,20 @@ public abstract class BaseComponentGenerator implements IComponentGenerator
return getDataDictionary(context).getAssociationDefinition(node, associationName); return getDataDictionary(context).getAssociationDefinition(node, associationName);
} }
/**
* Adds the given string parameter to the list of parameters to be used for
* validating constraints on the client.
* This method adds the quotes around the given parameter and also escapes
* any ocurrences of the double quote character.
*
* @param params The list of parameters for the constraint
* @param param The string parameter to add
*/
protected void addStringConstraintParam(List<String> params, String param)
{
params.add("\"" + StringUtils.replace(param, "\"", "\\\"") + "\"");
}
private DataDictionary getDataDictionary(FacesContext context) private DataDictionary getDataDictionary(FacesContext context)
{ {
if (this.dataDictionary == null) if (this.dataDictionary == null)

View File

@@ -41,6 +41,12 @@ public class EditSpaceDialog extends CreateSpaceDialog
return Application.getMessage(FacesContext.getCurrentInstance(), "ok"); return Application.getMessage(FacesContext.getCurrentInstance(), "ok");
} }
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
/** /**
* Returns the editable node * Returns the editable node
* *

View File

@@ -200,7 +200,7 @@ public class UIClipboardShelfItem extends UIShelfItem
out.write(buildActionLink(ACTION_REMOVE_ITEM, i, bundle.getString(MSG_REMOVE_ITEM), WebResources.IMAGE_REMOVE)); out.write(buildActionLink(ACTION_REMOVE_ITEM, i, bundle.getString(MSG_REMOVE_ITEM), WebResources.IMAGE_REMOVE));
out.write("&nbsp;"); out.write("&nbsp;");
out.write(buildActionLink(ACTION_PASTE_ITEM, i, bundle.getString(MSG_PASTE_ITEM), WebResources.IMAGE_PASTE)); out.write(buildActionLink(ACTION_PASTE_ITEM, i, bundle.getString(MSG_PASTE_ITEM), WebResources.IMAGE_PASTE));
if (item.Mode == ClipboardStatus.COPY) if (item.Mode == ClipboardStatus.COPY && dd.isSubClass(item.Node.getType(), ContentModel.TYPE_LINK) == false)
{ {
out.write("&nbsp;"); out.write("&nbsp;");
out.write(buildActionLink(ACTION_PASTE_LINK, i, bundle.getString(MSG_PASTE_LINK), WebResources.IMAGE_PASTE_LINK)); out.write(buildActionLink(ACTION_PASTE_LINK, i, bundle.getString(MSG_PASTE_LINK), WebResources.IMAGE_PASTE_LINK));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

After

Width:  |  Height:  |  Size: 282 B

View File

@@ -26,6 +26,20 @@
<r:page titleId="title_action_specialise_type"> <r:page titleId="title_action_specialise_type">
<script type="text/javascript">
function itemSelected(inputField)
{
if (inputField.selectedIndex == 0)
{
document.getElementById("specialise-type-action:ok-button").disabled = true;
}
else
{
document.getElementById("specialise-type-action:ok-button").disabled = false;
}
}
</script>
<f:view> <f:view>
<%-- load a bundle of properties with I18N strings --%> <%-- load a bundle of properties with I18N strings --%>
@@ -105,7 +119,8 @@
<tr> <tr>
<td><nobr><h:outputText value="#{msg.select_type}"/></nobr></td> <td><nobr><h:outputText value="#{msg.select_type}"/></nobr></td>
<td width="90%"> <td width="90%">
<h:selectOneMenu value="#{WizardManager.bean.actionProperties.objecttype}"> <h:selectOneMenu value="#{WizardManager.bean.actionProperties.objecttype}"
id="type" onchange="javascript:itemSelected(this);">
<f:selectItems value="#{WizardManager.bean.objectTypes}" /> <f:selectItems value="#{WizardManager.bean.objectTypes}" />
</h:selectOneMenu> </h:selectOneMenu>
</td> </td>
@@ -120,7 +135,8 @@
<table cellpadding="1" cellspacing="1" border="0"> <table cellpadding="1" cellspacing="1" border="0">
<tr> <tr>
<td align="center"> <td align="center">
<h:commandButton value="#{msg.ok}" action="#{WizardManager.bean.addAction}" styleClass="wizardButton" /> <h:commandButton id="ok-button" value="#{msg.ok}" action="#{WizardManager.bean.addAction}"
disabled="true" styleClass="wizardButton" />
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@@ -134,11 +134,13 @@
<a href='<a:outputText value="#{DocumentDetailsBean.nodeRefUrl}" id="out3" />' onclick="return false;"><a:outputText value="#{msg.noderef_link}" id="out4" /></a> <a href='<a:outputText value="#{DocumentDetailsBean.nodeRefUrl}" id="out3" />' onclick="return false;"><a:outputText value="#{msg.noderef_link}" id="out4" /></a>
</td> </td>
</tr> </tr>
<a:panel id="link-panel" rendered="#{NavigationBean.inPortalServer == false}">
<tr> <tr>
<td colspan=3> <td colspan=3>
<a href='<%=request.getContextPath()%><a:outputText value="#{LinkPropertiesBean.fileLinkBookmarkUrl}" id="out5" />'><a:outputText value="#{msg.link_destination_details}" id="out6" /></a> <a href='<%=request.getContextPath()%><a:outputText value="#{LinkPropertiesBean.fileLinkBookmarkUrl}" id="out5" />'><a:outputText value="#{msg.link_destination_details}" id="out6" /></a>
</td> </td>
</tr> </tr>
</a:panel>
</table> </table>
</a:panel> </a:panel>

View File

@@ -122,11 +122,13 @@
<a href='<a:outputText value="#{SpaceDetailsBean.nodeRefUrl}" id="out3" />' onclick="return false;"><a:outputText value="#{msg.noderef_link}" id="out4" /></a> <a href='<a:outputText value="#{SpaceDetailsBean.nodeRefUrl}" id="out3" />' onclick="return false;"><a:outputText value="#{msg.noderef_link}" id="out4" /></a>
</td> </td>
</tr> </tr>
<a:panel id="link-panel" rendered="#{NavigationBean.inPortalServer == false}">
<tr> <tr>
<td colspan=4> <td colspan=4>
<a href='<%=request.getContextPath()%><a:outputText value="#{LinkPropertiesBean.spaceLinkDestinationUrl}" id="out5" />'><a:outputText value="#{msg.link_destination_details}" id="out6" /></a> <a href='<%=request.getContextPath()%><a:outputText value="#{LinkPropertiesBean.spaceLinkDestinationUrl}" id="out5" />'><a:outputText value="#{msg.link_destination_details}" id="out6" /></a>
</td> </td>
</tr> </tr>
</a:panel>
</table> </table>
</a:panel> </a:panel>

View File

@@ -155,7 +155,7 @@
</a:column> </a:column>
<%-- Actions column --%> <%-- Actions column --%>
<a:column actions="true" style="text-align:left"> <a:column id="col1" actions="true" style="text-align:left">
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{msg.actions}"/> <h:outputText value="#{msg.actions}"/>
</f:facet> </f:facet>

View File

@@ -213,7 +213,7 @@
</a:column> </a:column>
<%-- Actions column --%> <%-- Actions column --%>
<a:column actions="true" style="text-align:left"> <a:column id="col1" actions="true" style="text-align:left">
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{msg.actions}"/> <h:outputText value="#{msg.actions}"/>
</f:facet> </f:facet>

View File

@@ -189,7 +189,7 @@
</a:column> </a:column>
<%-- Actions column --%> <%-- Actions column --%>
<a:column actions="true" style="text-align:left"> <a:column id="col1" actions="true" style="text-align:left">
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{msg.actions}"/> <h:outputText value="#{msg.actions}"/>
</f:facet> </f:facet>

View File

@@ -26,10 +26,11 @@
<td width=100% style="background-image: url(<%=request.getContextPath()%>/images/parts/titlebar_bg.gif)"> <td width=100% style="background-image: url(<%=request.getContextPath()%>/images/parts/titlebar_bg.gif)">
<%-- Toolbar --%> <%-- Toolbar --%>
<a:modeList itemSpacing="3" iconColumnWidth="0" horizontal="true" <a:modeList itemSpacing="3" iconColumnWidth="0" horizontal="true"
itemStyleClass="topToolbar" itemLinkStyleClass="topToolbarLink" selectedStyleClass="topToolbarHighlight" selectedLinkStyleClass="topToolbarLinkHighlight" itemStyleClass="topToolbar" itemLinkStyleClass="topToolbarLink" selectedStyleClass="topToolbar" selectedLinkStyleClass="topToolbarLink"
value="#{NavigationBean.toolbarLocation}" actionListener="#{NavigationBean.toolbarLocationChanged}"> value="#{NavigationBean.toolbarLocation}" actionListener="#{NavigationBean.toolbarLocationChanged}">
<a:listItem value="company" label="#{msg.company_home}" /> <a:listItem value="company" label="#{msg.company_home}" rendered="#{NavigationBean.companyHomeVisible}" />
<a:listItem value="home" label="#{msg.my_home}" /> <a:listItem value="home" label="#{msg.my_home}" />
<a:listItem value="guest" label="#{msg.guest_home}" rendered="#{NavigationBean.isGuest == false && NavigationBean.guestHomeVisible}" />
</a:modeList> </a:modeList>
</td> </td>
<td><img src="<%=request.getContextPath()%>/images/parts/titlebar_end.gif" width=8 height=30></td> <td><img src="<%=request.getContextPath()%>/images/parts/titlebar_end.gif" width=8 height=30></td>