Arquivo da Categoría: Moss

Moss busca avanzada personalización — Se non importa en investigación avanzada XSLT

Non modificar procura avanzada XSLT, moitas veces, entón parece que estou escalando pequenos outeiros cada vez.

O meu máis novo lección é esta: Se importa ao facer referencia a unha columna. Na miña busca avanzada, I columnas definido como esta:

<raíz xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<
Columnas>
<
Columna Nome="GafTrainingInvoiceNumber" />
<
Columna Nome="GafTrainingInvoiceLocation" />
<
Columna Nome="WorkId"/>
<
Columna Nome="Posición"/>
<
Columna Nome="Título"/>
<
Columna Nome="Autor"/>
<
Columna Nome="Tamaño"/>
<
Columna Nome="Camiño"/>
<
Columna Nome="Descrición"/>
<
Columna Nome="Escribir"/>
<
Columna Nome="Nome_do_Site"/>
<
Columna Nome="CollapsingStatus"/>
<
Columna Nome="HitHighlightedSummary"/>
<
Columna Nome="HitHighlightedProperties"/>
<
Columna Nome="Contentclass"/>
<
Columna Nome="IsDocument"/>
<
Columna Nome="PictureThumbnailURL"/>
</
Columnas>
</
raíz>

O XLST que exhibe o número da nota fiscal e localización factura fora:

<p>
Training Invoice Number: <XSL:valor de seleccionar="GafTrainingInvoiceNumber"/>
<
br></br>
Training Invoice Location: <XSL:valor de seleccionar="GafTrainingInvoiceLocation"/>
</
p>

Con todo, o select ten que referenciar a propiedade en todas as letras minúsculas, como no:

<p>
Training Invoice Number: <XSL:valor de seleccionar="gaftraininginvoicenumber"/>
<
br></br>
Training Invoice Location: <XSL:valor de seleccionar="gaftraininginvoicelocation"/>
</
p>


Until I corrected that, search results showed the labels (i.e. "Training Invoice Number") but no data.

Moss / InfoPath Forms Server (InfoPath 2007) desempeño lista desplegable

Categoría adicional: InfoPath

Resumo: Un InfoPath 2007 formar implantado nun servidor Moss ofrece unha lista desplegable de provedores vinculados a unha lista MOSS personalizado. Ao seleccionar un provedor, normas de asignar valores de campo a un puñado de campos de texto, como vendas nome rep, enderezo, cidade, Estado, zip e teléfono. O desempeño é horrible. Notamos que o rendemento empeora (in a non-linear fashion) para cada campo adicional que actualizar esta forma. É dicir,, se só actualizar o nome do representante de vendas, leva [x] cantidade de tempo. Se atualizarmos representante de vendas, address1, address2, cidade, Estado, zip, leva 10 veces maior.

Solución: Escribir un servizo web (código de exemplo pódese atopar aquí) que se transmite en nome dun provedor e regresa de novo a información do provedor. Entón, asignar os campos deste xeito. Aínda que iso tamén parece lento, Non houbo diferenza perceptible no desempeño cando atribuímos 1 campo contra 8 campos. Como un extra adicional, users get a cool "contacting the server" Cylon efecto, mentres se espera para a forma de invocar e consumir os resultados de servizos.

Moss: Excepción. (Excepción de HRESULT: 0x80020009 (DISP_E_EXCEPTION))

Actualización: Nunca determinou a causa raíz do problema e nunca vir á tona de novo.

Notamos durante a implementación dun sitio web de desenvolvemento que, de súpeto, dous usuarios son capaces de acceder a un conxunto de sitios. Estas contas poden acceder ao sitio principal, pero ao tentar acceder a unha colección sitio web específico, they just get a blank screen. No errors displayed, just a white blank page.

We log in as a site collection admin and try to add one of those users as a site admin and this time, upon pressing "OK", we get this message:

Excepción. (Excepción de HRESULT: 0x80020009 (DISP_E_EXCEPTION))

We spent some time researching this and unfortunately, didn’t come up with anything useful. There were some messages in the diagnostic log, but it was hard to exactly correlate them with this issue.

A finais, we deleting the site collection and re-created it and that solved it.

If I figure out what caused this in future, Vou actualizar este post.

Moss: Iteración mediante listas personalizadas e retornando datos filtrados para InfoPath

Escenario empresarial:

Proporcionar un método que permite que os usuarios insiran as solicitudes de compra precisos axiña.

Problema de negocio:

O cliente fai negocios con centos de empresas.

Vendors are "type" específico. Isto significa que un provedor vende equipamento informático (e.g. Dell) ou material de oficina (e.g. Staples).

Como podemos permitir que os usuarios finais que crear solicitudes de compra seleccionar un provedor válido?

Business Solution:

Differentiate vendors in the system via "type".

Enable users to select the "type" de produto e, a continuación, proporcionar un conxunto de filtración de provedores axeitados.

Solución Técnica:

Un formulario do InfoPath foi deseñado que permite que os usuarios insiran as solicitudes de compra en liña.

Dúas listas de selección de selección de provedores control InfoPath. Primeiro, the user selects a "purchase type". This limits a second selection list to contain only vendors that sell for that purchase type. This is a classic cascading drop-down.

Os vendedores están gardados nunha lista personalizada Moss con columnas personalizadas para os atributos de provedores, como nome, address and especially "type".

Implement a web service for an InfoPath client to consume that iterates through the custom vendor list, returning only vendors matching a supplied "type".

Invoke the web service via the InfoPath form.

Leccións aprendidas:

  • Primeiro, it seems necessary to go this route. I would have preferred to do the filtering entirely within InfoPath and not create any web service functionality here. Con todo, forms server does not provide the required filtering capability. We can put a rule onto a the "type" selection list in the form to sort of re-open the vendor query, but we can’t get it to work properly. Polo tanto, it was necessary to implement the web service.
  • This is a classic "cascading selection list" problem in the InfoPath forms server world and there are many good examples out there that explain how to solve this.
  • A blank value for a column in the vendor list does not return an empty string when referenced like this: initItem["Vendor Name"]. Pola, it returns a null.

Some other Notes:

  • I return an array[] of vendors because I had some difficulty returning an ArrayList. InfoPath was complaining about it and I didn’t have the time or the inclination to fight over it. Este, claro, puts an artificial limit on the total number of vendors. It also compelled me to implement a trim() method on the array because I hate the idea of returning back 100’s of null vendors. InfoPath doesn’t care, but it nagged at me. (De novo, this was easier than fighting InfoPath over ArrayLists).
  • I implemented a GetSpecificVendorByName() function as well, which may be instructive.

O código:

utilización Sistema;
utilización System.Web;
utilización System.Web.Services;
utilización System.Web.Services.Protocols;
utilización Microsoft.SharePoint;
utilización System.Configuration;

/// <resumo>
///
Vendor Service: Provides vendor related services which today are consumed by an infopath client form.
///
/// History:
/// ——–
/// 07/24/07: Initial coding, Paul J. Gavin of Conchango.
///
/// </resumo>
[WebService(Namespace = "Http://www.conchango.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
público clase VendorService : System.Web.Services.WebService
{

/// <resumo>
/// Represents a vendor from a custom sharepoint list maintained by MSUSA.
/// </resumo>
público clase Vendor
{
público Vendor() { }

público Vendor(SPItem initItem)
{
se (! (initItem["Vendor Name"] == nulo)) VendorName = initItem["Vendor Name"].ToString();
se (! (initItem["Address 1"] == nulo)) VendorAddress1 = initItem["Address 1"].ToString();
se (! (initItem["Address 2"] == nulo)) VendorAddress2 = initItem["Address 2"].ToString();
se (! (initItem["City"] == nulo)) VendorCity = initItem["City"].ToString();
se (! (initItem["VendorPhone"] == nulo)) VendorPhone = initItem["VendorPhone"].ToString();
se (! (initItem["PurchaseType"] == nulo)) VendorType = initItem["PurchaseType"].ToString();
se (! (initItem["State"] == nulo)) VendorState = initItem["State"].ToString();
se (! (initItem["Zip"] == nulo)) VendorZip = initItem["Zip"].ToString();
se (!(initItem["Fax"] == nulo)) VendorFax = initItem["Fax"].ToString();
se (!(initItem["SalesRepName"] == nulo)) VendorSalesRepName = initItem["SalesRepName"].ToString();

VendorItemId = initItem.ID; // Unique ID maintained via MOSS.
}

público int VendorItemId;
público corda VendorName;
público corda VendorAddress1;
público corda VendorAddress2;
público corda VendorCity;
público corda VendorState;
público corda VendorZip;
público corda VendorPhone;
público corda VendorType;
público corda VendorSalesRepName;
público corda VendorFax;
}

público VendorService () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

privado Vendor[] GenerateTestVendors()
{
Vendor[] resultList;
resultList = novo Vendor[100];

Vendor v;
v = novo Vendor();
v.VendorAddress1 = "v1_address1";
v.VendorAddress2 = "v1_address2";
v.VendorCity = "v1_city";
v.VendorName = "v1_vendorname";
v.VendorPhone = "v1_vendorphone";
v.VendorState = "v1_st";
v.VendorType = "v1_type";
v.VendorZip = "v1_zip";

resultList[0] = v;

v = novo Vendor();

v.VendorAddress1 = "v2_address1";
v.VendorAddress2 = "v2_address2";
v.VendorCity = "v2_city";
v.VendorName = "v2_vendorname";
v.VendorPhone = "v2_vendorphone";
v.VendorState = "v2_st";
v.VendorType = "v2_type";
v.VendorZip = "v2_zip";

resultList[1] = v;

v = novo Vendor();
v.VendorAddress1 = "v3_address1";
v.VendorAddress2 = "v3_address2";
v.VendorCity = "v3_city";
v.VendorName = "v3_vendorname";
v.VendorPhone = "v3_vendorphone";
v.VendorState = "v3_st";
v.VendorType = "v3_type";
v.VendorZip = "v3_zip";

resultList[2] = v;

volver resultList;

}

[WebMethod]
público Vendor GetSpecificVendorById(int vendorId)
{
corda SpVendorSiteName; // Name of the actual MOSS site that hosts the vendor custom list.
corda SpVendorListName; // Name of the actual MOSS list containing vendors.

SpVendorSiteName = ConfigurationSettings.AppSettings["VendorListHostingSite"].ToString();
SpVendorListName = ConfigurationSettings.AppSettings["VendorList"].ToString();

utilización (SPSite site = novo SPSite(SpVendorSiteName))
{

utilización (SPWeb web = site.OpenWeb())
{

SPList currentList = web.Lists[SpVendorListName];

SPItem specificItem = currentList.Items[vendorId];

volver novo Vendor(specificItem);

} // using spweb web = site.openweb()
} // using spsite site = new spsite("Http://localhost/mizuho")

}

[WebMethod]
// Assumes that the vendor name is unique, from a business perspective
público Vendor GetSpecificVendorByVendorName(corda vendorName)
{
corda SpVendorSiteName; // Name of the actual MOSS site that hosts the vendor custom list.
corda SpVendorListName; // Name of the actual MOSS list containing vendors.

SpVendorSiteName = ConfigurationSettings.AppSettings["VendorListHostingSite"].ToString();
SpVendorListName = ConfigurationSettings.AppSettings["VendorList"].ToString();

utilización (SPSite site = novo SPSite(SpVendorSiteName))
{
utilización (SPWeb web = site.OpenWeb())
{

SPList currentList = web.Lists[SpVendorListName];

foreach (SPItem vendorItem en currentList.Items)
{
se (vendorItem["Vendor Name"] == nulo) continuar;

se (vendorItem["Vendor Name"].ToString().Igual(vendorName))
volver novo Vendor(vendorItem);
}

Vendor v = novo Vendor();
v.VendorPhone = "not found: " + vendorName;

volver v;

volver nulo;

} // using spweb web = site.openweb()
} // using spsite site = new spsite("Http://localhost/mizuho")

} // método

[WebMethod]
público Vendor[] GetVendorsOfType (corda filterType)
{

corda SpVendorSiteName; // Name of the actual MOSS site that hosts t
he vendor custom list.
corda SpVendorListName; // Name of the actual MOSS list containing vendors.

SpVendorSiteName = ConfigurationSettings.AppSettings["VendorListHostingSite"].ToString();
SpVendorListName = ConfigurationSettings.AppSettings["VendorList"].ToString();

Vendor[] resultList;
int vendorIndex = 0;
resultList = novo Vendor[1000];

// Initialize the list with a default friendly message.
Vendor v = novo Vendor();
v.VendorName = "Select a vendor type to populate this list.";
resultList[0] = v;

// Convert the filter to lower case for easier string comparison later.
filterType = filterType.ToLower();

// If the filter type passed is "test", generate some simple data.
#rexión Filter type = "test"
se (filterType.Equals("test"))
volver GenerateTestVendors();
#endregion

se (certo)
{
utilización (SPSite site = novo SPSite(SpVendorSiteName))
{
utilización (SPWeb web = site.OpenWeb())
{

v = nulo;

SPList currentList = web.Lists[SpVendorListName];

// Iterate through all the items in the vendor list.
foreach (SPItem vendorItem en currentList.Items)
{

corda lowerVendorType;

lowerVendorType = vendorItem["PurchaseType"].ToString().ToLower();
lowerVendorType = lowerVendorType.Substring(3);

se (lowerVendorType.Equals(filterType))
{
resultList[vendorIndex ] = novo Vendor(vendorItem);
}
} // iterating thru all the vendors in the list


volver TrimVendorArray(vendorIndex, resultList);
// return resultList;

} // using spweb web = site.openweb()
} // using spsite site = new spsite("Http://localhost/mizuho")

} // if true

volver nulo;
}

privado Vendor[] TrimVendorArray(int newsize, Vendor[] originalVendorArray)
{
Vendor[] trimmedArray;

se (newsize == 0) newsize = 1;
trimmedArray = novo Vendor[newsize];

int currentCounter = 0;

para (currentCounter = 0; currentCounter < newsize; currentCounter )
{
trimmedArray[currentCounter] = originalVendorArray[currentCounter];
}

volver trimmedArray;

}
}