mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Reverted config changes (with the exception of context import order) and tested config extensions in external config files
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2226 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,20 +25,5 @@
|
|||||||
<ref bean="DictionaryService"/>
|
<ref bean="DictionaryService"/>
|
||||||
</constructor-arg>
|
</constructor-arg>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- the list of standard transformation mimetypes that are exposed in the UI -->
|
|
||||||
<bean id="webClientTransformMimetypes" class="java.util.ArrayList" >
|
|
||||||
<constructor-arg>
|
|
||||||
<list>
|
|
||||||
<value>text/html</value>
|
|
||||||
<value>application/pdf</value>
|
|
||||||
<value>text/plain</value>
|
|
||||||
<value>text/xml</value>
|
|
||||||
<value>application/x-shockwave-flash</value>
|
|
||||||
<value>image/gif</value>
|
|
||||||
<value>image/jpeg</value>
|
|
||||||
</list>
|
|
||||||
</constructor-arg>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
@@ -304,6 +304,15 @@
|
|||||||
<!-- Example configuration to demonstrate how to expose aspect from exampleModel.xml -->
|
<!-- Example configuration to demonstrate how to expose aspect from exampleModel.xml -->
|
||||||
<!-- <aspect name="my:imageClassification"/> -->
|
<!-- <aspect name="my:imageClassification"/> -->
|
||||||
</aspects>
|
</aspects>
|
||||||
|
<transformers>
|
||||||
|
<transformer name="text/html"/>
|
||||||
|
<transformer name="application/pdf"/>
|
||||||
|
<transformer name="text/plain"/>
|
||||||
|
<transformer name="text/xml"/>
|
||||||
|
<transformer name="application/x-shockwave-flash"/>
|
||||||
|
<transformer name="image/gif"/>
|
||||||
|
<transformer name="image/jpeg"/>
|
||||||
|
</transformers>
|
||||||
<image-transformers>
|
<image-transformers>
|
||||||
<transformer name="image/gif"/>
|
<transformer name="image/gif"/>
|
||||||
<transformer name="image/jpeg"/>
|
<transformer name="image/jpeg"/>
|
||||||
|
@@ -18,7 +18,6 @@ package org.alfresco.web.bean.wizard;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -42,6 +41,7 @@ import org.alfresco.repo.action.executer.MoveActionExecuter;
|
|||||||
import org.alfresco.repo.action.executer.SimpleWorkflowActionExecuter;
|
import org.alfresco.repo.action.executer.SimpleWorkflowActionExecuter;
|
||||||
import org.alfresco.repo.action.executer.SpecialiseTypeActionExecuter;
|
import org.alfresco.repo.action.executer.SpecialiseTypeActionExecuter;
|
||||||
import org.alfresco.repo.action.executer.TransformActionExecuter;
|
import org.alfresco.repo.action.executer.TransformActionExecuter;
|
||||||
|
import org.alfresco.service.ServiceRegistry;
|
||||||
import org.alfresco.service.cmr.action.ActionDefinition;
|
import org.alfresco.service.cmr.action.ActionDefinition;
|
||||||
import org.alfresco.service.cmr.action.ActionService;
|
import org.alfresco.service.cmr.action.ActionService;
|
||||||
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||||
@@ -99,7 +99,6 @@ public abstract class BaseActionWizard extends AbstractWizardBean
|
|||||||
protected DictionaryService dictionaryService;
|
protected DictionaryService dictionaryService;
|
||||||
protected MimetypeService mimetypeService;
|
protected MimetypeService mimetypeService;
|
||||||
protected List<SelectItem> actions;
|
protected List<SelectItem> actions;
|
||||||
private List<String> transformMimetypes;
|
|
||||||
protected List<SelectItem> transformers;
|
protected List<SelectItem> transformers;
|
||||||
protected List<SelectItem> imageTransformers;
|
protected List<SelectItem> imageTransformers;
|
||||||
protected List<SelectItem> aspects;
|
protected List<SelectItem> aspects;
|
||||||
@@ -109,16 +108,6 @@ public abstract class BaseActionWizard extends AbstractWizardBean
|
|||||||
protected Map<String, Serializable> currentActionProperties;
|
protected Map<String, Serializable> currentActionProperties;
|
||||||
protected List<SelectItem> objectTypes;
|
protected List<SelectItem> objectTypes;
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the available mimetypes to act as targets of transformations
|
|
||||||
*
|
|
||||||
* @param mimetypes a list of valid mimetypes
|
|
||||||
*/
|
|
||||||
public void setTransformMimetypes(List<String> mimetypes)
|
|
||||||
{
|
|
||||||
this.transformMimetypes = mimetypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialises the wizard
|
* Initialises the wizard
|
||||||
*/
|
*/
|
||||||
@@ -626,41 +615,61 @@ public abstract class BaseActionWizard extends AbstractWizardBean
|
|||||||
*/
|
*/
|
||||||
public List<SelectItem> getTransformers()
|
public List<SelectItem> getTransformers()
|
||||||
{
|
{
|
||||||
if (this.transformers != null)
|
if (this.transformers == null)
|
||||||
{
|
{
|
||||||
return this.transformers;
|
ConfigService svc = (ConfigService)FacesContextUtils.getRequiredWebApplicationContext(
|
||||||
}
|
FacesContext.getCurrentInstance()).getBean(Application.BEAN_CONFIG_SERVICE);
|
||||||
// check that the mimetypes are available
|
Config wizardCfg = svc.getConfig("Action Wizards");
|
||||||
if (this.transformMimetypes == null)
|
if (wizardCfg != null)
|
||||||
{
|
|
||||||
logger.warn("'transformMimetypes' property was not set");
|
|
||||||
this.transformMimetypes = Collections.emptyList();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.transformers = new ArrayList<SelectItem>(10);
|
|
||||||
|
|
||||||
Map<String, String> displaysByMimetype = this.mimetypeService.getDisplaysByMimetype();
|
|
||||||
for (String mimetype : this.transformMimetypes)
|
|
||||||
{
|
|
||||||
// get the display label
|
|
||||||
String label = displaysByMimetype.get(mimetype);
|
|
||||||
if (label == null)
|
|
||||||
{
|
{
|
||||||
// unrecognized mimetype
|
ConfigElement transformersCfg = wizardCfg.getConfigElement("transformers");
|
||||||
logger.warn("Unrecognized mimetype given to 'transformMimetypes': " + mimetype);
|
if (transformersCfg != null)
|
||||||
// just ignore it
|
{
|
||||||
continue;
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
|
Map<String, String> mimeTypes = this.mimetypeService.getDisplaysByMimetype();
|
||||||
|
this.transformers = new ArrayList<SelectItem>();
|
||||||
|
for (ConfigElement child : transformersCfg.getChildren())
|
||||||
|
{
|
||||||
|
String id = child.getAttribute("name");
|
||||||
|
|
||||||
|
// look for a client localized string
|
||||||
|
String label = null;
|
||||||
|
String msgId = child.getAttribute("displayLabelId");
|
||||||
|
if (msgId != null)
|
||||||
|
{
|
||||||
|
label = Application.getMessage(context, msgId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if there wasn't an externalized string look for one in the config
|
||||||
|
if (label == null)
|
||||||
|
{
|
||||||
|
label = child.getAttribute("displayLabel");
|
||||||
|
}
|
||||||
|
|
||||||
|
// if there wasn't a client based label get it from the mime type service
|
||||||
|
if (label == null)
|
||||||
|
{
|
||||||
|
label = mimeTypes.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.transformers.add(new SelectItem(id, label));
|
||||||
|
}
|
||||||
|
|
||||||
|
// make sure the list is sorted by the label
|
||||||
|
QuickSort sorter = new QuickSort(this.transformers, "label", true, IDataContainer.SORT_CASEINSENSITIVE);
|
||||||
|
sorter.sort();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logger.warn("Could not find transformers configuration element");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logger.warn("Could not find Action Wizards configuration section");
|
||||||
}
|
}
|
||||||
// create UI object
|
|
||||||
SelectItem item = new SelectItem(mimetype, label);
|
|
||||||
// add to collection
|
|
||||||
this.transformers.add(item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// sort
|
|
||||||
QuickSort sorter = new QuickSort(this.transformers, "label", true, IDataContainer.SORT_CASEINSENSITIVE);
|
|
||||||
sorter.sort();
|
|
||||||
|
|
||||||
return this.transformers;
|
return this.transformers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -488,10 +488,6 @@
|
|||||||
<property-name>rulesBean</property-name>
|
<property-name>rulesBean</property-name>
|
||||||
<value>#{RulesBean}</value>
|
<value>#{RulesBean}</value>
|
||||||
</managed-property>
|
</managed-property>
|
||||||
<managed-property>
|
|
||||||
<property-name>transformMimetypes</property-name>
|
|
||||||
<value>#{webClientTransformMimetypes}</value>
|
|
||||||
</managed-property>
|
|
||||||
</managed-bean>
|
</managed-bean>
|
||||||
|
|
||||||
<managed-bean>
|
<managed-bean>
|
||||||
@@ -529,10 +525,6 @@
|
|||||||
<property-name>mimetypeService</property-name>
|
<property-name>mimetypeService</property-name>
|
||||||
<value>#{MimetypeService}</value>
|
<value>#{MimetypeService}</value>
|
||||||
</managed-property>
|
</managed-property>
|
||||||
<managed-property>
|
|
||||||
<property-name>transformMimetypes</property-name>
|
|
||||||
<value>#{webClientTransformMimetypes}</value>
|
|
||||||
</managed-property>
|
|
||||||
</managed-bean>
|
</managed-bean>
|
||||||
|
|
||||||
<managed-bean>
|
<managed-bean>
|
||||||
|
Reference in New Issue
Block a user