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


Java Status.STATUS_NOT_FOUND属性代码示例

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


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

示例1: executeImpl

@Override
protected Map<String, Object> executeImpl(SiteInfo site, String linkName,
      WebScriptRequest req, JSONObject json, Status status, Cache cache) 
{
   Map<String, Object> model = new HashMap<String, Object>();
   
   // Try to find the link
   LinkInfo link = linksService.getLink(site.getShortName(), linkName);
   if (link == null)
   {
      String message = "No link found with that name";
      throw new WebScriptException(Status.STATUS_NOT_FOUND, message);
   }
   
   // Build the model
   model.put(PARAM_ITEM, renderLink(link));
   model.put("node", link.getNodeRef());
   model.put("link", link);
   model.put("site", site);
   model.put("siteId", site.getShortName());
   
   // All done
   return model;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:24,代码来源:LinkGet.java

示例2: getClassQName

@Override
protected QName getClassQName(WebScriptRequest req)
{
    QName classQName = null;
    String prefix = req.getServiceMatch().getTemplateVars().get(DICTIONARY_PREFIX);
    String shortName = req.getServiceMatch().getTemplateVars().get(DICTIONARY_SHORT_CLASS_NAME);
    if (prefix != null && prefix.length() != 0 && shortName != null && shortName.length()!= 0)
    {            
        classQName = createClassQName(prefix, shortName);
        if (classQName == null)
        {
            // Error 
            throw new WebScriptException(Status.STATUS_NOT_FOUND, "Check the className - " + prefix + ":" + shortName + " - parameter in the URL");
        }
    }
    return classQName;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:17,代码来源:PropertiesGet.java

示例3: getFullNamespaceURI

/**
  * @param classname     the class name as cm_person
  * @return String       the full name in the following format {namespaceuri}shorname
  */
 public String getFullNamespaceURI(String classname)
 {
    	try
    	{
String result = null;
  	String prefix = this.getPrefix(classname);
  	String url = this.namespaceService.getNamespaceURI(prefix);
String name = this.getShortName(classname);
result = "{" + url + "}"+ name;
return result;
    	}
    	catch (Exception e)
    	{
    		throw new WebScriptException(Status.STATUS_NOT_FOUND, "The exact classname - " + classname + "  parameter has not been provided in the URL");
    	}
 }
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:20,代码来源:DictionaryWebServiceBase.java

示例4: buildModel

@Override
protected Map<String, Object> buildModel(ReplicationModelBuilder modelBuilder, 
                                         WebScriptRequest req, Status status, Cache cache)
{
    // Which definition did they ask for?
    String replicationDefinitionName = 
       req.getServiceMatch().getTemplateVars().get("replication_definition_name");
    ReplicationDefinition replicationDefinition =
       replicationService.loadReplicationDefinition(replicationDefinitionName);
    
    // Does it exist?
    if(replicationDefinition == null) {
       throw new WebScriptException(
             Status.STATUS_NOT_FOUND, 
             "No Replication Definition found with that name"
       );
    }
   
    // Have it turned into simple models
    return modelBuilder.buildDetails(replicationDefinition);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:21,代码来源:ReplicationDefinitionGet.java

示例5: getAssociationQname

@Override
protected QName getAssociationQname(WebScriptRequest req)
{
    String associationName = req.getServiceMatch().getTemplateVars().get(DICTIONARY_ASSOCIATION_SHORTNAME);
    String associationPrefix = req.getServiceMatch().getTemplateVars().get(DICTIONARY_ASSOCIATION_PREFIX);
    
    if(associationPrefix == null)
    {
        throw new WebScriptException(Status.STATUS_NOT_FOUND, "Missing parameter association prefix in the URL");
    }
    if(associationName == null)
    {
        throw new WebScriptException(Status.STATUS_NOT_FOUND, "Missing parameter association name in the URL");
    }
    
    return QName.createQName(getFullNamespaceURI(associationPrefix, associationName));
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:17,代码来源:AssociationGet.java

示例6: execute

private Map<String, Object> execute(WebScriptRequest req, Status status)
{
    // initialise model to pass on for template to render
    Map<String, Object> model = new HashMap<String, Object>();
    
    // get inviteId and inviteTicket
    String inviteId = req.getServiceMatch().getTemplateVars().get("inviteId");
    String inviteTicket = req.getServiceMatch().getTemplateVars().get("inviteTicket");
    
    try 
    {
        Invitation invitation = invitationService.getInvitation(inviteId);
        
        if (invitation instanceof NominatedInvitation)
        {
            NominatedInvitation theInvitation = (NominatedInvitation)invitation;
            String ticket = theInvitation.getTicket();
            if (ticket == null || (! ticket.equals(inviteTicket)))
            {
                throw new WebScriptException(Status.STATUS_NOT_FOUND, "Ticket mismatch");
            }
            // return the invite info
            model.put("invite", toInviteInfo(theInvitation));
            return model;
        }
        else
        {
            // Not a nominated invitation
            throw new WebScriptException(Status.STATUS_FORBIDDEN, "Not a nominated invitation");
        }
    }
    catch (InvitationExceptionNotFound nfe)
    {
        throw new WebScriptException(Status.STATUS_NOT_FOUND,
        "No invite found for given id");
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:37,代码来源:InviteByTicket.java

示例7: getAssociationQname

@Override
protected QName getAssociationQname(WebScriptRequest req)
{
    String associationName = req.getServiceMatch().getTemplateVars().get(DICTIONARY_ASSOCIATION_NAME);
    if(associationName == null)
    {
    	throw new WebScriptException(Status.STATUS_NOT_FOUND, "Missing parameter association name in the URL");
    }
    
    return QName.createQName(getFullNamespaceURI(associationName));
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:11,代码来源:AssociationGet.java

示例8: getClassQname

@Override
protected QName getClassQname(String namespacePrefix, String name)
{
    String className = namespacePrefix + "_" + name;
    if(isValidClassname(className) == false)
    {
        throw new WebScriptException(Status.STATUS_NOT_FOUND, "Check the name - " + name + "parameter in the URL");
    }
    return QName.createQName(getFullNamespaceURI(className));
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:10,代码来源:ClassesGet.java

示例9: executeImpl

@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{
    Map<String, Object> model = new HashMap<String, Object>(7);
    
    String appName = getParamAppName(req);
    if (appName == null)
    {
        throw new WebScriptException(Status.STATUS_BAD_REQUEST, "audit.err.app.notProvided");
    }
    AuditApplication app = auditService.getAuditApplications().get(appName);
    if (app == null)
    {
        throw new WebScriptException(Status.STATUS_NOT_FOUND, "audit.err.app.notFound", appName);
    }
    // Get from/to times
    Long fromTime = getParamFromTime(req);           // might be null
    Long toTime = getParamToTime(req);               // might be null
    
    // Clear
    int cleared = auditService.clearAudit(appName, fromTime, toTime);
    
    model.put(JSON_KEY_CLEARED, cleared);
    
    // Done
    if (logger.isDebugEnabled())
    {
        logger.debug("Result: \n\tRequest: " + req + "\n\tModel: " + model);
    }
    return model;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:31,代码来源:AuditClearPost.java

示例10: unprotectedExecuteImpl

@Override
protected Map<String, Object> unprotectedExecuteImpl(WebScriptRequest req, Status status, Cache cache)
{
    // get the filterID parameter.
    Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
    String filterID = templateVars.get("filterID");

    Map<String, Object> model = new HashMap<String, Object>(1);

    if (filterID == null)
    {
        model.put("filters", facetService.getFacets());
    }
    else
    {
        SolrFacetProperties fp = facetService.getFacet(filterID);
        if (fp == null)
        {
            throw new WebScriptException(Status.STATUS_NOT_FOUND, "Filter not found");
        }
        model.put("filter", fp);
    }

    if (logger.isDebugEnabled())
    {
        logger.debug("Retrieved all available facets: " + model.values());
    }

    return model;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:30,代码来源:SolrFacetConfigAdminGet.java

示例11: getClassQname

@Override
protected QName getClassQname(String namespacePrefix, String name)
{
    if(isValidClassname(namespacePrefix, name) == false)
    {
        throw new WebScriptException(Status.STATUS_NOT_FOUND, "Check the name - " + name + "parameter in the URL");
    }
    return QName.createQName(getFullNamespaceURI(namespacePrefix, name));
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:9,代码来源:ClassesGet.java

示例12: getClassQname

/**
 * Override method from AbstractClassGet
 */
@Override
protected QName getClassQname(WebScriptRequest req)
{
    String prefix = req.getServiceMatch().getTemplateVars().get(DICTIONARY_PREFIX);
    String shortName = req.getServiceMatch().getTemplateVars().get(DICTIONARY_SHORT_CLASS_NAME);
    
    //validate the classname and throw appropriate error message
    if (isValidClassname(prefix, shortName) == false)
    {
        throw new WebScriptException(Status.STATUS_NOT_FOUND, "Check the classname - " + prefix + ":" + shortName + " - parameter in the URL");
    }
    return QName.createQName(getFullNamespaceURI(prefix, shortName));
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:16,代码来源:ClassGet.java

示例13: getPropertyQname

@Override
protected QName getPropertyQname(WebScriptRequest req)
{
    String propertyName = req.getServiceMatch().getTemplateVars().get(DICTIONARY_PROPERTY_NAME);
    //validate the presence of property name
    if(propertyName == null)
    {
        throw new WebScriptException(Status.STATUS_NOT_FOUND, "Missing parameter propertyname in the URL");
    }
    
    return QName.createQName(getFullNamespaceURI(propertyName));
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:12,代码来源:PropertyGet.java

示例14: executeImpl

@Override
protected Map<String, Object> executeImpl(SiteInfo site, NodeRef nodeRef,
     BlogPostInfo blog, WebScriptRequest req, JSONObject json, Status status, Cache cache) 
{
    if (blog == null)
    {
       throw new WebScriptException(Status.STATUS_NOT_FOUND, "Blog Post Not Found");
    }

    // Build the response
    Map<String, Object> model = new HashMap<String, Object>();
    
    // TODO Fetch this from the BlogPostInfo object
    NodeRef node = blog.getNodeRef();
    Map<String, Object> item = BlogPostLibJs.getBlogPostData(node, services);
    model.put(ITEM, item);
    model.put(POST, blog);
    
    model.put("externalBlogConfig", BlogPostLibJs.hasExternalBlogConfiguration(node, services));
    
    int contentLength = -1;
    String arg = req.getParameter("contentLength");
    if (arg != null)
    {
        try
        {
            contentLength = Integer.parseInt(arg);
        }
        catch (NumberFormatException ignored)
        {
            // Intentionally empty
        }
    }
    
    model.put("contentLength", contentLength);
    
    return model;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:38,代码来源:BlogPostGet.java

示例15: getClassQname

@Override
protected QName getClassQname(WebScriptRequest req)
{
    String className = req.getServiceMatch().getTemplateVars().get(DICTIONARY_CLASS_NAME);
		
    // validate the classname
    if (isValidClassname(className) == false)
    {
        throw new WebScriptException(Status.STATUS_NOT_FOUND, "Check the classname - " + className + " - parameter in the URL");
    }
   
    return QName.createQName(getFullNamespaceURI(className));
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:13,代码来源:PropertyGet.java


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