Examples of CmsObject


Examples of org.apache.stanbol.cmsadapter.servicesapi.model.web.CMSObject

    public static void tearDownAfterClass() throws Exception {}

    @Before
    public void setUp() {
        rootStripped = new CMSObjectBuilder(PREFIX_ROOT).namespace().build();
        CMSObject child1 = new CMSObjectBuilder(PREFIX_CHILD_1).build();
        CMSObject child2 = new CMSObjectBuilder(PREFIX_CHILD_2).build();
        root = new CMSObjectBuilder(PREFIX_ROOT).namespace().child(child1).child(child2).build();
    }
View Full Code Here

Examples of org.apache.stanbol.cmsadapter.servicesapi.model.web.CMSObject

    public void createObjects(List<Object> objects, MappingEngine engine) {
        if (objects != null) {
            for (Object object : objects) {
                if (canProcess(object, engine.getSession())) {
                    try {
                        CMSObject cmsObject = (CMSObject) object;
                        CmisObject node = ((Session) engine.getSession()).getObject(CMISObjectId
                                .getObjectId(cmsObject.getUniqueRef()));
                        List<Relationship> relations = node.getRelationships();
                        // FIXME find a better way to reuse cmislifters' func.
                        CMISNodeTypeLifter lifter = new CMISNodeTypeLifter(engine);

                        for (Relationship relation : relations) {
View Full Code Here

Examples of org.apache.stanbol.cmsadapter.servicesapi.model.web.CMSObject

        PropertyDefinition pd1 = new PropertyDefinitionBuilder(PX_PD_1).build();
        PropertyDefinition pd2 = new PropertyDefinitionBuilder(PX_PD_2).build();
        PropertyDefinition pd3 = new PropertyDefinitionBuilder(PX_PD_3).build();
        Property p1 = new PropertyBuilder(PX_P_1).propertyDefinition(pd1).build();
        Property p2 = new PropertyBuilder(PX_P_2).propertyDefinition(pd2).build();
        CMSObject root = new CMSObjectBuilder(PX_ROOT).build();
        CMSObject child11 = new CMSObjectBuilder(PX_O_11).build();
        CMSObject child12 = new CMSObjectBuilder(PX_O_12).build();
        CMSObject child21 = new CMSObjectBuilder(PX_O_21).build();
        CMSObject child13 = new CMSObjectBuilder(PX_O_13).build();

        ObjectTypeDefinition type1 = new ObjectTypeBuilder(PX_OT_1).propertyDefinition(pd1).build();
        ObjectTypeDefinition type2 = new ObjectTypeBuilder(PX_OT_2).propertyDefinition(pd2).build();
        ObjectTypeDefinition type3 = new ObjectTypeBuilder(PX_OT_3).propertyDefinition(pd3).build();

        root.setObjectTypeRef(type1.getUniqueRef());
        child11.setObjectTypeRef(type1.getUniqueRef());
        child12.setObjectTypeRef(type2.getUniqueRef());
        child13.setObjectTypeRef(type2.getUniqueRef());
        child21.setObjectTypeRef(type3.getUniqueRef());

        p1.setContainerObjectRef(root.getUniqueRef());
        root.getProperty().add(p1);
        root.getProperty().add(p2);

        root.getChildren().add(child11);
        child11.setParentRef(root.getUniqueRef());

        root.getChildren().add(child12);
        child12.setParentRef(root.getUniqueRef());

        child11.getChildren().add(child21);
        child21.setParentRef(child11.getUniqueRef());

        // child13 has the same name as child11
        root.getChildren().add(child13);
        child13.setParentRef(root.getUniqueRef());
        child13.setLocalname(child11.getLocalname());

        processPaths(root);
        repository.addAll(Arrays.asList(new Object[] {root, child11, child12, child13, child21, type1, type2,
                                                      type3, pd1, pd2}));
View Full Code Here

Examples of org.apache.stanbol.cmsadapter.servicesapi.model.web.CMSObject

        offlineAccess.getNodeByPath("/", new Object());
    }

    @Test
    public void testGetNodeById() throws RepositoryAccessException {
        CMSObject expected = (CMSObject) repository.get(0);
        List<CMSObject> real = offlineAccess.getNodeById(expected.getUniqueRef(), null);

        assertEquals(1, real.size());
        assertSame(expected, real.get(0));

        expectedException.expect(RepositoryAccessException.class);
View Full Code Here

Examples of org.opencms.file.CmsObject

  }

  @Override
  public int doStartTag() throws JspException {
    CmsFlexController m_controller = CmsFlexController.getController(pageContext.getRequest());
    CmsObject cms = m_controller.getCmsObject();

        if (recursive == null || "tree".equalsIgnoreCase(recursive)) {
        navigationIterator = new TreeNavigationIterator(cms);
        } else if ("flat".equalsIgnoreCase(recursive)) {
          navigationIterator = new FlatRecursiveNavigationIterator(cms);
View Full Code Here

Examples of org.opencms.file.CmsObject

 
  /* (non-Javadoc)
   * @see dk.valtech.octools.util.CmsObjectProvider#getCmsObject(javax.servlet.http.HttpServletRequest)
   */
  public CmsObject getCmsObject(HttpServletRequest request) throws CmsException {
    CmsObject cms = initCmsObjectFromSession(request);
    if (cms == null) {
      cms = initCmsObject(request);
    }
    if (cms == null && defaultToGuest) {
      cms = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserGuest());
View Full Code Here

Examples of org.opencms.file.CmsObject

  /* (non-Javadoc)
   * @see org.opencms.security.I_CmsAuthorizationHandler#initCmsObject(javax.servlet.http.HttpServletRequest)
   */
  public CmsObject initCmsObject(HttpServletRequest request) {
    I_CmsAuthorizationHandler auth = OpenCms.getAuthorizationHandler();
    CmsObject cms = null;
    if (auth != this) {
      cms = auth.initCmsObject(request);
    }
    return cms;
  }
View Full Code Here

Examples of org.opencms.file.CmsObject

  /* (non-Javadoc)
   * @see org.opencms.security.I_CmsAuthorizationHandler#initCmsObject(javax.servlet.http.HttpServletRequest, java.lang.String, java.lang.String)
   */
  public CmsObject initCmsObject(HttpServletRequest request, String userName, String pwd) throws CmsException {
    I_CmsAuthorizationHandler auth = OpenCms.getAuthorizationHandler();
    CmsObject cms = null;
    if (auth != this) {
      cms = auth.initCmsObject(request, userName, pwd);
    }
    return cms;
  }
View Full Code Here

Examples of org.opencms.file.CmsObject

          I_CmsReport report = null;
          // CmsDbContext dbc;

      try {
        String exportUser = OpenCms.getDefaultUsers().getUserExport();
        CmsObject cms = OpenCms.initCmsObject(exportUser);

        CmsUUID projectId = (CmsUUID) event.getData().get(I_CmsEventListener.KEY_PROJECTID);
        CmsUUID publishHistoryId = new CmsUUID((String)event.getData().get(I_CmsEventListener.KEY_PUBLISHID));
        report = (I_CmsReport)event.getData().get(I_CmsEventListener.KEY_REPORT);
       
        PublishProjectEventContext context = new PublishProjectEventContext(cms, projectId, report);
       
        boolean isInitialized = false;
       
        @SuppressWarnings("unchecked")
        List<CmsPublishedResource> resources = cms.readPublishedResources(publishHistoryId);
        Iterator<CmsPublishedResource> iter = resources.iterator();
       
        while (iter.hasNext()) {
          CmsPublishedResource resource = (CmsPublishedResource) iter.next();
          if (handler.handlesResource(context, resource)) {
View Full Code Here

Examples of org.opencms.file.CmsObject

    }

  @SuppressWarnings("unchecked")
    @Override
    protected void prepare() throws JspTagException {
    CmsObject cms = CmsFlexController.getCmsObject(pageContext.getRequest());
   
    CmsJspNavBuilder builder = new CmsJspNavBuilder(cms);
   
    iterator = builder.getNavigationBreadCrumb(begin, true).iterator();
    }
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.