- Link generator now shows edit box in edit mode

- Hidden endpoint URL from user, blog URL entered instread
- Modification made to support typepad
- Added custom generator for blog selection list
- Blog module incorporated into main build scripts

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6119 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2007-06-27 10:49:15 +00:00
parent 1c0b08d21e
commit a45351ff3d
2 changed files with 27 additions and 14 deletions

View File

@@ -30,6 +30,7 @@ import javax.faces.context.FacesContext;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.ui.common.ComponentConstants;
import org.alfresco.web.ui.repo.component.property.PropertySheetItem;
import org.alfresco.web.ui.repo.component.property.UIPropertySheet;
@@ -42,18 +43,28 @@ import org.alfresco.web.ui.repo.component.property.UIPropertySheet;
*/
public class LinkGenerator extends BaseComponentGenerator
{
private boolean inEditMode = false;
/**
* @see org.alfresco.web.bean.generator.IComponentGenerator#generate(javax.faces.context.FacesContext, java.lang.String)
*/
@SuppressWarnings("unchecked")
public UIComponent generate(FacesContext context, String id)
{
UIComponent component = context.getApplication().
createComponent(UIOutput.COMPONENT_TYPE);
component.setRendererType("javax.faces.Link");
component.getAttributes().put("target", "new");
FacesHelper.setupComponentId(context, component, id);
UIComponent component = null;
if (this.inEditMode == false)
{
component = context.getApplication().createComponent(UIOutput.COMPONENT_TYPE);
component.setRendererType("javax.faces.Link");
component.getAttributes().put("target", "new");
}
else
{
component = context.getApplication().createComponent(ComponentConstants.JAVAX_FACES_INPUT);
component.setRendererType(ComponentConstants.JAVAX_FACES_TEXT);
}
FacesHelper.setupComponentId(context, component, id);
return component;
}
@@ -61,10 +72,10 @@ public class LinkGenerator extends BaseComponentGenerator
* @see org.alfresco.web.bean.generator.BaseComponentGenerator#createComponent(javax.faces.context.FacesContext, org.alfresco.web.ui.repo.component.property.UIPropertySheet, org.alfresco.web.ui.repo.component.property.PropertySheetItem)
*/
@Override
protected UIComponent createComponent(FacesContext context, UIPropertySheet propertySheet,
PropertySheetItem item)
protected UIComponent createComponent(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem item)
{
return this.generate(context, item.getName());
this.inEditMode = propertySheet.inEditMode();
return this.generate(context, item.getName());
}
/**
@@ -77,9 +88,12 @@ public class LinkGenerator extends BaseComponentGenerator
{
super.setupProperty(context, propertySheet, item, propertyDef, component);
// Add child text component
UIOutput output = createOutputTextComponent(context, "label_" + component.getId());
output.setValueBinding("value", component.getValueBinding("value"));
component.getChildren().add(output);
if (component.getRendererType().equals("javax.faces.Link") == true)
{
// Add child text component
UIOutput output = createOutputTextComponent(context, "label_" + component.getId());
output.setValueBinding("value", component.getValueBinding("value"));
component.getChildren().add(output);
}
}
}

View File

@@ -34,7 +34,6 @@ import javax.faces.component.UISelectItems;
import javax.faces.component.UISelectOne;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.DoubleConverter;
import javax.faces.convert.FloatConverter;
import javax.faces.convert.IntegerConverter;
import javax.faces.convert.LongConverter;