小编rav*_*nsp的帖子

来自{PRODUCT_NAME}的XCode包标识符格式

假设我在XCode构建设置中有一个iPhone应用程序,其产品名称是" 我的应用程序 "(在单词之间有空格).在我的info.plist中,Bundle标识符被指定为com.mycompany.${PRODUCT_NAME:rfc1034identifier}

在应用程序包中生成的info.plist中,包标识符显示为com.mycompany.My-App.我需要它com.mycompany.MyApp.如何更改Bundle Identifier设置,以便按照我想要的方式转换产品名称?

PS.如果我更改为${PRODUCT_NAME:rfc1034identifier}to ${PRODUCT_NAME:identifier},则生成的包标识符将是com.mycompany.My_App.我只需要在结果中完全删除产品名称中的空格字符.

iphone xcodebuild cfbundleidentifier

28
推荐指数
1
解决办法
5万
查看次数

iPhoneSDK从CATransform3D计算旋转角度

如何通过提供CATransform3D结构作为输入来计算Z轴周围的旋转?

基本上我需要的是另一种方式CATransform3DMakeRotation.

iphone core-animation catransform3d

10
推荐指数
2
解决办法
5992
查看次数

Sitecore Publishable标志使MasterI数据库无法获取GetItem()

我正在使用sitecore 6.6.0(rev.120918).从sitecore管理员门户,我去关闭项目的Publishable标志(见图).

在此输入图像描述

在此之后,Sitecore.Data.Database.GetDatabase("master").GetItem("{itemID}")返回null.

如果我再次打开Publishable标志,则GetItem()返回正确的项目.这种行为的原因是什么?可发布设置控制发布到Web数据库的功能.为什么它会影响GetItem()对master数据库的API调用?

sitecore

8
推荐指数
2
解决办法
1640
查看次数

将sitecore 6.6索引配置升级到sitecore 7(使用ComputedFields)

Sitecore CMS + DMS 6.6.0 rev.130404 => 7.0 rev.130424

在我们的项目中,我们一直在为我们的索引使用AdvancedDatabaseCrawler(ADC)(特别是因为它的动态字段功能).这是一个示例索引配置:

<index id="GeoIndex" type="Sitecore.Search.Index, Sitecore.Kernel">
<param desc="name">$(id)</param>
<param desc="folder">$(id)</param>
<analyzer ref="search/analyzer" />
<locations hint="list:AddCrawler">
  <web type="scSearchContrib.Crawler.Crawlers.AdvancedDatabaseCrawler, scSearchContrib.Crawler">
    <database>web</database>
    <root>/sitecore/content/Globals/Locations</root>
    <IndexAllFields>true</IndexAllFields>
    <include hint="list:IncludeTemplate">
      <!--Suburb Template-->
      <suburb>{FF0D64AA-DCB4-467A-A310-FF905F9393C0}</suburb>
    </include>
    <dynamicFields hint="raw:AddDynamicFields">
      <dynamicField type="OurApp.CustomSearchFields.SearchTextField,OurApp" name="search text" storageType="NO" indexType="TOKENIZED" vectorType="NO" />
      <dynamicField type="OurApp.CustomSearchFields.LongNameField,OurApp" name="display name" storageType="YES" indexType="UN_TOKENIZED" vectorType="NO" />
    </dynamicFields>
  </web>
</locations>
</index>
Run Code Online (Sandbox Code Playgroud)

如您所见,我们使用scSearchContrib.Crawler.Crawlers.AdvancedDatabaseCrawler爬虫作为爬虫,它使用<dynamicFields hint="raw:AddDynamicFields">部分内部定义的字段将自定义字段注入索引.

现在我们将项目升级到sitecore 7.在Sitecore 7中,他们已将DynamicFields功能从ADC移植到sitecore.我发现了一些关于此的文章,并转换了我们的自定义搜索字段类来实现sitecore 7 IComputedIndexField接口,而不是继承BaseDynamicFieldADC中的类.现在我的问题是如何更改索引配置以匹配新的sitecore 7 API.网上有点点零碎,但找不到转换配置所需的所有示例.有人可以帮我这个吗?

虽然我这样做,但我的印象是我们不必重建我们的索引,因为它仍然在内部使用Lucene.我不想改变索引结构.只想将代码和配置从AdvancedDatabaseCrawler升级到Sitecore 7.我是否应该担心破坏现有的索引?请详细说明这一点.

谢谢

indexing lucene.net sitecore sitecore6 sitecore7

6
推荐指数
2
解决办法
1852
查看次数

带有用于 cookie 的 requireSSL 的 Sitecore

我们基于 Sitecore 6.6.0(修订版 120918)的网站可以通过 http 和 https 运行。我们还有一项安全要求,即无论网站是否通过 http 访问,都必须通过 SSL 传输所有 cookie。

我们通过在 web.config 中使用 requireSSL 属性实现了这一要求,如下所述:如何在 ASP.NET 会话 Cookie 上设置安全标志?

通过此更改,我们的公共网站运行良好,并且在 Firebug 中进行分析时,我们可以看到所有 cookie 都是“安全的”,即使通过 http 访问该网站也是如此。

但问题是当我尝试通过 http 登录到 sitecore 管理门户时,它抛出错误The application is configured to issue secure cookies. These cookies require the browser to issue the request over SSL (https protocol). However, the current request is not over SSL.我可以访问 sitecore 管理门户的唯一方法是通过 https。即使使用 https,它也会出现一些奇怪的问题。使用一段时间后,它说很多管理员用户已登录,我必须踢出一些才能进入。我也无法远程访问管理员门户。

为什么公共网站使用 SSL cookie,但 sitecore 管理门户有 SSL cookie 问题。它可能是我们网站中不兼容的配置吗?

asp.net sitecore requiressl

5
推荐指数
1
解决办法
3052
查看次数

Sitecore索引重建实践

在我们的sitecore项目(6.6.0 rev.130404)中,我们有超过200万个sitecore项目.我们配置了几个Lucene索引(每个索引都包含这些项的子集).我们面临的问题是重新构建这些索引所需的时间.特别是使用Sitecore的QuickSearch索引,除了我们的自定义索引之外,重建该索引可能还需要将近一整天的时间.

在日常运营中维护大型sitecore索引的常规做法是什么?您需要多久重建一次索引?当你这样做时,如何处理长网站停机时间(索引重建使索引脱机)?

lucene sitecore sitecore6

5
推荐指数
1
解决办法
1814
查看次数

实体框架 - 使用 IDbConnectionInterceptor 设置 session_context

我正在关注本教程,以便通过 Entity Framework 6 CodeFirst 在 SQL Server 中使用行级安全性。教程代码示例展示了如何使用 IDbConnectionInterceptor 并在session_context. 为了检索用户 ID,它使用静态访问器方法HttpContext.Current.User.Identity.GetUserId(),该方法与 Asp.Net 身份和 System.Web 命名空间相结合。

在我的多租户 Web 应用程序中,我希望将tenantId注入到DbConnectionInterceptorusing Unity 中(不创建与 硬耦合HttpContext)并在session_context. 我发现DbConnectionInterceptor需要全局注册(例如在应用程序启动时),因此您不能让 UnityDbConnectionInterceptor为每个请求创建实例。

我的解决方案中还有 2 个 DbContexts,代表 2 个不同的数据库(租户数据库和系统数据库),我只想应用于session_context租户数据库。

如此看来,留给我唯一的选择是有tenantId注入DbContext通过Unity isntance并访问DbContext内部实例Opened()的方法DbConnectionInterceptor。为此,我想到了interceptionContextOpened()方法中使用参数。interceptionContextDbContexts(复数)属性。没有关于此的文档,所以我假设这样的事情会起作用:

public void Opened(DbConnection connection, DbConnectionInterceptionContext interceptionContext)
{
    var firstDbContext = interceptionContext.DbContexts.FirstOrDefault(d …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework row-level-security

5
推荐指数
1
解决办法
5119
查看次数

将二进制图像数据从Web服务读入UIImage

我正在iPhone应用程序中使用Web服务.Web服务方法返回一个响应,该响应具有多个字段(例如ID,描述等).其中一个字段包含我需要在我的iPhone应用程序中转换为UIImage的二进制图像数据.

我正在成功使用NSXMLParser从XML响应中提取数据.在parser:foundCharacters:XMLParser 的选择器中,它NSString*指向每个字段中的字符串.由于这是一个字符串,这是我在遇到图像字段时读取图像数据的方法:

UIImage *img = [[UIImage alloc] initWithData:[string dataUsingEncoding:NSUTF8StringEncoding]];
Run Code Online (Sandbox Code Playgroud)

但是img变量在这一行之后仍然是"零".似乎XML字符串中的数据与转换不兼容.我在这做错了什么?(我能够将其他字段读入我的变量但不能读取此图像数据字段)

提前致谢..

iphone web-services binary-data

4
推荐指数
1
解决办法
6570
查看次数

在Visual Studio中查找空方法

如何找到项目中定义的特定类型的所有空方法?一个用例示例是查找Asp.Net应用程序中定义的所有空Page_Load方法。

c# replace visual-studio

4
推荐指数
1
解决办法
1182
查看次数

sitecore - 允许访问sitemap.xml,同时禁止其他xml文件

在我们的sitecore 6.6.0(rev.130404)项目中,我们在根文件夹中有一个sitemap.xml文件.但是,由于web.config中的配置,无法从浏览器访问该文件.

<add path="*.xml" verb="*" type="System.Web.HttpForbiddenHandler" name="xml (integrated)" preCondition="integratedMode"/>
Run Code Online (Sandbox Code Playgroud)

此配置是按照sitecore安全加固指南中的说明添加的.

如果我们删除此配置,则用户可以访问sitecore文件夹中的任何.xml文件.我们怎样才允许访问sitemap.xml而不允许访问网站中的其他xml文件?

(我们在IIS7集成模式下运行)

xml sitecore httpforbiddenhandler sitecore6 sitemap.xml

4
推荐指数
1
解决办法
1876
查看次数