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

Java SiteVisibility类代码示例

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

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



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

示例1: createTestDocuments

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
protected NodeRef[] createTestDocuments(final RequestContext requestContext) {
    NodeRef[] docNodeRefs = TenantUtil.runAsUserTenant(new TenantRunAsWork<NodeRef[]>()
    {
        @Override
        public NodeRef[] doWork() throws Exception
        {
            String siteName = "site" + GUID.generate();
            SiteInformation siteInfo = new SiteInformation(siteName, siteName, siteName, SiteVisibility.PUBLIC);
            TestSite site = currentNetwork.createSite(siteInfo);
            NodeRef nodeRefDoc1 = getTestFixture().getRepoService().createDocument(site.getContainerNodeRef("documentLibrary"), "Test Doc1", "Test Doc1 Title", "Test Doc1 Description", "Test Content");
            NodeRef nodeRefDoc2 = getTestFixture().getRepoService().createDocument(site.getContainerNodeRef("documentLibrary"), "Test Doc2", "Test Doc2 Title", "Test Doc2 Description", "Test Content");
            
            NodeRef[] result = new NodeRef[2];
            result[0] = nodeRefDoc1;
            result[1] = nodeRefDoc2;
            
            return result;
        }
    }, requestContext.getRunAsUser(), requestContext.getNetworkId());
    
    return docNodeRefs;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:23,代码来源:EnterpriseWorkflowTestApi.java


示例2: createSite

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
/**
 * @see org.alfresco.service.cmr.site.SiteService#createSite(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)
 */
public SiteInfo createSite(final String sitePreset, 
                           String passedShortName, 
                           final String title, 
                           final String description, 
                           final boolean isPublic)
{
    // Determine the site visibility
    SiteVisibility visibility = SiteVisibility.PRIVATE;
    if (isPublic == true)
    {
        visibility = SiteVisibility.PUBLIC;
    }
    
    // Create the site
    return createSite(sitePreset, passedShortName, title, description, visibility);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:SiteServiceImpl.java


示例3: createSiteInfo

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
/**
 * Creates a site information object given a site node reference
 * 
 * @param siteNodeRef
 *            site node reference
 * @return SiteInfo site information object
 */
private SiteInfo createSiteInfo(NodeRef siteNodeRef)
{
    SiteInfo siteInfo = null;
    
    // Get the properties
    Map<QName, Serializable> properties = this.directNodeService.getProperties(siteNodeRef);
    String shortName = (String) properties.get(ContentModel.PROP_NAME);
    String sitePreset = (String) properties.get(PROP_SITE_PRESET);
    String title = DefaultTypeConverter.INSTANCE.convert(String.class, properties.get(ContentModel.PROP_TITLE));
    String description = DefaultTypeConverter.INSTANCE.convert(String.class, properties.get(ContentModel.PROP_DESCRIPTION));

    // Get the visibility of the site
    SiteVisibility visibility = getSiteVisibility(siteNodeRef);
    
    // Create and return the site information
    Map<QName, Serializable> customProperties = getSiteCustomProperties(properties);
    
    siteInfo = new SiteInfoImpl(sitePreset, shortName, title, description, visibility, customProperties, siteNodeRef);
    siteInfo.setCreatedDate(DefaultTypeConverter.INSTANCE.convert(Date.class, properties.get(ContentModel.PROP_CREATED)));
    siteInfo.setLastModifiedDate(DefaultTypeConverter.INSTANCE.convert(Date.class, properties.get(ContentModel.PROP_MODIFIED)));
    
    return siteInfo;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:31,代码来源:SiteServiceImpl.java


示例4: testSiteMembersPaged

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
@Test public void testSiteMembersPaged()
{
    // Choose a site name that will link back to this test case...
    final String siteShortName = testName.getMethodName();
    log.debug("Creating test site called: " + siteShortName);

    TRANSACTION_HELPER.doInTransaction(new RetryingTransactionCallback<Void>()
    {
        public Void execute() throws Throwable
        {
            // ...and create the site
            final TestSiteAndMemberInfo testSiteAndMemberInfo = perMethodTestSites.createTestSiteWithUserPerRole(siteShortName, "sitePreset", SiteVisibility.PUBLIC, AuthenticationUtil.getAdminUserName());

            List<Pair<SiteService.SortFields, Boolean>> sortProps = new ArrayList<Pair<SiteService.SortFields, Boolean>>(1);
            sortProps.add(new Pair<SiteService.SortFields, Boolean>(SiteService.SortFields.FirstName, true));
            PagingResults<SiteMembership> pagedMembers = SITE_SERVICE.listMembersPaged(siteShortName, true, sortProps, new PagingRequest(100));
            assertNotNull(pagedMembers);
            assertNotNull(pagedMembers.getPage());
            assertNotNull(pagedMembers.getQueryExecutionId());
            assertFalse(pagedMembers.hasMoreItems());
            log.debug("About to delete site completely.");
            SITE_SERVICE.deleteSite(siteShortName);
            return null;
        }
    });
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:SiteServiceImplMoreTest.java


示例5: testCustomRole

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
public void testCustomRole()
{
    try
    {
        // Create a site
        siteService.createSite("customrolessite", "customrolessite", "Test custom role", "Test custom role", SiteVisibility.PUBLIC);

        this.siteService.setMembership("customrolessite", USER_TWO, "SiteCoordinator");

        // Get the members of the site
        final List<Pair<SiteService.SortFields, Boolean>> sort = new ArrayList<Pair<SiteService.SortFields, Boolean>>();
        sort.add(new Pair<SiteService.SortFields, Boolean>(SiteService.SortFields.SiteTitle, Boolean.TRUE));
        sort.add(new Pair<SiteService.SortFields, Boolean>(SiteService.SortFields.Role, Boolean.TRUE));

        PagingResults<SiteMembership> sites = siteService.listSitesPaged(USER_TWO, sort, new PagingRequest(0, 100));
        assertNotNull(sites);
        assertEquals(sites.getPage().size(), 1);
    }
    catch (Exception ex)
    {
        fail("Custom role breaks sites API. Take a look on MNT-12873\n" + ex.getMessage());
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:CustomRoleTest.java


示例6: checkSiteInfo

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
private void checkSiteInfo(SiteInfo siteInfo, 
                           String expectedSitePreset, 
                           String expectedShortName, 
                           String expectedTitle, 
                           String expectedDescription, 
                           SiteVisibility expectedVisibility)
{
    assertNotNull(siteInfo);
    assertEquals(expectedSitePreset, siteInfo.getSitePreset());
    assertEquals(expectedShortName, siteInfo.getShortName());
    assertEquals(expectedTitle, siteInfo.getTitle());
    assertEquals(expectedDescription, siteInfo.getDescription());
    assertEquals(expectedVisibility, siteInfo.getVisibility());
    assertNotNull(siteInfo.getNodeRef());
    
    // Check that the site is a tag scope
    assertTrue(this.taggingService.isTagScope(siteInfo.getNodeRef()));
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:SiteServiceImplTest.java


示例7: testListSitesWhereSiteVisibilityPublicAndSkipCount

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
public void testListSitesWhereSiteVisibilityPublicAndSkipCount() throws Exception
{
    // paging
    Integer skipCount = 1;
    int maxItems = 2;
    int totalResults = 2;
    Paging paging = getPaging(skipCount, maxItems, totalResults, totalResults);

    Map<String, String> filters = new HashMap<String, String>();
    filters.put("visibility", SiteVisibility.PUBLIC.name());

    // list sites
    ListResponse<Site> resp = listSitesWithWhere(paging, filters, null);

    // check results
    List<SiteImpl> expectedList = new LinkedList<>();
    expectedList.add((SiteImpl) site9);

    checkList(expectedList, paging.getExpectedPaging(), resp);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:21,代码来源:TestSites.java


示例8: testUserRoleInGroups

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
/**
 * 
 * See https://issues.alfresco.com/jira/browse/MNT-2229
 */    
public void testUserRoleInGroups()
{
	String sitName = "testMembership2" + UUID.randomUUID();
	// Create a site as user one
    this.siteService.createSite(TEST_SITE_PRESET, sitName, TEST_TITLE, TEST_DESCRIPTION, SiteVisibility.PUBLIC);
    
    /**
     *  Add a group (GROUP_ONE) with role COLLABORATOR
     */
    this.siteService.setMembership(sitName, this.groupOne, SiteModel.SITE_COLLABORATOR);
    
    /**
     *  Add a group (GROUP_TWO) with role CONSUMER
     */
    this.siteService.setMembership(sitName, this.groupTwo, SiteModel.SITE_CONSUMER);
    
    List<SiteMemberInfo> roles = this.siteService.listMembersInfo(sitName, USER_TWO, null,  0, true);
    
    assertEquals(roles.get(0).getMemberRole(), SiteModel.SITE_COLLABORATOR);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:SiteServiceImplTest.java


示例9: testRenameSite

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
public void testRenameSite()
{
    // test that changing the name of a site generates an appropriate exception

    try
    {
        String siteName = GUID.generate();

        SiteInfo siteInfo = createSite(siteName, "doclib", SiteVisibility.PUBLIC);
        NodeRef childRef = siteInfo.getNodeRef();

        Map<QName, Serializable> props = new HashMap<QName, Serializable>(); 
        props.put(ContentModel.PROP_NAME, siteName + "Renamed"); 

        nodeService.addProperties(childRef, props);

        fail("Should have caught rename");
    }
    catch(SiteServiceException e)
    {
        assertTrue(e.getMessage().contains("can not be renamed"));
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:SiteServiceImplTest.java


示例10: testJSAPI

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
public void testJSAPI() throws Exception
{
    // Create a site with a custom property
    SiteInfo siteInfo = this.siteService.createSite(TEST_SITE_PRESET, "mySiteWithCustomProperty", TEST_TITLE, TEST_DESCRIPTION, SiteVisibility.PUBLIC);
    NodeRef siteNodeRef = siteInfo.getNodeRef();
    Map<QName, Serializable> properties = new HashMap<QName, Serializable>(1);
    properties.put(QName.createQName(SiteModel.SITE_CUSTOM_PROPERTY_URL, "additionalInformation"), "information");
    this.nodeService.addAspect(siteNodeRef, QName.createQName(SiteModel.SITE_MODEL_URL, "customSiteProperties"), properties);
    
    // Create a model to pass to the unit test scripts
    Map<String, Object> model = new HashMap<String, Object>();
    model.put("customSiteName", "mySiteWithCustomProperty");
    model.put("preexistingSiteCount", siteService.listSites(null, null).size());
    
    // Execute the unit test script
    ScriptLocation location = new ClasspathScriptLocation("org/alfresco/repo/site/script/test_siteService.js");
    this.scriptService.executeScript(location, model);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:SiteServiceImplTest.java


示例11: testGetSiteTitleDisplayHandler

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
/**
 * Site title display handler test.
 *
 * @throws Exception
 */
@Test
public void testGetSiteTitleDisplayHandler() throws Exception
{
    final String siteShortName = "siteDisplayHandlerTest" + System.currentTimeMillis();
    final String siteTitle = "Site Title Display Handler Test";
    temporarySites.createSite("sitePreset", siteShortName, siteTitle, "site desc", SiteVisibility.PRIVATE, AuthenticationUtil.getAdminUserName());

    FacetLabelDisplayHandler siteHandler = displayHandlerRegistry.getDisplayHandler("SITE");
    assertNotNull(siteHandler);
    
    String randomSiteName = "randomSiteName" + System.currentTimeMillis();
    FacetLabel name = siteHandler.getDisplayLabel(randomSiteName);
    assertNotNull(name);
    assertEquals("There is no site with the name [" + randomSiteName + "], hence, the handler should return the passed-in short name.", randomSiteName, name.getLabel());
    name = siteHandler.getDisplayLabel(siteShortName);
    assertNotNull(name);
    assertEquals(siteTitle, name.getLabel());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:SolrFacetQueriesDisplayHandlersTest.java


示例12: initNonStaticData

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
@Before public void initNonStaticData() throws Exception
{
    companyHome = repositoryHelper.getCompanyHome();
    
    // Create the test folder used for these tests
    testFolderName = "Test-folder-"+ System.currentTimeMillis();
    testFolder     = testNodes.createFolder(companyHome, testFolderName, AuthenticationUtil.getAdminUserName());
    
    // Create the node used as a content supplier for one test
    String testImageNodeName = "testImageNode" + System.currentTimeMillis();
    nodeWithImageContent     = testNodes.createQuickFile(MimetypeMap.MIMETYPE_IMAGE_PNG, companyHome, testImageNodeName, AuthenticationUtil.getAdminUserName());
    
    // Create a test site - note that 'admin' is the site creator.
    testSiteInfo = testSites.createTestSiteWithUserPerRole(this.getClass().getSimpleName(),
                                                           "sitePreset",
                                                           SiteVisibility.PRIVATE,
                                                           AuthenticationUtil.getAdminUserName());
    final NodeRef siteDocLib = testSiteInfo.doclib;
    // Put a piece of content in that site - again the creator is admin.
    // This piece of content is malformed and it will not be possible to create thumbnails from it.
    brokenJpg                = testNodes.createQuickFileByName("quickCorrupt.jpg", siteDocLib, AuthenticationUtil.getAdminUserName());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:23,代码来源:RenditionServicePermissionsTest.java


示例13: createTestSites

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
@Before public void createTestSites() throws Exception
{
    ADMIN = AuthenticationUtil.getAdminUserName();
    
    final String guid = GUID.generate();
    
    // admin creates the test sites. This is how this test case was before refactoring. TODO Probably better to have a non-admin user create the sites.
    publicSite   = testSites.createSite("sitePreset", "pub" + guid,   "", "", SiteVisibility.PUBLIC,  ADMIN);
    privateSite1 = testSites.createSite("sitePreset", "priv1" + guid, "", "", SiteVisibility.PRIVATE, ADMIN);
    privateSite2 = testSites.createSite("sitePreset", "priv2" + guid, "", "", SiteVisibility.PRIVATE, ADMIN);
    modSite1     = testSites.createSite("sitePreset", "mod1" + guid,  "", "", SiteVisibility.MODERATED, ADMIN);
    modSite2     = testSites.createSite("sitePreset", "mod2" + guid, "", "",  SiteVisibility.MODERATED, ADMIN);
    log.debug("Created some test sites...");
    
    AuthenticationUtil.clearCurrentSecurityContext();
    // test site cleanup is handled automatically by the JUnit Rule.
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:SubscriptionServiceActivitiesTest.java


示例14: initStaticData

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
@BeforeClass public static void initStaticData() throws Exception
{
    CONTENT_SERVICE       = APP_CONTEXT_INIT.getApplicationContext().getBean("ContentService", ContentService.class);
    NODE_SERVICE          = APP_CONTEXT_INIT.getApplicationContext().getBean("NodeService", NodeService.class);
    SERVICE_REGISTRY      = APP_CONTEXT_INIT.getApplicationContext().getBean("ServiceRegistry", ServiceRegistry.class);
    TRANSACTION_HELPER    = APP_CONTEXT_INIT.getApplicationContext().getBean("retryingTransactionHelper", RetryingTransactionHelper.class);
    PERMISSION_SERVICE    = APP_CONTEXT_INIT.getApplicationContext().getBean("permissionService", PermissionServiceSPI.class);
    SEARCH_SCRIPT         = APP_CONTEXT_INIT.getApplicationContext().getBean("searchScript", Search.class);
    VERSIONABLE_ASPECT    = APP_CONTEXT_INIT.getApplicationContext().getBean("versionableAspect", VersionableAspect.class);
    VERSION_SERVICE       = APP_CONTEXT_INIT.getApplicationContext().getBean("VersionService", VersionService.class);
    DICTIONARY_SERVICE    = APP_CONTEXT_INIT.getApplicationContext().getBean("DictionaryService", DictionaryService.class);       
    NAMESPACE_SERVICE     = APP_CONTEXT_INIT.getApplicationContext().getBean("namespaceService", NamespaceService.class);
    DICTIONARY_DAO        = APP_CONTEXT_INIT.getApplicationContext().getBean("dictionaryDAO", DictionaryDAO.class);
    TENANT_ADMIN_SERVICE  = APP_CONTEXT_INIT.getApplicationContext().getBean("tenantAdminService", TenantAdminService.class);
    MESSAGE_SERVICE       = APP_CONTEXT_INIT.getApplicationContext().getBean("messageService", MessageService.class);
    TRANSACTION_SERVICE   = APP_CONTEXT_INIT.getApplicationContext().getBean("transactionComponent", TransactionService.class);
    POLICY_COMPONENT      = APP_CONTEXT_INIT.getApplicationContext().getBean("policyComponent", PolicyComponent.class);

    USER_ONES_TEST_SITE = STATIC_TEST_SITES.createTestSiteWithUserPerRole(GUID.generate(), "sitePreset", SiteVisibility.PRIVATE, USER_ONE_NAME);
    USER_ONES_TEST_FILE = STATIC_TEST_NODES.createQuickFile(MimetypeMap.MIMETYPE_TEXT_PLAIN, USER_ONES_TEST_SITE.doclib, "test.txt", USER_ONE_NAME);		
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:ScriptNodeTest.java


示例15: testMultipleInviteRequests

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
public void testMultipleInviteRequests() throws Exception
{
    String shortName  = GUID.generate();
    createSite("myPreset", shortName, "myTitle", "myDescription", SiteVisibility.MODERATED, 200);
    String userName = USER_TWO;
    String roleName = SiteModel.SITE_CONSUMER;
    String inviteComments = "Request to join";
 
    try {
         //Create a new moderated invitation
         String moderatedInvitationId = createModeratedInvitation(shortName, inviteComments, userName, roleName);
         //Create another invitation
         String newModeratedInvitationId = createModeratedInvitation(shortName, inviteComments, userName, roleName);
         fail("A request to join this site is already in pending");
    }
    catch (AssertionFailedError e) {
          // Ignore since we where expecting this
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:20,代码来源:SiteServiceTest.java


示例16: testDeleteSiteAsSiteAdmin

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
public void testDeleteSiteAsSiteAdmin() throws Exception
{
    // Create a site
    String shortName = GUID.generate();
    createSite("myPreset", shortName, "myTitle", "myDescription", SiteVisibility.PUBLIC, 200);
    // Get the site
    sendRequest(new GetRequest(URL_SITES + "/" + shortName), 200);

    // try to delete the site
    this.authenticationComponent.setCurrentUser(USER_THREE);
    // Delete the site
    sendRequest(new DeleteRequest(URL_SITES + "/" + shortName), 500);
    // Get the site
    Response response = sendRequest(new GetRequest(URL_SITES + "/" + shortName), 200);
    JSONObject jsonObj = new JSONObject(response.getContentAsString());
    assertEquals(shortName, jsonObj.get("shortName"));

    // set the current user as site-admin
    this.authenticationComponent.setCurrentUser(USER_FOUR_AS_SITE_ADMIN);
    // Delete the site
    sendRequest(new DeleteRequest(URL_SITES + "/" + shortName), 200);
    sendRequest(new GetRequest(URL_SITES + "/" + shortName), 404);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:24,代码来源:SiteServiceTest.java


示例17: initTestSiteAndUsersAndSomeContent

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
@Before
public void initTestSiteAndUsersAndSomeContent()
{
    final String siteShortName = ActionServiceImpl2Test.class.getSimpleName() + "TestSite"
            + System.currentTimeMillis();

    // This will create a public Share site whose creator is the admin user.
    // It will create 4 users (one for each of the Share roles, and add them
    // to the site.
    testSiteAndMemberInfo = temporarySites.createTestSiteWithUserPerRole(siteShortName, "sitePreset",
            SiteVisibility.PUBLIC, AuthenticationUtil.getAdminUserName());

    AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
    testNode = transactionHelper.doInTransaction(new RetryingTransactionCallback<NodeRef>()
    {
        public NodeRef execute() throws Throwable
        {
            // get the Document Library NodeRef
            final NodeRef docLibNodeRef = testSiteAndMemberInfo.doclib;

            // Create a test node. It doesn't need content.
            return nodeService.createNode(docLibNodeRef, ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CONTAINS,
                    ContentModel.TYPE_CONTENT).getChildRef();
        }
    });
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:ActionServiceImpl2Test.java


示例18: getFilterPropListOfSites

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
private List<FilterProp> getFilterPropListOfSites(final Parameters parameters)
{
    List<FilterProp> filterProps = new ArrayList<FilterProp>();
    Query q = parameters.getQuery();
    if (q != null)
    {
        MapBasedQueryWalkerOrSupported propertyWalker = new MapBasedQueryWalkerOrSupported(LIST_SITES_EQUALS_QUERY_PROPERTIES, null);
        QueryHelper.walk(q, propertyWalker);

        String siteVisibilityStr = propertyWalker.getProperty(PARAM_VISIBILITY, WhereClauseParser.EQUALS, String.class);
        if (siteVisibilityStr != null && !siteVisibilityStr.isEmpty())
        {
            SiteVisibility siteVisibility = getSiteVisibilityFromParam(siteVisibilityStr);
            filterProps.add(new FilterPropString(SiteModel.PROP_SITE_VISIBILITY, siteVisibility.name(), FilterPropString.FilterTypeString.EQUALS));
        }

        String sitePreset = propertyWalker.getProperty(PARAM_PRESET, WhereClauseParser.EQUALS, String.class);
        if (sitePreset != null && !sitePreset.isEmpty())
        {
            filterProps.add(new FilterPropString(SiteModel.PROP_SITE_PRESET, sitePreset, FilterPropString.FilterTypeString.EQUALS));
        }
    }

    // expected null or non-empty list
    return filterProps.isEmpty() ? null : filterProps;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:27,代码来源:SitesImpl.java


示例19: testExportSiteWithMutipleUsers

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
public void testExportSiteWithMutipleUsers() throws Exception
{
    // Create a site
    String shortName = GUID.generate();
    createSite("myPreset", shortName, "myTitle", "myDescription", SiteVisibility.PUBLIC, 200);

    // add a user and a person as members
    addSiteMember(USER_FROM_LDAP, shortName);
    addSiteMember(USER_ONE, shortName);

    // Export site
    Response response = sendRequest(new GetRequest(getExportUrl(shortName)), 200);

    // check exported files
    List<String> entries = getEntries(new ZipInputStream(new ByteArrayInputStream(
            response.getContentAsByteArray())));
    assertFalse(entries.contains("No_Users_In_Site.txt"));
    assertFalse(entries.contains("No_Persons_In_Site.txt"));
    assertTrue(entries.contains("People.acp"));
    assertTrue(entries.contains(shortName + "-people.xml"));
    assertTrue(entries.contains("Users.acp"));
    assertTrue(entries.contains(shortName + "-users.xml"));
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:24,代码来源:SiteExportServiceTest.java


示例20: testExportSiteWithOneLDAPUser

import org.alfresco.service.cmr.site.SiteVisibility; //导入依赖的package包/类
public void testExportSiteWithOneLDAPUser() throws Exception
{
    // Create a site
    String shortName = GUID.generate();
    createSite("myPreset", shortName, "myTitle", "myDescription", SiteVisibility.PUBLIC, 200);

    // add a user synced from LDAP(authenticator node not present)
    addSiteMember(USER_FROM_LDAP, shortName);

    // Export site
    Response response = sendRequest(new GetRequest(getExportUrl(shortName)), 200);

    // check No_Users_In_Site.txt present
    // because there is no user associated with the single member of the
    // site
    List<String> entries = getEntries(new ZipInputStream(new ByteArrayInputStream(
            response.getContentAsByteArray())));
    assertFalse(entries.contains("Users.acp"));
    assertTrue(entries.contains("No_Users_In_Site.txt"));
    assertTrue(entries.contains("People.acp"));
    assertTrue(entries.contains(shortName + "-people.xml"));
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:23,代码来源:SiteExportServiceTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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