Examples of MetaInfo


Examples of de.innovationgate.webgate.api.MetaInfo

                if (metaNames.contains(metaEntry.getName())) {
                    throw new WGSchemaValidationException("Duplicate meta definition '" + metaEntry.getName() + "' on '" + docDef.getDocumentKey() + "'.");
                }           
                metaNames.add(metaEntry.getName());
               
                MetaInfo metaInfo = WGFactory.getInstance().getMetaInfo(metaEntry.getName(), WGDocument.doctypeNumberToClass(docDef.getDocumentType()));
                if (metaInfo == null) {
                    throw new WGSchemaValidationException("Unknown metadata field '" + metaEntry.getName() + "' predefined for document " + docDef.getDocumentKey());
                }
               
                if (metaEntry.getValues().size() > 0) {
                    Object singleValue = metaEntry.getValues().get(0);
                    if (singleValue != null && !metaInfo.getDataType().isAssignableFrom(singleValue.getClass())) {
                        throw new WGSchemaValidationException("Metadata field '" + metaEntry.getName() + "' predefined with value of wrong type " + singleValue.getClass().getName() + " (Should be " + metaInfo.getDataType() ") for document " + docDef.getDocumentKey());
                    }
                }
               
            }
           
View Full Code Here

Examples of org.apache.jetspeed.om.profile.MetaInfo

    @return the new MetaData object, empty if meta is null
    */
    protected static MetaData getMetaData(Entry entry)
    {
        MetaData data = new MetaData();
        MetaInfo meta = entry.getMetaInfo();

        if ( meta != null )
        {
            if ( meta.getTitle() != null )
                data.setTitle( meta.getTitle() );

            if ( meta.getDescription() != null )
                data.setDescription( meta.getDescription() );

            if ( meta.getImage() != null )
                data.setImage( meta.getImage() );
        }

        if ( entry.getParent() != null )
        {

View Full Code Here

Examples of org.apache.jetspeed.om.registry.MetaInfo

                assertTrue(mapParams.containsKey("itemdisplayed"));
                assertTrue(mapParams.containsKey("HACK"));
                Parameter p = (Parameter) mapParams.get("HACK");
                assertTrue(p.getValue().equals("hacker"));
                Parameter p2 = (Parameter) mapParams.get("showtitle");
                MetaInfo p2m = p2.getMetaInfo();
                assertTrue(p2m.getTitle().equals("Show title description ?"));
                assertTrue(p2.getTitle().equals("Show title description ?"));
                Map pMap = hack.getParameterMap();
                String v15 = (String) pMap.get("itemdisplayed");
                assertTrue(v15.equals("15"));

                // test falling back on meta info

                PortletEntry mp = (PortletEntry) portlets.elementAt(5);
                assertNotNull(mp);
                assertTrue(mp.getName().equals("MetaTest"));
                assertTrue(mp.getType().equals("ref"));
                assertTrue(mp.getParent().equals("AdminScreen"));
                assertTrue(mp.getClassname().equals("org.apache.jetspeed.portal.portlets.TurbineScreenPortlet"));
                String title = mp.getTitle();
                assertNotNull(title);
                assertTrue(title.equals("Turbine Screen in a portlet"));
                assertTrue(mp.getDescription().equals("We put the Admin Screen in a portlet."));
                MetaInfo meta = mp.getMetaInfo();
                assertNotNull(meta);
                assertTrue(mp.getMetaInfo().getTitle().equals("Turbine Screen in a portlet"));
                assertTrue(meta.getDescription().equals("We put the Admin Screen in a portlet."));

                // media type
                Iterator mpi = mp.listMediaTypes();
                assertNotNull(mpi);
                HashMap mpMap = new HashMap();
View Full Code Here

Examples of org.apache.jetspeed.om.registry.MetaInfo

        assertTrue(entry.isCachedOnURL() == false);
        assertEquals(entry.getClassname(), "org.apache.jetspeed.portlets.BigKahunaPortlet");
        assertEquals(entry.getDescription(), "This is the big kahuna meta portlet");
        assertTrue(entry.isHidden() == false);
               
        MetaInfo meta = entry.getMetaInfo();
        assertNotNull(meta);
        assertEquals(meta.getImage(), "/images/image.gif");
        assertEquals(meta.getDescription(), "This is the big kahuna meta portlet");
        assertEquals(meta.getTitle(), "The Kahuna Portlet");
        assertEquals(entry.getName(), "BigKahuna");           
        assertEquals(entry.getParent(), null);
        SecurityReference ref = entry.getSecurityRef();
        assertNotNull(ref);
        assertEquals(ref.getParent(), "admin-only");
View Full Code Here

Examples of org.apache.jetspeed.om.registry.MetaInfo

        assertTrue(entry.isCachedOnURL() == false);
        assertEquals(entry.getClassname(), "org.apache.jetspeed.portlets.BigKahunaPortlet");
        assertEquals(entry.getDescription(), "new description");
        assertTrue(entry.isHidden() == false);
               
        MetaInfo meta = entry.getMetaInfo();
        assertNotNull(meta);
        assertEquals(meta.getImage(), "/images/image.gif");
        assertEquals(meta.getDescription(), "new description");
        assertEquals(meta.getTitle(), "The Kahuna Portlet");
        assertEquals(entry.getName(), "BigKahuna");           
        assertEquals(entry.getParent(), null);
        SecurityReference ref = entry.getSecurityRef();
        assertNotNull(ref);
        assertEquals(ref.getParent(), "admin-only");
View Full Code Here

Examples of org.apache.jetspeed.om.registry.MetaInfo

        assertTrue(entry.isCachedOnURL() == true);
        assertEquals(entry.getClassname(), "org.apache.jetspeed.portlets.BigKahunaPortlet");
        assertEquals(entry.getDescription(), "This is the big kahuna meta portlet");
        assertTrue(entry.isHidden() == false);
               
        MetaInfo meta = entry.getMetaInfo();
        assertNotNull(meta);
        assertEquals(meta.getImage(), "/images/image.gif");
        assertEquals(meta.getDescription(), "This is the big kahuna meta portlet");
        assertEquals(meta.getTitle(), "The Kahuna Portlet");
        assertEquals(entry.getName(), "BigKahunaRef");           
        assertEquals(entry.getParent(), "BigKahuna");
        SecurityReference ref = entry.getSecurityRef();
        assertNotNull(ref);
        assertNull(ref.getParent());
View Full Code Here

Examples of org.apache.jetspeed.om.registry.MetaInfo

                entry.setApplication(false);
                entry.setCachedOnURL(false);
                entry.setClassname("org.apache.jetspeed.portlets.BigKahunaPortlet");
                entry.setDescription("This is the big kahuna portlet");
                entry.setHidden(false);
                MetaInfo meta = new BaseMetaInfo();
                meta.setImage("/images/image.gif");
                meta.setDescription("This is the big kahuna meta portlet");
                meta.setTitle("The Meta Kahuna Portlet");
                entry.setMetaInfo(meta);
                entry.setName("BigKahuna");           
                entry.setParent(null);
                SecurityReference ref = new BaseSecurityReference();
                ref.setParent("admin-only");
                entry.setSecurityRef(ref);
                entry.setTitle("The Kahuna Portlet");
                entry.setType(PortletEntry.TYPE_ABSTRACT);               
                entry.setURL("http://bigkahuna.org");
                   
                // parameters
                entry.addParameter("simple", "simple-value");
               
                CachedParameter param = new BaseCachedParameter();
                param.setDescription("pdescription");
                param.setHidden(false);
                meta = new BaseMetaInfo();
                meta.setDescription("meta desc");
                meta.setImage("meta image");
                meta.setTitle("meta title");
                param.setMetaInfo(meta);
                param.setName("coconut");               
                SecurityReference ref2 = new BaseSecurityReference();
                ref2.setParent("admin-only");               
                param.setSecurityRef(ref2);
                param.setTitle("Coconut");
                param.setType("hmm");
                param.setValue("hawaii");
                entry.addParameter(param);
                param.setCachedOnName(true);
                param.setCachedOnValue(false);

               
                param = new BaseCachedParameter();
                param.setDescription("second pdescription");
                param.setHidden(true);
                meta = new BaseMetaInfo();
                meta.setDescription("second meta desc");
                meta.setImage("second meta image");
                meta.setTitle("second meta title");
                param.setMetaInfo(meta);
                param.setName("second coconut");
                SecurityReference ref3 = new BaseSecurityReference();
                ref3.setParent("second admin-only");               
                param.setSecurityRef(ref3);
View Full Code Here

Examples of org.apache.jetspeed.om.registry.MetaInfo

        pe.setApplication(pde.getApplication());
        pe.setCachedOnURL(pde.getCachedOnUrl());
        pe.setClassname(pde.getClassname());
        pe.setDescription(pde.getDescription());
        pe.setHidden(pde.getHidden());
        MetaInfo meta = new BaseMetaInfo();
        meta.setImage(pde.getImage());
        meta.setDescription(pde.getDescription());
        meta.setTitle(pde.getTitle());
        pe.setMetaInfo(meta);               
        pe.setName(pde.getName());           
        pe.setParent(pde.getParent());
        if(pde.getSecurityRef() != null)
        {
            SecurityReference ref = new BaseSecurityReference();
            ref.setParent(pde.getSecurityRef());
            pe.setSecurityRef(ref);
        }

        pe.setTitle(pde.getTitle());
        pe.setType(pde.getType());
        pe.setURL(pde.getURL());
       
        // parameters
        Iterator params = pde.getPortletParameters().iterator();
        while (params.hasNext())
        {
            PortletParameter pp = (PortletParameter)params.next();
            CachedParameter cp = new BaseCachedParameter(pp.getId());
            cp.setCachedOnName(pp.getCachedOnName());
            cp.setCachedOnValue(pp.getCachedOnValue());
            cp.setDescription(pp.getDescription());
            cp.setHidden(pp.getHidden());
            cp.setName(pp.getName());
            cp.setType(pp.getType());
            cp.setValue(pp.getValue());

           
            cp.setTitle(pp.getTitle());
            if (pp.getDescription() != null || pp.getTitle() != null || pp.getImage() != null)
            {
                MetaInfo meta2 = new BaseMetaInfo();
                meta2.setImage(pp.getImage());
                meta2.setDescription(pp.getDescription());
                meta2.setTitle(pp.getTitle());
                cp.setMetaInfo(meta2);
            }
            if (pp.getSecurityRef() != null)
            {
                SecurityReference ref2 = new BaseSecurityReference();
View Full Code Here

Examples of org.apache.slider.providers.agent.application.metadata.Metainfo

    StateAccessForProviders access = createNiceMock(StateAccessForProviders.class);

    AgentProviderService mockAps = Mockito.spy(aps);
    doReturn(access).when(mockAps).getAmState();
    doReturn("scripts/hbase_master.py").when(mockAps).getScriptPathFromMetainfo(anyString());
    Metainfo metainfo = new Metainfo();
    metainfo.addService(new Service());
    doReturn(metainfo).when(mockAps).getApplicationMetainfo(any(SliderFileSystem.class), anyString());

    try {
      doReturn(true).when(mockAps).isMaster(anyString());
      doNothing().when(mockAps).addInstallCommand(
View Full Code Here

Examples of org.apache.slider.providers.agent.application.metadata.Metainfo

  }

  @Test
  public void testProcessConfig() throws Exception {
    InputStream metainfo_1 = new ByteArrayInputStream(metainfo_1_str.getBytes());
    Metainfo metainfo = new MetainfoParser().parse(metainfo_1);
    assert metainfo.getServices().size() == 1;
    AgentProviderService aps = new AgentProviderService();
    HeartBeat hb = new HeartBeat();
    ComponentStatus status = new ComponentStatus();
    status.setClusterName("test");
    status.setComponentName("HBASE_MASTER");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.