本文整理汇总了Java中com.ibm.xsp.FacesExceptionEx类的典型用法代码示例。如果您正苦于以下问题:Java FacesExceptionEx类的具体用法?Java FacesExceptionEx怎么用?Java FacesExceptionEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FacesExceptionEx类属于com.ibm.xsp包,在下文中一共展示了FacesExceptionEx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StarterFacesContextFactory
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
public StarterFacesContextFactory() {
if (_debug)
System.out.println(getClass().getName() + " created");
Object inst;
try {
@SuppressWarnings("rawtypes")
Class delegateClass = DominoFacesContextFactoryImpl.class;
inst = delegateClass.newInstance();
} catch (Exception e) {
e.printStackTrace();
throw new FacesExceptionEx(e);
}
if (inst instanceof FacesContextFactory) {
_delegate = (FacesContextFactory) inst;
} else {
_delegate = null;
}
}
示例2: initDojoAttributes
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
protected void initDojoAttributes(FacesContext context, FacesDojoComponent dojoComponent, Map<String,String> attrs) throws IOException {
if(dojoComponent instanceof UITooltip) {
UITooltip c = (UITooltip)dojoComponent;
DojoRendererUtil.addDojoHtmlAttributes(attrs,"label",c.getLabel()); // $NON-NLS-1$
if(c.getShowDelay() != 0 )
DojoRendererUtil.addDojoHtmlAttributes(attrs,"showDelay",c.getShowDelay()); // $NON-NLS-1$
String _for = c.getFor();
if(StringUtil.isNotEmpty(_for)) {
UIComponent f = FacesUtil.getComponentFor(c, _for);
if(f==null) {
throw new FacesExceptionEx(null,"Unknown 'for' component {0}", _for); // $NLX-TooltipRenderer.Unknownforcomponent0-1$
}
DojoRendererUtil.addDojoHtmlAttributes(attrs,"connectId",f.getClientId(context)); // $NON-NLS-1$
}
DojoRendererUtil.addDojoHtmlAttributes(attrs,"position",c.getPosition()); // $NON-NLS-1$
}
}
示例3: prefetchData
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
@Override
public void prefetchData(int start, int count) {
// We should discard the current cache if the caller asks for a different block count
// start should generally be a multiple of count...
if(count!=blockSize && count>0) {
clearData(true);
blockSize = count;
}
if(blockSize == 0){
ArithmeticException ae = new ArithmeticException("Divide by zero error");// $NLX-DataBlockAccessor_DivideByZeroError-1$
String zeroArgConstr = "com.ibm.xsp.extlib.model.DataBlockAccessor.DataBlockAccessor()"; //$NON-NLS-1$
String twoArgConstr = "com.ibm.xsp.extlib.model.DataBlockAccessor.DataBlockAccessor(DataAccessorSource, int)"; //$NON-NLS-1$
String exMsg = "Blocksize cannot be zero. The {0} zero argument constructor should only be used during serialization. Please use the constructor {1}."; // $NLX-DataBlockAccessor_BlocksizeZeroSoWrongConstructor-1$
throw new FacesExceptionEx(ae, StringUtil.format(exMsg, zeroArgConstr, twoArgConstr));
}
// Now, find the block and load it if necessary
// Note that pre-fetch is just an indicator here, so 'count' might not be fulfilled
findBlockByIndex(start/blockSize, true);
}
示例4: save
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
@Override
public boolean save(FacesContext context, DataContainer data) throws FacesExceptionEx {
// invoke the query save method binding
Object object = ((Container)data).getObject();
if (_saveObject != null) {
Object[] params = null;
if(_saveObject instanceof MethodBindingEx){
params = new Object[] { object };
((MethodBindingEx)_saveObject).setComponent(getComponent());
((MethodBindingEx)_saveObject).setParamNames(s_saveObjectParamNames);
}
if (FacesUtil.isCancelled(_saveObject.invoke(context, params))) {
return false;
}
return true;
}
throw new FacesExceptionEx(null,"The save method has not been implemented in the data source"); // $NLX-ObjectDataSource.Missingsavemethodtothedatasource-1$
}
示例5: findDataIterator
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
protected FacesDataIterator findDataIterator() {
String id = getFor();
if(StringUtil.isNotEmpty(id)) {
UIComponent c = FacesUtil.getComponentFor(getComponent(), id);
if(c==null) {
throw new FacesExceptionEx(null,"Component {0} does not exist",id); // $NLX-DataIteratorAddRows.Component0doesnotexist-1$
}
if(!(c instanceof FacesDataIterator)) {
throw new FacesExceptionEx(null,"Component {0} is not a data iterator",id); // $NLX-DataIteratorAddRows.Component0isnotadataiterator-1$
}
return (FacesDataIterator)c;
}
for(UIComponent c=getComponent(); c!=null; c=c.getParent()) {
if(c instanceof FacesDataIterator) {
return (FacesDataIterator)c;
}
}
throw new FacesExceptionEx(null,"The simple action cannot find a data iterator"); // $NLX-DataIteratorAddRows.Thesimpleactioncannotfindadataite-1$
}
示例6: getForComponent
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
/**
* Find the edit component associated to this row.
* @return the UIInput, or null if none is found
*/
public UIInput getForComponent() {
// Find the component based on its id
String id = getFor();
if(StringUtil.isNotEmpty(id)) {
UIComponent edit = FacesUtil.getComponentFor(this, id);
if(edit==null) {
throw new FacesExceptionEx(null,"Unknown component {0} assigned to the \"for\" property of the form row",id); // $NLX-UIFormLayoutRow.Unknowncomponent0assignedtothefor-1$
}
if(!(edit instanceof UIInput)) {
return null;
//throw new FacesExceptionEx(null,"The for component {0} must be an input component",id);
}
return (UIInput)edit;
}
// Else, look for the first child that is an edit component
return findEdit(this);
}
示例7: iterateChildren
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked") // $NON-NLS-1$
public ITreeNode.NodeIterator iterateChildren(int start, int count) {
try {
View view = getView();
ViewEntryCollection col;
Object keys = getKeys();
if(keys!=null) {
if(keys instanceof Vector) {
col = view.getAllEntriesByKey((Vector)keys,isKeysExactMatch());
} else {
col = view.getAllEntriesByKey(keys,isKeysExactMatch());
}
} else {
col = view.getAllEntries();
}
return new ListIterator(view,col,start,count);
}catch(NotesException ex) {
throw new FacesExceptionEx(ex,"Error while reading the list or views/folders"); // $NLX-ViewEntryTreeNode.Errorwhilereadingthelistorviewsfo-1$
}
}
示例8: moveToNext
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
private void moveToNext(boolean first) {
// If no more entries to retrieve, then stop!
if(count==0) {
current = null;
return;
}
// If there is a child list iterator, use it
try {
while(true) {
current = first ? entries.getFirstEntry() : entries.getNextEntry();
first = false;
if(current==null) {
break;
}
if(accept(current)) {
return;
}
}
} catch(NotesException ex) {
throw new FacesExceptionEx(ex,"Error while reading view content for the Tree"); // $NLX-ViewEntryTreeNode.Errorwhilereadingviewcontentforth-1$
}
}
示例9: getDocument
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
public static Document getDocument(Object var) {
if (var instanceof Document) {
return (Document) var;
}
if (var instanceof DominoDocument) {
return ((DominoDocument) var).getDocument();
}
if (var instanceof String) {
Object data = FacesUtil.resolveRequestMapVariable(FacesContext.getCurrentInstance(), (String) var);
if (data instanceof DominoDocument) {
DominoDocument dd = (DominoDocument) data;
return (Document) dd.getDocument();
}
if (data instanceof Document) {
return (Document) data;
}
}
throw new FacesExceptionEx(null, "Cannot find document {0}", var); // $NLX-NotesFunctionEx_CannotFindNotesDocument-1$
}
示例10: openView
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
@Override
protected View openView() throws NotesException {
// Find the database
Database nabDb = findNAB();
if(nabDb==null) {
throw new FacesExceptionEx(null,"Not able to find a valid address book for the name picker"); // $NLX-DominoNABNamePickerData.Notabletofindavalidaddressbookfor-1$
}
// Find the view
String viewName = getViewName();
if(StringUtil.isEmpty(viewName)) {
throw new FacesExceptionEx(null,"Not able to find a view in the address book that matches the selection criterias"); // $NLX-DominoNABNamePickerData.Notabletofindaviewintheaddressboo-1$
}
View view = nabDb.getView(viewName);
return view;
}
示例11: loadEntries
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
public List<IPickerEntry> loadEntries(Object[] ids, String[] attributeNames) {
try {
EntryMetaData meta = createEntryMetaData(null);
View view = meta.getView();
view.setAutoUpdate(false);
try {
// TODO: use the options here?
ArrayList<IPickerEntry> entries = new ArrayList<IPickerEntry>(ids.length);
for(int i=0; i<ids.length; i++) {
ViewEntry ve = view.getEntryByKey(ids[i],true);
if(ve!=null) {
Entry e = meta.createEntry(ve);
entries.add(e);
} else {
entries.add(null);
}
//ve.recycle();
}
return entries;
} finally {
// Recycle the view?
}
} catch(NotesException ex) {
throw new FacesExceptionEx(ex,"Error while loading entry"); // $NLX-AbstractDominoViewPickerData.Errorwhileloadingentry-1$
}
}
示例12: computeParameterValues
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
/**
*
* @param p
* @return <code>null</code> or a non-empty list of Object values,
* where each object implements Serializable or is <code>null</code>.
*/
public static List<Object> computeParameterValues(List<SqlParameter> p){
if(p!=null && !p.isEmpty()) {
List<Object> parameters = new ArrayList<Object>();
for(int i=0; i<p.size(); i++) {
SqlParameter paramComplex = p.get(i);
Object value = paramComplex.getValue();
if(value!=null) {
if(!(value instanceof Serializable)) {
String msg = "The value returned by the SQL parameter #{0} must be Serializable ({1})"; // $NLX-SqlParameter.Thevaluereturnedbythe0parameter1m-1$
msg = StringUtil.format(msg, i, value.getClass().getName());
throw new FacesExceptionEx(null, msg);
}
}
parameters.add(value);
}
return parameters;
}
return null;
}
示例13: readStates
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
private static final String[][] readStates(final int searchIndex) {
if(states==null) {
try {
String[] allStates = SampleDataUtil.readStates();
states = new String[allStates.length][];
for(int i=0; i<states.length; i++) {
states[i] = StringUtil.splitString(allStates[i], ',', true);
}
// Sort by Label
(new QuickSort.ObjectArray(states) {
@Override
public int compare(Object s1, Object s2) {
String l1 = ((String[])s1)[searchIndex];
String l2 = ((String[])s2)[searchIndex];
return StringUtil.compareToIgnoreCase(l1, l2);
}
}).sort();
} catch(IOException e) {
throw new FacesExceptionEx("Unable to read the state list");
}
}
return states;
}
示例14: restoreView
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
@Override
public UIViewRoot restoreView(FacesContext context, String viewId, String renderKitId) {
SerializedView serView = restore();
Node node = (Node) serView.getStructure();
try {
UIViewRoot root = (UIViewRoot) node.restore(ClassLoaderUtil.getContextClassLoader(StateManagerTestImpl.class));
FacesUtil.setRestoreRoot(context, root);
UIViewRoot old = context.getViewRoot();
try {
context.setViewRoot(root);
root.processRestoreState(context, serView.getState());
} finally {
context.setViewRoot(old);
}
FacesUtil.setRestoreRoot(context, null);
return root;
} catch(Exception e) {
throw new FacesExceptionEx(e);
}
}
示例15: OpenNTFFacesContextFactory
import com.ibm.xsp.FacesExceptionEx; //导入依赖的package包/类
public OpenNTFFacesContextFactory() {
if (_debug)
System.out.println(getClass().getName() + " created");
Object inst;
try {
@SuppressWarnings("rawtypes")
Class delegateClass = DominoFacesContextFactoryImpl.class;
inst = delegateClass.newInstance();
} catch (Exception e) {
e.printStackTrace();
throw new FacesExceptionEx(e);
}
if (inst instanceof FacesContextFactory) {
_delegate = (FacesContextFactory) inst;
} else {
_delegate = null;
}
}