• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ObjectType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.chemistry.opencmis.client.api.ObjectType的典型用法代码示例。如果您正苦于以下问题:Java ObjectType类的具体用法?Java ObjectType怎么用?Java ObjectType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ObjectType类属于org.apache.chemistry.opencmis.client.api包,在下文中一共展示了ObjectType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testMNT10430

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
@Test
  public void testMNT10430() throws Exception
  {
      final TestNetwork network1 = getTestFixture().getRandomNetwork();

      String username = "user" + System.currentTimeMillis();
      PersonInfo personInfo = new PersonInfo(username, username, username, TEST_PASSWORD, null, null,
      		null, null, null, null, null);
      TestPerson person1 = network1.createUser(personInfo);
      String person1Id = person1.getId();

      publicApiClient.setRequestContext(new RequestContext(network1.getId(), person1Id));
      CmisSession cmisSession = publicApiClient.createPublicApiCMISSession(Binding.browser, CMIS_VERSION_11, AlfrescoObjectFactoryImpl.class.getName());

ObjectType objectType = cmisSession.getTypeDefinition("D:testcmis:maDoc");

// try and get the mandatory aspects
List<String> mandatoryAspects = ((AlfrescoType)objectType).getMandatoryAspects();
System.out.println("Mandatory Aspects");
for(String mandatoryAspect : mandatoryAspects)
{ 
	System.out.println(mandatoryAspect); 
}
assertTrue("The aspects should have P:cm:generalclassifiable", mandatoryAspects.contains("P:cm:generalclassifiable"));
  }
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:26,代码来源:TestCMIS.java


示例2: testCanConnectCMISUsingDefaultTenantImpl

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
private void testCanConnectCMISUsingDefaultTenantImpl(Binding binding, String cmisVersion)
{
    String url = httpClient.getPublicApiCmisUrl(TenantUtil.DEFAULT_TENANT, binding, cmisVersion, null);
    
    Map<String, String> parameters = new HashMap<String, String>();
    
    // user credentials
    parameters.put(SessionParameter.USER, "admin");
    parameters.put(SessionParameter.PASSWORD, "admin");
    
    parameters.put(SessionParameter.ATOMPUB_URL, url);
    parameters.put(SessionParameter.BROWSER_URL, url);
    parameters.put(SessionParameter.BINDING_TYPE, binding.getOpenCmisBinding().value());
    
    SessionFactory factory = SessionFactoryImpl.newInstance();
    // perform request : http://host:port/alfresco/api/-default-/public/cmis/versions/${cmisVersion}/${binding}
    List<Repository> repositories = factory.getRepositories(parameters);
    
    assertTrue(repositories.size() > 0);
    
    parameters.put(SessionParameter.REPOSITORY_ID, TenantUtil.DEFAULT_TENANT);
    Session session = factory.createSession(parameters);
    // perform request : http://host:port/alfresco/api/-default-/public/cmis/versions/${cmisVersion}/${binding}/type?id=cmis:document
    ObjectType objectType = session.getTypeDefinition("cmis:document");
    
    assertNotNull(objectType);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:28,代码来源:TestCMIS.java


示例3: getTypeAspectIds

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
private static List<String> getTypeAspectIds(Session pSession, String pStrTypeId) {
	
	List<String> lFoundAspectIds = new ArrayList<String>();
	
	ObjectType lObjectType = getTypeDefinition(pSession, pStrTypeId);
	
	// cerco gli eventuali mandatoryAspect del tipo
	List<CmisExtensionElement> lExtensions = lObjectType.getExtensions();
	for (CmisExtensionElement lExtension : lExtensions) {
		if (lExtension.getName().matches("(?i:.*aspect.*)")) {
			for (CmisExtensionElement lAspectExtension : lExtension.getChildren()) {
				lFoundAspectIds.add(lAspectExtension.getValue());
			}
		}
	}
	
	return lFoundAspectIds;
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:19,代码来源:AlfrescoHelper.java


示例4: testMNT10430

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
@Test
  public void testMNT10430() throws Exception
  {
      final TestNetwork network1 = getTestFixture().getRandomNetwork();

      String username = "user" + System.currentTimeMillis();
      PersonInfo personInfo = new PersonInfo(username, username, username, TEST_PASSWORD, null, null,
      		null, null, null, null, null);
      TestPerson person1 = network1.createUser(personInfo);
      String person1Id = person1.getId();

      publicApiClient.setRequestContext(new RequestContext(network1.getId(), person1Id));
      CmisSession cmisSession = publicApiClient.createPublicApiCMISSession(Binding.browser, CMIS_VERSION_11,
      		"org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");

ObjectType objectType = cmisSession.getTypeDefinition("D:testcmis:maDoc");

// try and get the mandatory aspects
List<String> mandatoryAspects = ((AlfrescoType)objectType).getMandatoryAspects();
System.out.println("Mandatory Aspects");
for(String mandatoryAspect : mandatoryAspects)
{ 
	System.out.println(mandatoryAspect); 
}
assertTrue("The aspects should have P:cm:generalclassifiable", mandatoryAspects.contains("P:cm:generalclassifiable"));
  }
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:27,代码来源:TestCMIS.java


示例5: prepareContentStream

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
protected ContentStream prepareContentStream(Session session,
		File contentFile, String typeId, Map<String, Object> properties)
		throws Exception {

	ObjectType docType = session.getTypeDefinition(typeId);

	TikaProperties tikaProperties = new TikaProperties(contentFile);
	tikaProperties.setDocumentType(docType);
	tikaProperties.enrichProperties(session, properties);

	String name = (String) properties.get(PropertyIds.NAME);
	long size = contentFile.length();
	String mimetype = tikaProperties.getMIMEType();
	InputStream stream = new BufferedInputStream(new FileInputStream(
			contentFile));

	return session.getObjectFactory().createContentStream(name, size,
			mimetype, stream);
}
 
开发者ID:fmui,项目名称:ApacheChemistryInAction,代码行数:20,代码来源:AbstractAddServlet.java


示例6: findDocumentType

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
/**
 * Identifies the document type from content.
 */
public ObjectType findDocumentType(Session session) {
	// get the type id for the MIME type
	String newTypeId = TikaMappingService
			.getRepositoryTypeIdFromMIMEType(getMIMEType());

	// check if type exists in the repository
	try {
		docType = session.getTypeDefinition(newTypeId);
	} catch (CmisObjectNotFoundException e) {
		// type not found -> fall back to cmis:document
		docType = session.getTypeDefinition(BaseTypeId.CMIS_DOCUMENT
				.value());
	}

	return docType;
}
 
开发者ID:fmui,项目名称:ApacheChemistryInAction,代码行数:20,代码来源:TikaProperties.java


示例7: addType

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
/**
 * Helper for {@link #getCreatableTypes(Session, String)}.
 */
private static void addType(List<Tree<ObjectType>> types,
		List<ObjectType> resultList) {
	for (Tree<ObjectType> tt : types) {
		if (tt.getItem() != null) {
			boolean isCreatable = (tt.getItem().isCreatable() == null ? true
					: tt.getItem().isCreatable().booleanValue());

			if (isCreatable) {
				resultList.add(tt.getItem());
			}

			addType(tt.getChildren(), resultList);
		}
	}
}
 
开发者ID:fmui,项目名称:ApacheChemistryInAction,代码行数:19,代码来源:CMISHelper.java


示例8: doInBackground

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
@Override
protected CmisResult<Document> doInBackground(Void... arg0) {
    Document doc = null;
    Exception exception = null;

    // Try to retrieve the parent folder object and then create an album.
    try {
        Folder folder = (Folder) session.getObjectByPath(albumParentfolderPath);

        // Create the map of properties associated to the future album.
        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(PropertyIds.OBJECT_TYPE_ID, CmisBookIds.BOOK_ALBUM);
        properties.put(PropertyIds.BASE_TYPE_ID, ObjectType.DOCUMENT_BASETYPE_ID);
        properties.put(PropertyIds.NAME, albumTitle);

        doc = folder.createDocument(properties, null, null);
    } catch (Exception e) {
        exception = e;
    }
    return new CmisResult<Document>(exception, doc);
}
 
开发者ID:fmui,项目名称:ApacheChemistryInAction,代码行数:22,代码来源:CreateAlbumTask.java


示例9: doGetTypesTreeLeaves

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
private static void doGetTypesTreeLeaves(List<Tree<ObjectType>> pTypesTree, List<ObjectType> pLeaves) {
	for (Tree<ObjectType> tree : pTypesTree) {
		List<Tree<ObjectType>> lChildren = tree.getChildren();

		if (lChildren.isEmpty()) {
			pLeaves.add(tree.getItem());

		} else {
			doGetTypesTreeLeaves(lChildren, pLeaves);
		}
	}
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:13,代码来源:AlfrescoHelper.java


示例10: getTypeDefinition

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
public static ObjectType getTypeDefinition(Session pSession, String pStrId) {
	mLog.debug("START getDocumentType(String)");

	ObjectType lType = null;
	try {
		lType = pSession.getTypeDefinition(pStrId, true);

	} catch (CmisObjectNotFoundException e) {
		// Niente: il tipo non esiste e si restituisce null
		mLog.debug("Tipo '{}' non trovato", pStrId);
	}

	mLog.debug("END getDocumentType(String)");
	return lType;
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:16,代码来源:AlfrescoHelper.java


示例11: getRelationshipTypes

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
public static List<RelationshipType> getRelationshipTypes(Session pSession, String pRelationsRootId) {
	mLog.debug("START getRelationshipTypes(Session, String)");
	
	List<RelationshipType> lRelationTypes = new ArrayList<RelationshipType>();
	
	for (ObjectType lObjectType : pSession.getTypeChildren(pRelationsRootId, true)) {
		lRelationTypes.add((RelationshipType) lObjectType);
	}
	
	mLog.debug("END getRelationshipTypes(Session, String)");
	return lRelationTypes;
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:13,代码来源:AlfrescoHelper.java


示例12: getAllowedRelationshipTypes

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
public static List<RelationshipType> getAllowedRelationshipTypes(Session pSession, String pRelationsRootId, String pStrTypeId) {
	mLog.debug("START getAllowedRelationshipTypes(Session, String, String)");
	
	List<RelationshipType> lAllowedRelationTypes = new ArrayList<RelationshipType>();
	
	List<String> lTypeAspectIds = getTypeAspectIds(pSession, pStrTypeId);
	
	for (RelationshipType lRelationType : getRelationshipTypes(pSession, pRelationsRootId)) {
		
		boolean lIsAllowed = false;
		
		List<ObjectType> lRelationAllowedTypes = new ArrayList<ObjectType>();
		lRelationAllowedTypes.addAll(lRelationType.getAllowedSourceTypes());
		lRelationAllowedTypes.addAll(lRelationType.getAllowedTargetTypes());
		
		for (ObjectType lObjectType : lRelationAllowedTypes) {
			if (lObjectType.getId().equals(pStrTypeId) || lTypeAspectIds.contains(lObjectType.getId())) {
				lIsAllowed = true;
				break;
			}
		}
		
		if (lIsAllowed) {
			lAllowedRelationTypes.add(lRelationType);
		}
	}
			
	mLog.debug("END getAllowedRelationshipTypes(Session, String, String)");
	return lAllowedRelationTypes;
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:31,代码来源:AlfrescoHelper.java


示例13: getDocTypes

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
@GET
@Path("/")
public Response getDocTypes() {
	Session lSession = Util.getUserAlfrescoSession(httpRequest);

	List<ObjectType> lObjectTypeTreeLeaves =
	        AlfrescoHelper.getTypesTreeLeaves(lSession, mAlfrescoBaseTypeId, true);

	return Response.ok(lObjectTypeTreeLeaves).build();
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:11,代码来源:DocumentType.java


示例14: getDocTypeById

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
@GET
@Path("/{id}")
public Response getDocTypeById(@PathParam("id") String pStrId) {
	Session lSession = Util.getUserAlfrescoSession(httpRequest);
	ObjectType lObjectType = AlfrescoHelper.getTypeDefinition(lSession, pStrId);

	return Response.ok(lObjectType).build();
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:9,代码来源:DocumentType.java


示例15: serialize

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
@Override
public void serialize(ObjectType value, JsonGenerator gen, SerializerProvider serializers)
        throws IOException, JsonProcessingException {

	gen.writeStartObject();

	gen.writeStringField("id", value.getId());
	gen.writeStringField("name", value.getDisplayName());
	gen.writeStringField("description", value.getDescription());
	
	gen.writeBooleanField("isSecondary",
		(value.getBaseTypeId() == null)? false : BaseTypeId.CMIS_SECONDARY.value().equals(value.getBaseTypeId().value()));
	
	if (value instanceof RelationshipType) {
		gen.writeFieldName("allowedSourceTypes");
		gen.writeObject(((RelationshipType) value).getAllowedSourceTypes());
		
		gen.writeFieldName("allowedTargetTypes");
		gen.writeObject(((RelationshipType) value).getAllowedTargetTypes());
	}
	
	// Proprietà
	gen.writeFieldName("properties");
	gen.writeObject(value.getPropertyDefinitions());
	
	// Aspetti
	gen.writeArrayFieldStart("aspects");
	if (value.getExtensions() != null) {
		for (CmisExtensionElement lExtension : value.getExtensions()) {
			if (lExtension.getName().matches("(?i:.*aspect.*)")) {
				for (CmisExtensionElement lAspectExtension : lExtension.getChildren()) {
					gen.writeString(lAspectExtension.getValue());
				}
			}
		}
	}
	gen.writeEndArray();

	gen.writeEndObject();
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:41,代码来源:ObjectTypeSerializer.java


示例16: getTypes

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
@Override
public List<TreeNodeDTO<EditorType>> getTypes() {
  List<TreeNodeDTO<EditorType>> nodes = new ArrayList<>();

  for (Tree<ObjectType> tree : cmisProxy.getSession().getTypeDescendants(null, -1, true)) {
    nodes.add(fillWith(tree));
  }

  return nodes;
}
 
开发者ID:empt-ak,项目名称:meditor,代码行数:11,代码来源:CmisTypeServiceImpl.java


示例17: fillWith

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
private TreeNodeDTO<EditorType> fillWith(Tree<ObjectType> tree) {
  TreeNodeDTO<EditorType> treeNodeDTO = new TreeNodeDTO<>(new EditorType(tree.getItem()));

  List<TreeNodeDTO<EditorType>> children = new ArrayList<>();
  for (Tree<ObjectType> t : tree.getChildren()) {
    children.add(fillWith(t));
  }

  treeNodeDTO.setChildren(children);

  return treeNodeDTO;
}
 
开发者ID:empt-ak,项目名称:meditor,代码行数:13,代码来源:CmisTypeServiceImpl.java


示例18: isObjectTypeVersionable

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
public boolean isObjectTypeVersionable(String objectType) {
    if (CamelCMISConstants.CMIS_DOCUMENT.equals(getCMISTypeFor(objectType))) {
        ObjectType typeDefinition = session.getTypeDefinition(objectType);
        return ((DocumentType) typeDefinition).isVersionable();
    }
    return false;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:CMISSessionFacade.java


示例19: supportsSecondaries

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
public boolean supportsSecondaries() {
    if (session.getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) {
        return false;
    }
    for (ObjectType type : session.getTypeChildren(null, false)) {
        if (BaseTypeId.CMIS_SECONDARY.value().equals(type.getId())) {
            return true;
        }
    }
    return false;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:12,代码来源:CMISSessionFacade.java


示例20: getCreatableFolderTypes

import org.apache.chemistry.opencmis.client.api.ObjectType; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected List<ObjectType> getCreatableFolderTypes(
		HttpServletRequest request, HttpServletResponse response) {
	List<ObjectType> types = null;

	HttpSession httpSession = request.getSession(false);
	if (httpSession != null) {
		types = (List<ObjectType>) httpSession
				.getAttribute(HTTP_SESSION_FOLDER_TYPES);
	}

	return types;
}
 
开发者ID:fmui,项目名称:ApacheChemistryInAction,代码行数:14,代码来源:AbstractTheBlendServlet.java



注:本文中的org.apache.chemistry.opencmis.client.api.ObjectType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GeoPackageGeometryData类代码示例发布时间:2022-05-23
下一篇:
Java Contents类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap