Outlook Web Add-in MVC -> Call Controller in TaskPane - asp.net-mvc

i am trying to develop an outlook web mvc addin with visual studio 2017.
I successfully integrated my XML-Manifest, the ribbon button is added correctly and the task pane opens after clicking my button.
Anyway my view cannot be displayed!
My error message is the same as "Shyam sundar shah" got more than a year ago:
"Add-in error: Something went wrond and we couldn´t start this add-in. Please try again later or contact your system administrator."
Outlook web addin is not loading in Outlook webApps using MVC
I linked the question cause i am not able to link any images in my questions yet.
Here is my Extensionpoint in the manifest:
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="ReadTab">
<Group id="ReadGroup">
<Label resid="ReadGroupLabel" />
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="ReadButtonLabel" />
<Supertip>
<Title resid="ReadSuperTipTitle" />
<Description resid="ReadSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon" />
<bt:Image size="32" resid="icon" />
<bt:Image size="80" resid="icon" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="ReadPane" />
</Action>
</Control>
<Control xsi:type="Button" id="msgReadOpenPaneButton2">
<Label resid="ReadButtonLabel2" />
<Supertip>
<Title resid="ReadSuperTipTitle2" />
<Description resid="ReadSuperTipDescription2" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon" />
<bt:Image size="32" resid="icon" />
<bt:Image size="80" resid="icon" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="ReadPane2"/>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
<bt:Urls>
<bt:Url id="functionFile" DefaultValue="https://localhost:44302/Functions/FunctionFile.html"/>
<bt:Url id="ReadPane" DefaultValue="https://localhost:44302/Home/Login"/>
<bt:Url id="ReadPane2" DefaultValue="http://localhost:12543/Home/Login"/>
</bt:Urls>
As you can see i tried the SSL and the non SSL path. Both throw the same error.
My controller action is as simple as possible. I am just testing a local initialized variable of being true or false and in both cases i return the View with a correspondenting Model. So I dont think my problem is hiding there.(the cases will be completed later, cause there is no relation to my problem):
private bool _unconnect = false;
public ActionResult Login()
{
LoginModel model = new LoginModel();
if (!_unconnect)
{
return View(model);
}
else
{
return View(model);
}
}
I didn´t found any solution in the above linked question or anywhere else.
Are there any new cognitions for this error?
Thanks in advance.

Related

.NET Maui TabBar und IOS causes black Appscreen at start

Inserting the following code in my .NET Maui project works under android, but under ios it causes the app to start and present just a black screen.
Is there a special behavior und IOS for the tabbar icons?
<TabBar>
<Tab Title="Home" Icon="reshot.svg" >
<ShellContent Title="Home" ContentTemplate="{DataTemplate local:MainPage}" Route="MainPage" />
</Tab>
<Tab Title="Page1" Icon="dotnet_bot.svg">
<ShellContent Title="Page1" ContentTemplate="{DataTemplate local:Page1}" Route="Page1" />
</Tab>
<Tab Title="Page2" Icon="dotnet_bot.svg" >
<ShellContent Title="Page2" ContentTemplate="{DataTemplate local:Page2}" Route="Page2" />
</Tab>
<Tab Title="Page3" Icon="dotnet_bot.svg" >
<ShellContent Title="Page2" ContentTemplate="{DataTemplate local:Page1}" Route="Page1" />
</Tab>
<Tab Title="Page4" Icon="dotnet_bot.svg" >
<ShellContent Title="Page2" ContentTemplate="{DataTemplate local:Page2}" Route="Page2" />
</Tab>
</TabBar>

TFS 2017 WITD Import error VS403073

While importing a newly customized Work Item Type Definition into TFS 2017.3, I am receiving the error:
VS403073: Group {GroupName} violates the rule that a group can only
contain a single HTML or WebPage control preceded by label controls.
My question is three-fold:
1) Where are these styling/schema rules documented? I was unable to find any information on this, or any other schema rule, on Microsoft's site here.
2) I am trying to keep several FieldControls and a single HTMLFieldControl grouped together under one heading on the WebForm for organization purposes. Why would there be a rule put in place to prevent this type of organization?
3) Is it possible to, and what would be the consequences of, bypassing this rule and importing the WITD anyway?
Please let me know if any further information/clarification is needed.
Edit:
Psudo code would be something to this effect:
<WebLayout>
...
<Page>
<Section>
<Group Label="Group 1">
<Control type="FieldControl" Label="G1C1" FieldName="X.G1Field1" />
<Control type="FieldControl" Label="G1C2" FieldName="X.G1Field2" />
<Control type="FieldControl" Label="G1C3" FieldName="X.G1Field3" />
<Control type="HTMLFieldControl" Label="G1C4" FieldName="X.G1Field4" />
</Group>
</Section>
</Page>
</WebLayout>
I ran into this as well. I moved the HTMLFieldControl to its own group and that resolved the issue.
Example from Microsoft's documentation
Error:
<Section>
<Group Label="Description:">
<Control Label="Reason For Request:" Type="HtmlFieldControl" FieldName="System.Description" />
<Control Label="Business Case For Request:" Type="HtmlFieldControl" FieldName="MB.BusinessCase" />
</Group>
</Section>
Resolution:
<Section>
<Group Label="Reason for Request">
<Control Label="Reason For Request:" Type="HtmlFieldControl" FieldName="System.Description" />
</Group>
<Group Label="Business Case">
<Control Label="Business Case For Request" Type="HtmlFieldControl" FieldName="Custom.BusinessCase" />
</Group>
</Section>
Documentation can be found HERE

Adding new Workflow State in TFS 2015.4 Agile Template - and missing in Kanban Board

I am using TFS 2015.4, Agile template. I want to alter my workflow states to include Analysis as an option. I have modified the User Story WIT and ProcessConfiguration, Workflow nodes and valid states, etc. I reuploaded the template successfully and set the new template to default. All is well with regard to setting user story states. However, on the Kanban board, I want to add a tab that maps to the newly added Analysis. This new option is not showing up. Is there something else I'm missing?
You need to modify the process configuration to map new workflow states to metastates. Try the steps below:
Export ProcessConfiguration file:
witadmin exportprocessconfig /collection:http://tfsserver:8080/tfs/teamprojectcollection /p:teamproject /f:C:\Users\username\Desktop\ProcessConfiguration.xml
Modify the XML definition file. In your case, you should modify RequirementBacklog by adding your Analysis state:
<RequirementBacklog category="Microsoft.RequirementCategory" parent="Microsoft.FeatureCategory" pluralName="Stories" singularName="User Story" workItemCountLimit="1000">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="100" refname="System.WorkItemType" />
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.StoryPoints" />
<Column width="100" refname="Microsoft.VSTS.Common.ValueArea" />
<Column width="200" refname="System.IterationPath" />
<Column width="200" refname="System.Tags" />
</Columns>
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Active" />
<State type="InProgress" value="Resolved" />
<State type="InProgress" value="Analysis" />
<State type="Complete" value="Closed" />
</States>
</RequirementBacklog>
Import ProcessConfiguration file:
witadmin importprocessconfig /collection:http://tfsserver:8080/tfs/teamprojectcollection /p:teamproject /f:C:\Users\username\Desktop\ProcessConfiguration.xml
In this way, you can add a Column and choose Analysis state, it's similar to the screenshot below:

GCM in Delphi Seattle without BAAS

I am trying to implement GCM without BAAS in GCM. I have looked at previous examples using the bridge and from my research the following should work without relying on the old TGCMReceiver component.
But the following line always returns nil, I run this after the application starts up on a button click:
APushService := TPushServiceManager.Instance.GetServiceByName(TPushService.TServiceNames.GCM);
APushService is always nil.
My AndroidManifest looks as follows:
<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.embarcadero.Project1"
android:versionCode="1"
android:versionName="1.0.0"
android:installLocation="auto">
<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<permission android:name="com.embarcadero.Project1.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.embarcadero.Project1.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-feature android:glEsVersion="0x00020000" android:required="True"/>
<application android:persistent="False"
android:restoreAnyVersion="False"
android:label="Project1"
android:debuggable="True"
android:largeHeap="False"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme"
android:hardwareAccelerated="true">
<meta-data android:name="com.google.android.gms.version" android:value="4323000" />
<!-- Our activity is a subclass of the built-in NativeActivity framework class.
This will take care of integrating with our NDK code. -->
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
android:label="Project1"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
android:launchMode="singleTask">
<!-- Tell NativeActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="Project1" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<receiver
android:name="com.embarcadero.gcm.notifications.GCMNotification" android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.embarcadero.Project1" />
</intent-filter>
</receiver>
<receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" />
<receiver android:exported="true" android:name="com.embarcadero.gcm.notifications.GCMNotification" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.embarcadero.Project1" />
</intent-filter>
</receiver>
<service android:name="com.embarcadero.gcm.notifications.GCMIntentService" />
</application>
</manifest>
<!-- END_INCLUDE(manifest) -->
I have tried using the common TGCMReceiver application that is out there from CodeRage9 using XE8, it doesn't work in XE10 / Seattle and it does appear that XE10 is updated in this regard but I cannot make anything work with simple Google Cloud Messaging and am looking for some guidance.
The answer is shown here: Issue with GCM Push notification service DELPHI XE6
Except with .Active := True not AutoActivate := True as indicated by the Answer.
TL;DR version. Drop TKinvyProvider on form with just the GCMAppID populated, Drop TPushEvent on Form with AutoRegister and AutoActivate set to false. In entitlement list set "support push notification : true".. add in the following to your AndroidManifest.template.xml:
<service android:name="com.embarcadero.gcm.notifications.GCMIntentService" />
Right before </application>.

JSF 2.2 custom validator not triggered in ui:repeat

after a desperate period of trials and errors i come to you looking for help, since now i am even unsure if i am doing it all wrong.
My code below displays some fields from a user profile in read only input text boxes. The data comes from a bean as ArrayList of "field" objects, whos properties are described in the ui:param directives.
The user can click an unlock/lock button next to the box to start/finish editing her data.
I want to trigger input validation when the user presses enter after editing or clicks the lock button.
But whatever i tried, after editing and pressing enter or clicking the button, the changed value is not written back and my custom validator is not triggered. Somehow it seems that after clicking the button the then rendered input box is not bound to the field? However, the validator works (and all attributes get passed to it) if used in an input text that is always rendered - and i don't understand it :)
Please have a look at it. If i did not explain my intent well enough or if you need more code, please let me know.
Edit: the annotations of the backing bean:
#ManagedBean( name = "beanProfile" )
#RequestScoped
The jsf code:
<ui:composition>
<ui:param name="i18n" value="#{field.i18n}" />
<ui:param name="val" value="#{field.value}" />
<ui:param name="req" value="#{field.required}" />
<ui:param name="min" value="#{field.min}" />
<ui:param name="max" value="#{field.max}" />
<ui:param name="validationType" value="#{field.validationType}" />
<ui:param name="useHidden" value="#{field.hidden}" />
<ui:param name="locked" value="#{field.locked}" />
<ui:param name="fullName" value="#{beanProfile.name}" />
<h:form id="profileFrm">
<h:outputText value="#{msg.role_profile} " styleClass="headingOutputText" />
<h:outputText value="#{fullName}" styleClass="headerTitle" />
<p />
<h:panelGroup>
<ui:repeat var="field" value="#{beanProfile.userFields}">
<h:panelGrid columns="2">
<h:outputText value="#{msg[i18n]}" styleClass="headerTitle" />
<h:message showDetail="true" for="visInput" styleClass="warn"
rendered="#{!useHidden}" />
<h:message showDetail="true" for="invisInput" styleClass="warn"
rendered="#{useHidden}" />
</h:panelGrid>
<h:panelGrid columns="2" columnClasses="nameColumn">
<h:inputText id="visInput" required="true" value="#{val}"
rendered="#{!useHidden}" readonly="#{locked}" >
<f:validator validatorId="customValidator" />
<f:attribute name="requiredField" value="#{req}" />
<f:attribute name="minLen" value="#{min}" />
<f:attribute name="maxLen" value="#{max}" />
<f:attribute name="type" value="#{validationType}" />
</h:inputText>
<h:inputSecret id="invisInput" required="true" value="#{val}"
rendered="#{useHidden}" readonly="#{locked}">
<f:validator validatorId="customValidator" />
<f:attribute name="requiredField" value="#{req}" />
<f:attribute name="minLen" value="#{min}" />
<f:attribute name="maxLen" value="#{max}" />
<f:attribute name="type" value="#{validationType}" />
</h:inputSecret>
<h:commandLink id="lock" action="#{beanProfile.lock(field)}"
rendered="#{!locked}" title="#{msg.profile_lock}">
<h:graphicImage height="16" width="16"
name="images/padlock_unlocked.svg" alt="#{msg.profile_lock}" />
</h:commandLink>
<h:commandLink id="unlock" action="#{beanProfile.unlock(field)}"
rendered="#{locked}" title="#{msg.profile_unlock}">
<h:graphicImage height="16" width="16"
name="images/padlock_locked.svg" alt="#{msg.profile_unlock}" />
</h:commandLink>
</h:panelGrid>
</ui:repeat>
</h:panelGroup>
<p />
<h:commandButton id="submitProfileBtn" value="#{msg.cmd_submit}"
styleClass="button" includeViewParams="true"
action="#{beanProfile.submitProfile()}" />
</h:form>
</ui:composition>
The origin of your problem is that you are using the RequestScoped scope for your backing bean containing the Model, so when you want to do a postback request in order to execute the backing bean method the binding just have dissapeared (not in the server memory) and the JSF lifecycle doesn't execute as expected. The solution is to use a longer scope as the ViewScoped scope. Ideally you should use the CDI compatible viewScoped scope, so you have to use JSF 2.2.x version.
Thank you lametaweb, you led me in the right direction.
Being unable to use the #ViewScoped annotation i found the link
how-to-install-cdi-in-tomcat
and followed BalusC's directions for using CDI in Tomcat. Then i had to let all the java classes implement the Serializable interface.
Now i can use the #ViewScoped annotation and the validator gets triggered.

Resources