@Test public void testFindViewByName() { assertEquals( "all", page.findViewByName( "all" ).label() ); }
public EldaView findViewByName( String viewName ) { EldaView view = null; ResIterator i = getModelW().getModel().listSubjectsWithProperty( ELDA_API.viewName, viewName ); if (!i.hasNext()) { if (viewName.equals( EldaView.BasicView.NAME )) { view = new EldaView.BasicView( this ); } else if (viewName.equals( EldaView.DescriptionView.NAME )) { view = new EldaView.DescriptionView( this ); } else { throw new EldaException( "Could not locate view with viewName = " + viewName ); } } else { Resource viewRoot = i.next(); if (i.hasNext()) { log.warn("ambiguous view name: there is more than one resource with viewName '{}'", viewName); } view = new EldaView( this, viewRoot ); } return view; }
Page extends CommonNodeWrapper { public EldaView findViewByName( String viewName ) { EldaView view = null; ResIterator i = getModelW().getModel().listSubjectsWithProperty( ELDA_API.viewName, viewName ); if (!i.hasNext()) { if (viewName.equals( EldaView.BasicView.NAME )) { view = new EldaView.BasicView( this ); } else if (viewName.equals( EldaView.DescriptionView.NAME )) { view = new EldaView.DescriptionView( this ); } else { throw new EldaException( "Could not locate view with viewName = " + viewName ); } } else { Resource viewRoot = i.next(); if (i.hasNext()) { log.warn("ambiguous view name: there is more than one resource with viewName '{}'", viewName); } view = new EldaView( this, viewRoot ); } return view; } }
Page extends CommonNodeWrapper { public EldaView findViewByName( String viewName ) { EldaView view = null; ResIterator i = getModelW().getModel().listSubjectsWithProperty( ELDA_API.viewName, viewName ); if (!i.hasNext()) { if (viewName.equals( EldaView.BasicView.NAME )) { view = new EldaView.BasicView( this ); } else if (viewName.equals( EldaView.DescriptionView.NAME )) { view = new EldaView.DescriptionView( this ); } else { throw new EldaException( "Could not locate view with viewName = " + viewName ); } } else { Resource viewRoot = i.next(); if (i.hasNext()) { log.warn("ambiguous view name: there is more than one resource with viewName '{}'", viewName); } view = new EldaView( this, viewRoot ); } return view; } Page( ResultsModel mw, Resource root ); }
Page extends CommonNodeWrapper { public EldaView findViewByName( String viewName ) { EldaView view = null; ResIterator i = getModelW().getModel().listSubjectsWithProperty( ELDA_API.viewName, viewName ); if (!i.hasNext()) { if (viewName.equals( EldaView.BasicView.NAME )) { view = new EldaView.BasicView( this ); } else if (viewName.equals( EldaView.DescriptionView.NAME )) { view = new EldaView.DescriptionView( this ); } else { throw new EldaException( "Could not locate view with viewName = " + viewName ); } } else { Resource viewRoot = i.next(); if (i.hasNext()) { log.warn("ambiguous view name: there is more than one resource with viewName '{}'", viewName); } view = new EldaView( this, viewRoot ); } return view; } Page( ResultsModel mw, Resource root ); void initialiseShortNameRenderer( ShortnameService sns ); ShortNameRenderer shortNameRenderer(); EldaURL pageURL(); boolean isItemEndpoint(); int pageNumber(); int itemsPerPage(); int totalResults(); String resultsCountSummary(); int startIndex(); Resource isPartOf(); Resource definition(); String extendedMetadataURL(); Resource firstPage(); Resource prevPage(); Resource nextPage(); Resource lastPage(); boolean hasPageData(); List<PageFormat> formats(); List<EldaView> views(); List<Binding<Resource>> termBindings(); List<Binding<String>> varBindings(); Map<String, String> varBindingsMap(); List<DisplayRdfNode> items(); Model pageObjectModel(); EldaView currentView(); EldaView findViewByName( String viewName ); PageMetadata metadata(); List<PropertyPath> currentPropertyPaths(); String pageTitle(); boolean itemHasAllProperties( List<Object> properties ); boolean itemHasAllProperties( Object... properties ); List<DisplayRdfNode> resourcesWithAllProperties( List<Object> properties ); List<Link> filterRemovalLinks(); List<Link> sortRemovalLinks(); }
Page extends CommonNodeWrapper { public EldaView findViewByName( String viewName ) { EldaView view = null; ResIterator i = getModelW().getModel().listSubjectsWithProperty( ELDA_API.viewName, viewName ); if (!i.hasNext()) { if (viewName.equals( EldaView.BasicView.NAME )) { view = new EldaView.BasicView( this ); } else if (viewName.equals( EldaView.DescriptionView.NAME )) { view = new EldaView.DescriptionView( this ); } else { throw new EldaException( "Could not locate view with viewName = " + viewName ); } } else { Resource viewRoot = i.next(); if (i.hasNext()) { log.warn("ambiguous view name: there is more than one resource with viewName '{}'", viewName); } view = new EldaView( this, viewRoot ); } return view; } Page( ResultsModel mw, Resource root ); void initialiseShortNameRenderer( ShortnameService sns ); ShortNameRenderer shortNameRenderer(); EldaURL pageURL(); boolean isItemEndpoint(); int pageNumber(); int itemsPerPage(); int totalResults(); String resultsCountSummary(); int startIndex(); Resource isPartOf(); Resource definition(); String extendedMetadataURL(); Resource firstPage(); Resource prevPage(); Resource nextPage(); Resource lastPage(); boolean hasPageData(); List<PageFormat> formats(); List<EldaView> views(); List<Binding<Resource>> termBindings(); List<Binding<String>> varBindings(); Map<String, String> varBindingsMap(); List<DisplayRdfNode> items(); Model pageObjectModel(); EldaView currentView(); EldaView findViewByName( String viewName ); PageMetadata metadata(); List<PropertyPath> currentPropertyPaths(); String pageTitle(); boolean itemHasAllProperties( List<Object> properties ); boolean itemHasAllProperties( Object... properties ); List<DisplayRdfNode> resourcesWithAllProperties( List<Object> properties ); List<Link> filterRemovalLinks(); List<Link> sortRemovalLinks(); static final int NO_VALUE; static final String DEFAULT_VIEW_NAME; }