自2011sp1 Tridion自带预编译核心服务客户端以来.是否仍有理由通过添加服务引用来生成您自己的代理?或者这个旧方法现在正式弃用了吗?
是否可以从TBB动态设置元数据字段的值?或者是否可以从TBB动态添加不一定存在于架构中的元数据字段?
我想这样做的原因是我使用的是DD4T,我希望将面包屑自动添加到DD4T xml中.
我尝试过以下方法:
public override void Transform(Engine engine, Package package)
{
Initialize(engine,package);
var page = GetPage();
string output = page.OrganizationalItem.Title;
var parent = page.OrganizationalItem as StructureGroup;
while (parent != null)
{
output = GetLinkToStructureGroupIndexPage(parent) + Separator + output;
parent = parent.OrganizationalItem as StructureGroup;
}
// I tried this to dynamically add the field
//var metadata = page.Metadata.OwnerDocument.CreateElement("breadcrumb");
//metadata.InnerText = output;
//page.Metadata.AppendChild(metadata);
//I tried this to dynamically set an existing field on the schema
foreach (XmlNode xml in page.Metadata)
{ …Run Code Online (Sandbox Code Playgroud) 我正在Eclipse Kepler(JEE版)中开发一个Spring MVC Web应用程序.我使用普通的JSP作为视图技术.
我将一个模型放在请求上作为属性,并使用'useBean'从JSP中的请求中读取它.
当我这样做时,内容辅助在EL(表达式语言)中对此对象失败.但它适用于:
换句话说:内容辅助工作正常,除非我在EL构造内部的bean上尝试它.
总结代码中的问题:
<jsp:useBean id="pageModel" type="org.myorg.PageModel" scope="request" />
THIS WORKS - a property of a prefined object: ${pageContext.request.... }
THIS WORKS - write out property from 'pageModel' in scriptlet code: <%= pageModel.... %>
THIS DOES NOT - write out property from 'pageModel' in EL: ${pageModel....}
Run Code Online (Sandbox Code Playgroud)
非常感谢所有帮助!
我正在尝试创建一个执行ServletDispatcher.include的Thymeleaf方言处理器。我扩展了AbstractElementTagProcessor并重写了doProcess方法。相关代码片段为:
@Override
protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag, final IElementTagStructureHandler structureHandler) {
ServletContext servletContext = null; // TODO: get servlet context
HttpServletRequest request = null; // TODO: get request
HttpServletResponse response = null; // TODO: get response
// Retrieve dispatcher to component JSP view
RequestDispatcher dispatcher = servletContext.getRequestDispatcher("/something");
// Create wrapper (acts as response, but stores output in a CharArrayWriter)
CharResponseWrapper wrapper = new CharResponseWrapper(response);
// Run the include
dispatcher.include(request, wrapper);
String result = wrapper.toString();
// Create a …Run Code Online (Sandbox Code Playgroud) 我有一个Sonarcloud帐户,正在尝试使用SonarQube.Scanner.MSBuild.exe分析Visual Studio解决方案。我创建了一个令牌,并将其作为SonarQube.Analysis.xml文件中的sonar.login属性传递。我使用https://sonarcloud.io作为sonar.host.url,但我也尝试过https://sonarqube.com。
这是配置的相关代码段:
<Property Name="sonar.host.url">https://sonarcloud.io</Property>
<Property Name="sonar.login">***my*token****</Property>
<Property Name="sonar.password"></Property>
<Property Name="sonar.organization">MyOrganization</Property>
Run Code Online (Sandbox Code Playgroud)
分析似乎运行良好,但是最后尝试将分析上传到Sonarcloud时,出现了以下错误:
ERROR: Error during SonarQube Scanner execution
ERROR: You're only authorized to execute a local (preview) SonarQube analysis without pushing the results to the SonarQube server. Please contact your SonarQube administrator.
Run Code Online (Sandbox Code Playgroud)
我尝试连接到本地Sonarqube服务器,并且工作正常。有人知道这里出了什么问题吗?
tridion ×2
dd4t ×1
eclipse ×1
el ×1
jsp ×1
sonarqube ×1
spring-mvc ×1
thymeleaf ×1
tridion-2011 ×1