Category Archives: MOSS

MOSS customization tfittxija avvanzata — Każ ma materja fit-tfittxija XSLT avvanzata

I ma jimmodifikawx XSLT tfittxija avvanzata ħafna drabi, hekk jidher li huwa simili jien tixbit għoljiet żgħar kull darba.

Lezzjoni ġodda tiegħi huwa dan: Kawża kwistjonijiet meta referenzjar kolonna. Fit-tfittxija avvanzata tiegħi, Għandi kolonni definiti bħala dan:

<root xmlns:XSi="http://www.w3.org/2001/XMLSchema-instance">
<
Kolonni>
<
Kolonna Isem="GafTrainingInvoiceNumber" />
<
Kolonna Isem="GafTrainingInvoiceLocation" />
<
Kolonna Isem="WorkId"/>
<
Kolonna Isem="Rank"/>
<
Kolonna Isem="Titolu"/>
<
Kolonna Isem="Awtur"/>
<
Kolonna Isem="Daqs"/>
<
Kolonna Isem="Path"/>
<
Kolonna Isem="Deskrizzjoni"/>
<
Kolonna Isem="Ikteb"/>
<
Kolonna Isem="SiteName"/>
<
Kolonna Isem="CollapsingStatus"/>
<
Kolonna Isem="HitHighlightedSummary"/>
<
Kolonna Isem="HitHighlightedProperties"/>
<
Kolonna Isem="Contentclass"/>
<
Kolonna Isem="IsDocument"/>
<
Kolonna Isem="PictureThumbnailURL"/>
</
Kolonni>
</
root>

Il XLST li juri n-numru tal-fattura u l-post fattura kien:

<p>
Training Invoice Number: <XSL:il-valur tal- tagħżel="GafTrainingInvoiceNumber"/>
<
br></br>
Training Invoice Location: <XSL:il-valur tal- tagħżel="GafTrainingInvoiceLocation"/>
</
p>

Madankollu, il agħżel għandu referenza l-proprjetà kollha żgħira, kif fil-:

<p>
Training Invoice Number: <XSL:il-valur tal- tagħżel="gaftraininginvoicenumber"/>
<
br></br>
Training Invoice Location: <XSL:il-valur tal- tagħżel="gaftraininginvoicelocation"/>
</
p>


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

MOSS / InfoPath Formoli Server (InfoPath 2007) prestazzjoni lista drop-down

Kategorija addizzjonali: InfoPath

Sommarju: An InfoPath 2007 jiffurmaw mobilitati lejn server MOSS jipprovdi lista drop-down ta 'bejjiegħa marbut ma' lista MOSS custom. Malli tagħżel bejjiegħ, regoli tassenja valuri qasam għal numru żgħir ta 'oqsma test bħall-isem rep bejgħ, indirizz, belt, istat, zip u telefon. Prestazzjoni hija horrible. Aħna Avviż li qed isiru agħar prestazzjoni (b'mod mhux lineari) għal kull qasam ieħor aħna aġġornament b'dan il-mod. Jiġifieri, jekk aħna biss taġġorna l-isem rep bejgħ, li tieħu [x] ammont ta 'ħin. Jekk aħna aġġornament bejgħ rep, address1, address2, belt, istat, zip, li tieħu 10 darbiet itwal.

Soluzzjoni: Ikteb servizz web (kodiċi tal-kampjun tista 'tinstab hawn) li jiġi mgħoddi fl-isem ta 'bejjiegħ u dan jirritorna lura d-dettalji bejjiegħ. Imbagħad, tassenja l-oqsma b'dan il-mod. Għalkemm dan ukoll jidher bil-mod, ma kien hemm l-ebda differenza fil-prestazzjoni meta aħna assenjat 1 qasam versus 8 oqsma. Bħala bonus, users get a cool "contacting the server" Cylon effett waqt li jkunu jistennew il-formola jinvokaw u jikkunsmaw ir-riżultati tas-servizz.

MOSS: Eċċezzjoni seħħet. (Eċċezzjoni minn HRESULT: 0x80020009 (DISP_E_EXCEPTION))

UPDATE: Aħna qatt determinat l-kawża ewlenija ta 'din il-problema u qatt ma jerġa' wiċċ.

Aħna Avviż matul l-implimentazzjoni ta 'sit żvilupp li għarrieda, żewġ utenti ma jkollhomx aċċess għall ġabra sit. Dawk il-kontijiet jista 'jawtentika għall-sit prinċipali, iżda meta jippruvaw jiksbu aċċess għas ġabra sit partikolari, huma biss jiksbu Skrin vojt. Ebda żbalji murija, biss paġna vojta abjad.

Aħna login bħala admin ġbir sit u tipprova żżid wieħed minn dawk l-utenti bħala admin sit u dan iż-żmien, upon pressing "OK", irridu jiksbu dan il-messaġġ:

Eċċezzjoni seħħet. (Eċċezzjoni minn HRESULT: 0x80020009 (DISP_E_EXCEPTION))

Aħna qattgħu xi żmien riċerka dan u sfortunatament, ma toħroġ ma 'xi ħaġa utli. Kien hemm xi messaġġi fil-log dijanjostiku, iżda kien diffiċli li jikkorrelataw eżattament bl din il-kwistjoni.

Fl-aħħar, aħna tħassar il-ġbir sit u jerġa 'tinħoloq u li solvuti.

Jekk I ċifra barra dak ikkawżat dan fil-futur, I ser taġġorna din il-kariga.

MOSS: Iterazzjoni permezz ta 'listi tad-dwana u r-ritorn data ffiltrata lill InfoPath

Xenarju Business:

Provide a method that enables users to enter accurate purchase requisitions quickly.

Problema Business:

The client does business with several hundred vendors.

Vendors are "type" specific. This means that a vendor sells computer equipment (e.g. Dell) or office supplies (e.g. Staples).

How do we enable end users who create purchase requisitions select a valid vendor?

Soluzzjoni tan-Negozju:

Differentiate vendors in the system via "type".

Enable users to select the "type" of product and then provide a filtered set of appropriate vendors.

Soluzzjoni teknika:

An InfoPath form has been designed that enables users to enter online purchase requisitions.

Two InfoPath selection lists control vendor selection. Ewwel, 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.

Vendors are stored in a MOSS custom list with custom columns for vendor attributes such as name, 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.

Lezzjonijiet Meħuda:

  • Ewwel, 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. Madankollu, 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. Għalhekk, 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"]. Minflok, 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. Dan, tal-kors, 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. (Għal darb'oħra, this was easier than fighting InfoPath over ArrayLists).
  • I implemented a GetSpecificVendorByName() function as well, which may be instructive.

Il-kodiċi:

użu Sistema;
użu System.Web;
użu System.Web.Services;
użu System.Web.Services.Protocols;
użu Microsoft.SharePoint;
użu System.Configuration;

/// <sommarju>
///
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.
///
/// </sommarju>
[Webservice(Namespace = "http://www.conchango.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
pubbliku klassi VendorService : System.Web.Services.Webservice
{

/// <sommarju>
/// Represents a vendor from a custom sharepoint list maintained by MSUSA.
/// </sommarju>
pubbliku klassi Vendor
{
pubbliku Vendor() { }

pubbliku Vendor(Bżiq initItem)
{
jekk (! (initItem["Vendor Name"] == null)) VendorName = initItem["Vendor Name"].ToString();
jekk (! (initItem["Address 1"] == null)) VendorAddress1 = initItem["Address 1"].ToString();
jekk (! (initItem["Address 2"] == null)) VendorAddress2 = initItem["Address 2"].ToString();
jekk (! (initItem["City"] == null)) VendorCity = initItem["City"].ToString();
jekk (! (initItem["VendorPhone"] == null)) VendorPhone = initItem["VendorPhone"].ToString();
jekk (! (initItem["PurchaseType"] == null)) VendorType = initItem["PurchaseType"].ToString();
jekk (! (initItem["State"] == null)) VendorState = initItem["State"].ToString();
jekk (! (initItem["Zip"] == null)) VendorZip = initItem["Zip"].ToString();
jekk (!(initItem["Fax"] == null)) VendorFax = initItem["Fax"].ToString();
jekk (!(initItem["SalesRepName"] == null)) VendorSalesRepName = initItem["SalesRepName"].ToString();

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

pubbliku int VendorItemId;
pubbliku string VendorName;
pubbliku string VendorAddress1;
pubbliku string VendorAddress2;
pubbliku string VendorCity;
pubbliku string VendorState;
pubbliku string VendorZip;
pubbliku string VendorPhone;
pubbliku string VendorType;
pubbliku string VendorSalesRepName;
pubbliku string VendorFax;
}

pubbliku VendorService () {

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

privat Vendor[] GenerateTestVendors()
{
Vendor[] resultList;
resultList = ġdid Vendor[100];

Vendor v;
v = ġdid 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 = ġdid 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 = ġdid 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;

ritorn resultList;

}

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

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

użu (SPSite site = ġdid SPSite(SpVendorSiteName))
{

użu (SPWeb web = site.OpenWeb())
{

SPList currentList = web.Lists[SpVendorListName];

Bżiq specificItem = currentList.Items[vendorId];

ritorn ġdid 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
pubbliku Vendor GetSpecificVendorByVendorName(string vendorName)
{
string SpVendorSiteName; // Name of the actual MOSS site that hosts the vendor custom list.
string SpVendorListName; // Name of the actual MOSS list containing vendors.

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

użu (SPSite site = ġdid SPSite(SpVendorSiteName))
{
użu (SPWeb web = site.OpenWeb())
{

SPList currentList = web.Lists[SpVendorListName];

foreach (Bżiq vendorItem fil currentList.Items)
{
jekk (vendorItem["Vendor Name"] == null) continue;

jekk (vendorItem["Vendor Name"].ToString().Ugwali(vendorName))
ritorn ġdid Vendor(vendorItem);
}

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

ritorn v;

ritorn null;

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

} // metodu

[WebMethod]
pubbliku Vendor[] GetVendorsOfType (string filterType)
{

string SpVendorSiteName; // Name of the actual MOSS site that hosts t
he vendor custom list.
string 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 = ġdid Vendor[1000];

// Initialize the list with a default friendly message.
Vendor v = ġdid 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.
#reġjun Filter type = "test"
jekk (filterType.Equals("test"))
ritorn GenerateTestVendors();
#endregion

jekk (vera)
{
użu (SPSite site = ġdid SPSite(SpVendorSiteName))
{
użu (SPWeb web = site.OpenWeb())
{

v = null;

SPList currentList = web.Lists[SpVendorListName];

// Iterate through all the items in the vendor list.
foreach (Bżiq vendorItem fil currentList.Items)
{

string lowerVendorType;

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

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


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

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

} // if true

ritorn null;
}

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

jekk (newsize == 0) newsize = 1;
trimmedArray = ġdid Vendor[newsize];

int currentCounter = 0;

għal (currentCounter = 0; currentCounter < newsize; currentCounter )
{
trimmedArray[currentCounter] = originalVendorArray[currentCounter];
}

ritorn trimmedArray;

}
}