当前位置: 首页>>代码示例>>Java>>正文


Java I18NUtil.getMessage方法代码示例

本文整理汇总了Java中org.springframework.extensions.surf.util.I18NUtil.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java I18NUtil.getMessage方法的具体用法?Java I18NUtil.getMessage怎么用?Java I18NUtil.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.extensions.surf.util.I18NUtil的用法示例。


在下文中一共展示了I18NUtil.getMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testCreateFolderLink

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
/**
 * Tests the creation of a folder link
 * 
 * @throws Exception
 */
public void testCreateFolderLink() throws Exception
{
    // create a link of file site1File1_1 in folder site1Folder2
    NodeRef linkNodeRef = documentLinkService.createDocumentLink(site1Folder1, site1Folder2);
    assertNotNull(linkNodeRef);

    // test if the link node is listed as a child of site1Folder2
    String site1Folder1LinkName =  I18NUtil.getMessage("doclink_service.link_to_label", (site1Folder1Name + ".url"));
    NodeRef linkNodeRef2 = fileFolderService.searchSimple(site1Folder2, site1Folder1LinkName);
    assertNotNull(linkNodeRef2);
    assertEquals(linkNodeRef, linkNodeRef2);

    // check the type of the link
    assertEquals(nodeService.getType(linkNodeRef), ApplicationModel.TYPE_FOLDERLINK);

    // check if the link destination is site1File1_1
    NodeRef linkDestination = documentLinkService.getLinkDestination(linkNodeRef);
    assertNotNull(linkDestination);
    assertEquals(linkDestination, site1Folder1);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:DocumentLinkServiceImplTest.java

示例2: resolveMessage

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
private String resolveMessage(String messageId, Object[] params)
{
    String message = I18NUtil.getMessage(messageId, params);

    if (message == null)
    {
        message = messageId;

        if (params != null)
        {
            message += " - " + Arrays.toString(params);
        }
    }

    return message;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:PortEarlyPropertyChecker.java

示例3: applyInternal

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
@Override
protected String applyInternal() throws Exception
{
    StoreRef storeRef = importerBootstrap.getStoreRef();
    NodeRef rootNodeRef = nodeService.getRootNode(storeRef);
    List<NodeRef> results = searchService.selectNodes(rootNodeRef, copyPath, null, namespaceService, true);
    if (results.size() > 1)
    {
        throw new PatchException(ERR_MULTIPLE_FOUND, copyPath);
    }
    else if (results.size() == 1)
    {
        makeCopy(results.get(0));
        return I18NUtil.getMessage(MSG_CREATED);
    }
   
    
    return null;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:UpdateAuditTemplatePatch.java

示例4: describe

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
@Override
public String describe()
{
    if (matches.size() > SHOW_MAX_MATCHES)
    {
        return I18NUtil.getMessage(
                    "system.schema_comp.redundant_obj.many_matches",
                    matches.size(),
                    dbObject,
                    describeMatches(),
                    matches.size() - SHOW_MAX_MATCHES);            
    }
    else
    {
        return I18NUtil.getMessage(
                    "system.schema_comp.redundant_obj",
                    matches.size(),
                    dbObject,
                    describeMatches());
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:RedundantDbObject.java

示例5: evaluateSingleValue

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
protected void evaluateSingleValue(Object value)
{
    // convert the value to a String
    String valueStr = DefaultTypeConverter.INSTANCE.convert(String.class, value);
    Matcher matcher = patternMatcher.matcher(valueStr);
    boolean matches = matcher.matches();
    if (matches != requiresMatch)
    {
        // Look for a message corresponding to this constraint name
        String messageId = CONSTRAINT_REGEX_MSG_PREFIX + getShortName();
        if (I18NUtil.getMessage(messageId, value) != null)
        {
            throw new ConstraintException(messageId, value);
        }
        // Otherwise, fall back to a generic (but unfriendly) message
        else if (requiresMatch)
        {
            throw new ConstraintException(RegexConstraint.CONSTRAINT_REGEX_NO_MATCH, value, expression);
        }
        else
        {
            throw new ConstraintException(RegexConstraint.CONSTRAINT_REGEX_MATCH, value, expression);
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:26,代码来源:RegexConstraint.java

示例6: applyInternal

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
@Override
protected String applyInternal() throws Exception
{
    List<NodeRef> refs = searchService.selectNodes(
            repository.getRootHome(), 
            target, 
            null, 
            namespaceService, 
            false);
    if (refs.size() < 1)
    {
        // skip as it can be deleted
        return I18NUtil.getMessage(MSG_SKIP);
    }
    else
    {
        updateContent(refs.get(0));
    }

    return I18NUtil.getMessage(MSG_SUCCESS);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:FixTemplatePatch.java

示例7: getMessage

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
@Override
public String getMessage()
{
    String message = I18NUtil.getMessage(getKey(), getArgs());
    
    if(message == null)
    {
        return key;
    }
    return message;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:12,代码来源:AuthenticationDiagnostic.java

示例8: applyInternal

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
@Override
protected String applyInternal() throws Exception
{
 // NOTE: SiteService is not currently MT-enabled (eg. getSiteRoot) so skip if applied to tenant
    if (AuthenticationUtil.isRunAsUserTheSystemUser() || !AuthenticationUtil.isMtEnabled())
    {
        // Set all the sites in the repository
        List<SiteInfo> sites = this.siteService.listSites(null, null);
        renameDispayNames(sites);
    }
    // Report status
    return I18NUtil.getMessage(SUCCESS_MSG);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:14,代码来源:RenameSiteAuthorityDisplayName.java

示例9: validateImportedM2Model

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
private void validateImportedM2Model(M2Model m2Model)
{
    List<M2Namespace> namespaces = m2Model.getNamespaces();
    if (namespaces.size() > 1)
    {
        throw new ConstraintViolatedException(I18NUtil.getMessage("cmm.rest_api.model.import_namespace_multiple_found", namespaces.size()));
    }
    else if (namespaces.isEmpty())
    {
        throw new ConstraintViolatedException("cmm.rest_api.model.import_namespace_undefined");
    }

    checkUnsupportedModelElements(m2Model.getTypes());
    checkUnsupportedModelElements(m2Model.getAspects());
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:16,代码来源:CustomModelsImpl.java

示例10: getBaseTemplate

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
@Override
protected NodeRef getBaseTemplate()
{
    List<NodeRef> refs = searchService.selectNodes(
            repository.getRootHome(), 
            XPATH, 
            null, 
            namespaceService, 
            false);
    if (refs.size() != 1)
    {
        throw new AlfrescoRuntimeException(I18NUtil.getMessage("patch.updateFollowingEmailTemplatesPatch.error"));
    }
    return refs.get(0);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:16,代码来源:UpdateFollowingEmailTemplatesPatch.java

示例11: resolveMessage

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
/**
 * Resolves the message id to the localised string.
 * <p>
 * If a localised message can not be found then the message Id is
 * returned.
 * 
 * @param messageId     the message Id
 * @param params        message parameters
 * @return              the localised message (or the message id if none found)
 */
private static String resolveMessage(String messageId, Object[] params)
{
    String message = I18NUtil.getMessage(messageId, params);
    if (message == null)
    {
        // If a localized string cannot be found then return the messageId and the params
        message = messageId;
        if (params != null)
        {
            message += " - " + Arrays.toString(params);
        }
    }
    return buildErrorLogNumber(message);
}
 
开发者ID:Alfresco,项目名称:alfresco-core,代码行数:25,代码来源:AlfrescoRuntimeException.java

示例12: getUrls

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
/**
 * Retrieve registered search engines
 * 
 * @return  set of search engines
 */
private Set<UrlTemplate> getUrls(String urlType)
{
    if (logger.isDebugEnabled())
        logger.debug("Search Engine parameters: urltype=" + urlType);

    Set<UrlTemplate> urls = new HashSet<UrlTemplate>();
    Config config = configService.getConfig("OpenSearch");

    OpenSearchConfigElement searchConfig = (OpenSearchConfigElement)config.getConfigElement(OpenSearchConfigElement.CONFIG_ELEMENT_ID);
    for (OpenSearchConfigElement.EngineConfig engineConfig : searchConfig.getEngines())
    {
        Map<String, String> engineUrls = engineConfig.getUrls();
        for (Map.Entry<String, String> engineUrl : engineUrls.entrySet())
        {
            String type = engineUrl.getKey();
            String url = searchProxy.createUrl(engineConfig, type);
            
            if ((urlType.equals(URL_ARG_ALL)) ||
                (urlType.equals(URL_ARG_DESCRIPTION) && type.equals(MimetypeMap.MIMETYPE_OPENSEARCH_DESCRIPTION)) ||
                (urlType.equals(URL_ARG_TEMPLATE) && !type.equals(MimetypeMap.MIMETYPE_OPENSEARCH_DESCRIPTION)))
            {
                String label = engineConfig.getLabel();
                String labelId = engineConfig.getLabelId();
                if (labelId != null && labelId.length() > 0)
                {
                    String i18nLabel = I18NUtil.getMessage(labelId);
                    if (i18nLabel == null && label == null)
                    {
                        label = (i18nLabel == null) ? "$$" + labelId + "$$" : i18nLabel;
                    }
                }
                urls.add(new UrlTemplate(label, type, url));
            }

            // TODO: Extract URL templates from OpenSearch description
            else if (urlType.equals(URL_ARG_TEMPLATE) && 
                     type.equals(MimetypeMap.MIMETYPE_OPENSEARCH_DESCRIPTION))
            {            
            }
        }
    }
    
    if (logger.isDebugEnabled())
        logger.debug("Retrieved " + urls.size() + " engine registrations");
    
    return urls;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:53,代码来源:SearchEngines.java

示例13: getCodeName

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
/**
 * Gets the short name of the status code
 * 
 * @return  status code name
 */
public String getCodeName()
{
    String codeName =  I18NUtil.getMessage("webscript.code." + code + ".name");
    return codeName == null ? "" : codeName;
}
 
开发者ID:Alfresco,项目名称:alfresco-solrclient,代码行数:11,代码来源:Status.java

示例14: getMessage

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
@Override
@NotAuditable
public String getMessage(String messageKey)
{
    return I18NUtil.getMessage(messageKey);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:7,代码来源:StaticMessageLookup.java

示例15: deleteMailbox

import org.springframework.extensions.surf.util.I18NUtil; //导入方法依赖的package包/类
public void deleteMailbox(AlfrescoImapUser user, String mailboxName)
{
    if (logger.isDebugEnabled())
    {
        logger.debug("Deleting mailbox: mailboxName=" + mailboxName);
    }
    if (mailboxName == null)
    {
        throw new IllegalArgumentException(I18NUtil.getMessage(ERROR_MAILBOX_NAME_IS_MANDATORY));
    }

    AlfrescoImapFolder folder = getOrCreateMailbox(user, mailboxName, true, false);
    NodeRef nodeRef = folder.getFolderInfo().getNodeRef();
    
    List<FileInfo> childFolders = fileFolderService.listFolders(nodeRef);

    if (childFolders.isEmpty())
    {
        folder.signalDeletion();
        // Delete child folders and messages
        fileFolderService.delete(nodeRef);
    }
    else
    {
        if (folder.isSelectable())
        {
            // Delete all messages for this folder
            // Don't delete subfolders and their messages
            List<FileInfo> messages = fileFolderService.listFiles(nodeRef);
            for (FileInfo message : messages)
            {
                fileFolderService.delete(message.getNodeRef());
            }
            nodeService.addAspect(nodeRef, ImapModel.ASPECT_IMAP_FOLDER_NONSELECTABLE, null);
        }
        else
        {
            throw new AlfrescoRuntimeException(mailboxName + " - Can't delete a non-selectable store with children.");
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:42,代码来源:ImapServiceImpl.java


注:本文中的org.springframework.extensions.surf.util.I18NUtil.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。