mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
- AWC-663 & AR-602; specialise-type handling
- Added property config for cm:titled aspect so that name, title and description appear at top of property sheet for custom types git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2945 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -68,11 +68,8 @@
|
||||
|
||||
<config evaluator="node-type" condition="my:sop">
|
||||
<property-sheet>
|
||||
<show-property name="name" />
|
||||
<show-property name="mimetype" display-label-id="content_type"
|
||||
component-generator="MimeTypeSelectorGenerator" />
|
||||
<show-property name="title" />
|
||||
<show-property name="description" />
|
||||
<show-property name="size" display-label-id="size"
|
||||
converter="org.alfresco.faces.ByteSizeConverter"
|
||||
show-in-edit-mode="false" />
|
||||
|
@@ -635,6 +635,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.
|
||||
select_action=Select Action
|
||||
select_an_action=Select an action...
|
||||
select_a_type=Select a type...
|
||||
action=Action
|
||||
action_settings=Action Settings
|
||||
set_action_values=Set action values
|
||||
|
@@ -5,21 +5,27 @@
|
||||
<show-property name="name" />
|
||||
<show-property name="mimetype" display-label-id="content_type"
|
||||
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"
|
||||
ignore-if-missing="false" />
|
||||
<show-property name="description" display-label-id="description"
|
||||
ignore-if-missing="false" />
|
||||
<show-property name="author" display-label-id="author"
|
||||
ignore-if-missing="false" />
|
||||
<show-property name="size" display-label-id="size"
|
||||
converter="org.alfresco.faces.ByteSizeConverter"
|
||||
show-in-edit-mode="false" />
|
||||
<show-property name="author" display-label-id="author"
|
||||
ignore-if-missing="false" />
|
||||
</property-sheet>
|
||||
</config>
|
||||
|
||||
<config evaluator="node-type" condition="folder">
|
||||
<property-sheet>
|
||||
<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"
|
||||
ignore-if-missing="false" />
|
||||
<show-property name="description" display-label-id="description"
|
||||
@@ -87,6 +93,24 @@
|
||||
</property-sheet>
|
||||
</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">
|
||||
<property-sheet>
|
||||
<show-property name="removeAfter"/>
|
||||
@@ -138,12 +162,6 @@
|
||||
</property-sheet>
|
||||
</config>
|
||||
|
||||
<config evaluator="aspect-name" condition="author">
|
||||
<property-sheet>
|
||||
<show-property name="author" />
|
||||
</property-sheet>
|
||||
</config>
|
||||
|
||||
<config evaluator="aspect-name" condition="auditable">
|
||||
<property-sheet>
|
||||
<show-property name="creator" read-only="true" show-in-edit-mode="false" />
|
||||
|
@@ -193,7 +193,7 @@
|
||||
<type name="folder" display-label-id="space"/>
|
||||
<type name="content"/>
|
||||
</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>
|
||||
<!-- The list of aspects to show in the add/remove features action -->
|
||||
|
@@ -329,10 +329,8 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
||||
|
||||
// add the well known object type to start with
|
||||
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());
|
||||
Config wizardCfg = svc.getConfig("Action Wizards");
|
||||
if (wizardCfg != null)
|
||||
@@ -345,8 +343,13 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
||||
QName idQName = Repository.resolveToQName(child.getAttribute("name"));
|
||||
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 &&
|
||||
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
|
||||
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
|
||||
QuickSort sorter = new QuickSort(this.objectTypes, "label", true, IDataContainer.SORT_CASEINSENSITIVE);
|
||||
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
|
||||
{
|
||||
|
@@ -26,6 +26,20 @@
|
||||
|
||||
<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>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
@@ -105,7 +119,8 @@
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.select_type}"/></nobr></td>
|
||||
<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}" />
|
||||
</h:selectOneMenu>
|
||||
</td>
|
||||
@@ -120,7 +135,8 @@
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
|
Reference in New Issue
Block a user